withdrawTransferOffer walks back offers created createTransferOffer prior counterpart acceptance—ideal cancellation UX referencing listTransferOffers.
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.withdrawTransferOffer.
Minimal example
const res = await canton.validator.withdrawTransferOffer({
contractId: '<offer-contract-id>',
});
console.log(res.withdrawn_offer_contract_id);
Parameters
contractId(required, string) — Offer contract identifier sender withdraws referencing outbound ledger workflows awaiting counterpart acceptance.
Returns
withdrawn_offer_contract_id(string) — Echo correlating withdrawn transitions surfaced explorers referencing instrumentation dashboards.
Errors and pitfalls
- Withdrawing already-settled offers yields descriptive HTTP failures—confirm ACS watchers verifying terminal states beforehand.
Auth and party
Bearer token binding sender wallet identity exercising Canton authorization referencing outbound obligations exclusively belonging caller personas.
See also
Source
src/clients/validator-api/operations/v0/wallet/transfer-offers/withdraw.ts on GitHub.