Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async prepare(tx: Transaction): Promise {
const response = await this.provider.send(
RPCMethod.CreateTransaction,
{ ...tx.txParams, priority: tx.toDS },
);
if (response.error || !response.result) {
this.address = undefined;
this.error = response.error;
tx.setStatus(TxStatus.Rejected);
} else {
tx.id = response.result.TranID;
tx.setStatus(TxStatus.Pending);
return response.result.ContractAddress;
}
}