This action can be used to cancel and valid order (bids/listings)
You can supply an object of parameters listed below:
Parameter | Description | Required | Example |
---|---|---|---|
ids | A list of one or more order ids | true | ["0x5c27af06f65deac22abb4307fb68ead818152fee9bc781558be12f8a6a590f97", "0x5c27af06f65deac22abb4307fb68ead818152fee9bc781558be12f8a6a590f97"] |
wallet | A valid WalletClient from viem or a ReservoirWallet generated from an adapter. Learn more about adapters. | true | Refer to viem's documentation on WalletClients_ |
onProgress | Callback to update UI state as execution progresses. Can also be used to get the transaction hash for a given step item. | true | (steps) => { console.log(steps) } |
options | Supports all of the parameters allowed in the execute cancel api | false | { maxFeePerGas: 2000, ... } |
chainId | Override the current active chain | false | 1 |
Example
import { getClient, Execute } from "@reservoir0x/reservoir-sdk";
import { createWalletClient, http } from 'viem'
...
address = "0x8ba1f109551bD432803012645Ac136ddd6000000"
wallet = createWalletClient({
account: address,
transport: http()
})
getClient()?.actions.cancelOrder({
ids: "0x5c27af06f65deac22abb4307fb68ead818152fee9bc781558be12f8a6a590f97",
wallet,
onProgress: (steps: Execute['steps']) => {
console.log(steps)
}
})