Skip to content

Preparing a Script Transaction

Akin to Contracts, we can configure the call parameters and transaction parameters for Scripts, as well as retrieve the entire transaction request or transaction ID prior to submission.

ts
const script = new Script(binHexlified, abiContents, wallet);

const tx = script.functions.main(argument);

// Set the call parameters
tx.callParams({ gasLimit: 100 });

// Get the entire transaction request prior to
const txRequest = await tx.getTransactionRequest();

// Get the transaction ID
const txId = await tx.getTransactionId();

// Retrieve the value of the call and the actual gas used
const { value, gasUsed } = await tx.call();
See code in context