placeBid

This action is used to place a bid or multiple bids on an ERC-1155 or ERC-721 token. You can also use this action to bid on multiple exchanges/marketplaces.

You can supply an object of parameters listed below:

ParameterDescriptionRequiredExample
bidsAn array of objects representing bids, mapping directly to the params property from the execute bid api.true[{ weiPrice: 10000000000000000, orderbook: 'reservoir', orderKind: 'seaport-v1.4', token: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d:0" }]
signerA valid signer from ethers.trueRefer 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.
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) }

Example

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

...

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

getClient()?.actions.placeBid({
  bids: [{  
      weiPrice: 10000000000000000,  
      orderbook: 'reservoir',  
      orderKind: 'seaport-v1.4',  
      token: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d:0"  
  }],
  signer,
  onProgress: (steps: Execute['steps']) => {
    console.log(steps)
  }
})