Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.
19 changes: 19 additions & 0 deletions docs/react.airdropnftparams.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; [AirdropNFTParams](./react.airdropnftparams.md)

## AirdropNFTParams 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 to pass to `useTransferBatchNFT`<!-- -->.

<b>Signature:</b>

```typescript
export declare type AirdropNFTParams = {
tokenId: BigNumberish;
addresses: AirdropInput;
};
```
4 changes: 4 additions & 0 deletions docs/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import { useAddress } from "@thirdweb-dev/react"
```
|
| [useAirdropNFT(contract)](./react.useairdropnft.md) | <b><i>(BETA)</i></b> Use this to transfer tokens on your |
| [useAllContractEvents(contract, options)](./react.useallcontractevents.md) | <b><i>(BETA)</i></b> Use this to query (and subscribe) to all events on a contract. |
| [useAllRoleMembers(contract)](./react.useallrolemembers.md) | <b><i>(BETA)</i></b> Use this to get the roles of a |
| [useAuctionWinner(contract, listingId)](./react.useauctionwinner.md) | <b><i>(BETA)</i></b> Use this to get the winner of an auction listing from your marketplace contract. |
Expand Down Expand Up @@ -108,6 +109,7 @@ import { useNetworkMistmatch } from "@thirdweb-dev/react"
| [useTotalCirculatingSupply(\[contract, tokenId\])](./react.usetotalcirculatingsupply.md) | <p><b><i>(BETA)</i></b> Use this to get a the total (minted) supply of your [NFTContract](./react.nftcontract.md)<!-- -->.</p><p>\*</p> |
| [useTotalCount(contract)](./react.usetotalcount.md) | <b><i>(BETA)</i></b> Use this to get a the number of tokens in your [NFTContract](./react.nftcontract.md)<!-- -->. |
| [useTransferBatchToken(contract)](./react.usetransferbatchtoken.md) | <b><i>(BETA)</i></b> Use this to transfer batch tokens on your contract |
| [useTransferNFT(contract)](./react.usetransfernft.md) | <b><i>(BETA)</i></b> Use this to transfer tokens on your [NFTContract](./react.nftcontract.md) |
| [useTransferToken(contract)](./react.usetransfertoken.md) | <b><i>(BETA)</i></b> Use this to transfer tokens on your contract |
| [useUnclaimedNFTs(contract, queryParams)](./react.useunclaimednfts.md) | <b><i>(BETA)</i></b> Use this to get a list of \*unclaimed\* NFT tokens of your ERC721 Drop contract. |
| [useUnclaimedNFTSupply(contract)](./react.useunclaimednftsupply.md) | |
Expand Down Expand Up @@ -148,6 +150,7 @@ import { useWalletConnect } from "@thirdweb-dev/react"

| Type Alias | Description |
| --- | --- |
| [AirdropNFTParams](./react.airdropnftparams.md) | <b><i>(BETA)</i></b> The params to pass to <code>useTransferBatchNFT</code>. |
| [BuyNowParams](./react.buynowparams.md) | |
| [ClaimIneligibilityParameters](./react.claimineligibilityparameters.md) | <b><i>(BETA)</i></b> The options to be passed as the second parameter to the <code>useClaimIneligibilityReasons</code> hook. |
| [ClaimNFTParams](./react.claimnftparams.md) | <b><i>(BETA)</i></b> The params for the [useClaimNFT()](./react.useclaimnft.md) hook mutation. |
Expand All @@ -162,6 +165,7 @@ import { useWalletConnect } from "@thirdweb-dev/react"
| [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. |
| [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>. |
| [useNFTBalanceParams](./react.usenftbalanceparams.md) | <b><i>(BETA)</i></b> The params to pass to <code>useNftBalance</code>. |
| [useTotalCirculatingSupplyParams](./react.usetotalcirculatingsupplyparams.md) | <b><i>(BETA)</i></b> The params to pass to <code>useTotalCirculatingSupply</code>. |
| [WalletAddress](./react.walletaddress.md) | <b><i>(BETA)</i></b> A wallet address. |
Expand Down
2 changes: 1 addition & 1 deletion docs/react.tokenparams.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The parameters to pass to the mint and transfer functions.
```typescript
export declare type TokenParams = {
to: WalletAddress;
amount: string | number;
amount: Amount;
};
```
<b>References:</b> [WalletAddress](./react.walletaddress.md)
Expand Down
25 changes: 25 additions & 0 deletions docs/react.transfernftparams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

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

## TransferNFTParams 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 to pass to `useTransferNFT`<!-- -->.

<b>Signature:</b>

```typescript
export declare type TransferNFTParams<TContract> = TContract extends Erc1155 ? {
to: WalletAddress;
tokenId: BigNumberish;
amount: Amount;
} : {
to: WalletAddress;
tokenId: BigNumberish;
};
```
<b>References:</b> [WalletAddress](./react.walletaddress.md)

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

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

## useAirdropNFT() 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 transfer tokens on your

<b>Signature:</b>

```typescript
export declare function useAirdropNFT(contract: Erc1155): import("@tanstack/react-query").UseMutationResult<Omit<{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
}, "data">, unknown, AirdropNFTParams, unknown>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| contract | Erc1155 | an instance of a |

