-
Notifications
You must be signed in to change notification settings - Fork 0
create transfer offer
createTransferOffer resolves the WalletAppInstall contract ID via EnvLoader for the ledger client's network, submits WalletAppInstall_CreateTransferOffer as the ledger client's acting party, and extracts the newly minted TransferOffer contract ID from tree event 1.
Pair with acceptTransferOffer when onboarding wallets programmatically.
import { createTransferOffer } from '@fairmint/canton-node-sdk';
const canton = new Canton({
network: 'NETWORK_NAME',
partyId: 'FUNDER_PARTY_ID',
});const transferOfferContractId = await createTransferOffer({
ledgerClient: canton.ledger,
receiverPartyId: 'RECEIVER_PARTY_ID',
amount: 'AMOUNT_DECIMAL_STRING',
description: 'Human-readable memo',
});
console.log(transferOfferContractId);CreateTransferOfferParams:
-
ledgerClient(required) — Ledger client whosepartyIdfunds / authors the offer. -
receiverPartyId(required) — Destination party. -
amount(required, decimal string) — Amulet quantity (AmuletUnit). -
description(required) — Stored alongside offer metadata. -
expiresAt(optionalDate) — Defaults to 24 hours ahead.
Promise<string> — TransferOffer contract ID string created by the submission.
Throws OperationError TRANSACTION_FAILED when event 1 is not a CreatedTreeEvent.
Throws when EnvLoader lacks WalletAppInstall mapping for the active network — configure validator wallet metadata accordingly.
Acts as ledgerClient.getPartyId() (actAs). Ensure that party's wallet installation matches Canton splice packaging referenced by EnvLoader.