cancelOrder
This action is can be used to cancel and valid order (bids/listings)
You can supply an object of parameters listed below:
Parameter | Description | Required | Example |
---|---|---|---|
id | An order id | true | "0x5c27af06f65deac22abb4307fb68ead818152fee9bc781558be12f8a6a590f97" |
signer | A valid signer from ethers. | true | Refer to ethers documentation on signers Note: if you're using the SDK on the server refer to the docs on how to create a signer. |
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, ... } |
Example
import { getClient, Execute } from "@reservoir0x/reservoir-sdk";
import { ethers } from "ethers";
...
address = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"
signer = new ethers.VoidSigner(address, provider)
getClient()?.actions.cancelOrder({
id: "0x5c27af06f65deac22abb4307fb68ead818152fee9bc781558be12f8a6a590f97",
signer,
onProgress: (steps: Execute['steps']) => {
console.log(steps)
}
})
Updated over 1 year ago