-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
documentationRelates to documentationRelates to documentation
Milestone
Description
Currently from the docs of the TransactionBuilder API it is not fully clear you can also provide lockingBytecode for the output to:
but this might play an increasingly important role in the future with the P2S CHIP
addOutput() & addOutputs()
transactionBuilder.addOutput(output: Output): this transactionBuilder.addOutputs(outputs: Output[]): thisAdds a single output or a list of outputs to the transaction.
interface Output { to: string | Uint8Array; amount: bigint; token?: TokenDetails; } interface TokenDetails { amount: bigint; category: string; nft?: { capability: 'none' | 'mutable' | 'minting'; commitment: string; }; }Example
import { aliceAddress, bobAddress, transactionBuilder, tokenCategory } from './somewhere.js'; transactionBuilder.addOutput({ to: aliceAddress, amount: 100_000n, token: { amount: 1000n, category: tokenCategory, } }); transactionBuilder.addOutputs([ { to: aliceAddress, amount: 50_000n }, { to: bobAddress, amount: 50_000n }, ]);
Metadata
Metadata
Assignees
Labels
documentationRelates to documentationRelates to documentation