Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async sendTransaction() {
// Build raw transaction object
const transaction = await this.buildICXTransaction();
// Create signature of the transaction
const signedTransaction = new SignedTransaction(transaction, this.wallet);
// Read params to transfer to nodes
const signedTransactionProperties = JSON.stringify(signedTransaction.getProperties()).split(",").join(", \n")
document.getElementById('I01-1').innerHTML = `<b>Signed Transaction</b>: ${signedTransactionProperties}`;
// Send transaction
this.txHash = await this.iconService.sendTransaction(signedTransaction).execute();
console.log(this.txHash)
document.getElementById('I03-1').innerHTML = this.txHash;
// Print transaction hash
document.getElementById('I01-2').innerHTML = `<b>Transfer Request Complete.</b> Tx hash is ${this.txHash}`;
}
async deployScore() {
// Build raw transaction object
const transaction = await this.buildDeployTransaction();
// Create signature of the transaction
const signedTransaction = new SignedTransaction(transaction, this.wallet);
// Read params to transfer to nodes
const signedTransactionProperties = JSON.stringify(signedTransaction.getProperties()).split(",").join(", \n")
document.getElementById('D01-2').innerHTML = `<b>Signed Transaction</b>: ${signedTransactionProperties}`;
// Send transaction
this.deployTxHash = await this.iconService.sendTransaction(signedTransaction).execute();
document.getElementById('D02-1').innerHTML = this.deployTxHash;
// Print transaction hash
document.getElementById('D01-3').innerHTML = `<b>Transfer Request Complete.</b> Tx hash is ${this.deployTxHash}`;
}
async sendTransaction() {
if (!this.scoreAddress) {
document.getElementById('D03-1').innerHTML = 'Deploy ST Token and check deployment transaction first.';
return;
}
// Build raw transaction object
const transaction = await this.buildTokenTransaction();
// Create signature of the transaction
const signedTransaction = new SignedTransaction(transaction, this.wallet);
// Read params to transfer to nodes
const signedTransactionProperties = JSON.stringify(signedTransaction.getProperties()).split(",").join(", \n")
document.getElementById('D03-1').innerHTML = `<b>Signed Transaction</b>: ${signedTransactionProperties}`;
// Send transaction
this.transactionTxHash = await this.iconService.sendTransaction(signedTransaction).execute();
document.getElementById('D05-1').innerHTML = this.transactionTxHash;
// Print transaction hash
document.getElementById('D03-2').innerHTML = `<b>Transfer Request Complete.</b> Tx hash is ${this.transactionTxHash}`;
}