Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit 424df52

Browse files
authored
Jw/fix marketplace doc issues (#435)
1 parent 02b94a3 commit 424df52

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

docs/sdk.marketplace.getlisting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ either a direct or auction listing
2626

2727
## Remarks
2828

29-
Create and manage auctions in your marketplace.
29+
Get a listing by its listing id
3030

3131
## Example
3232

3333

3434
```javascript
35-
const listingId = "1";
35+
const listingId = 0;
3636
const listing = await contract.getListing(listingId);
3737
```
3838

docs/sdk.marketplace.setbidbufferbps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A percentage (e.g. 5%) in basis points (5% = 500, 100% = 10000). A new bid is co
3131

3232
```javascript
3333
// the bid buffer in basis points
34-
const bufferBps = 500; // 5%
34+
const bufferBps = 5_00; // 5%
3535
await contract.setBidBufferBps(bufferBps);
3636
```
3737

docs/sdk.marketplacedirect.makeoffer.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Make an offer on a direct listing
3434

3535

3636
```javascript
37+
import { ChainId, NATIVE_TOKENS } from "@thirdweb-dev/sdk";
38+
3739
// The listing ID of the asset you want to offer on
3840
const listingId = 0;
3941
// The price you are willing to offer per token
@@ -47,7 +49,7 @@ await contract.direct.makeOffer(
4749
listingId,
4850
quantity,
4951
currencyContractAddress,
50-
bidAmount
52+
pricePerToken
5153
);
5254
```
5355

docs/snippets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@
370370
{
371371
"name": "getListing",
372372
"summary": "Convenience function to get either a direct or auction listing\n\n",
373-
"remarks": "\n\nCreate and manage auctions in your marketplace.\n\n",
373+
"remarks": "\n\nGet a listing by its listing id\n\n",
374374
"examples": {
375-
"javascript": "const listingId = \"1\";\nconst listing = await contract.getListing(listingId);"
375+
"javascript": "const listingId = 0;\nconst listing = await contract.getListing(listingId);"
376376
},
377377
"reference": "https://docs.thirdweb.com/typescript/sdk.Marketplace.getListing"
378378
},
@@ -381,7 +381,7 @@
381381
"summary": "Set the Auction bid buffer\n\n",
382382
"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",
383383
"examples": {
384-
"javascript": "// the bid buffer in basis points\nconst bufferBps = 500; // 5%\nawait contract.setBidBufferBps(bufferBps);"
384+
"javascript": "// the bid buffer in basis points\nconst bufferBps = 5_00; // 5%\nawait contract.setBidBufferBps(bufferBps);"
385385
},
386386
"reference": "https://docs.thirdweb.com/typescript/sdk.Marketplace.setBidBufferBps"
387387
},
@@ -537,7 +537,7 @@
537537
"summary": "Make an offer for a Direct Listing\n\n",
538538
"remarks": "\n\nMake an offer on a direct listing\n\n",
539539
"examples": {
540-
"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);"
540+
"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);"
541541
},
542542
"reference": "https://docs.thirdweb.com/typescript/sdk.MarketplaceDirect.makeOffer"
543543
}

src/contracts/marketplace.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ export class Marketplace implements UpdateableNetwork {
197197
* @param listingId - the listing id
198198
* @returns either a direct or auction listing
199199
*
200-
* @remarks Create and manage auctions in your marketplace.
200+
* @remarks Get a listing by its listing id
201201
* @example
202202
* ```javascript
203-
* const listingId = "1";
203+
* const listingId = 0;
204204
* const listing = await contract.getListing(listingId);
205205
* ```
206206
*/
@@ -364,7 +364,7 @@ export class Marketplace implements UpdateableNetwork {
364364
* @example
365365
* ```javascript
366366
* // the bid buffer in basis points
367-
* const bufferBps = 500; // 5%
367+
* const bufferBps = 5_00; // 5%
368368
* await contract.setBidBufferBps(bufferBps);
369369
* ```
370370
* @param bufferBps - the bps value

src/core/classes/marketplace-direct.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ export class MarketplaceDirect {
219219
*
220220
* @example
221221
* ```javascript
222+
* import { ChainId, NATIVE_TOKENS } from "@thirdweb-dev/sdk";
223+
*
222224
* // The listing ID of the asset you want to offer on
223225
* const listingId = 0;
224226
* // The price you are willing to offer per token
@@ -232,7 +234,7 @@ export class MarketplaceDirect {
232234
* listingId,
233235
* quantity,
234236
* currencyContractAddress,
235-
* bidAmount
237+
* pricePerToken
236238
* );
237239
* ```
238240
*/

0 commit comments

Comments
 (0)