<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;, unknown, [AirdropNFTParams](./react.airdropnftparams.md)<!-- -->, unknown&gt;

a mutation object that can be used to transfer batch NFTs

## Example 1


```jsx
const Component = () => {
const editionDrop = useEditionDrop(<ContractAddress>);
const {
mutate: airdropNFT,
isLoading,
error,
} = useAirdropNFT(editionDrop);

if (error) {
console.error("failed to transfer batch NFTs", error);
}

return (
<button
disabled={isLoading}
onClick={() => airdropNFT({
tokenId: 2,
addresses: [{ address: "0x...", quantity: 2 }, { address: "0x...", quantity: 4 } }]
)}
>
Airdrop NFT
</button>
};
```

## Example 2


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

if (error) {
console.error("failed to transfer batch NFTs", error);
}

return (
<button
disabled={isLoading}
onClick={() => airdropNFT({
tokenId: 2,
addresses: [{ address: "0x...", quantity: 2 }, { address: "0x...", quantity: 4 } }]
)}
>
Airdrop NFT
</button>
);
};
```

86 changes: 86 additions & 0 deletions docs/react.usetransfernft.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; [useTransferNFT](./react.usetransfernft.md)

## useTransferNFT() 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 transfer tokens on your [NFTContract](./react.nftcontract.md)

<b>Signature:</b>

```typescript
export declare function useTransferNFT<TContract extends NFTContract>(contract: RequiredParam<TContract>): import("@tanstack/react-query").UseMutationResult<Omit<{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
}, "data">, unknown, TransferNFTParams<TContract>, unknown>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| contract | [RequiredParam](./react.requiredparam.md)<!-- -->&lt;TContract&gt; | an instance of a [NFTContract](./react.nftcontract.md) |

<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;, unknown, [TransferNFTParams](./react.transfernftparams.md)<!-- -->&lt;TContract&gt;, unknown&gt;

a mutation object that can be used to transfer NFTs

## Example 1


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

if (error) {
console.error("failed to transfer nft", error);
}

return (
<button
disabled={isLoading}
onClick={() => transferNFT({ to: "0x...", tokenId: 2 })}
>
Transfer NFT!
</button>
);
};
```

## Example 2


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

if (error) {
console.error("failed to transfer nft", error);
}

return (
<button
disabled={isLoading}
onClick={() => transferNFT({ to: "0x...", tokenId: 2 })}
>
Transfer
</button>
);
};
```

