createTransferOffer creates an offer contract consumed counterparties exercise via acceptTransferOffer—distinct token-standard asynchronous APIs documented createTokenStandardTransfer.
Setup
import { Canton } from '@fairmint/canton-node-sdk';
const canton = new Canton({
network: 'devnet',
provider: '5n',
partyId: 'OWN_PARTY_ID',
});
Import and receiver
import { Canton } from '@fairmint/canton-node-sdk';
Receiver: canton.validator.createTransferOffer.
Minimal example
const offer = await canton.validator.createTransferOffer({
receiver_party_id: 'Alice::1220...',
amount: '100',
description: 'Refund',
expires_at: Date.now() + 3_600_000,
tracking_id: `offer-${crypto.randomUUID()}`,
});
console.log(offer.offer_contract_id);
Parameters
receiver_party_id(required, string) — Destination party receiving funds upon acceptance.amount(required, string) — Decimal-string Amulet quantity sender intends transferring when counterpart accepts.description(required, string) — Memo surfaced downstream tooling when permitted.expires_at(required, number) — Absolute expiry timestamp milliseconds aligning validator wallet semantics.tracking_id(required, string) — Unique correlation identifier poweringgetTransferOfferStatus.
Returns
offer_contract_id(string) — Contract identifier referencing persisted offer enabling ledger interactions referencing counterpart workflows.
Errors and pitfalls
- Insufficient unlocked Amulet balances reject atomically—preflight
getWalletBalance.
Auth and party
Bearer token binding sender wallet identity exercising Canton authority obligations.
See also
Source
src/clients/validator-api/operations/v0/wallet/transfer-offers/create.ts on GitHub.