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
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
3 changes: 3 additions & 0 deletions docs/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ import { useNetworkMistmatch } from "@thirdweb-dev/react"
| [usePack(contractAddress)](./react.usepack.md) | Hook for getting an instance of a <code>Pack</code> contract. This contract supports the creation of on-chain luck-based lootboxes. |
| [usePlatformFees(contract)](./react.useplatformfees.md) | <b><i>(BETA)</i></b> Use this to get the platform fees settings of your |
| [usePrimarySaleRecipient(contract)](./react.useprimarysalerecipient.md) | <b><i>(BETA)</i></b> |
| [useResetClaimConditions(\[contract, tokenId\])](./react.useresetclaimconditions.md) | <b><i>(BETA)</i></b> Use this to reset claim conditions on your [NFTContract](./react.nftcontract.md) |
| [useResolvedMediaType(uri)](./react.useresolvedmediatype.md) | |
| [useRevokeRole(contract)](./react.userevokerole.md) | <b><i>(BETA)</i></b> Use this to revoke a [WalletAddress](./react.walletaddress.md) a specific role on a |
| [useRoleMembers(contract, role)](./react.userolemembers.md) | <b><i>(BETA)</i></b> Use this to get the members of a role on a |
| [useRoyaltySettings(contract)](./react.useroyaltysettings.md) | <b><i>(BETA)</i></b> Use this to get the royalty settings of your |
| [useSDK()](./react.usesdk.md) | |
| [useSetAllRoleMembers(contract)](./react.usesetallrolemembers.md) | <b><i>(BETA)</i></b> Use this to OVERWRITE the list of addresses that are members of specific roles |
| [useSetClaimConditions(\[contract, tokenId\])](./react.usesetclaimconditions.md) | <b><i>(BETA)</i></b> Use this to set claim conditions on your [NFTContract](./react.nftcontract.md) |
| [useSignatureDrop(contractAddress)](./react.usesignaturedrop.md) | Hook for getting an instance of an <code>SignatureDrop</code> contract. This contract is meant to interface with ERC721 compliant NFTs that can be lazily minted. |
| [useSplit(contractAddress)](./react.usesplit.md) | Hook for getting an instance of a <code>Split</code> contract. This contract supports fund distribution to multiple parties. |
| [useToken(contractAddress)](./react.usetoken.md) | Hook for getting an instance of an <code>Token</code> contract. This contract supports ERC20 compliant tokens. |
Expand Down Expand Up @@ -175,6 +177,7 @@ import { useWalletConnect } from "@thirdweb-dev/react"
| [NFT](./react.nft.md) | <b><i>(BETA)</i></b> A single NFT token |
| [NFTContract](./react.nftcontract.md) | <b><i>(BETA)</i></b> The possible NFT contract types. |
| [RequiredParam](./react.requiredparam.md) | <b><i>(BETA)</i></b> Makes a parameter required to be passed, but still allowes it to be undefined. |
| [SetClaimConditionsParams](./react.setclaimconditionsparams.md) | <b><i>(BETA)</i></b> The params for the [useSetClaimConditions()](./react.usesetclaimconditions.md) hook mutation. |
| [TokenBurnParams](./react.tokenburnparams.md) | <b><i>(BETA)</i></b> The parameters to pass to the burn function. |
| [TokenParams](./react.tokenparams.md) | <b><i>(BETA)</i></b> The parameters to pass to the mint and transfer functions. |
| [TransferNFTParams](./react.transfernftparams.md) | <b><i>(BETA)</i></b> The params to pass to <code>useTransferNFT</code>. |
Expand Down
19 changes: 19 additions & 0 deletions docs/react.setclaimconditionsparams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/react](./react.md) &gt; [SetClaimConditionsParams](./react.setclaimconditionsparams.md)

## SetClaimConditionsParams type

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>

The params for the [useSetClaimConditions()](./react.usesetclaimconditions.md) hook mutation.

<b>Signature:</b>

