vechain / vechain-sdk-js

The official JavaScript SDK for VeChain.
19 stars 6 forks source link

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

Open Valazan opened 1 week ago

Valazan commented 1 week ago

Expand the multiple clauses transaction execution to support:

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()