import { createRaribleSdk } from "@rarible/sdk" import { toOrderId, toUnionAddress } from "@rarible/types" import type { BlockchainWallet } from "@rarible/sdk-wallet" export async function acceptBid(wallet: BlockchainWallet) { const sdk = createRaribleSdk(wallet, "testnet") const acceptBidResponse = await sdk.order.acceptBid({ orderId: toOrderId(""), }) const acceptBidResult = await acceptBidResponse.submit({ amount: 1, //optional originFees: [{ account: toUnionAddress(""), //2,5% value: 250, }], //optional payouts: [{ account: toUnionAddress(""), //5% value: 500, }], //optional infiniteApproval: true, //Set true if you want to convert received WETH/wTEZ tokens to ETH/TEZ unwrap: false, }) await acceptBidResult.wait() }