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

Commit

Permalink
Update documentation for signature drop (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj authored Jun 21, 2022
1 parent bacf3cb commit 9e4f8c8
Show file tree
Hide file tree
Showing 34 changed files with 943 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
| [NFTDrop](./sdk.nftdrop.md) | Setup a collection of one-of-one NFTs that are minted as users claim them. |
| [Pack](./sdk.pack.md) | Create lootboxes of NFTs with rarity based open mechanics. |
| [RemoteStorage](./sdk.remotestorage.md) | Fetch and upload files to IPFS or any other storage. |
| [SignatureDrop](./sdk.signaturedrop.md) | Setup a collection of NFTs where when it comes to minting, you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by that external party.. |
| [SmartContract](./sdk.smartcontract.md) | <b><i>(BETA)</i></b> Custom contract dynamic class with feature detection |
| [Split](./sdk.split.md) | Create custom royalty splits to distribute funds. |
| [ThirdwebSDK](./sdk.thirdwebsdk.md) | The main entry point for the thirdweb SDK |
Expand Down
24 changes: 24 additions & 0 deletions docs/sdk.signaturedrop._constructor_.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [(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&lt;SignatureDropContract&gt; | <i>(Optional)</i> |

11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.analytics.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [analytics](./sdk.signaturedrop.analytics.md)

## SignatureDrop.analytics property

<b>Signature:</b>

```typescript
analytics: ContractAnalytics<SignatureDropContract>;
```
24 changes: 24 additions & 0 deletions docs/sdk.signaturedrop.burn.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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&lt;[TransactionResult](./sdk.transactionresult.md)<!-- -->&gt;

31 changes: 31 additions & 0 deletions docs/sdk.signaturedrop.claim.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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&lt;[TransactionResultWithId](./sdk.transactionresultwithid.md)<!-- -->&lt;[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->&gt;\[\]&gt;

- 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)

32 changes: 32 additions & 0 deletions docs/sdk.signaturedrop.claimcondition.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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);
```

45 changes: 45 additions & 0 deletions docs/sdk.signaturedrop.claimto.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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&lt;[TransactionResultWithId](./sdk.transactionresultwithid.md)<!-- -->&lt;[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->&gt;\[\]&gt;

- 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
```

11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.contractabi.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [contractAbi](./sdk.signaturedrop.contractabi.md)

## SignatureDrop.contractAbi property

<b>Signature:</b>

```typescript
static contractAbi: any;
```
11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.contractroles.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [contractRoles](./sdk.signaturedrop.contractroles.md)

## SignatureDrop.contractRoles property

<b>Signature:</b>

```typescript
static contractRoles: readonly ["admin", "minter", "transfer"];
```
11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.contracttype.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [contractType](./sdk.signaturedrop.contracttype.md)

## SignatureDrop.contractType property

<b>Signature:</b>

```typescript
static contractType: "signature-drop";
```
48 changes: 48 additions & 0 deletions docs/sdk.signaturedrop.createbatch.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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&lt;[TransactionResultWithId](./sdk.transactionresultwithid.md)<!-- -->&lt;[NFTMetadata](./sdk.nftmetadata.md)<!-- -->&gt;\[\]&gt;

## 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
```

11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.encoder.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [encoder](./sdk.signaturedrop.encoder.md)

## SignatureDrop.encoder property

<b>Signature:</b>

```typescript
encoder: ContractEncoder<SignatureDropContract>;
```
11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.estimator.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [estimator](./sdk.signaturedrop.estimator.md)

## SignatureDrop.estimator property

<b>Signature:</b>

```typescript
estimator: GasCostEstimator<SignatureDropContract>;
```
11 changes: 11 additions & 0 deletions docs/sdk.signaturedrop.events.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [events](./sdk.signaturedrop.events.md)

## SignatureDrop.events property

<b>Signature:</b>

```typescript
events: ContractEvents<SignatureDropContract>;
```
40 changes: 40 additions & 0 deletions docs/sdk.signaturedrop.getall.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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&lt;[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->\[\]&gt;

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);
```

40 changes: 40 additions & 0 deletions docs/sdk.signaturedrop.getallclaimed.md
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) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [SignatureDrop](./sdk.signaturedrop.md) &gt; [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&lt;[NFTMetadataOwner](./sdk.nftmetadataowner.md)<!-- -->\[\]&gt;

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;
```

Loading

0 comments on commit 9e4f8c8

Please sign in to comment.