listToken

This action is used to list an ERC-1155 or ERC-721 token. You can also use this action to list to multiple exchanges/marketplaces.

You can supply an object of parameters listed below:

ParameterDescriptionRequiredExample
listingsAn array of objects representing listings, mapping directly to the params property from the execute list api.true[{ token: "0:0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", weiPrice: 10000000000000000, orderbook: "reservoir", orderKind: "seaport", expirationTime: 1667403808616 }]
signerA valid signer from ethers.trueRefer to ethers documentation on signers
onProgressCallback 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) }
precheckA boolean indicating whether to just get back the steps and not to execute them. This is useful for checking if marketplace approval is required before iterating over the steps.falsefalse

Example

import { getClient, Execute } from "@reservoir0x/reservoir-kit-client";
import { ethers } from "ethers";

...

address = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"
signer = new ethers.VoidSigner(address, provider)

getClient()?.actions.listToken({
  listings: [{  
          token: "0:0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",  
          weiPrice: 10000000000000000,  
          orderbook: "reservoir",  
          orderKind: "seaport",  
          expirationTime: 1667403808616  
  }],
  signer,
  onProgress: (steps: Execute['steps']) => {
    console.log(steps)
  }
})