```typescript
export declare type SetClaimConditionsParams = {
phases: ClaimConditionInput[];
reset?: boolean;
};
```
4 changes: 2 additions & 2 deletions docs/react.useactiveclaimcondition.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Use this to get the active claim conditon for ERC20, ERC721 or ERC1155 based con
<b>Signature:</b>

```typescript
export declare function useActiveClaimCondition<TContract extends NFTDrop | EditionDrop | TokenDrop | SignatureDrop>(...[contract, tokenId]: ActiveClaimConditionParams<TContract>): import("@tanstack/react-query").UseQueryResult<{
export declare function useActiveClaimCondition<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): import("@tanstack/react-query").UseQueryResult<{
snapshot?: {
address: string;
maxClaimable: string;
Expand Down Expand Up @@ -40,7 +40,7 @@ export declare function useActiveClaimCondition<TContract extends NFTDrop | Edit

| Parameter | Type | Description |
| --- | --- | --- |
| \[contract, tokenId\] | ActiveClaimConditionParams&lt;TContract&gt; | |
| \[contract, tokenId\] | ClaimConditionsInputParams&lt;TContract&gt; | |

<b>Returns:</b>

Expand Down
4 changes: 2 additions & 2 deletions docs/react.useclaimconditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Use this to get all claim conditons for ERC20, ERC721 or ERC1155 based contracts
<b>Signature:</b>

```typescript
export declare function useClaimConditions<TContract extends NFTDrop | EditionDrop | TokenDrop | SignatureDrop>(...[contract, tokenId]: ActiveClaimConditionParams<TContract>): import("@tanstack/react-query").UseQueryResult<{
export declare function useClaimConditions<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): import("@tanstack/react-query").UseQueryResult<{
snapshot?: {
address: string;
maxClaimable: string;
Expand Down Expand Up @@ -40,7 +40,7 @@ export declare function useClaimConditions<TContract extends NFTDrop | EditionDr

| Parameter | Type | Description |
| --- | --- | --- |
| \[contract, tokenId\] | ActiveClaimConditionParams&lt;TContract&gt; | |
| \[contract, tokenId\] | ClaimConditionsInputParams&lt;TContract&gt; | |

<b>Returns:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs/react.useclaimineligibilityreasons.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Use this to check for reasons that prevent claiming for either ERC20, ERC721 or
<b>Signature:</b>

```typescript
export declare function useClaimIneligibilityReasons<TContract extends NFTDrop | EditionDrop | TokenDrop | SignatureDrop>(...[contract, params, tokenId]: ClaimIneligibilityInputParams<TContract>): import("@tanstack/react-query").UseQueryResult<import("@thirdweb-dev/sdk/dist/browser").ClaimEligibility[], unknown>;
export declare function useClaimIneligibilityReasons<TContract extends NFTContract>(...[contract, params, tokenId]: ClaimIneligibilityInputParams<TContract>): import("@tanstack/react-query").UseQueryResult<import("@thirdweb-dev/sdk/dist/browser").ClaimEligibility[], unknown>;
```

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

[Home](./index.md) &gt; [@thirdweb-dev/react](./react.md) &gt; [useResetClaimConditions](./react.useresetclaimconditions.md)

## useResetClaimConditions() function

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>

Use this to reset claim conditions on your [NFTContract](./react.nftcontract.md)

<b>Signature:</b>

```typescript
export declare function useResetClaimConditions<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): import("@tanstack/react-query").UseMutationResult<Omit<{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
}, "data"> | undefined, unknown, void, unknown>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| \[contract, tokenId\] | ClaimConditionsInputParams&lt;TContract&gt; | |

<b>Returns:</b>

import("@tanstack/react-query").UseMutationResult&lt;Omit&lt;{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;unknown&gt;; }, "data"&gt; \| undefined, unknown, void, unknown&gt;

a mutation object that can be used to reset claim conditions

## Example 1


```jsx
const Component = () => {
const nftDrop = useNFTDrop(<ContractAddress>);
const {
mutate: resetClaimConditions,
isLoading,
error,
} = useResetClaimConditions(nftDrop);

if (error) {
console.error("failed to reset claim conditions", error);
}

return (
<button
disabled={isLoading}
onClick={resetClaimConditions}
>
Reset Claim Conditions
</button>
);
};
```

## Example 2


```jsx
const Component = () => {
const { contract } = useContract(<ContractAddress>);
const {
mutate: resetClaimConditions,
isLoading,
error,
} = useResetClaimConditions(contract?.nft);

if (error) {
console.error("failed to reset claim conditions", error);
}

return (
<button
disabled={isLoading}
onClick={resetClaimConditions}
>
Reset Claim Conditions
</button>
);
};
```

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

[Home](./index.md) &gt; [@thirdweb-dev/react](./react.md) &gt; [useSetClaimConditions](./react.usesetclaimconditions.md)

## useSetClaimConditions() function

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>

Use this to set claim conditions on your [NFTContract](./react.nftcontract.md)

<b>Signature:</b>

```typescript
export declare function useSetClaimConditions<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): import("@tanstack/react-query").UseMutationResult<Omit<{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
}, "data"> | undefined, unknown, SetClaimConditionsParams, unknown>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| \[contract, tokenId\] | ClaimConditionsInputParams&lt;TContract&gt; | |

<b>Returns:</b>

import("@tanstack/react-query").UseMutationResult&lt;Omit&lt;{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () =&gt; Promise&lt;unknown&gt;; }, "data"&gt; \| undefined, unknown, [SetClaimConditionsParams](./react.setclaimconditionsparams.md)<!-- -->, unknown&gt;

a mutation object that can be used to set claim conditions

## Example 1


```jsx
const Component = () => {
const nftDrop = useNFTDrop(<ContractAddress>);
const {
mutate: setClaimConditions,
isLoading,
error,
} = useSetClaimConditions(nftDrop);

if (error) {
console.error("failed to set claim conditions", error);
}

return (
<button
disabled={isLoading}
onClick={() => setClaimConditions({ phases: [{ price: 2, maxQuantity: 100 }] })}
>
Set Claim Conditions!
</button>
);
};
```

## Example 2


```jsx
const Component = () => {
const { contract } = useContract(<ContractAddress>);
const {
mutate: setClaimConditions,
isLoading,
error,
} = useSetClaimConditions(contract?.nft);

if (error) {
console.error("failed to set claim conditions", error);
}

return (
<button
disabled={isLoading}
onClick={() => setClaimConditions({ phases: [{ price: 2, maxQuantity: 100 }] })}
>
Set Claim Conditions!
</button>
);
};
```

27 changes: 23 additions & 4 deletions etc/react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { CallOverrides } from 'ethers';
import { Chain } from './types';
import { ChainId } from '@thirdweb-dev/sdk/dist/browser';
import { ChainOrRpc } from '@thirdweb-dev/sdk/dist/browser';
import { ClaimConditionInput } from '@thirdweb-dev/sdk/dist/browser';
import { ClaimEligibility } from '@thirdweb-dev/sdk/dist/browser';
import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet';
import { Connector } from './connectors';
Expand Down Expand Up @@ -267,6 +268,12 @@ export type RequiredParam<T> = T | undefined;
// @internal (undocumented)
export type RolesForContract<TContract extends ContractWithRoles> = TContract extends SmartContract ? Role | (string & {}) : NonNullable<TContract["roles"]>["roles"][number];

// @beta
export type SetClaimConditionsParams = {
phases: ClaimConditionInput[];
reset?: boolean;
};

// @public (undocumented)
export interface SharedMediaProps {
// (undocumented)
Expand Down Expand Up @@ -364,10 +371,10 @@ export { useAccount }
// @internal (undocumented)
export function useActiveChainId(): SUPPORTED_CHAIN_ID | undefined;

// Warning: (ae-forgotten-export) The symbol "ActiveClaimConditionParams" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ClaimConditionsInputParams" needs to be exported by the entry point index.d.ts
//
// @beta
export function useActiveClaimCondition<TContract extends NFTDrop | EditionDrop | TokenDrop | SignatureDrop>(...[contract, tokenId]: ActiveClaimConditionParams<TContract>): UseQueryResult< {
export function useActiveClaimCondition<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): UseQueryResult< {
snapshot?: {
address: string;
maxClaimable: string;
Expand Down Expand Up @@ -464,7 +471,7 @@ type: ListingType.Auction;
export function useChainId(): number | undefined;

// @beta
export function useClaimConditions<TContract extends NFTDrop | EditionDrop | TokenDrop | SignatureDrop>(...[contract, tokenId]: ActiveClaimConditionParams<TContract>): UseQueryResult< {
export function useClaimConditions<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): UseQueryResult< {
snapshot?: {
address: string;
maxClaimable: string;
Expand Down Expand Up @@ -499,7 +506,7 @@ export function useClaimedNFTSupply(contract: RequiredParam<DropContract>): UseQ
// Warning: (ae-forgotten-export) The symbol "ClaimIneligibilityInputParams" needs to be exported by the entry point index.d.ts
//
// @beta
export function useClaimIneligibilityReasons<TContract extends NFTDrop | EditionDrop | TokenDrop | SignatureDrop>(...[contract, params, tokenId]: ClaimIneligibilityInputParams<TContract>): UseQueryResult<ClaimEligibility[], unknown>;
export function useClaimIneligibilityReasons<TContract extends NFTContract>(...[contract, params, tokenId]: ClaimIneligibilityInputParams<TContract>): UseQueryResult<ClaimEligibility[], unknown>;

// @beta
export function useClaimNFT<TContract extends DropContract>(contract: RequiredParam<TContract>): UseMutationResult<ClaimNFTReturnType<TContract>, unknown, ClaimNFTParams<TContract>, unknown>;
Expand Down Expand Up @@ -1588,6 +1595,12 @@ export { useProvider }
// @internal (undocumented)
export function useReadonlySDK(readonlyRpcUrl: string, sdkOptions: SDKOptions, storageInterface?: IStorage): ThirdwebSDK;

// @beta
export function useResetClaimConditions<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): UseMutationResult<Omit<{
receipt: TransactionReceipt;
data: () => Promise<unknown>;
}, "data"> | undefined, unknown, void, unknown>;

// @public (undocumented)
export function useResolvedMediaType(uri?: string): {
url: string | undefined;
Expand Down Expand Up @@ -1623,6 +1636,12 @@ export function useSDK(): ThirdwebSDK | undefined;
// @beta
export function useSetAllRoleMembers<TContract extends ContractWithRoles>(contract: RequiredParam<TContract>): UseMutationResult<void, unknown, { [role in RolesForContract<TContract>]: string[]; }, unknown>;

// @beta
export function useSetClaimConditions<TContract extends NFTContract>(...[contract, tokenId]: ClaimConditionsInputParams<TContract>): UseMutationResult<Omit<{
receipt: TransactionReceipt;
data: () => Promise<unknown>;
}, "data"> | undefined, unknown, SetClaimConditionsParams, unknown>;

// @public
export function useSignatureDrop(contractAddress?: string): SignatureDrop | undefined;

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "2.6.5-0",
"version": "2.6.6-0",
"repository": {
"type": "git",
"url": "git+https://github.com:thirdweb-dev/react.git"
Expand Down Expand Up @@ -34,7 +34,7 @@
"@microsoft/api-extractor": "^7.19.4",
"@microsoft/tsdoc": "^0.14.1",
"@swc/core": "^1.2.177",
"@thirdweb-dev/sdk": "^2.3.35",
"@thirdweb-dev/sdk": "^2.3.37",
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
"@types/mime": "^2.0.3",
"@types/react": "^18.0.5",
Expand Down
Loading