Skip to content

Builtin Template Helpers

The SDK includes typed builder classes for the two standard builtin templates: Account and Faucet. These wrap common patterns so you don’t have to construct raw callMethod instructions manually.

Build transactions that operate on account components.

import { AccountInvokeBuilder, Network } from "@tari-project/ootle";
const tx = new AccountInvokeBuilder(Network.Esmeralda, accountAddress)
.feeTransactionPayFromComponent(accountAddress, 1000n)
.publicTransfer(accountAddress, resourceAddress, 500n, recipientAddress)
.build();

Build transactions that interact with faucet components (for testnet token distribution).

import { FaucetInvokeBuilder, Network } from "@tari-project/ootle";
const tx = new FaucetInvokeBuilder(Network.Esmeralda, faucetAddress)
.feeTransactionPayFromComponent(accountAddress, 1000n)
.takeFaucetFunds(accountAddress, 10_000n)
.build();

When to use builtin helpers vs TransactionBuilder

Section titled “When to use builtin helpers vs TransactionBuilder”

Use the builtin helpers when:

  • You’re doing standard account operations (transfers, deposits)
  • You want type-safe method calls without remembering argument shapes

Use TransactionBuilder directly when:

  • You’re calling custom template methods
  • You need to compose multiple instructions in a single transaction
  • You need fine-grained control over the instruction sequence