ReadonlyarkReadonlyarkReadonlyboardingReadonlycontractOptional ReadonlydelegatorReadonlydustReadonlyforfeitReadonlyforfeitReadonlyidentityReadonlyindexerReadonlynetworkReadonlynetworkReadonlyoffchainReadonlyonchainReadonlyrenewalReadonlyserverReadonlywalletStaticMIN_Get the contract script for the wallet's default address. This is the pkScript hex, used to identify the wallet in ContractManager.
Build an offchain transaction from the given inputs and outputs, sign it, submit to the ark provider, and finalize.
The ark transaction id and server-signed checkpoint PSBTs (for bookkeeping)
The intent ID.
The inputs of the intent.
Expected recipients to validate in the vtxo tree.
Optionalsession: SignerSessionThe musig2 signing session, if not provided, the signing will be skipped.
Finalizes pending transactions by retrieving them from the server and finalizing each one.
Optionalvtxos: ExtendedVirtualCoin[]Optional list of VTXOs to use instead of retrieving them from the server
Array of transaction IDs that were finalized
Get the ContractManager for managing contracts including the wallet's default address.
The ContractManager handles:
const manager = await wallet.getContractManager();
// Create a contract for a Boltz swap
const contract = await manager.createContract({
label: "Boltz Swap",
type: "vhtlc",
params: { ... },
script: swapScript,
address: swapAddress,
});
// Start watching for events (includes wallet's default address)
const stop = await manager.onContractEvent((event) => {
console.log(`${event.type} on ${event.contractScript}`);
});
Build a map of scriptHex → VtxoScript for all wallet contracts, so VTXOs can be extended with the correct tapscript per contract.
Optionalfilter: GetVtxosFilterGet all pkScript hex strings for the wallet's own addresses (both delegate and non-delegate, current and historical). Falls back to only the current script if ContractManager is not yet initialized.
OptionalvalidAt: numberSend BTC and/or assets to one or more recipients.
Promise resolving to the ark transaction ID
Optionalparams: SettleParamsOptionaleventCallback: (event: SettlementEvent) => voidConvert this wallet to a readonly wallet.
A readonly wallet with the same configuration but readonly identity
const wallet = await Wallet.create({ identity: SingleKey.fromHex('...'), ... });
const readonlyWallet = await wallet.toReadonly();
// Can query balance and addresses
const balance = await readonlyWallet.getBalance();
const address = await readonlyWallet.getAddress();
// But cannot send transactions (type error)
// readonlyWallet.sendBitcoin(...); // TypeScript error
Staticcreate
Main wallet implementation for Bitcoin transactions with Ark protocol support. The wallet does not store any data locally and relies on Ark and onchain providers to fetch UTXOs and VTXOs.
Example