Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions docs/sdk.marketplace.getlisting.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ either a direct or auction listing

## Remarks

Create and manage auctions in your marketplace.
Get a listing by its listing id

## Example


```javascript
const listingId = "1";
const listingId = 0;
const listing = await contract.getListing(listingId);
```

2 changes: 1 addition & 1 deletion docs/sdk.marketplace.setbidbufferbps.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A percentage (e.g. 5%) in basis points (5% = 500, 100% = 10000). A new bid is co

```javascript
// the bid buffer in basis points
const bufferBps = 500; // 5%
const bufferBps = 5_00; // 5%
await contract.setBidBufferBps(bufferBps);
```

4 changes: 3 additions & 1 deletion docs/sdk.marketplacedirect.makeoffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Make an offer on a direct listing


```javascript
import { ChainId, NATIVE_TOKENS } from "@thirdweb-dev/sdk";

// The listing ID of the asset you want to offer on
const listingId = 0;
// The price you are willing to offer per token
Expand All @@ -47,7 +49,7 @@ await contract.direct.makeOffer(
listingId,
quantity,
currencyContractAddress,
bidAmount
pricePerToken
);
```

8 changes: 4 additions & 4 deletions docs/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@
{
"name": "getListing",
"summary": "Convenience function to get either a direct or auction listing\n\n",
"remarks": "\n\nCreate and manage auctions in your marketplace.\n\n",
"remarks": "\n\nGet a listing by its listing id\n\n",
"examples": {
"javascript": "const listingId = \"1\";\nconst listing = await contract.getListing(listingId);"
"javascript": "const listingId = 0;\nconst listing = await contract.getListing(listingId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Marketplace.getListing"
},
Expand All @@ -381,7 +381,7 @@
"summary": "Set the Auction bid buffer\n\n",
"remarks": "\n\nA percentage (e.g. 5%) in basis points (5% = 500, 100% = 10000). A new bid is considered to be a winning bid only if its bid amount is at least the bid buffer (e.g. 5%) greater than the previous winning bid. This prevents buyers from making very slightly higher bids to win the auctioned items.\n\n",
"examples": {
"javascript": "// the bid buffer in basis points\nconst bufferBps = 500; // 5%\nawait contract.setBidBufferBps(bufferBps);"
"javascript": "// the bid buffer in basis points\nconst bufferBps = 5_00; // 5%\nawait contract.setBidBufferBps(bufferBps);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Marketplace.setBidBufferBps"
},
Expand Down Expand Up @@ -537,7 +537,7 @@
"summary": "Make an offer for a Direct Listing\n\n",
"remarks": "\n\nMake an offer on a direct listing\n\n",
"examples": {
"javascript": "// The listing ID of the asset you want to offer on\nconst listingId = 0;\n// The price you are willing to offer per token\nconst pricePerToken = 1;\n// The quantity of tokens you want to receive for this offer\nconst quantity = 1;\n// The address of the currency you are making the offer in (must be ERC-20)\nconst currencyContractAddress = NATIVE_TOKENS[ChainId.Rinkeby].wrapped.address\n\nawait contract.direct.makeOffer(\n listingId,\n quantity,\n currencyContractAddress,\n bidAmount\n);"
"javascript": "import { ChainId, NATIVE_TOKENS } from \"@thirdweb-dev/sdk\";\n\n// The listing ID of the asset you want to offer on\nconst listingId = 0;\n// The price you are willing to offer per token\nconst pricePerToken = 1;\n// The quantity of tokens you want to receive for this offer\nconst quantity = 1;\n// The address of the currency you are making the offer in (must be ERC-20)\nconst currencyContractAddress = NATIVE_TOKENS[ChainId.Rinkeby].wrapped.address\n\nawait contract.direct.makeOffer(\n listingId,\n quantity,\n currencyContractAddress,\n pricePerToken\n);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.MarketplaceDirect.makeOffer"
}
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ export class Marketplace implements UpdateableNetwork {
* @param listingId - the listing id
* @returns either a direct or auction listing
*
* @remarks Create and manage auctions in your marketplace.
* @remarks Get a listing by its listing id
* @example
* ```javascript
* const listingId = "1";
* const listingId = 0;
* const listing = await contract.getListing(listingId);
* ```
*/
Expand Down Expand Up @@ -364,7 +364,7 @@ export class Marketplace implements UpdateableNetwork {
* @example
* ```javascript
* // the bid buffer in basis points
* const bufferBps = 500; // 5%
* const bufferBps = 5_00; // 5%
* await contract.setBidBufferBps(bufferBps);
* ```
* @param bufferBps - the bps value
Expand Down
4 changes: 3 additions & 1 deletion src/core/classes/marketplace-direct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ export class MarketplaceDirect {
*
* @example
* ```javascript
* import { ChainId, NATIVE_TOKENS } from "@thirdweb-dev/sdk";
*
* // The listing ID of the asset you want to offer on
* const listingId = 0;
* // The price you are willing to offer per token
Expand All @@ -232,7 +234,7 @@ export class MarketplaceDirect {
* listingId,
* quantity,
* currencyContractAddress,
* bidAmount
* pricePerToken
* );
* ```
*/
Expand Down