acceptTransferOffer submits TransferOffer_Accept on the provided contract using acceptingPartyId as actAs. The full transaction tree response is returned for downstream parsing.
Setup
import { acceptTransferOffer } from '@fairmint/canton-node-sdk';
const canton = new Canton({
network: 'NETWORK_NAME',
partyId: 'RECEIVER_PARTY_ID',
});
Minimal example
const tree = await acceptTransferOffer({
ledgerClient: canton.ledger,
transferOfferContractId: 'CONTRACT_ID_FROM_CREATE_OFFER',
acceptingPartyId: 'RECEIVER_PARTY_ID',
});
console.log(tree.transactionTree.updateId);
Parameters
AcceptTransferOfferParams:
ledgerClient(required) — Authenticated ledger client for submit/wait tree.transferOfferContractId(required) — TargetTransferOffercontract.acceptingPartyId(required) — Party exercising the accept choice (typically the receiver).
Returns
Promise<SubmitAndWaitForTransactionTreeResponse> — Includes transactionTree.eventsById for further inspection.
Errors
Propagates ledger ApiError on contract visibility, authorization, or timeout issues.
Auth and party
Must act as the beneficiary with rights to TransferOffer_Accept. If acceptingPartyId mismatches ledger session, submission fails.