vechain-sdk-js icon indicating copy to clipboard operation
vechain-sdk-js copied to clipboard

Feat: support raw clauses and transaction options in the execution of multiple clauses transaction

Open Valazan opened this issue 8 months ago • 0 comments

Expand the multiple clauses transaction execution to support:

  • transaction options
  • raw clauses

Es:


/* setup env */
const thor = ThorClient.fromUrl('https://testnet.vechain.org');
const randomSigner = new VeChainPrivateKeySigner(secp256k1.generatePrivateKey(), thor);

/* prepare */
const clauses = [
  clauseBuilder.functionInteraction(
    '0x8384738c995d49c5b692560ae688fc8b51af1059',
    'increment()'
  ),
];
const options = { /* toggle fee delegation, tx comment, dependency, etc. */ }

/* execute */
const tx = await thor.contracts.executeMultipleClausesTransaction(clauses, randomSigner, /* pass options here? */ );

/* wait & track */
await tx.wait()

Valazan avatar Jun 21 '24 10:06 Valazan