This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation for signature drop (#478)
- Loading branch information
Showing
34 changed files
with
943 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [(constructor)](./sdk.signaturedrop._constructor_.md) | ||
|
||
## SignatureDrop.(constructor) | ||
|
||
Constructs a new instance of the `SignatureDrop` class | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
constructor(network: NetworkOrSignerOrProvider, address: string, storage: IStorage, options?: SDKOptions, contractWrapper?: ContractWrapper<SignatureDropContract>); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| network | [NetworkOrSignerOrProvider](./sdk.networkorsignerorprovider.md) | | | ||
| address | string | | | ||
| storage | [IStorage](./sdk.istorage.md) | | | ||
| options | [SDKOptions](./sdk.sdkoptions.md) | <i>(Optional)</i> | | ||
| contractWrapper | ContractWrapper<SignatureDropContract> | <i>(Optional)</i> | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [analytics](./sdk.signaturedrop.analytics.md) | ||
|
||
## SignatureDrop.analytics property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
analytics: ContractAnalytics<SignatureDropContract>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [burn](./sdk.signaturedrop.burn.md) | ||
|
||
## SignatureDrop.burn() method | ||
|
||
Burn a single NFT | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
burn(tokenId: BigNumberish): Promise<TransactionResult>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| tokenId | BigNumberish | the token Id to burn | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[TransactionResult](./sdk.transactionresult.md)<!-- -->> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [claim](./sdk.signaturedrop.claim.md) | ||
|
||
## SignatureDrop.claim() method | ||
|
||
Claim NFTs to the connected wallet. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
claim(quantity: BigNumberish, proofs?: BytesLike[]): Promise<TransactionResultWithId<NFTMetadataOwner>[]>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| quantity | BigNumberish | | | ||
| proofs | BytesLike\[\] | <i>(Optional)</i> | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<!-- --><[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->>\[\]> | ||
|
||
- an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata | ||
|
||
## Remarks | ||
|
||
See [NFTDrop.claimTo()](./sdk.nftdrop.claimto.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [claimCondition](./sdk.signaturedrop.claimcondition.md) | ||
|
||
## SignatureDrop.claimCondition property | ||
|
||
Configure claim conditions | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
claimCondition: DropSingleClaimConditions<SignatureDropContract>; | ||
``` | ||
|
||
## Remarks | ||
|
||
Define who can claim NFTs in the collection, when and how many. | ||
|
||
## Example | ||
|
||
|
||
```javascript | ||
const presaleStartTime = new Date(); | ||
const claimCondition = { | ||
startTime: presaleStartTime, // start the presale now | ||
maxQuantity: 2, // limit how many mints for this presale | ||
price: 0.01, // presale price | ||
snapshot: ['0x...', '0x...'], // limit minting to only certain addresses | ||
}; | ||
await contract.claimCondition.set(claimCondition); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [claimTo](./sdk.signaturedrop.claimto.md) | ||
|
||
## SignatureDrop.claimTo() method | ||
|
||
Claim unique NFTs to a specific Wallet | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
claimTo(destinationAddress: string, quantity: BigNumberish, proofs?: BytesLike[]): Promise<TransactionResultWithId<NFTMetadataOwner>[]>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| destinationAddress | string | Address you want to send the token to | | ||
| quantity | BigNumberish | Quantity of the tokens you want to claim | | ||
| proofs | BytesLike\[\] | <i>(Optional)</i> Array of proofs | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<!-- --><[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->>\[\]> | ||
|
||
- an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata | ||
|
||
## Remarks | ||
|
||
Let the specified wallet claim NFTs. | ||
|
||
## Example | ||
|
||
|
||
```javascript | ||
const address = "{{wallet_address}}"; // address of the wallet you want to claim the NFTs | ||
const quantity = 1; // how many unique NFTs you want to claim | ||
|
||
const tx = await contract.claimTo(address, quantity); | ||
const receipt = tx.receipt; // the transaction receipt | ||
const claimedTokenId = tx.id; // the id of the NFT claimed | ||
const claimedNFT = await tx.data(); // (optional) get the claimed NFT metadata | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [contractAbi](./sdk.signaturedrop.contractabi.md) | ||
|
||
## SignatureDrop.contractAbi property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static contractAbi: any; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [contractRoles](./sdk.signaturedrop.contractroles.md) | ||
|
||
## SignatureDrop.contractRoles property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static contractRoles: readonly ["admin", "minter", "transfer"]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [contractType](./sdk.signaturedrop.contracttype.md) | ||
|
||
## SignatureDrop.contractType property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static contractType: "signature-drop"; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [createBatch](./sdk.signaturedrop.createbatch.md) | ||
|
||
## SignatureDrop.createBatch() method | ||
|
||
Create a batch of unique NFTs to be claimed in the future | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
createBatch(metadatas: NFTMetadataInput[]): Promise<TransactionResultWithId<NFTMetadata>[]>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| metadatas | [NFTMetadataInput](./sdk.nftmetadatainput.md)<!-- -->\[\] | The metadata to include in the batch. | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<!-- --><[NFTMetadata](./sdk.nftmetadata.md)<!-- -->>\[\]> | ||
|
||
## Remarks | ||
|
||
Create batch allows you to create a batch of many unique NFTs in one transaction. | ||
|
||
## Example | ||
|
||
|
||
```javascript | ||
// Custom metadata of the NFTs to create | ||
const metadatas = [{ | ||
name: "Cool NFT", | ||
description: "This is a cool NFT", | ||
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file | ||
}, { | ||
name: "Cool NFT", | ||
description: "This is a cool NFT", | ||
image: fs.readFileSync("path/to/image.png"), | ||
}]; | ||
|
||
const results = await contract.createBatch(metadatas); // uploads and creates the NFTs on chain | ||
const firstTokenId = results[0].id; // token id of the first created NFT | ||
const firstNFT = await results[0].data(); // (optional) fetch details of the first created NFT | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [encoder](./sdk.signaturedrop.encoder.md) | ||
|
||
## SignatureDrop.encoder property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
encoder: ContractEncoder<SignatureDropContract>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [estimator](./sdk.signaturedrop.estimator.md) | ||
|
||
## SignatureDrop.estimator property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
estimator: GasCostEstimator<SignatureDropContract>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [events](./sdk.signaturedrop.events.md) | ||
|
||
## SignatureDrop.events property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
events: ContractEvents<SignatureDropContract>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [getAll](./sdk.signaturedrop.getall.md) | ||
|
||
## SignatureDrop.getAll() method | ||
|
||
Get All Minted NFTs | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getAll(queryParams?: QueryAllParams): Promise<NFTMetadataOwner[]>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| queryParams | [QueryAllParams](./sdk.queryallparams.md) | <i>(Optional)</i> optional filtering to only fetch a subset of results. | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->\[\]> | ||
|
||
The NFT metadata for all NFTs queried. | ||
|
||
## Remarks | ||
|
||
Get all the data associated with every NFT in this contract. | ||
|
||
By default, returns the first 100 NFTs, use queryParams to fetch more. | ||
|
||
## Example | ||
|
||
|
||
```javascript | ||
const nfts = await contract.getAll(); | ||
console.log(nfts); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SignatureDrop](./sdk.signaturedrop.md) > [getAllClaimed](./sdk.signaturedrop.getallclaimed.md) | ||
|
||
## SignatureDrop.getAllClaimed() method | ||
|
||
Get All Claimed NFTs | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getAllClaimed(queryParams?: QueryAllParams): Promise<NFTMetadataOwner[]>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| queryParams | [QueryAllParams](./sdk.queryallparams.md) | <i>(Optional)</i> optional filtering to only fetch a subset of results. | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->\[\]> | ||
|
||
The NFT metadata and their ownersfor all NFTs queried. | ||
|
||
## Remarks | ||
|
||
Fetch all the NFTs (and their owners) that have been claimed in this Drop. | ||
|
||
\* | ||
|
||
## Example | ||
|
||
|
||
```javascript | ||
const claimedNFTs = await contract.getAllClaimed(); | ||
const firstOwner = claimedNFTs[0].owner; | ||
``` | ||
|
Oops, something went wrong.