35 changes: 32 additions & 3 deletions etc/react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
```ts

import { AbiFunction } from '@thirdweb-dev/sdk/dist/browser';
import type { AirdropInput } from '@thirdweb-dev/sdk/dist/browser';
import type { Amount } from '@thirdweb-dev/sdk/dist/browser';
import { AuctionListing } from '@thirdweb-dev/sdk/dist/browser';
import { BaseContract } from 'ethers';
Expand Down Expand Up @@ -81,6 +82,12 @@ import type { ValidContractInstance } from '@thirdweb-dev/sdk/dist/browser';
import { Vote } from '@thirdweb-dev/sdk/dist/browser';
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect';

// @beta
export type AirdropNFTParams = {
tokenId: BigNumberish;
addresses: AirdropInput;
};

// @public (undocumented)
export type BuyNowParams<TListingType = ListingType> = TListingType extends ListingType.Direct ? {
id: BigNumberish;
Expand Down Expand Up @@ -295,7 +302,17 @@ export interface ThirdwebSDKProviderProps extends Pick<ThirdwebProviderProps, "d
// @beta
export type TokenParams = {
to: WalletAddress;
amount: string | number;
amount: Amount;
};

// @beta
export type TransferNFTParams<TContract> = TContract extends Erc1155 ? {
to: WalletAddress;
tokenId: BigNumberish;
amount: Amount;
} : {
to: WalletAddress;
tokenId: BigNumberish;
};

export { useAccount }
Expand Down Expand Up @@ -337,6 +354,12 @@ export function useActiveListings(contract: RequiredParam<Marketplace>, filter?:
// @public
export function useAddress(): string | undefined;

// @beta
export function useAirdropNFT(contract: Erc1155): UseMutationResult<Omit<{
receipt: TransactionReceipt;
data: () => Promise<unknown>;
}, "data">, unknown, AirdropNFTParams, unknown>;

// @beta
export function useAllContractEvents(contract: RequiredParam<ReturnType<typeof useContract>["contract"]>, options?: {
queryFilter?: EventQueryFilter;
Expand Down Expand Up @@ -1574,6 +1597,12 @@ export function useTotalCount(contract: RequiredParam<NFTContract>): UseQueryRes
// @beta
export function useTransferBatchToken(contract: RequiredParam<Erc20>): UseMutationResult<void, unknown, TokenParams[], unknown>;

// @beta
export function useTransferNFT<TContract extends NFTContract>(contract: RequiredParam<TContract>): UseMutationResult<Omit<{
receipt: TransactionReceipt;
data: () => Promise<unknown>;
}, "data">, unknown, TransferNFTParams<TContract>, unknown>;

// @beta
export function useTransferToken(contract: RequiredParam<Erc20>): UseMutationResult<Omit<{
receipt: TransactionReceipt;
Expand Down Expand Up @@ -1687,8 +1716,8 @@ export type WalletLinkConnectorType = "walletLink" | "coinbase" | {
// dist/hooks/async/roles.d.ts:126:5 - (ae-incompatible-release-tags) The symbol "role" is marked as @beta, but its signature references "RolesForContract" which is marked as @internal
// dist/hooks/async/roles.d.ts:161:5 - (ae-incompatible-release-tags) The symbol "role" is marked as @beta, but its signature references "RolesForContract" which is marked as @internal
// dist/hooks/useNetwork.d.ts:48:5 - (ae-forgotten-export) The symbol "SwitchChainError" needs to be exported by the entry point index.d.ts
// dist/types.d.ts:148:5 - (ae-incompatible-release-tags) The symbol "buyForWallet" is marked as @public, but its signature references "WalletAddress" which is marked as @beta
// dist/types.d.ts:154:5 - (ae-incompatible-release-tags) The symbol "to" is marked as @public, but its signature references "WalletAddress" which is marked as @beta
// dist/types.d.ts:168:5 - (ae-incompatible-release-tags) The symbol "buyForWallet" is marked as @public, but its signature references "WalletAddress" which is marked as @beta
// dist/types.d.ts:174:5 - (ae-incompatible-release-tags) The symbol "to" is marked as @public, but its signature references "WalletAddress" which is marked as @beta

// (No @packageDocumentation comment for this package)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "2.6.0-1",
"version": "2.6.0-2",
"repository": {
"type": "git",
"url": "git+https://github.com:thirdweb-dev/react.git"
Expand Down
Loading