See the canonical spec:
.TypeScriptimport { Client, Wallet } from 'xrpl'; async function cancelOffer(): Promise<void> { const client = new Client('wss://honeycluster.dev'); await client.connect(); const wallet = Wallet.fromSeed('s...'); const prepared = await client.autofill({ TransactionType: 'OfferCancel', Account: wallet.address, OfferSequence: 123, }); const signed = wallet.sign(prepared); const res = await client.submitAndWait(signed.tx_blob); console.log(res); await client.disconnect(); } cancelOffer().catch(console.error);
| Field | Type | Required | Description |
|---|---|---|---|
Account | String | Yes | The address of the account cancelling the offer |
OfferSequence | Number | Yes | Sequence number of the offer to cancel |
OfferSequence:
Must reference an existing offer from the same account
The offer will be removed from the order book
Only the offer creator can cancel their offers
Note:
Cancelled offers cannot be recovered
If the offer has been partially filled, only the remaining portion is cancelled
Cancels a previously created offer on the DEX
OfferSequence must reference an existing offer from your account
Cancelled offers are removed from the order book
Only the offer creator can cancel their offers
Always use autofill to set fees and sequence safely when using the XRPL client library