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

Multichain SDK - override chain for any contract + getContract is now async #492

Merged
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
14 changes: 14 additions & 0 deletions docs/sdk.chainandaddress.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; [ChainAndAddress](./sdk.chainandaddress.md)

## ChainAndAddress type

<b>Signature:</b>

```typescript
export declare type ChainAndAddress = {
chainId: ChainIdOrName;
address: string;
};
```
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deployedition.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Edition contract
<b>Signature:</b>

```typescript
deployEdition(metadata: NFTContractDeployMetadata): Promise<string>;
deployEdition(metadata: NFTContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [NFTContractDeployMetadata](./sdk.nftcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deployeditiondrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new EditionDrop contract
<b>Signature:</b>

```typescript
deployEditionDrop(metadata: NFTContractDeployMetadata): Promise<string>;
deployEditionDrop(metadata: NFTContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [NFTContractDeployMetadata](./sdk.nftcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploymarketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Marketplace contract
<b>Signature:</b>

```typescript
deployMarketplace(metadata: MarketplaceContractDeployMetadata): Promise<string>;
deployMarketplace(metadata: MarketplaceContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [MarketplaceContractDeployMetadata](./sdk.marketplacecontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploymultiwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ Deploys a new Multiwrap contract
<b>Signature:</b>

```typescript
deployMultiwrap(metadata: MultiwrapContractDeployMetadata): Promise<string>;
deployMultiwrap(metadata: MultiwrapContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [MultiwrapContractDeployMetadata](./sdk.multiwrapcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploynftcollection.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys an NFT Collection contract
<b>Signature:</b>

```typescript
deployNFTCollection(metadata: NFTContractDeployMetadata): Promise<string>;
deployNFTCollection(metadata: NFTContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [NFTContractDeployMetadata](./sdk.nftcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploynftdrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new NFTDrop contract
<b>Signature:</b>

```typescript
deployNFTDrop(metadata: NFTContractDeployMetadata): Promise<string>;
deployNFTDrop(metadata: NFTContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [NFTContractDeployMetadata](./sdk.nftcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploypack.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Pack contract
<b>Signature:</b>

```typescript
deployPack(metadata: NFTContractDeployMetadata): Promise<string>;
deployPack(metadata: NFTContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [NFTContractDeployMetadata](./sdk.nftcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploysplit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Split contract
<b>Signature:</b>

```typescript
deploySplit(metadata: SplitContractDeployMetadata): Promise<string>;
deploySplit(metadata: SplitContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [SplitContractDeployMetadata](./sdk.splitcontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploytoken.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Token contract
<b>Signature:</b>

```typescript
deployToken(metadata: TokenContractDeployMetadata): Promise<string>;
deployToken(metadata: TokenContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [TokenContractDeployMetadata](./sdk.tokencontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deploytokendrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Token Drop contract
<b>Signature:</b>

```typescript
deployTokenDrop(metadata: TokenContractDeployMetadata): Promise<string>;
deployTokenDrop(metadata: TokenContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [TokenContractDeployMetadata](./sdk.tokencontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.contractdeployer.deployvote.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Deploys a new Vote contract
<b>Signature:</b>

```typescript
deployVote(metadata: VoteContractDeployMetadata): Promise<string>;
deployVote(metadata: VoteContractDeployMetadata, chain?: ChainIdOrName): Promise<string>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| metadata | [VoteContractDeployMetadata](./sdk.votecontractdeploymetadata.md) | the contract metadata |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to deploy the contract to, defaults to the chain the SDK is connected to |

<b>Returns:</b>

Expand Down
22 changes: 11 additions & 11 deletions docs/sdk.contractdeployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export declare class ContractDeployer extends RPCConnectionHandler

| Method | Modifiers | Description |
| --- | --- | --- |
| [deployEdition(metadata)](./sdk.contractdeployer.deployedition.md) | | Deploys a new Edition contract |
| [deployEditionDrop(metadata)](./sdk.contractdeployer.deployeditiondrop.md) | | Deploys a new EditionDrop contract |
| [deployMarketplace(metadata)](./sdk.contractdeployer.deploymarketplace.md) | | Deploys a new Marketplace contract |
| [deployMultiwrap(metadata)](./sdk.contractdeployer.deploymultiwrap.md) | | <b><i>(BETA)</i></b> Deploys a new Multiwrap contract |
| [deployNFTCollection(metadata)](./sdk.contractdeployer.deploynftcollection.md) | | Deploys an NFT Collection contract |
| [deployNFTDrop(metadata)](./sdk.contractdeployer.deploynftdrop.md) | | Deploys a new NFTDrop contract |
| [deployPack(metadata)](./sdk.contractdeployer.deploypack.md) | | Deploys a new Pack 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 |
| [deployVote(metadata)](./sdk.contractdeployer.deployvote.md) | | Deploys a new Vote contract |
| [deployEdition(metadata, chain)](./sdk.contractdeployer.deployedition.md) | | Deploys a new Edition contract |
| [deployEditionDrop(metadata, chain)](./sdk.contractdeployer.deployeditiondrop.md) | | Deploys a new EditionDrop contract |
| [deployMarketplace(metadata, chain)](./sdk.contractdeployer.deploymarketplace.md) | | Deploys a new Marketplace contract |
| [deployMultiwrap(metadata, chain)](./sdk.contractdeployer.deploymultiwrap.md) | | <b><i>(BETA)</i></b> Deploys a new Multiwrap contract |
| [deployNFTCollection(metadata, chain)](./sdk.contractdeployer.deploynftcollection.md) | | Deploys an NFT Collection contract |
| [deployNFTDrop(metadata, chain)](./sdk.contractdeployer.deploynftdrop.md) | | Deploys a new NFTDrop contract |
| [deployPack(metadata, chain)](./sdk.contractdeployer.deploypack.md) | | Deploys a new Pack contract |
| [deploySplit(metadata, chain)](./sdk.contractdeployer.deploysplit.md) | | Deploys a new Split contract |
| [deployToken(metadata, chain)](./sdk.contractdeployer.deploytoken.md) | | Deploys a new Token contract |
| [deployTokenDrop(metadata, chain)](./sdk.contractdeployer.deploytokendrop.md) | | Deploys a new Token Drop contract |
| [deployVote(metadata, chain)](./sdk.contractdeployer.deployvote.md) | | Deploys a new Vote contract |
| [updateSigner(signer)](./sdk.contractdeployer.updatesigner.md) | | |

1 change: 1 addition & 0 deletions docs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
| [AirdropInput](./sdk.airdropinput.md) | Input model to pass a list of addresses + amount to transfer to each one |
| [Amount](./sdk.amount.md) | Represents a currency amount already formatted. ie. "1" for 1 ether. |
| [BufferOrStringWithName](./sdk.bufferorstringwithname.md) | |
| [ChainAndAddress](./sdk.chainandaddress.md) | |
| [ClaimCondition](./sdk.claimcondition.md) | Represents a claim condition fetched from the SDK |
| [ClaimConditionInput](./sdk.claimconditioninput.md) | Input model to create a claim condition with optional snapshot of wallets |
| [ClaimConditionsForToken](./sdk.claimconditionsfortoken.md) | |
Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.thirdwebsdk.getcontract.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ Get an instance of a Custom ThirdwebContract
<b>Signature:</b>

```typescript
getContract(address: string): Promise<SmartContract<import("contracts").ThirdwebContract>>;
getContract(address: string, chain?: ChainIdOrName): Promise<SmartContract<import("contracts").ThirdwebContract>>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| address | string | the address of the deployed contract |
| chain | ChainIdOrName | <i>(Optional)</i> optional the chain (id or name) of the contract (defaults to the SDK chainId) |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.thirdwebsdk.getcontractfromabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Get an instance of a Custom contract from a json ABI
<b>Signature:</b>

```typescript
getContractFromAbi(address: string, abi: ContractInterface): SmartContract<import("contracts").ThirdwebContract>;
getContractFromAbi(address: string, abi: ContractInterface, chain?: ChainIdOrName): SmartContract<import("contracts").ThirdwebContract>;
```

## Parameters
Expand All @@ -21,6 +21,7 @@ getContractFromAbi(address: string, abi: ContractInterface): SmartContract<impor
| --- | --- | --- |
| address | string | the address of the deployed contract |
| abi | ContractInterface | the JSON abi |
| chain | ChainIdOrName | <i>(Optional)</i> optional the chain (id or name) of the contract (defaults to the SDK chainId) |

<b>Returns:</b>

Expand Down
3 changes: 2 additions & 1 deletion docs/sdk.thirdwebsdk.getcontractlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Return all the contracts deployed by the specified address
<b>Signature:</b>

```typescript
getContractList(walletAddress: string): Promise<{
getContractList(walletAddress: string, chain?: ChainIdOrName): Promise<{
address: string;
contractType: "custom" | "token" | "split" | "edition" | "edition-drop" | "token-drop" | "vote" | "marketplace" | "pack" | "nft-drop" | "signature-drop" | "multiwrap" | "nft-collection";
metadata: () => Promise<any>;
Expand All @@ -21,6 +21,7 @@ getContractList(walletAddress: string): Promise<{
| Parameter | Type | Description |
| --- | --- | --- |
| walletAddress | string | the deployed address |
| chain | ChainIdOrName | <i>(Optional)</i> the chain to fetch from contracts from |

<b>Returns:</b>

Expand Down
5 changes: 3 additions & 2 deletions docs/sdk.thirdwebsdk.getedition.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ Get an instance of an Edition contract
<b>Signature:</b>

```typescript
getEdition(address: string): Edition;
getEdition(address: string, chain?: ChainIdOrName): Promise<Edition>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| address | string | the address of the deployed contract |
| chain | ChainIdOrName | <i>(Optional)</i> optional, chain (id or name) of the contract (defaults to the chain the SDK is connected to) |

<b>Returns:</b>

[Edition](./sdk.edition.md)
Promise&lt;[Edition](./sdk.edition.md)<!-- -->&gt;

the contract

5 changes: 3 additions & 2 deletions docs/sdk.thirdwebsdk.geteditiondrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ Get an instance of a Edition Drop contract
<b>Signature:</b>

```typescript
getEditionDrop(address: string): EditionDrop;
getEditionDrop(address: string, chain?: ChainIdOrName): Promise<EditionDrop>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| address | string | the address of the deployed contract |
| chain | ChainIdOrName | <i>(Optional)</i> optional, chain (id or name) of the contract (defaults to the chain the SDK is connected to) |

<b>Returns:</b>

[EditionDrop](./sdk.editiondrop.md)
Promise&lt;[EditionDrop](./sdk.editiondrop.md)<!-- -->&gt;

the contract

5 changes: 3 additions & 2 deletions docs/sdk.thirdwebsdk.getmarketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ Get an instance of a Marketplace contract
<b>Signature:</b>

```typescript
getMarketplace(address: string): Marketplace;
getMarketplace(address: string, chain?: ChainIdOrName): Promise<Marketplace>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| address | string | the address of the deployed contract |
| chain | ChainIdOrName | <i>(Optional)</i> optional, chain (id or name) of the contract (defaults to the chain the SDK is connected to) |

<b>Returns:</b>

[Marketplace](./sdk.marketplace.md)
Promise&lt;[Marketplace](./sdk.marketplace.md)<!-- -->&gt;

the contract

5 changes: 3 additions & 2 deletions docs/sdk.thirdwebsdk.getmultiwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ Get an instance of a Multiwrap contract
<b>Signature:</b>

```typescript
getMultiwrap(address: string): Multiwrap;
getMultiwrap(address: string, chain?: ChainIdOrName): Promise<Multiwrap>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| address | string | the address of the deployed contract |
| chain | ChainIdOrName | <i>(Optional)</i> optional, chain (id or name) of the contract (defaults to the chain the SDK is connected to) |

<b>Returns:</b>

[Multiwrap](./sdk.multiwrap.md)
Promise&lt;[Multiwrap](./sdk.multiwrap.md)<!-- -->&gt;

the contract

5 changes: 3 additions & 2 deletions docs/sdk.thirdwebsdk.getnftcollection.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ Get an instance of a NFT Collection contract
<b>Signature:</b>

```typescript
getNFTCollection(address: string): NFTCollection;
getNFTCollection(address: string, chain?: ChainIdOrName): Promise<NFTCollection>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| address | string | the address of the deployed contract |
| chain | ChainIdOrName | <i>(Optional)</i> optional, chain (id or name) of the contract (defaults to the chain the SDK is connected to) |

<b>Returns:</b>

[NFTCollection](./sdk.nftcollection.md)
Promise&lt;[NFTCollection](./sdk.nftcollection.md)<!-- -->&gt;

the contract

Loading