Skip to content

Reference

acceptTransferOffer

Exercise TransferOffer_Accept so the recipient settles an outstanding Wallet transfer offer into their holdings.

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) — Target TransferOffer contract.
  • 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.

See also

Source

src/utils/amulet/offers.ts