See the canonical spec:
.TypeScriptimport { Client, Wallet } from 'xrpl'; async function acceptNFTokenOffer(): Promise<void> { const client = new Client('wss://honeycluster.dev'); await client.connect(); const wallet = Wallet.fromSeed('s...'); const prepared = await client.autofill({ TransactionType: 'NFTokenAcceptOffer', Account: wallet.address, NFTokenSellOffer: 'ABC...', }); const signed = wallet.sign(prepared); const res = await client.submitAndWait(signed.tx_blob); console.log(res); await client.disconnect(); } acceptNFTokenOffer().catch(console.error);
| Field | Type | Required | Description |
|---|---|---|---|
Account | String | Yes | The address of the account accepting the offer |
NFTokenSellOffer | String | No | The ID of the sell offer to accept |
NFTokenBuyOffer | String | No | The ID of the buy offer to accept |
Usage:
To accept a sell offer: Provide NFTokenSellOffer
To accept a buy offer: Provide NFTokenBuyOffer
Can accept both offers simultaneously for immediate trading
Note:
Executes a previously created NFToken offer
Automatically transfers the NFToken and payment between parties
The offer is consumed and removed from the ledger
Can only accept offers that are currently active
If accepting both offers, they must be compatible (same NFToken, complementary prices)
Executes a previously created buy or sell offer
NFTokenSellOffer or NFTokenBuyOffer must be specified
Automatically transfers the NFToken and payment between parties
The offer is consumed and removed from the ledger
Always use autofill to set fees and sequence safely when using the XRPL client library