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
Show all changes
29 commits
Select commit Hold shift + click to select a range
cd3d9ca
Implement Signature Drop SDK wrapper
ndeto May 12, 2022
fdf21fd
Alias SignatureDrop
ndeto May 12, 2022
df56b19
Use cases to determine type of contract
ndeto May 17, 2022
57cc73d
Implement type gurad on DelayedReveal class
ndeto May 17, 2022
d8fee5c
Exclude constructor in SignatureDrop deploy
ndeto May 17, 2022
5bafc83
Add Delay Reveal Functionality
ndeto May 18, 2022
9f58bd8
Adjust tests to use SignatureDrop Instances
ndeto May 19, 2022
4dba613
Rename index variable in signature-drop
ndeto May 19, 2022
7d3f5d5
Add Signature Mint WIP
ndeto May 19, 2022
e26b20b
Change Wrapper in Erc721WithQuantitySignatureMinting to ISignatureMin…
ndeto May 20, 2022
d02149d
Fix Type errors for SignatureMinting class
ndeto May 20, 2022
9219a94
signature minting - generating signatures tests
kumaryash90 May 23, 2022
621dcdb
tests: mint with URI and mint batch with URI
kumaryash90 May 23, 2022
d1ddc6c
tests: claiming
kumaryash90 May 23, 2022
0d4101b
Signature Minting Test Suites
ndeto May 23, 2022
7bae79c
Implement Claim Conditions
ndeto May 23, 2022
0745a4d
Add Claim conditions tests to Signature Drop
ndeto May 23, 2022
e24fc7f
Restore tests to working state after splitting SignatureDrop
ndeto May 24, 2022
e870c0e
All Signature Drop Tests passing
ndeto May 25, 2022
38228c8
Implement totalClaimedSupply & totalUnclaimedSupply , Update Document…
ndeto May 25, 2022
fb5d02d
Update Docs
ndeto May 25, 2022
997d819
Change TokensMintedEvent to TokensMintedWithSignatureEvent
ndeto May 25, 2022
66222ab
Rebase and Unyalc
ndeto May 25, 2022
138d2a8
Update thirdweb-dev contracts to 2.3.9-0
ndeto May 25, 2022
f59318e
Update contracts build
ndeto May 25, 2022
9bba6b3
Remove 1155 imports and Update Signature Drop documentation
ndeto May 25, 2022
2b8c636
Move Sigmint deployer to before-setup, Clean up imports, documentation
ndeto May 25, 2022
8ecb002
Rebase with main branch
ndeto May 25, 2022
6dab301
Use addresses.ts to supply the sigMint contract address
ndeto May 25, 2022
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
12 changes: 12 additions & 0 deletions cache/solidity-files-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_format": "ethers-rs-sol-cache-3",
"paths": {
"artifacts": "out",
"sources": "src",
"tests": "test",
"libraries": [
"lib"
]
},
"files": {}
}
2 changes: 1 addition & 1 deletion docs/sdk.all_roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<b>Signature:</b>

```typescript
ALL_ROLES: ("transfer" | "lister" | "minter" | "admin" | "pauser" | "editor" | "asset")[]
ALL_ROLES: ("transfer" | "lister" | "admin" | "minter" | "pauser" | "editor" | "asset")[]
```
26 changes: 26 additions & 0 deletions docs/sdk.contractdeployer.deploysignaturedrop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [ContractDeployer](./sdk.contractdeployer.md) &gt; [deploySignatureDrop](./sdk.contractdeployer.deploysignaturedrop.md)

## ContractDeployer.deploySignatureDrop() method

Deploys a new SignatureDrop contract

<b>Signature:</b>

