Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"type: docs" #399

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
"type: docs"
  • Loading branch information
VitalyLyaper committed Nov 18, 2022
commit 4c29ea057775ccbc1f3f7199cbf382e2dbc6867d
32 changes: 21 additions & 11 deletions docs/reference/buy.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,27 @@ async function buyNft(orderId: string) {
const sdk = createRaribleSdk(wallet, "dev")

// Get order info
const buy = await sdk.order.buy({
toOrderId(orderId),
})
// buy: {
// baseFee: number
// maxAmount: BigNumber
// multiple: boolean
// submit: Function
// supportsPartialFill: boolean
// }

const buy = await sdk.order.buy.prepare({
orderId: toOrderId(orderId)
})

/**
* Number of NFTs to buy or to sell (in case of accepting bids)
* amount: number
* Origin fees, if not supported by the underlying contract, will throw Error
* originFees?: UnionPart[]
* Payouts, if not supported by the underlying contract, will throw Error
* payouts?: UnionPart[]
* Use infinite approvals (for ERC-20)
* infiniteApproval?: boolean
* ItemId for fill collection order
* itemId?: ItemId | ItemId[]
* Max fees value. Should be greater than 0. If required and not provided, will throw Error
* maxFeesBasePoint?: number,
* Force pay royalties. It's working only on AMM orders
* addRoyalties?: boolean
*/

// Send transaction
const result = await buy.submit(
amount: 1, //amount of NFTs you want to buy
Expand Down