```typescript
deploySignatureDrop(metadata: NFTContractDeployMetadata): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [NFTContractDeployMetadata](./sdk.nftcontractdeploymetadata.md) | the contract metadata |

<b>Returns:</b>

Promise&lt;string&gt;

the address of the deployed contract

1 change: 1 addition & 0 deletions docs/sdk.contractdeployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export declare class ContractDeployer extends RPCConnectionHandler
| [deployNFTCollection(metadata)](./sdk.contractdeployer.deploynftcollection.md) | | Deploys a new NFTCollection contract |
| [deployNFTDrop(metadata)](./sdk.contractdeployer.deploynftdrop.md) | | Deploys a new NFTDrop contract |
| [deployPack(metadata)](./sdk.contractdeployer.deploypack.md) | | Deploys a new Pack contract |
| [deploySignatureDrop(metadata)](./sdk.contractdeployer.deploysignaturedrop.md) | | Deploys a new SignatureDrop contract |
| [deploySplit(metadata)](./sdk.contractdeployer.deploysplit.md) | | Deploys a new Split contract |
| [deployToken(metadata)](./sdk.contractdeployer.deploytoken.md) | | Deploys a new Token contract |
| [deployTokenDrop(metadata)](./sdk.contractdeployer.deploytokendrop.md) | | Deploys a new Token Drop contract |
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk.contractmetadata.set.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<b>Signature:</b>

```typescript
set(metadata: z.input<TSchema["input"]>): Promise<((<A>() => A extends never ? 1 : 0) extends <A_1>() => A_1 extends z.output<TSchema["output"]> ? 1 : 0 ? 1 : 0) extends infer T ? T extends ((<A>() => A extends never ? 1 : 0) extends <A_1>() => A_1 extends z.output<TSchema["output"]> ? 1 : 0 ? 1 : 0) ? T extends 1 ? Omit<{
set(metadata: z.input<TSchema["input"]>): Promise<(<A>() => A extends never ? 1 : 0 extends <A_1>() => A_1 extends z.output<TSchema["output"]> ? 1 : 0 ? 1 : 0) extends 1 ? Omit<{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
}, "data"> : {
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<z.output<TSchema["output"]>>;
} : never : never>;
}>;
```

## Parameters
Expand All @@ -24,6 +24,6 @@ set(metadata: z.input<TSchema["input"]>): Promise<((<A>() => A extends never ? 1

<b>Returns:</b>

Promise&lt;((&lt;A&gt;() =&gt; A extends never ? 1 : 0) extends &lt;A\_1&gt;() =&gt; A\_1 extends z.output&lt;TSchema\["output"\]&gt; ? 1 : 0 ? 1 : 0) extends infer T ? T extends ((&lt;A&gt;() =&gt; A extends never ? 1 : 0) extends &lt;A\_1&gt;() =&gt; A\_1 extends z.output&lt;TSchema\["output"\]&gt; ? 1 : 0 ? 1 : 0) ? T extends 1 ? Omit&lt;{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;unknown&gt;; }, "data"&gt; : { receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;z.output&lt;TSchema\["output"\]&gt;&gt;; } : never : never&gt;
Promise&lt;(&lt;A&gt;() =&gt; A extends never ? 1 : 0 extends &lt;A\_1&gt;() =&gt; A\_1 extends z.output&lt;TSchema\["output"\]&gt; ? 1 : 0 ? 1 : 0) extends 1 ? Omit&lt;{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;unknown&gt;; }, "data"&gt; : { receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;z.output&lt;TSchema\["output"\]&gt;&gt;; }&gt;


6 changes: 3 additions & 3 deletions docs/sdk.contractmetadata.update.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<b>Signature:</b>

```typescript
update(metadata: Partial<z.input<TSchema["input"]>>): Promise<((<A>() => A extends never ? 1 : 0) extends <A_1>() => A_1 extends z.output<TSchema["output"]> ? 1 : 0 ? 1 : 0) extends infer T ? T extends ((<A>() => A extends never ? 1 : 0) extends <A_1>() => A_1 extends z.output<TSchema["output"]> ? 1 : 0 ? 1 : 0) ? T extends 1 ? Omit<{
update(metadata: Partial<z.input<TSchema["input"]>>): Promise<(<A>() => A extends never ? 1 : 0 extends <A_1>() => A_1 extends z.output<TSchema["output"]> ? 1 : 0 ? 1 : 0) extends 1 ? Omit<{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
}, "data"> : {
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<z.output<TSchema["output"]>>;
} : never : never>;
}>;
```

## Parameters
Expand All @@ -24,5 +24,5 @@ update(metadata: Partial<z.input<TSchema["input"]>>): Promise<((<A>() => A exten

<b>Returns:</b>

Promise&lt;((&lt;A&gt;() =&gt; A extends never ? 1 : 0) extends &lt;A\_1&gt;() =&gt; A\_1 extends z.output&lt;TSchema\["output"\]&gt; ? 1 : 0 ? 1 : 0) extends infer T ? T extends ((&lt;A&gt;() =&gt; A extends never ? 1 : 0) extends &lt;A\_1&gt;() =&gt; A\_1 extends z.output&lt;TSchema\["output"\]&gt; ? 1 : 0 ? 1 : 0) ? T extends 1 ? Omit&lt;{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;unknown&gt;; }, "data"&gt; : { receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;z.output&lt;TSchema\["output"\]&gt;&gt;; } : never : never&gt;
Promise&lt;(&lt;A&gt;() =&gt; A extends never ? 1 : 0 extends &lt;A\_1&gt;() =&gt; A\_1 extends z.output&lt;TSchema\["output"\]&gt; ? 1 : 0 ? 1 : 0) extends 1 ? Omit&lt;{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;unknown&gt;; }, "data"&gt; : { receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;z.output&lt;TSchema\["output"\]&gt;&gt;; }&gt;

2 changes: 1 addition & 1 deletion docs/sdk.delayedreveal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Handles delayed reveal logic
<b>Signature:</b>

```typescript
export declare class DelayedReveal<T extends DropERC721>
export declare class DelayedReveal<T extends SignatureDrop | DropERC721>
```

## Constructors
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk.dropclaimconditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Manages claim conditions for NFT Drop contracts
<b>Signature:</b>

```typescript
export declare class DropClaimConditions<TContract extends DropERC721 | DropERC20>
export declare class DropClaimConditions<TContract extends SignatureDrop | DropERC721 | DropERC20>
```

## Constructors
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk.erc721.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Standard ERC721 NFT functions
<b>Signature:</b>

```typescript
export declare class Erc721<T extends DropERC721 | TokenERC721 | BaseERC721 = BaseERC721> implements UpdateableNetwork, DetectableFeature
export declare class Erc721<T extends SignatureDrop | DropERC721 | TokenERC721 | BaseERC721 = BaseERC721> implements UpdateableNetwork, DetectableFeature
```
<b>Implements:</b> UpdateableNetwork, DetectableFeature

Expand Down
12 changes: 12 additions & 0 deletions docs/sdk.filledsignature721withquantity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [FilledSignature721WithQuantity](./sdk.filledsignature721withquantity.md)

## FilledSignature721WithQuantity type


<b>Signature:</b>

```typescript
export declare type FilledSignature721WithQuantity = z.output<typeof Signature721WithQuantityInput>;
```
6 changes: 6 additions & 0 deletions docs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
| [NFTCollection](./sdk.nftcollection.md) | Create a collection of one-of-one NFTs. |
| [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. |
| [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 Expand Up @@ -114,6 +115,7 @@
| [MintRequest1155](./sdk.mintrequest1155.md) | |
| [MintRequest20](./sdk.mintrequest20.md) | |
| [MintRequest721](./sdk.mintrequest721.md) | |
| [MintRequest721withQuantity](./sdk.mintrequest721withquantity.md) | |
| [NATIVE\_TOKEN\_ADDRESS](./sdk.native_token_address.md) | |
| [NATIVE\_TOKENS](./sdk.native_tokens.md) | |
| [SDKOptionsSchema](./sdk.sdkoptionsschema.md) | |
Expand All @@ -139,6 +141,7 @@
| [EditionMetadataOwner](./sdk.editionmetadataowner.md) | |
| [FileOrBuffer](./sdk.fileorbuffer.md) | |
| [FilledConditionInput](./sdk.filledconditioninput.md) | |
| [FilledSignature721WithQuantity](./sdk.filledsignature721withquantity.md) | |
| [FilledSignaturePayload1155](./sdk.filledsignaturepayload1155.md) | |
| [FilledSignaturePayload20](./sdk.filledsignaturepayload20.md) | |
| [FilledSignaturePayload721](./sdk.filledsignaturepayload721.md) | |
Expand All @@ -152,16 +155,19 @@
| [PayloadToSign1155](./sdk.payloadtosign1155.md) | |
| [PayloadToSign20](./sdk.payloadtosign20.md) | |
| [PayloadToSign721](./sdk.payloadtosign721.md) | |
| [PayloadToSign721withQuantity](./sdk.payloadtosign721withquantity.md) | |
| [PayloadWithUri1155](./sdk.payloadwithuri1155.md) | |
| [PayloadWithUri20](./sdk.payloadwithuri20.md) | |
| [PayloadWithUri721](./sdk.payloadwithuri721.md) | |
| [PayloadWithUri721withQuantity](./sdk.payloadwithuri721withquantity.md) | |
| [PermitRequestMessage](./sdk.permitrequestmessage.md) | EIP-2612 token permit message for gasless transaction |
| [Price](./sdk.price.md) | Represents a currency price already formatted. ie. "1" for 1 ether. |
| [Role](./sdk.role.md) | |
| [SDKOptions](./sdk.sdkoptions.md) | All these configuration options are optional with sane defaults: |
| [SignedPayload1155](./sdk.signedpayload1155.md) | |
| [SignedPayload20](./sdk.signedpayload20.md) | |
| [SignedPayload721](./sdk.signedpayload721.md) | |
| [SignedPayload721WithQuantitySignature](./sdk.signedpayload721withquantitysignature.md) | |
| [SignerOrProvider](./sdk.signerorprovider.md) | |
| [Snapshot](./sdk.snapshot.md) | |
| [SnapshotInfo](./sdk.snapshotinfo.md) | |
Expand Down
14 changes: 14 additions & 0 deletions docs/sdk.mintrequest721withquantity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [MintRequest721withQuantity](./sdk.mintrequest721withquantity.md)

## MintRequest721withQuantity variable

<b>Signature:</b>

```typescript
MintRequest721withQuantity: {
name: string;
type: string;
}[]
```
12 changes: 12 additions & 0 deletions docs/sdk.payloadtosign721withquantity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [PayloadToSign721withQuantity](./sdk.payloadtosign721withquantity.md)

## PayloadToSign721withQuantity type


<b>Signature:</b>

```typescript
export declare type PayloadToSign721withQuantity = z.input<typeof Signature721WithQuantityInput>;
```
12 changes: 12 additions & 0 deletions docs/sdk.payloadwithuri721withquantity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/sdk](./sdk.md) &gt; [PayloadWithUri721withQuantity](./sdk.payloadwithuri721withquantity.md)

## PayloadWithUri721withQuantity type


<b>Signature:</b>

```typescript
export declare type PayloadWithUri721withQuantity = z.output<typeof Signature721WithQuantityOutput>;
```
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)

39 changes: 39 additions & 0 deletions docs/sdk.signaturedrop.claimconditions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- 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; [claimConditions](./sdk.signaturedrop.claimconditions.md)

## SignatureDrop.claimConditions property

Configure claim conditions

<b>Signature:</b>

```typescript
claimConditions: DropClaimConditions<SignatureDropContract>;
```

## Remarks

Define who can claim NFTs in the collection, when and how many.

## Example


```javascript
const presaleStartTime = new Date();
const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const claimConditions = [
{
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
},
{
startTime: publicSaleStartTime, // 24h after presale, start public sale
price: 0.08, // public sale price
}
]);
await contract.claimConditions.set(claimConditions);
```

Loading