# __thirdweb TypeScript SDK Documentation__

> Frontend, Backend, and Onchain tools to build complete web3 apps — on every EVM chain.

---
**UI Components**
---
# Payments
---
## Widgets
---

###### Connect SDK

## Widgets.BuyWidget

Widget is a prebuilt UI for purchasing a specific token.

### Example

#### Basic usage

The `BuyWidget` component requires `client`, `chain`, and `amount` props to function.

```tsx
import { ethereum } from "thirdweb/chains";
 
<BuyWidget client={client} chain={ethereum} amount="0.1" />;
```

#### Buy a specific token

You can specify a token to purchase by passing the `tokenAddress` prop.

```tsx
<BuyWidget
  client={client}
  chain={ethereum}
  amount="100"
  tokenAddress="0xA0b86a33E6417E4df2057B2d3C6d9F7cc11b0a70"
/>;
```

#### Customize the UI

You can customize the UI of the `BuyWidget` component by passing a custom theme object to the `theme` prop.

```tsx
<BuyWidget
  client={client}
  chain={ethereum}
  amount="0.1"
  theme={darkTheme({
    colors: {
      modalBg: "red",
    },
  })}
/>;
```

Refer to the [Theme](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details.

#### Update the Title

You can update the title of the widget by passing a `title` prop to the `BuyWidget` component.

```tsx
<BuyWidget
  client={client}
  chain={ethereum}
  amount="0.1"
  title="Buy ETH"
/>;
```

#### Configure the wallet connection

You can customize the wallet connection flow by passing a `connectOptions` object to the `BuyWidget` component.

```tsx
<BuyWidget
  client={client}
  chain={ethereum}
  amount="0.1"
  connectOptions={{
    connectModal: {
      size: "compact",
      title: "Sign in",
    },
  }}
/>;
```

Refer to the [BuyWidgetConnectOptions](https://portal.thirdweb.com/references/typescript/v5/BuyWidgetConnectOptions) type for more details.

```ts
function BuyWidget(props: BuyWidgetProps): Element;
```

### Parameters

Props of type [BuyWidgetProps](https://portal.thirdweb.com/references/typescript/v5/BuyWidgetProps) to configure the BuyWidget component.

#### Type

```ts
let props: {
  activeWallet?: Wallet;
  amount: string;
  chain: Chain;
  className?: string;
  client: ThirdwebClient;
  connectOptions?: BuyWidgetConnectOptions;
  currency?: SupportedFiatCurrency;
  description?: string;
  hiddenWallets?: Array<WalletId>;
  image?: string;
  locale?: LocaleId;
  onCancel?: () => void;
  onError?: (error: Error) => void;
  onSuccess?: () => void;
  paymentLinkId?: string;
  paymentMethods?: Array<"crypto" | "card">;
  presetOptions?: [number, number, number];
  purchaseData?: PurchaseData;
  showThirdwebBranding?: boolean;
  style?: React.CSSProperties;
  supportedTokens?: SupportedTokens;
  theme?: "light" | "dark" | Theme;
  title?: string;
  tokenAddress?: Address;
};
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## Widgets.CheckoutWidget

Widget a prebuilt UI for purchasing a specific token.

### Example

#### Default configuration

By default, the `CheckoutWidget` component will allows users to fund their wallets with crypto or fiat on any of the supported chains..

```tsx
<CheckoutWidget client={client} />;
```

#### Customize the UI

You can customize the UI of the `CheckoutWidget` component by passing a custom theme object to the `theme` prop.

```tsx
<CheckoutWidget
  client={client}
  theme={darkTheme({
    colors: {
      modalBg: "red",
    },
  })}
/>;
```

Refer to the [Theme](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details.

#### Update the Title

You can update the title of the widget by passing a `title` prop to the `CheckoutWidget` component.

```tsx
<CheckoutWidget client={client} title="Checkout ETH" />;
```

#### Configure the wallet connection

You can customize the wallet connection flow by passing a `connectOptions` object to the `CheckoutWidget` component.

```tsx
<CheckoutWidget
  client={client}
  connectOptions={{
    connectModal: {
      size: "compact",
      title: "Sign in",
    },
  }}
/>;
```

Refer to the [CheckoutWidgetConnectOptions](https://portal.thirdweb.com/references/typescript/v5/CheckoutWidgetConnectOptions) type for more details.

```ts
function CheckoutWidget(props: CheckoutWidgetProps): Element;
```

### Parameters

Props of type [CheckoutWidgetProps](https://portal.thirdweb.com/references/typescript/v5/CheckoutWidgetProps) to configure the CheckoutWidget component.

#### Type

```ts
let props: {
  activeWallet?: Wallet;
  amount: string;
  chain: Chain;
  className?: string;
  client: ThirdwebClient;
  connectOptions?: CheckoutWidgetConnectOptions;
  currency?: SupportedFiatCurrency;
  description?: string;
  feePayer?: "user" | "seller";
  hiddenWallets?: Array<WalletId>;
  image?: string;
  locale?: LocaleId;
  name?: string;
  onCancel?: () => void;
  onError?: (error: Error) => void;
  onSuccess?: () => void;
  paymentLinkId?: string;
  paymentMethods?: Array<"crypto" | "card">;
  presetOptions?: [number, number, number];
  purchaseData?: PurchaseData;
  seller: Address;
  showThirdwebBranding?: boolean;
  style?: React.CSSProperties;
  supportedTokens?: SupportedTokens;
  theme?: "light" | "dark" | Theme;
  tokenAddress?: Address;
};
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## Widgets.TransactionWidget

Widget a prebuilt UI for purchasing a specific token.

### Example

#### Default configuration

By default, the `TransactionWidget` component will allows users to fund their wallets with crypto or fiat on any of the supported chains..

```tsx
<TransactionWidget
  client={client}
  transaction={prepareTransaction({
    to: "0x...",
    chain: ethereum,
    client: client,
  })}
  amount="0.1"
/>;
```

#### Customize the UI

You can customize the UI of the `TransactionWidget` component by passing a custom theme object to the `theme` prop.

```tsx
<TransactionWidget
  client={client}
  transaction={prepareTransaction({
    to: "0x...",
    chain: ethereum,
    client: client,
    value: toUnits("0.001", 18),
  })}
  theme={darkTheme({
    colors: {
      modalBg: "red",
    },
  })}
/>;
```

Refer to the [Theme](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details.

#### Update the Title

You can update the title of the widget by passing a `title` prop to the `TransactionWidget` component.

```tsx
<TransactionWidget
  transaction={prepareTransaction({
    to: "0x...",
    chain: ethereum,
    client: client,
    value: toUnits("0.001", 18),
  })}
  client={client}
  title="Transaction ETH"
/>;
```

#### Configure the wallet connection

You can customize the wallet connection flow by passing a `connectOptions` object to the `TransactionWidget` component.

```tsx
<TransactionWidget
  client={client}
  transaction={prepareTransaction({
    to: "0x...",
    chain: ethereum,
    client: client,
    value: toUnits("0.001", 18),
  })}
  connectOptions={{
    connectModal: {
      size: "compact",
      title: "Sign in",
    },
  }}
/>;
```

Refer to the [TransactionWidgetConnectOptions](https://portal.thirdweb.com/references/typescript/v5/TransactionWidgetConnectOptions) type for more details.

```ts
function TransactionWidget(props: TransactionWidgetProps): Element;
```

### Parameters

Props of type [TransactionWidgetProps](https://portal.thirdweb.com/references/typescript/v5/TransactionWidgetProps) to configure the TransactionWidget component.

#### Type

```ts
let props: {
  activeWallet?: Wallet;
  amount?: string;
  className?: string;
  client: ThirdwebClient;
  connectOptions?: TransactionWidgetConnectOptions;
  currency?: SupportedFiatCurrency;
  description?: string;
  feePayer?: "user" | "seller";
  hiddenWallets?: Array<WalletId>;
  image?: string;
  locale?: LocaleId;
  onCancel?: () => void;
  onError?: (error: Error) => void;
  onSuccess?: () => void;
  paymentLinkId?: string;
  paymentMethods?: Array<"crypto" | "card">;
  presetOptions?: [number, number, number];
  purchaseData?: PurchaseData;
  showThirdwebBranding?: boolean;
  style?: React.CSSProperties;
  supportedTokens?: SupportedTokens;
  theme?: "light" | "dark" | Theme;
  title?: string;
  tokenAddress?: Address;
  transaction: PreparedTransaction;
};
```

### Returns

```ts
let returnType: Element;
```
---
# Wallets
---

###### Connect SDK

## AccountAddress

### Example

#### Basic usage

```tsx
import { AccountProvider, AccountAddress } from "thirdweb/react";
 
<AccountProvider
  address="0x12345674b599ce99958242b3D3741e7b01841DF3"
  client={TW_CLIENT}
>
  <AccountAddress />
</AccountProvider>;
```

Result:

```html
<span>0x12345674b599ce99958242b3D3741e7b01841DF3</span>
```

#### Shorten the address

```tsx
import { AccountProvider, AccountAddress } from "thirdweb/react";
import { shortenAddress } from "thirdweb/utils";
 
<AccountProvider
  address="0x12345674b599ce99958242b3D3741e7b01841DF3"
  client={TW_CLIENT}
>
  <AccountAddress formatFn={shortenAddress} />
</AccountProvider>;
```

Result:

```html
<span>0x1234...1DF3</span>
```

```ts
function AccountAddress(
  __namedParameters: AccountAddressProps,
): Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,formatFn : (str: string) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: Element;
```

a `<span>` containing the full wallet address of the account
---

###### Connect SDK

## AccountBlobbie

A wrapper for the Blobbie component

```ts
function AccountBlobbie(
  props: Omit<BlobbieProps, "address">,
): Element;
```

### Parameters

BlobbieProps

#### Type

```ts
let props: Omit<BlobbieProps, "address">;
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## AccountProvider

A React context provider component that supplies Account-related data to its child components.

This component serves as a wrapper around the `AccountProviderContext.Provider` and passes the provided account data down to all of its child components through the context API.

### Example

```tsx
import {
  AccountProvider,
  AccountAvatar,
  AccountName,
  AccountAddress,
} from "thirdweb/react";
 
<AccountProvider address="0x..." client={client}>
  <AccountAvatar />
  <AccountName />
  <AccountAddress />
</AccountProvider>;
```

```ts
function AccountProvider(
  props: PropsWithChildren<AccountProviderProps>,
): Element;
```

### Parameters

#### Type

```ts
let props: PropsWithChildren<AccountProviderProps>;
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## Blobbie

A unique gradient avatar based on the provided address.

### Example

```tsx
import { Blobbie } from "thirdweb/react";
 
<Blobbie address="0x...." className="w-10 h-10" />;
```

```ts
function Blobbie(props: BlobbieProps): Element;
```

### Parameters

The component props.

#### Type

```ts
let props: BlobbieProps;
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## SocialIcon

Social auth provider icon

### Example

```tsx
import { SocialIcon } from "thirdweb/react";
 
<SocialIcon provider="google" />;
```

Result: An `<img />` component with the src of the icon

```html
<img src="google-icon-svg" />
```

```ts
function SocialIcon(__namedParameters: SocialIconProps): Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,alt : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,children : ReactNode,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,crossOrigin : CrossOrigin,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,decoding : "auto" | "async" | "sync",defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fetchPriority : "auto" | "high" | "low",height : string | number,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",nonce : string,onAbort : ReactEventHandler<HTMLImageElement>,onAbortCapture : ReactEventHandler<HTMLImageElement>,onAnimationEnd : AnimationEventHandler<HTMLImageElement>,onAnimationEndCapture : AnimationEventHandler<HTMLImageElement>,onAnimationIteration : AnimationEventHandler<HTMLImageElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLImageElement>,onAnimationStart : AnimationEventHandler<HTMLImageElement>,onAnimationStartCapture : AnimationEventHandler<HTMLImageElement>,onAuxClick : MouseEventHandler<HTMLImageElement>,onAuxClickCapture : MouseEventHandler<HTMLImageElement>,onBeforeInput : InputEventHandler<HTMLImageElement>,onBeforeInputCapture : FormEventHandler<HTMLImageElement>,onBeforeToggle : ToggleEventHandler<HTMLImageElement>,onBlur : FocusEventHandler<HTMLImageElement>,onBlurCapture : FocusEventHandler<HTMLImageElement>,onCanPlay : ReactEventHandler<HTMLImageElement>,onCanPlayCapture : ReactEventHandler<HTMLImageElement>,onCanPlayThrough : ReactEventHandler<HTMLImageElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLImageElement>,onChange : FormEventHandler<HTMLImageElement>,onChangeCapture : FormEventHandler<HTMLImageElement>,onClick : MouseEventHandler<HTMLImageElement>,onClickCapture : MouseEventHandler<HTMLImageElement>,onCompositionEnd : CompositionEventHandler<HTMLImageElement>,onCompositionEndCapture : CompositionEventHandler<HTMLImageElement>,onCompositionStart : CompositionEventHandler<HTMLImageElement>,onCompositionStartCapture : CompositionEventHandler<HTMLImageElement>,onCompositionUpdate : CompositionEventHandler<HTMLImageElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLImageElement>,onContextMenu : MouseEventHandler<HTMLImageElement>,onContextMenuCapture : MouseEventHandler<HTMLImageElement>,onCopy : ClipboardEventHandler<HTMLImageElement>,onCopyCapture : ClipboardEventHandler<HTMLImageElement>,onCut : ClipboardEventHandler<HTMLImageElement>,onCutCapture : ClipboardEventHandler<HTMLImageElement>,onDoubleClick : MouseEventHandler<HTMLImageElement>,onDoubleClickCapture : MouseEventHandler<HTMLImageElement>,onDrag : DragEventHandler<HTMLImageElement>,onDragCapture : DragEventHandler<HTMLImageElement>,onDragEnd : DragEventHandler<HTMLImageElement>,onDragEndCapture : DragEventHandler<HTMLImageElement>,onDragEnter : DragEventHandler<HTMLImageElement>,onDragEnterCapture : DragEventHandler<HTMLImageElement>,onDragExit : DragEventHandler<HTMLImageElement>,onDragExitCapture : DragEventHandler<HTMLImageElement>,onDragLeave : DragEventHandler<HTMLImageElement>,onDragLeaveCapture : DragEventHandler<HTMLImageElement>,onDragOver : DragEventHandler<HTMLImageElement>,onDragOverCapture : DragEventHandler<HTMLImageElement>,onDragStart : DragEventHandler<HTMLImageElement>,onDragStartCapture : DragEventHandler<HTMLImageElement>,onDrop : DragEventHandler<HTMLImageElement>,onDropCapture : DragEventHandler<HTMLImageElement>,onDurationChange : ReactEventHandler<HTMLImageElement>,onDurationChangeCapture : ReactEventHandler<HTMLImageElement>,onEmptied : ReactEventHandler<HTMLImageElement>,onEmptiedCapture : ReactEventHandler<HTMLImageElement>,onEncrypted : ReactEventHandler<HTMLImageElement>,onEncryptedCapture : ReactEventHandler<HTMLImageElement>,onEnded : ReactEventHandler<HTMLImageElement>,onEndedCapture : ReactEventHandler<HTMLImageElement>,onError : ReactEventHandler<HTMLImageElement>,onErrorCapture : ReactEventHandler<HTMLImageElement>,onFocus : FocusEventHandler<HTMLImageElement>,onFocusCapture : FocusEventHandler<HTMLImageElement>,onGotPointerCapture : PointerEventHandler<HTMLImageElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onInput : FormEventHandler<HTMLImageElement>,onInputCapture : FormEventHandler<HTMLImageElement>,onInvalid : FormEventHandler<HTMLImageElement>,onInvalidCapture : FormEventHandler<HTMLImageElement>,onKeyDown : KeyboardEventHandler<HTMLImageElement>,onKeyDownCapture : KeyboardEventHandler<HTMLImageElement>,onKeyPress : KeyboardEventHandler<HTMLImageElement>,onKeyPressCapture : KeyboardEventHandler<HTMLImageElement>,onKeyUp : KeyboardEventHandler<HTMLImageElement>,onKeyUpCapture : KeyboardEventHandler<HTMLImageElement>,onLoad : ReactEventHandler<HTMLImageElement>,onLoadCapture : ReactEventHandler<HTMLImageElement>,onLoadedData : ReactEventHandler<HTMLImageElement>,onLoadedDataCapture : ReactEventHandler<HTMLImageElement>,onLoadedMetadata : ReactEventHandler<HTMLImageElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLImageElement>,onLoadStart : ReactEventHandler<HTMLImageElement>,onLoadStartCapture : ReactEventHandler<HTMLImageElement>,onLostPointerCapture : PointerEventHandler<HTMLImageElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onMouseDown : MouseEventHandler<HTMLImageElement>,onMouseDownCapture : MouseEventHandler<HTMLImageElement>,onMouseEnter : MouseEventHandler<HTMLImageElement>,onMouseLeave : MouseEventHandler<HTMLImageElement>,onMouseMove : MouseEventHandler<HTMLImageElement>,onMouseMoveCapture : MouseEventHandler<HTMLImageElement>,onMouseOut : MouseEventHandler<HTMLImageElement>,onMouseOutCapture : MouseEventHandler<HTMLImageElement>,onMouseOver : MouseEventHandler<HTMLImageElement>,onMouseOverCapture : MouseEventHandler<HTMLImageElement>,onMouseUp : MouseEventHandler<HTMLImageElement>,onMouseUpCapture : MouseEventHandler<HTMLImageElement>,onPaste : ClipboardEventHandler<HTMLImageElement>,onPasteCapture : ClipboardEventHandler<HTMLImageElement>,onPause : ReactEventHandler<HTMLImageElement>,onPauseCapture : ReactEventHandler<HTMLImageElement>,onPlay : ReactEventHandler<HTMLImageElement>,onPlayCapture : ReactEventHandler<HTMLImageElement>,onPlaying : ReactEventHandler<HTMLImageElement>,onPlayingCapture : ReactEventHandler<HTMLImageElement>,onPointerCancel : PointerEventHandler<HTMLImageElement>,onPointerCancelCapture : PointerEventHandler<HTMLImageElement>,onPointerDown : PointerEventHandler<HTMLImageElement>,onPointerDownCapture : PointerEventHandler<HTMLImageElement>,onPointerEnter : PointerEventHandler<HTMLImageElement>,onPointerLeave : PointerEventHandler<HTMLImageElement>,onPointerMove : PointerEventHandler<HTMLImageElement>,onPointerMoveCapture : PointerEventHandler<HTMLImageElement>,onPointerOut : PointerEventHandler<HTMLImageElement>,onPointerOutCapture : PointerEventHandler<HTMLImageElement>,onPointerOver : PointerEventHandler<HTMLImageElement>,onPointerOverCapture : PointerEventHandler<HTMLImageElement>,onPointerUp : PointerEventHandler<HTMLImageElement>,onPointerUpCapture : PointerEventHandler<HTMLImageElement>,onProgress : ReactEventHandler<HTMLImageElement>,onProgressCapture : ReactEventHandler<HTMLImageElement>,onRateChange : ReactEventHandler<HTMLImageElement>,onRateChangeCapture : ReactEventHandler<HTMLImageElement>,onReset : FormEventHandler<HTMLImageElement>,onResetCapture : FormEventHandler<HTMLImageElement>,onScroll : UIEventHandler<HTMLImageElement>,onScrollCapture : UIEventHandler<HTMLImageElement>,onScrollEnd : UIEventHandler<HTMLImageElement>,onScrollEndCapture : UIEventHandler<HTMLImageElement>,onSeeked : ReactEventHandler<HTMLImageElement>,onSeekedCapture : ReactEventHandler<HTMLImageElement>,onSeeking : ReactEventHandler<HTMLImageElement>,onSeekingCapture : ReactEventHandler<HTMLImageElement>,onSelect : ReactEventHandler<HTMLImageElement>,onSelectCapture : ReactEventHandler<HTMLImageElement>,onStalled : ReactEventHandler<HTMLImageElement>,onStalledCapture : ReactEventHandler<HTMLImageElement>,onSubmit : FormEventHandler<HTMLImageElement>,onSubmitCapture : FormEventHandler<HTMLImageElement>,onSuspend : ReactEventHandler<HTMLImageElement>,onSuspendCapture : ReactEventHandler<HTMLImageElement>,onTimeUpdate : ReactEventHandler<HTMLImageElement>,onTimeUpdateCapture : ReactEventHandler<HTMLImageElement>,onToggle : ToggleEventHandler<HTMLImageElement>,onTouchCancel : TouchEventHandler<HTMLImageElement>,onTouchCancelCapture : TouchEventHandler<HTMLImageElement>,onTouchEnd : TouchEventHandler<HTMLImageElement>,onTouchEndCapture : TouchEventHandler<HTMLImageElement>,onTouchMove : TouchEventHandler<HTMLImageElement>,onTouchMoveCapture : TouchEventHandler<HTMLImageElement>,onTouchStart : TouchEventHandler<HTMLImageElement>,onTouchStartCapture : TouchEventHandler<HTMLImageElement>,onTransitionCancel : TransitionEventHandler<HTMLImageElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLImageElement>,onTransitionEnd : TransitionEventHandler<HTMLImageElement>,onTransitionEndCapture : TransitionEventHandler<HTMLImageElement>,onTransitionRun : TransitionEventHandler<HTMLImageElement>,onTransitionRunCapture : TransitionEventHandler<HTMLImageElement>,onTransitionStart : TransitionEventHandler<HTMLImageElement>,onTransitionStartCapture : TransitionEventHandler<HTMLImageElement>,onVolumeChange : ReactEventHandler<HTMLImageElement>,onVolumeChangeCapture : ReactEventHandler<HTMLImageElement>,onWaiting : ReactEventHandler<HTMLImageElement>,onWaitingCapture : ReactEventHandler<HTMLImageElement>,onWheel : WheelEventHandler<HTMLImageElement>,onWheelCapture : WheelEventHandler<HTMLImageElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,provider : string,radioGroup : string,referrerPolicy : HTMLAttributeReferrerPolicy,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,sizes : string,slot : string,spellCheck : Booleanish,srcSet : string,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",useMap : string,vocab : string,width : string | number}
```

### Returns

```ts
let returnType: Element;
```

an `<img />` component with the src set to the svg
---

###### Connect SDK

## WalletProvider

A React context provider component that supplies Wallet-related data to its child components.

This component serves as a wrapper around the `WalletProviderContext.Provider` and passes the provided wallet data down to all of its child components through the context API.

### Example

#### Basic usage

```tsx
import {
  WalletProvider,
  WalletIcon,
  WalletName,
} from "thirdweb/react";
 
<WalletProvider id="io.metamask">
  <WalletIcon />
  <WalletName />
</WalletProvider>;
```

```ts
function WalletProvider(
  props: PropsWithChildren<WalletProviderProps>,
): Element;
```

### Parameters

#### Type

```ts
let props: PropsWithChildren<WalletProviderProps>;
```

### Returns

```ts
let returnType: Element;
```
---
# Wallet Connection
---

###### Connect SDK

## ConnectButton

A fully featured wallet connection component that allows to:

* Connect to 500+ external wallets
* Connect with email, phone, passkey or socials
* Convert any wallet to a ERC4337 smart wallet for gasless transactions
* Sign in with ethereum (Auth)

Once connected, the component allows to:

* Resolve ENS names and avatars
* Manage multiple connected wallets
* Send and receive native tokens and ERC20 tokens
* View ERC20 tokens and NFTs
* Onramp, bridge and swap tokens
* Switch chains
* Connect to another app with WalletConnect

### Example

### Default setup

```tsx
import { createThirdwebClient } from "thirdweb";
import { ConnectButton } from "thirdweb/react";
 
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
 
<ConnectButton client={client} />;
```

[View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps)

### Customization options

#### Customizing wallet options

```tsx
<ConnectButton
  client={client}
  wallets={[
    createWallet("io.metamask"),
    createWallet("com.coinbase.wallet"),
    createWallet("me.rainbow"),
  ]}
/>;
```

[View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)

#### Customizing the default chain to connect to

```tsx
import { sepolia } from "thirdweb/chains";
 
<ConnectButton client={client} chain={sepolia} />;
```

#### Enabling Account Abstraction

By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts. And by setting `sponsorGas` to `true`, all transactions done with those smart accounts will be sponsored.

```tsx
<ConnectButton
  client={client}
  accountAbstraction={{
    chain: sepolia,
    sponsorGas: true,
  }}
/>;
```

Note that this prop doesn't affect ecosystem wallets. Ecosystem wallets will only be converted to smart accounts if the ecosystem owner has enabled account abstraction.

#### Enabling sign in with ethereum (Auth)

```tsx
<ConnectButton
  client={client}
  auth={{
    isLoggedIn: async (address) => {
      console.log("checking if logged in!", { address });
      return await isLoggedIn();
    },
    doLogin: async (params) => {
      console.log("logging in!");
      await login(params);
    },
    getLoginPayload: async ({ address }) =>
      generatePayload({ address }),
    doLogout: async () => {
      console.log("logging out!");
      await logout();
    },
  }}
/>;
```

#### Customizing the theme

```tsx
<ConnectButton client={client} theme="light" />;
```

For more granular control, you can also pass a custom theme object:

```tsx
<ConnectButton
  client={client}
  theme={lightTheme({
    colors: {
      modalBg: "red",
    },
  })}
/>;
```

[View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme)

#### Changing the display language

```tsx
<ConnectEmbed client={client} locale="ja_JP" />;
```

[View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId)

#### Customizing the connect button UI

```tsx
<ConnectButton
  client={client}
  connectButton={{
    label: "Sign in to MyApp",
  }}
/>;
```

#### Customizing the modal UI

```tsx
<ConnectButton
  client={client}
  connectModal={{
    title: "Sign in to MyApp",
    titleIcon: "https://example.com/logo.png",
    size: "compact",
  }}
/>;
```

#### Customizing details button UI (after connecting)

```tsx
<ConnectButton
  client={client}
  detailsButton={{
    displayBalanceToken: {
      [sepolia.id]: "0x...", // token address to display balance for
      [ethereum.id]: "0x...", // token address to display balance for
    },
  }}
/>;
```

[View all available auth helper functions](https://portal.thirdweb.com/references/typescript/v5/createAuth)

#### Customizing the Auth sign in button (after connecting, but before authenticating)

```tsx
<ConnectButton
  client={client}
  auth={{ ... }}
  signInButton: {
    label: "Authenticate with MyApp",
  },
}}
/>;
```

#### Customizing supported Tokens and NFTs

These tokens and NFTs will be shown in the modal when the user clicks "View Assets", as well as the send token screen.

```tsx
<ConnectButton
  client={client}
  supportedTokens={{
    [ethereum.id]: [
      {
        address: "0x...",
        name: "MyToken",
        symbol: "MT",
        icon: "https://example.com/icon.png",
      },
    ],
  }}
  supportedNFTs={{
    [ethereum.id]: [
      "0x...", // nft contract address
    ],
  }}
/>;
```

#### Customizing the orders of the tabs in the \[View Funds\] screen

When you click on "View Assets", by default the "Tokens" tab is shown first. If you want to show the "NFTs" tab first, change the order of the asset tabs to: \["nft", "token"\] Note: If an empty array is passed, the \[View Funds\] button will be hidden

```tsx
<ConnectButton
  client={client}
  detailsModal={{
    assetTabs: ["nft", "token"],
  }}
/>;
```

#### Callback for when the details modal is closed

```tsx
<ConnectButton
  detailsModal={{
    onClose: (screen: string) => {
      console.log({ screen });
    },
  }}
/>;
```

```ts
function ConnectButton(props: ConnectButtonProps): Element;
```

### Parameters

Props for the `ConnectButton` component

Refer to [ConnectButtonProps](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available props.

#### Type

```ts
let props: {
  accountAbstraction?: SmartWalletOptions;
  appMetadata?: AppMetadata;
  auth?: SiweAuthOptions;
  autoConnect?: { timeout: number } | boolean;
  chain?: Chain;
  chains?: Array<Chain>;
  client: ThirdwebClient;
  connectButton?: ConnectButton_connectButtonOptions;
  connectModal?: ConnectButton_connectModalOptions;
  detailsButton?: ConnectButton_detailsButtonOptions;
  detailsModal?: ConnectButton_detailsModalOptions;
  hiddenWallets?: Array<WalletId>;
  locale?: LocaleId;
  onConnect?: (wallet: Wallet) => void;
  onDisconnect?: (info: { account: Account; wallet: Wallet }) => void;
  recommendedWallets?: Array<Wallet>;
  showAllWallets?: boolean;
  signInButton?: {
    className?: string;
    label?: string;
    style?: React.CSSProperties;
  };
  supportedNFTs?: SupportedNFTs;
  supportedTokens?: SupportedTokens;
  switchButton?: {
    className?: string;
    label?: string;
    style?: React.CSSProperties;
  };
  theme?: "dark" | "light" | Theme;
  walletConnect?: { projectId?: string };
  wallets?: Array<Wallet>;
};
```

### Returns

```ts
let returnType: Element;
```

A JSX element that renders the `<ConnectButton>` component.
---

###### Connect SDK

## ConnectEmbed

An inline wallet connection component that allows to:

* Connect to 500+ external wallets
* Connect with email, phone, passkey or socials
* Convert any wallet to a ERC4337 smart wallet for gasless transactions
* Sign in with ethereum (Auth)

It renders the same UI as the [ConnectButton](https://portal.thirdweb.com/react/v5/ConnectButton) component's modal - but directly inline in the page instead of being in a modal.

Once connected, the component does not render any UI. It only renders UI if wallet is not connected.

### Example

### Default setup

```tsx
import { createThirdwebClient } from "thirdweb";
import { ConnectEmbed } from "thirdweb/react";
 
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
 
<ConnectEmbed client={client} />;
```

[View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps)

### Customization options

#### Customizing wallet options

```tsx
<ConnectEmbed
  client={client}
  wallets={[
    createWallet("io.metamask"),
    createWallet("com.coinbase.wallet"),
    createWallet("me.rainbow"),
  ]}
/>;
```

[View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)

#### Customizing the default chain to connect to

```tsx
import { base } from "thirdweb/chains";
 
<ConnectEmbed client={client} chain={base} />;
```

#### Enabling Account Abstraction

By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts. And by setting `sponsorGas` to `true`, all transactions done with those smart accounts will be sponsored.

```tsx
<ConnectEmbed
  client={client}
  accountAbstraction={{
    chain: sepolia,
    sponsorGas: true,
  }}
/>;
```

Note that this prop doesn't affect ecosystem wallets. Ecosystem wallets will only be converted to smart accounts if the ecosystem owner has enabled account abstraction.

#### Enabling sign in with ethereum (Auth)

```tsx
<ConnectEmbed
  client={client}
  auth={{
    isLoggedIn: async (address) => {
      console.log("checking if logged in!", { address });
      return await isLoggedIn();
    },
    doLogin: async (params) => {
      console.log("logging in!");
      await login(params);
    },
    getLoginPayload: async ({ address }) =>
      generatePayload({ address }),
    doLogout: async () => {
      console.log("logging out!");
      await logout();
    },
  }}
/>;
```

#### Customizing the theme

```tsx
<ConnectEmbed client={client} theme="light" />;
```

For more granular control, you can also pass a custom theme object:

```tsx
<ConnectEmbed
  client={client}
  theme={lightTheme({
    colors: {
      modalBg: "red",
    },
  })}
/>;
```

[View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme)

#### Changing the display language

```tsx
<ConnectEmbed client={client} locale="ja_JP" />;
```

[View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId)

```ts
function ConnectEmbed(props: ConnectEmbedProps): Element;
```

### Parameters

The props for the `ConnectEmbed` component.

Refer to the [ConnectEmbedProps](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details

#### Type

```ts
let props: {
  accountAbstraction?: SmartWalletOptions;
  appMetadata?: AppMetadata;
  auth?: SiweAuthOptions;
  autoConnect?: { timeout: number } | boolean;
  chain?: Chain;
  chains?: Array<Chain>;
  className?: string;
  client: ThirdwebClient;
  header?: { title?: string; titleIcon?: string } | true;
  hiddenWallets?: Array<WalletId>;
  locale?: LocaleId;
  modalSize?: "compact" | "wide";
  onConnect?: (wallet: Wallet) => void;
  privacyPolicyUrl?: string;
  recommendedWallets?: Array<Wallet>;
  requireApproval?: boolean;
  showAllWallets?: boolean;
  showThirdwebBranding?: boolean;
  style?: React.CSSProperties;
  termsOfServiceUrl?: string;
  theme?: "dark" | "light" | Theme;
  walletConnect?: { projectId?: string };
  wallets?: Array<Wallet>;
  welcomeScreen?: WelcomeScreen;
};
```

### Returns

```ts
let returnType: Element;
```

A JSX element that renders the `<ConnectEmbed>` component.
---

###### Connect SDK

## SiteEmbed

Embeds another thirdweb-supported site for seamless in-app and ecosystem wallet connection.

Make sure the embedded site includes `<AutoConnect />` and supports frame ancestors, see [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) for more information.

The embedded site must support the connected wallet (ecosystem or in-app).

### Example

```tsx
import { SiteEmbed } from "thirdweb/react";
 
<SiteEmbed
  src="https://thirdweb.com"
  client={thirdwebClient}
  ecosystem={{ id: "ecosystem.thirdweb" }}
/>;
```

```ts
function SiteEmbed(
  props: {
    client: ThirdwebClient;
    ecosystem?: Ecosystem;
    src: string;
  } & ClassAttributes<HTMLIFrameElement> &
    IframeHTMLAttributes<HTMLIFrameElement>,
): Element;
```

### Parameters

The props to pass to the iframe

#### Type

```ts
let props: {
  client: ThirdwebClient;
  ecosystem?: Ecosystem;
  src: string;
} & ClassAttributes<HTMLIFrameElement> &
  IframeHTMLAttributes<HTMLIFrameElement>;
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## SiteLink

Creates a link to another thirdweb-supported site with wallet connection parameters.

The target site must support the connected wallet (ecosystem or in-app).

### Example

```tsx
import { SiteLink } from "thirdweb/react";
 
<SiteLink
  href="https://thirdweb.com"
  client={thirdwebClient}
  ecosystem={{ id: "ecosystem.thirdweb" }}
>
  Visit Site
</SiteLink>;
```

```ts
function SiteLink(
  props: {
    children: ReactNode;
    client: ThirdwebClient;
    ecosystem?: Ecosystem;
    href: string;
  } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">,
): Element;
```

### Parameters

The props to pass to the anchor tag

#### Type

```ts
let props: {
  children: ReactNode;
  client: ThirdwebClient;
  ecosystem?: Ecosystem;
  href: string;
} & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">;
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## ThirdwebProvider

The ThirdwebProvider is component is a provider component that sets up the React Query client.

### Example

```jsx
import { ThirdwebProvider } from "thirdweb/react";
 
function Example() {
  return (
    <ThirdwebProvider>
      <App />
    </ThirdwebProvider>
  );
}
```

```ts
function ThirdwebProvider(
  props: PropsWithChildren<{
    connectionManager?: {
      activeAccountStore: Store<undefined | Account>;
      activeWalletChainStore: Store<
        undefined | Readonly<ChainOptions & { rpc: string }>
      >;
      activeWalletConnectionStatusStore: Store<ConnectionStatus>;
      activeWalletStore: Store<undefined | Wallet>;
      addConnectedWallet: (wallet: Wallet) => void;
      connect: (
        wallet: Wallet,
        options?: ConnectManagerOptions,
      ) => Promise<Wallet>;
      connectedWallets: ReadonlyStore<Array<Wallet>>;
      defineChains: (
        chains: Array<Readonly<ChainOptions & { rpc: string }>>,
      ) => void;
      disconnectWallet: (wallet: Wallet) => void;
      handleConnection: (
        wallet: Wallet,
        options?: ConnectManagerOptions,
      ) => Promise<Wallet>;
      isAutoConnecting: Store<boolean>;
      removeConnectedWallet: (wallet: Wallet) => void;
      setActiveWallet: (activeWallet: Wallet) => Promise<void>;
      switchActiveWalletChain: (chain: Readonly) => Promise<void>;
    };
  }>,
): Element;
```

### Parameters

The props for the ThirdwebProvider

#### Type

```ts
let props: PropsWithChildren<{
  connectionManager?: {
    activeAccountStore: Store<undefined | Account>;
    activeWalletChainStore: Store<
      undefined | Readonly<ChainOptions & { rpc: string }>
    >;
    activeWalletConnectionStatusStore: Store<ConnectionStatus>;
    activeWalletStore: Store<undefined | Wallet>;
    addConnectedWallet: (wallet: Wallet) => void;
    connect: (
      wallet: Wallet,
      options?: ConnectManagerOptions,
    ) => Promise<Wallet>;
    connectedWallets: ReadonlyStore<Array<Wallet>>;
    defineChains: (
      chains: Array<Readonly<ChainOptions & { rpc: string }>>,
    ) => void;
    disconnectWallet: (wallet: Wallet) => void;
    handleConnection: (
      wallet: Wallet,
      options?: ConnectManagerOptions,
    ) => Promise<Wallet>;
    isAutoConnecting: Store<boolean>;
    removeConnectedWallet: (wallet: Wallet) => void;
    setActiveWallet: (activeWallet: Wallet) => Promise<void>;
    switchActiveWalletChain: (chain: Readonly) => Promise<void>;
  };
}>;
```

### Returns

```ts
let returnType: Element;
```
---
# Chain
---

###### Connect SDK

## ChainProvider

A React context provider component that supplies Chain-related data to its child components.

This component serves as a wrapper around the `ChainProviderContext.Provider` and passes the provided chain data down to all of its child components through the context API.

### Example

#### Basic usage

```tsx
import { ChainProvider, ChainIcon, ChainName } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<ChainProvider chain={ethereum}>
  <ChainIcon />
  <ChainName />
</ChainProvider>;
```

#### Usage with defineChain

```tsx
import { defineChain } from "thirdweb/chains"l
import { ChainProvider, ChainName } from "thirdweb/react";
 
const chainId = someNumber;
 
<ChainProvider chain={defineChain(chainId)}>
  <ChainName />
</ChainProvider>
```

```ts
function ChainProvider(
  props: PropsWithChildren<ChainProviderProps>,
): Element;
```

### Parameters

#### Type

```ts
let props: PropsWithChildren<ChainProviderProps>;
```

### Returns

```ts
let returnType: Element;
```
---
# Transactions
---

###### Connect SDK

## BuyDirectListingButton

This button is used with thirdweb Marketplace v3 contract, for buying NFT(s) from a listing.

Under the hood, it prepares a transaction using the [buyFromListing extension](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyFromListing)and then pass it to a `<TransactionButton />`

Since it uses the TransactionButton, it can take in any props that can be passed to the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)

### Example

```tsx
import { BuyDirectListingButton } from "thirdweb/react";
 
<BuyDirectListingButton
  contractAddress="0x..." // contract address of the marketplace v3
  chain={...} // the chain which the marketplace contract is deployed on
  client={...} // thirdweb client
  listingId={100n} // the listingId or the item you want to buy
  quantity={1n} // optional - see the docs to learn more
>
  Buy NFT
</BuyDirectListingButton>
```

For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs.

```ts
function BuyDirectListingButton(
  props: BuyDirectListingButtonProps,
): Element;
```

### Parameters

props of type [BuyDirectListingButtonProps](https://portal.thirdweb.com/references/typescript/v5/BuyDirectListingButtonProps)

#### Type

```ts
let props: Omit<TransactionButtonProps, "transaction"> & {
  chain: Chain;
  client: ThirdwebClient;
  contractAddress: string;
  listingId: bigint;
  quantity?: bigint;
};
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## ClaimButton

This button is used to claim tokens (NFT or ERC20) from a given thirdweb Drop contract.

there are 3 type of Drop contract: NFT Drop (DropERC721), Edition Drop (DropERC1155) and Token Drop (DropERC20)

Learn more: https://thirdweb.com/explore/drops

Note: This button only works with thirdweb Drop contracts. For custom contract, please use [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)

### Example

Example for claiming NFT from an NFT Drop contract

```tsx
import { ClaimButton } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<ClaimButton
  contractAddress="0x..." // contract address of the NFT Drop
  chain={ethereum}
  client={client}
  claimParams={{
    type: "ERC721",
    quantity: 1n, // claim 1 token
  }}
>
  Claim now
</ClaimButton>;
```

For Edition Drop (ERC1155)

```tsx
<ClaimButton
  contractAddress="0x..." // contract address of the Edition Drop
  chain={ethereum}
  client={client}
  claimParams={{
    type: "ERC1155",
    quantity: 1n,
    tokenId: 0n,
  }}
>
  Claim now
</ClaimButton>;
```

For Token Drop (ERC20)

```tsx
<ClaimButton
  contractAddress="0x..." // contract address of the Token Drop
  chain={ethereum}
  client={client}
  claimParams={{
    type: "ERC20",
    quantity: "100", // claim 100 ERC20 tokens
    // instead of `quantity`, you can also use `quantityInWei` (bigint)
  }}
>
  Claim now
</ClaimButton>;
```

Attach custom Pay metadata

```tsx
<ClaimButton
  payModal={{
    metadata: {
      name: "Van Gogh Starry Night",
      image: "https://unsplash.com/starry-night.png",
    },
  }}
>
  ...
</ClaimButton>;
```

Since this button uses the `TransactionButton`, it can take in any props that can be passed to the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)

For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs.

```ts
function ClaimButton(props: ClaimButtonProps): Element;
```

### Parameters

#### Type

```ts
let props: Omit<TransactionButtonProps, "transaction"> & {
  chain: Chain;
  claimParams: ClaimParams;
  client: ThirdwebClient;
  contractAddress: string;
};
```

### Returns

```ts
let returnType: Element;
```

A wrapper for TransactionButton
---

###### Connect SDK

## CreateDirectListingButton

This button is used to create Direct listings for the thirdweb Marketplace v3 contract

It uses the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)and the [createListing extension](https://portal.thirdweb.com/references/typescript/v5/marketplace/createListing) under the hood which means it inherits all the props of those 2 components.

### Example

```tsx
import { CreateDirectListingButton } from "thirdweb/react";
 
<CreateDirectListingButton
  contractAddress="0x..." // contract address for the marketplace-v3
  chain={...} // the chain which the marketplace contract is deployed on
 
  // These props below are the same props for `createListing`
  // to get the full list, check the docs link above
  tokenId={0n}
  assetContractAddress="0x..." // The NFT contract address whose NFT(s) you want to sell
  pricePerToken={"0.1"} // sell for 0.1 <native token>
>
  Sell NFT
</CreateDirectListingButton>
```

For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs.

```ts
function CreateDirectListingButton(
  props: CreateDirectListingButtonProps,
): Element;
```

### Parameters

#### Type

```ts
let props: Omit<TransactionButtonProps, "transaction"> &
  CreateListingParams & {
    chain: Chain;
    client: ThirdwebClient;
    contractAddress: string;
  };
```

### Returns

```ts
let returnType: Element;
```
---

###### Connect SDK

## TransactionButton

TransactionButton component is used to render a button that triggers a transaction. It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction.

### Example

#### Basic usage

```tsx
<TransactionButton
  transaction={() => {}}
  onTransactionConfirmed={handleSuccess}
  onError={handleError}
>
  Confirm Transaction
</TransactionButton>;
```

#### Customize the styling by passing the `unstyled` prop and your inline styles and/or classes:

```tsx
<TransactionButton
  transaction={() => {}}
  unstyled
  className="bg-white text-black rounded-md p-4 flex items-center justify-center"
>
  Confirm Transaction
</TransactionButton>;
```

#### Handle errors

```tsx
<TransactionButton
  transaction={() => ...}
  onError={(err) => {
    alert(err.message);
    // Add your own logic here
  }}
>
  Confirm Transaction
</TransactionButton>
```

#### Alert when a transaction is sent

```tsx
<TransactionButton
  transaction={() => ...}
  onTransactionSent={(tx) => {
    alert("transaction sent!");
    // Add your own logic here. For example, a toast
  }}
>
  Confirm Transaction
</TransactionButton>
```

#### Alert when a transaction is completed

```tsx
<TransactionButton
  transaction={() => ...}
  onTransactionConfirmed={(tx) => {
    alert("transaction sent!");
    console.log(tx);
    // Add your own logic here. For example, a toast
  }}
>
  Confirm Transaction
</TransactionButton>
```

#### The onClick prop, if provided, will be called before the transaction is sent.

```tsx
<TransactionButton
  onClick={() => alert("Transaction is about to be sent")}
  transaction={...}
>
  ...
</TransactionButton>
```

#### Attach custom Pay metadata

```tsx
<TransactionButton
  payModal={{
    // This image & title will show up in the Pay modal
    metadata: {
      name: "Van Gogh Starry Night",
      image: "https://unsplash.com/starry-night.png",
    },
  }}
>
  ...
</TransactionButton>;
```

#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)

```tsx
<TransactionButton
  gasless={{
    provider: "engine",
    relayerUrl:
      "https://thirdweb.engine-***.thirdweb.com/relayer/***",
    relayerForwarderAddress: "0x...",
  }}
>
  ...
</TransactionButton>;
```

#### Gasless usage with OpenZeppelin

```tsx
<TransactionButton
  gasless={{
    provider: "openzeppelin",
    relayerUrl: "https://...",
    relayerForwarderAddress: "0x...",
  }}
>
  ...
</TransactionButton>;
```

```ts
function TransactionButton(props: TransactionButtonProps): Element;
```

### Parameters

The props for this component. Refer to [TransactionButtonProps](https://portal.thirdweb.com/references/typescript/v5/TransactionButtonProps) for details.

#### Type

```ts
let props: {
  children: React.ReactNode;
  className?: string;
  disabled?: boolean;
  gasless?: GaslessOptions;
  onClick?: () => void;
  onError?: (error: Error) => void;
  onTransactionConfirmed?: (receipt: TransactionReceipt) => void;
  onTransactionSent?: (
    transactionResult: WaitForReceiptOptions,
  ) => void;
  payModal?: SendTransactionPayModalConfig;
  style?: React.CSSProperties;
  theme?: "dark" | "light" | Theme;
  transaction: () =>
    | PreparedTransaction<any>
    | Promise<PreparedTransaction<any>>;
  type?: HTMLButtonElement["type"];
  unstyled?: boolean;
};
```

### Returns

```ts
let returnType: Element;
```
---
# NFT
---

###### Connect SDK

## NFTProvider

A React context provider component that supplies NFT-related data to its child components.

This component serves as a wrapper around the `NFTProviderContext.Provider` and passes the provided NFT data down to all of its child components through the context API.

### Example

```tsx
import { getContract } from "thirdweb";
import {
  NFTProvider,
  NFTMedia,
  NFTDescription,
  NFTName,
} from "thirdweb/react";
 
const contract = getContract({
  address: "0x...",
  chain: ethereum,
  client: yourThirdwebClient,
});
 
<NFTProvider contract={contract} tokenId={0n}>
  <NFTMedia />
  <NFTDescription />
  <NFTName />
</NFTProvider>;
```

```ts
function NFTProvider(
  props: PropsWithChildren<NFTProviderProps>,
): Element;
```

### Parameters

The props for the NFT provider

#### Type

```ts
let props: PropsWithChildren<NFTProviderProps>;
```

### Returns

```ts
let returnType: Element;
```
---
# Tokens
---

###### Connect SDK

## TokenProvider

A React context provider component that supplies Token-related data to its child components.

This component serves as a wrapper around the `TokenProviderContext.Provider` and passes the provided token data down to all of its child components through the context API.

### Example

#### Basic usage

```tsx
import { TokenProvider, TokenIcon, TokenName  } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<TokenProvider address="0x..." client={...} chain={ethereum}>
  <TokenIcon />
  <TokenName />
</TokenProvider>
```

#### This component also works with native token!

```tsx
import { NATIVE_TOKEN_ADDRESS } from "thirdweb";
import { ethereum } from "thirdweb/chains";
 
<TokenProvider
  address={NATIVE_TOKEN_ADDRESS}
  chain={ethereum}
  client={client}
>
  <TokenSymbol /> // "ETH"
</TokenProvider>;
```

```ts
function TokenProvider(
  props: PropsWithChildren<TokenProviderProps>,
): Element;
```

### Parameters

#### Type

```ts
let props: PropsWithChildren<TokenProviderProps>;
```

### Returns

```ts
let returnType: Element;
```
---
# Miscellaneous
---

###### Connect SDK

## MediaRenderer

```ts
function MediaRenderer(
  props: MediaRendererProps & RefAttributes<HTMLMediaElement>,
): ReactNode;
```

### Parameters

Refer to [MediaRendererProps](https://portal.thirdweb.com/references/typescript/v5/MediaRendererProps) to see the available props.

#### Type

```ts
let props: MediaRendererProps & RefAttributes<HTMLMediaElement>;
```

### Returns

```ts
let returnType: ReactNode;
```
---

###### Connect SDK

## PayEmbed

Deprecated

Use `BuyWidget`, `CheckoutWidget` or `TransactionWidget` instead.

Embed a prebuilt UI for funding wallets, purchases or transactions with crypto or fiat.

### Example

#### Default configuration

By default, the `PayEmbed` component will allows users to fund their wallets with crypto or fiat on any of the supported chains..

```tsx
<PayEmbed client={client} />;
```

#### Top up wallets

You can set the `mode` option to `"fund_wallet"` to allow users to top up their wallets with crypto or fiat.

```tsx
<PayEmbed
  client={client}
  payOptions={{
    mode: "fund_wallet",
    metadata: {
      name: "Get funds", // title of the payment modal
    },
    prefillBuy: {
      chain: base, // chain to prefill the buy screen with
      amount: "0.01", // amount to prefill the buy screen with
    },
  }}
/>;
```

#### Direct Payments

You can set the `mode` option to `"direct_payment"` to allow users to make a direct payment to a wallet address.

```tsx
<PayEmbed
  client={client}
  theme={"light"}
  payOptions={{
    mode: "direct_payment",
    paymentInfo: {
      amount: "35",
      chain: base,
      token: getDefaultToken(base, "USDC"),
      sellerAddress: "0x...", // the wallet address of the seller
    },
    metadata: {
      name: "Black Hoodie (Size L)",
      image: "/drip-hoodie.png",
    },
  }}
/>;
```

#### Transactions

You can set the `mode` option to `"transaction"` to allow users to execute a transaction with a different wallet, chain or token.

```tsx
<PayEmbed
  client={client}
  payOptions={{
    mode: "transaction",
    // can be any transaction
    transaction: claimTo({
      contract: nftContract,
      quantity: 1n,
      tokenId: 0n,
      to: "0x...",
    }),
    // this could be any metadata, including NFT metadata
    metadata: {
      name: "VIP Ticket",
      image: "https://...",
    },
  }}
/>;
```

You can also handle ERC20 payments by passing `erc20value` to your transaction:

```tsx
<PayEmbed
  client={client}
  payOptions={{
    mode: "transaction",
    transaction: prepareContractCall({
      contract: yourContract,
      functionName: "purchase",
      args: [arg1, arg2, ...],
      erc20value: {
        token: USDC_TOKEN_ADDRESS, // the erc20 token required to purchase
        amount: toUnits("100", 6), // the amount of erc20 token required to purchase
      },
    }),
  }}
 />
```

#### Enable/Disable payment methods

You can disable the use of crypto or fiat by setting the `buyWithCrypto` or `buyWithFiat` options to `false`.

```tsx
<PayEmbed
  client={client}
  payOptions={{
    buyWithFiat: false,
  }}
/>;
```

#### Customize the UI

You can customize the UI of the `PayEmbed` component by passing a custom theme object to the `theme` prop.

```tsx
<PayEmbed
  client={client}
  theme={darkTheme({
    colors: {
      modalBg: "red",
    },
  })}
/>;
```

Refer to the [Theme](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details.

#### Configure the wallet connection

You can customize the wallet connection flow by passing a `connectOptions` object to the `PayEmbed` component.

```tsx
<PayEmbed
  client={client}
  connectOptions={{
    connectModal: {
      size: "compact",
      title: "Sign in",
    },
  }}
/>;
```

Refer to the [PayEmbedConnectOptions](https://portal.thirdweb.com/references/typescript/v5/PayEmbedConnectOptions) type for more details.

```ts
function PayEmbed(props: PayEmbedProps): Element;
```

### Parameters

Props of type [PayEmbedProps](https://portal.thirdweb.com/references/typescript/v5/PayEmbedProps) to configure the PayEmbed component.

#### Type

```ts
let props: {
  activeWallet?: Wallet;
  className?: string;
  client: ThirdwebClient;
  connectOptions?: PayEmbedConnectOptions;
  hiddenWallets?: Array<WalletId>;
  locale?: LocaleId;
  paymentLinkId?: string;
  payOptions?: PayUIOptions;
  style?: React.CSSProperties;
  supportedTokens?: SupportedTokens;
  theme?: "light" | "dark" | Theme;
};
```

### Returns

```ts
let returnType: Element;
```
---
**React Hooks**
---
# Extensions
---
## EIP5792
---

###### Connect SDK

## EIP5792.useCapabilities

A hook to get the current wallet's capabilities according to [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).

This function is dependent on the wallet's support for EIP-5792, but will not throw._The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792._

### Example

```tsx
import { useCapabilities } from "thirdweb/react";
const { data: capabilities, isLoading } = useCapabilities();
```

```ts
function useCapabilities(options?: {
  chainId?: number;
  queryOptions?: { enabled?: boolean; retry?: number };
}): UseQueryResult<{ message?: string }>;
```

### Parameters

#### Type

```ts
let options: {
  chainId?: number;
  queryOptions?: { enabled?: boolean; retry?: number };
};
```

### Returns

```ts
let returnType: UseQueryResult<{ message?: string }>;
```

a React Query object.
---

###### Connect SDK

## EIP5792.useSendAndConfirmCalls

A hook to send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be batched and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions.

When calls are sent, all contracts that are interacted with will have their corresponding reads revalidated via React Query.

This hook is dependent on the wallet's support for EIP-5792 and could fail. The mutation function will use your currently connected wallet by default, but you can pass it a specific wallet to use if you'd like.

### Example

```tsx
import { useSendCalls } from "thirdweb/react";
 
const sendTx1 = approve({
  contract: USDT_CONTRACT,
  amount: 100,
  spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6",
});
const sendTx2 = approve({
  contract: USDT_CONTRACT,
  amount: 100,
  spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
});
const { mutate: sendCalls, data: result } = useSendAndConfirmCalls();
await sendCalls({
  client,
  calls: [sendTx1, sendTx2],
});
 
console.log(
  "Transaction hash:",
  result.receipts?.[0]?.transactionHash,
);
```

Sponsor transactions with a paymaster:

```ts
const { mutate: sendAndConfirmCalls, data: id } =
  useSendAndConfirmCalls();
const result = await sendAndConfirmCalls({
  client,
  calls: [sendTx1, sendTx2],
  capabilities: {
    paymasterService: {
      url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`,
    },
  },
});
console.log(
  "Transaction hash:",
  result.receipts?.[0]?.transactionHash,
);
```

We recommend proxying any paymaster calls via an API route you setup and control.

```ts
function useSendAndConfirmCalls(args?: {
  maxBlocksWaitTime?: number;
}): UseMutationResult<
  {
    atomic: boolean;
    chainId: number;
    id: string;
    receipts?: Array<
      WalletCallReceipt<bigint, "success" | "reverted">
    >;
    status: undefined | "pending" | "success" | "failure";
    statusCode: number;
    version: string;
  },
  Error,
  Omit<
    {
      atomicRequired?: boolean;
      calls: Array<PreparedSendCall<[], AbiFunction>>;
      capabilities?: WalletCapabilities;
      chain?: Readonly<ChainOptions & { rpc: string }>;
      version?: string;
      wallet: Wallet<WalletId>;
    },
    "chain" | "wallet"
  > & { wallet?: Wallet }
>;
```

### Parameters

#### Type

```ts
let args: { maxBlocksWaitTime?: number };
```

### Returns

```ts
let returnType: UseMutationResult<
  {
    atomic: boolean;
    chainId: number;
    id: string;
    receipts?: Array<
      WalletCallReceipt<bigint, "success" | "reverted">
    >;
    status: undefined | "pending" | "success" | "failure";
    statusCode: number;
    version: string;
  },
  Error,
  Omit<
    {
      atomicRequired?: boolean;
      calls: Array<PreparedSendCall<[], AbiFunction>>;
      capabilities?: WalletCapabilities;
      chain?: Readonly<ChainOptions & { rpc: string }>;
      version?: string;
      wallet: Wallet<WalletId>;
    },
    "chain" | "wallet"
  > & { wallet?: Wallet }
>;
```

A React Query mutation object to interact with sendAndConfirmCalls
---

###### Connect SDK

## EIP5792.useSendCalls

A hook to send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions.

When calls are sent, all contracts that are interacted with will have their corresponding reads revalidated via React Query.

This hook is dependent on the wallet's support for EIP-5792 and could fail. The mutatuon function will use your currently connected wallet by default, but you can pass it a specific wallet to use if you'd like.

### Example

```tsx
import { useSendCalls } from "thirdweb/react";
 
const sendTx1 = approve({
  contract: USDT_CONTRACT,
  amount: 100,
  spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6",
});
const sendTx2 = approve({
  contract: USDT_CONTRACT,
  amount: 100,
  spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
});
const { mutate: sendCalls, data: id } = useSendCalls();
await sendCalls({
  wallet,
  client,
  calls: [sendTx1, sendTx2],
});
```

Await the bundle's full confirmation:

```tsx
const { mutate: sendCalls, data } = useSendCalls();
const { data: result, isLoading } = useWaitForCallsReceipt(data);
await sendCalls({
  wallet,
  client,
  calls: [sendTx1, sendTx2],
});
 
console.log("Receipts:", result.receipts);
```

Sponsor transactions with a paymaster:

```ts
const { mutate: sendCalls, data: id } = useSendCalls();
await sendCalls({
  client,
  calls: [sendTx1, sendTx2],
  capabilities: {
    paymasterService: {
      url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`,
    },
  },
});
```

We recommend proxying any paymaster calls via an API route you setup and control.

```ts
function useSendCalls(): UseMutationResult<
  {
    chain: Readonly;
    client: ThirdwebClient;
    id: string;
    wallet: Wallet;
  },
  Error,
  Omit<
    {
      atomicRequired?: boolean;
      calls: Array<PreparedSendCall<[], AbiFunction>>;
      capabilities?: WalletCapabilities;
      chain?: Readonly<ChainOptions & { rpc: string }>;
      version?: string;
      wallet: Wallet<WalletId>;
    },
    "chain" | "wallet"
  > & { wallet?: Wallet }
>;
```

### Returns

```ts
let returnType: UseMutationResult<
  {
    chain: Readonly;
    client: ThirdwebClient;
    id: string;
    wallet: Wallet;
  },
  Error,
  Omit<
    {
      atomicRequired?: boolean;
      calls: Array<PreparedSendCall<[], AbiFunction>>;
      capabilities?: WalletCapabilities;
      chain?: Readonly<ChainOptions & { rpc: string }>;
      version?: string;
      wallet: Wallet<WalletId>;
    },
    "chain" | "wallet"
  > & { wallet?: Wallet }
>;
```

A React Query mutatuon object to interact with sendCalls
---

###### Connect SDK

## EIP5792.useWaitForCallsReceipt

A hook to wait for the receipt of eip5792 calls.

### Example

```tsx
const { data: receipt, isLoading } = useWaitForCallsReceipt({
  id,
  client,
  chain,
  wallet,
});
```

Example with useSendCalls:

```tsx
const { mutate: sendCalls, data } = useSendCalls();
const { data: receipt, isLoading } = useWaitForCallsReceipt(data);
```

```ts
function useWaitForCallsReceipt(
  args:
    | undefined
    | ({
        chain: Readonly;
        client: ThirdwebClient;
        id: string;
        wallet: Wallet;
      } & {
        maxBlocksWaitTime?: number;
        queryOptions?: { enabled?: boolean };
      }),
): UseQueryResult<
  {
    atomic: boolean;
    chainId: number;
    id: string;
    receipts?: Array<
      WalletCallReceipt<bigint, "success" | "reverted">
    >;
    status: undefined | "pending" | "success" | "failure";
    statusCode: number;
    version: string;
  },
  Error
>;
```

### Parameters

#### Type

```ts
let args:
  | undefined
  | ({
      chain: Readonly;
      client: ThirdwebClient;
      id: string;
      wallet: Wallet;
    } & {
      maxBlocksWaitTime?: number;
      queryOptions?: { enabled?: boolean };
    });
```

### Returns

```ts
let returnType: UseQueryResult<
  {
    atomic: boolean;
    chainId: number;
    id: string;
    receipts?: Array<
      WalletCallReceipt<bigint, "success" | "reverted">
    >;
    status: undefined | "pending" | "success" | "failure";
    statusCode: number;
    version: string;
  },
  Error
>;
```

A useQuery object.
---
## ENS
---

###### Connect SDK

## ENS.useEnsAvatar

Get the ENS avatar for an ENS name

### Example

```tsx
import { useEnsAvatar } from "thirdweb/react";
 
const { data: ensAvatar } = useEnsAvatar({
  client,
  ensName: "my-ens-name.eth",
});
```

```ts
function useEnsAvatar(options: {
  client: ThirdwebClient;
  ensName: undefined | null | string;
}): UseQueryResult<null | string, Error>;
```

### Parameters

the client and ENS name to get the avatar for

#### Type

```ts
let options: {
  client: ThirdwebClient;
  ensName: undefined | null | string;
};
```

### Returns

```ts
let returnType: UseQueryResult<null | string, Error>;
```

* a query object that resolves to the avatar
---

###### Connect SDK

## ENS.useEnsName

Get the ENS name and avatar for an address

### Example

```tsx
import { useEnsName } from "thirdweb/react";
 
const { data: ensName } = useEnsName({
  client,
  address: "0x1234...",
});
```

```ts
function useEnsName(options: {
  address: undefined | string;
  client: ThirdwebClient;
}): UseQueryResult<null | string, Error>;
```

### Parameters

the client and address to get the ENS name and avatar for

#### Type

```ts
let options: { address: undefined | string; client: ThirdwebClient };
```

### Returns

```ts
let returnType: UseQueryResult<null | string, Error>;
```

* a query object that resolves to the ENS name
---
# Wallets
---

###### Connect SDK

## useAuthToken

A hook that returns the authentication token (JWT) for the currently active wallet. This token can be used to authorize API calls to your backend server.

### Example

```tsx
function MyComponent() {
  const authToken = useAuthToken();
 
  const fetchData = async () => {
    const response = await fetch("https://api.example.com/data", {
      headers: {
        Authorization: `Bearer ${authToken}`,
      },
    });
    // ... handle response
  };
}
```

```ts
function useAuthToken(): null | string;
```

### Returns

```ts
let returnType: null | string;
```

The JWT string if the active wallet is an in-app wallet and matches the active account, null otherwise
---

###### Connect SDK

## useLinkProfile

Links a web2 or web3 profile to the connected in-app or ecosystem account._When a profile is linked to the account, that profile can then be used to sign into the same account._

### Example

#### Linking a social profile

```jsx
import { useLinkProfile } from "thirdweb/react";
 
const { mutate: linkProfile } = useLinkProfile();
 
const onClick = () => {
  linkProfile({
    client,
    strategy: "discord", // or "google", "x", "telegram", etc
  });
};
```

#### Linking an email

```jsx
import { useLinkProfile } from "thirdweb/react";
import { preAuthenticate } from "thirdweb/wallets";
 
const { mutate: linkProfile } = useLinkProfile();
 
// send a verification email first
const sendEmail = async () => {
  const email = await preAuthenticate({
    client,
    strategy: "email",
    email: "john.doe@example.com",
  });
};
 
// then link the profile with the verification code
const onClick = (code: string) => {
  linkProfile({
    client,
    strategy: "email",
    email: "john.doe@example.com",
    verificationCode: code,
  });
};
```

The same process can be used for phone and email, simply swap out the `strategy` parameter.

#### Linking a wallet

```jsx
import { useLinkProfile } from "thirdweb/react";
 
const { mutate: linkProfile } = useLinkProfile();
 
const onClick = () => {
  linkProfile({
    client,
    strategy: "wallet",
    wallet: createWallet("io.metamask"), // autocompletion for 400+ wallet ids
    chain: sepolia, // any chain works, needed for SIWE signature
  });
};
```

```ts
function useLinkProfile(): UseMutationResult<
  Array<Profile>,
  Error,
  AuthArgsType,
  unknown
>;
```

### Returns

```ts
let returnType: UseMutationResult<
  Array<Profile>,
  Error,
  AuthArgsType,
  unknown
>;
```
---

###### Connect SDK

## useNetworkSwitcherModal

Hook to open the Wallet Network Switcher Modal that shows allows users to switch to different network.

### Example

```tsx
import { createThirdwebClient } from "thirdweb";
import { useNetworkSwitcherModal } from "thirdweb/react";
import { base, ethereum, polygon, sepolia, arbitrum } from "thirdweb/chains";
 
const client = createThirdwebClient({
 clientId: "<your_client_id>",
});
 
function Example() {
  const networkSwitcher = useNetworkSwitcherModal();
 
  function handleClick() {
     networkSwitcher.open({
       client,
       theme: 'light'
       sections: [
         { label: 'Recently used', chains: [arbitrum, polygon] },
         { label: 'Popular', chains: [base, ethereum, sepolia] },
       ]
    });
  }
 
  return <button onClick={handleClick}> Switch Network </button>
}
```

```ts
function useNetworkSwitcherModal(): {
  close: () => void;
  open: (props: UseNetworkSwitcherModalOptions) => Promise<void>;
};
```

### Returns

```ts
let returnType: {
  close: () => void;
  open: (props: UseNetworkSwitcherModalOptions) => Promise<void>;
};
```
---

###### Connect SDK

## useProfiles

Retrieves all linked profiles of the connected in-app or ecosystem account.

### Example

```jsx
import { useProfiles } from "thirdweb/react";
 
const { data: profiles } = useProfiles({
  client,
});
 
console.log("Type:", profiles[0].type); // "discord"
console.log("Email:", profiles[0].details.email); // "john.doe@example.com"
```

```ts
function useProfiles(args: {
  client: ThirdwebClient;
}): UseQueryResult<Array<Profile>>;
```

### Parameters

#### Type

```ts
let args: { client: ThirdwebClient };
```

### Returns

```ts
let returnType: UseQueryResult<Array<Profile>>;
```

A React Query result containing the linked profiles for the connected in-app account. This hook will only run if the connected wallet supports account linking.
---

###### Connect SDK

## useUnlinkProfile

Unlinks a web2 or web3 profile currently connected in-app or ecosystem account._When a profile is unlinked from the account, it will no longer be able to be used to sign into the account._

### Example

#### Unlinking an email account

```jsx
import { useUnlinkProfile } from "thirdweb/react";
 
const { data: connectedProfiles, isLoading } = useProfiles({
  client: props.client,
});
const { mutate: unlinkProfile } = useUnlinkProfile();
 
const onClick = () => {
  unlinkProfile({
    client,
    // Select any other profile you want to unlink
    profileToUnlink: connectedProfiles[1],
  });
};
```

#### Unlinking an email account with account deletion

```jsx
import { useUnlinkProfile } from "thirdweb/react";
 
const { mutate: unlinkProfile } = useUnlinkProfile();
 
const onClick = () => {
  unlinkProfile({
    client,
    // Select the profile you want to unlink
    profileToUnlink: connectedProfiles[0],
    allowAccountDeletion: true, // This will delete the account if it's the last profile linked to the account
  });
};
```

```ts
function useUnlinkProfile(): UseMutationResult<
  void,
  Error,
  {
    allowAccountDeletion?: boolean;
    client: ThirdwebClient;
    profileToUnlink: Profile;
  },
  unknown
>;
```

### Returns

```ts
let returnType: UseMutationResult<
  void,
  Error,
  {
    allowAccountDeletion?: boolean;
    client: ThirdwebClient;
    profileToUnlink: Profile;
  },
  unknown
>;
```
---

###### Connect SDK

## useWalletBalance

Fetch the balance of a wallet in native currency or for a specific token. Leave `tokenAddress` undefined to fetch the native token balance.

### Example

#### Fetching the native token balance

```ts
import { useWalletBalance } from "thirdweb/react";
 
const { data, isLoading, isError } = useWalletBalance({
  chain,
  address,
  client,
});
console.log("balance", data?.displayValue, data?.symbol);
```

#### Fetching a specific token balance

```ts
import { useWalletBalance } from "thirdweb/react";
 
const tokenAddress = "0x..."; // the ERC20 token address
 
const { data, isLoading, isError } = useWalletBalance({
  chain,
  address,
  client,
  tokenAddress,
});
console.log("balance", data?.displayValue, data?.symbol);
```

```ts
function useWalletBalance(
  options: {
    address: undefined | string;
    chain: undefined | Readonly<ChainOptions & { rpc: string }>;
    client: ThirdwebClient;
    tokenAddress?: string;
  },
  queryOptions?: UseWalletBalanceQueryOptions,
): UseQueryResult<GetBalanceResult>;
```

### Parameters

GetWalletBalanceOptions - The options for fetching the wallet balance.

#### Type

```ts
let options: {
  address: undefined | string;
  chain: undefined | Readonly<ChainOptions & { rpc: string }>;
  client: ThirdwebClient;
  tokenAddress?: string;
};
```

#### Type

```ts
let queryOptions: UseWalletBalanceQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<GetBalanceResult>;
```

GetWalletBalanceResult The result of the query.
---

###### Connect SDK

## useWalletDetailsModal

Hook to open the Wallet Details Modal that shows various information about the connected wallet and allows users to perform various actions like sending funds, receiving funds, switching networks, Buying tokens, etc.

### Example

#### Basic usage

```tsx
import { createThirdwebClient } from "thirdweb";
import { useWalletDetailsModal } from "thirdweb/react";
 
const client = createThirdwebClient({
  clientId: "<your_client_id>",
});
 
function Example() {
  const detailsModal = useWalletDetailsModal();
 
  function handleClick() {
    detailsModal.open({ client, theme: "light" });
  }
 
  return <button onClick={handleClick}> Show Wallet Details </button>;
}
```

#### Callback for when the modal is closed

```tsx
detailsModal.open({
  client,
  onClose: (screen: string) => console.log({ screen }),
});
```

```ts
function useWalletDetailsModal(): {
  open: (props: UseWalletDetailsModalOptions) => void;
};
```

### Returns

```ts
let returnType: {
  open: (props: UseWalletDetailsModalOptions) => void;
};
```
---

###### Connect SDK

## useWalletImage

Returns the wallet icon for the provided wallet id.

### Example

```tsx
import { useWalletImage } from "thirdweb/react";
 
const { data: walletImage } = useWalletImage("io.metamask");
 
return <img src={walletImage} alt="MetaMask logo" />;
```

```ts
function useWalletImage(
  id: undefined | WalletId,
): UseQueryResult<string, Error>;
```

### Parameters

#### Type

```ts
let id: undefined | WalletId;
```

### Returns

```ts
let returnType: UseQueryResult<string, Error>;
```
---

###### Connect SDK

## useWalletInfo

Returns the wallet info for the provided wallet id.

### Example

```tsx
import { useWalletInfo } from "thirdweb/react";
 
const { data: walletInfo } = useWalletInfo("io.metamask");
console.log("wallet name", walletInfo?.name);
```

```ts
function useWalletInfo(
  id: undefined | WalletId,
): UseQueryResult<WalletInfo, Error>;
```

### Parameters

#### Type

```ts
let id: undefined | WalletId;
```

### Returns

```ts
let returnType: UseQueryResult<WalletInfo, Error>;
```
---
# Wallet Connection
---

###### Connect SDK

## useActiveAccount

A hook that returns the active account

### Example

```jsx
import { useActiveAccount } from "thirdweb/react";
 
const activeAccount = useActiveAccount();
console.log("address", activeAccount?.address);
```

```ts
function useActiveAccount(): undefined | Account;
```

### Returns

```ts
let returnType: undefined | Account;
```

The active `Account` or `undefined` if no active account is set.
---

###### Connect SDK

## useActiveWallet

A hook that returns the active wallet

### Example

#### Basic usage

```jsx
import { useActiveWallet } from "thirdweb/react";
 
const wallet = useActiveWallet();
```

#### Listen to account change event

```jsx
const wallet = useActiveWallet();
 
wallet?.subscribe("accountChanged", (account) => {
  console.log(account);
});
```

#### Listen to multiple accounts changed event

```jsx
const wallet = useActiveWallet();
 
wallet?.subscribe("accountsChanged", (addresses) => {
  console.log(addresses);
});
```

#### Listen to network change event

```jsx
const wallet = useActiveWallet();
 
wallet?.subscribe("chainChanged", (chain) => {
  console.log(chain);
});
```

```ts
function useActiveWallet(): undefined | Wallet;
```

### Returns

```ts
let returnType: undefined | Wallet;
```

The active `Wallet` or `undefined` if no active wallet is set.
---

###### Connect SDK

## useActiveWalletChain

A hook that returns the chain the active wallet is connected to

### Example

```jsx
import { useActiveWalletChain } from "thirdweb/react";
 
const activeChain = useActiveWalletChain();
```

```ts
function useActiveWalletChain():
  | undefined
  | Readonly<ChainOptions & { rpc: string }>;
```

### Returns

```ts
let returnType: undefined | Readonly<ChainOptions & { rpc: string }>;
```

The chain the active wallet is connected to or null if no active wallet.
---

###### Connect SDK

## useActiveWalletConnectionStatus

A hook that returns the active account's connection status.

### Example

```jsx
import { useActiveWalletConnectionStatus } from "thirdweb/react";
 
function Example() {
  const status = useActiveWalletConnectionStatus();
  console.log(status);
  return <div> ... </div>;
}
```

```ts
function useActiveWalletConnectionStatus(): ConnectionStatus;
```

### Returns

```ts
let returnType:
  | "connected"
  | "disconnected"
  | "connecting"
  | "unknown";
```

The active wallet's connection status.
---

###### Connect SDK

## useAdminWallet

Get the admin wallet for the active wallet Useful for smart wallets to get the underlying personal account

```ts
function useAdminWallet(): undefined | Wallet;
```

### Returns

```ts
let returnType: undefined | Wallet;
```

The admin wallet for the active wallet, or the active wallet if it doesn't have an admin account
---

###### Connect SDK

## useAutoConnect

Autoconnect the last previously connected wallet.

### Example

```tsx
import { useAutoConnect } from "thirdweb/react";
 
const { data: autoConnected, isLoading } = useAutoConnect({
  client,
  accountAbstraction,
  wallets,
  onConnect,
  timeout,
});
```

```ts
function useAutoConnect(
  props: AutoConnectProps,
): UseQueryResult<boolean, Error>;
```

### Parameters

The props for auto connect.

#### Type

```ts
let props: {
  accountAbstraction?: SmartWalletOptions;
  appMetadata?: AppMetadata;
  chain?: Chain;
  client: ThirdwebClient;
  onConnect?: (wallet: Wallet) => void;
  onTimeout?: () => void;
  siweAuth?: {
    doLogin: () => Promise<void>;
    isLoggedIn: boolean | undefined;
    isLoggingIn: boolean | undefined;
    requiresAuth: boolean;
  };
  timeout?: number;
  wallets?: Array<Wallet>;
};
```

### Returns

```ts
let returnType: UseQueryResult<boolean, Error>;
```

whether the auto connect was successful.
---

###### Connect SDK

## useConnect

A hook to set a wallet as active wallet

### Example

```jsx
import { createThirdwebClient } from "thirdweb";
import { useConnect } from "thirdweb/react";
import { createWallet } from "thirdweb/wallets";
 
const client = createThirdwebClient({
  clientId: "YOUR_CLIENT_ID",
});
 
function Example() {
  const { connect, isConnecting, error } = useConnect();
  return (
    <button
      onClick={() =>
        connect(async () => {
          // instantiate wallet
          const wallet = createWallet("io.metamask");
          // connect wallet
          await wallet.connect({
            client,
          });
          // return the wallet
          return wallet;
        })
      }
    >
      Connect
    </button>
  );
}
```

```ts
function useConnect(options?: ConnectManagerOptions): {
  readonly connect: (
    walletOrFn: Wallet | (() => Promise<Wallet>),
  ) => Promise<null | Wallet>;
  error: null | Error;
  isConnecting: boolean;
};
```

### Parameters

#### Type

```ts
let options: {
  accountAbstraction?: SmartWalletOptions;
  client: ThirdwebClient;
  onConnect?: (wallet: Wallet) => void;
  setWalletAsActive?: boolean;
};
```

### Returns

```ts
let returnType: {
  readonly connect: (
    walletOrFn: Wallet | (() => Promise<Wallet>),
  ) => Promise<null | Wallet>;
  error: null | Error;
  isConnecting: boolean;
};
```

A function that lets you connect a wallet.
---

###### Connect SDK

## useConnectedWallets

A hook that returns all connected wallets

### Example

```jsx
import { useConnectedWallets } from "thirdweb/react";
 
const wallets = useConnectedWallets();
```

```ts
function useConnectedWallets(): Array<Wallet>;
```

### Returns

```ts
let returnType: Array<Wallet>;
```

An array of all connected wallets
---

###### Connect SDK

## useConnectModal

hook that allows you to open the Connect UI in a Modal to prompt the user to connect wallet.

### Example

```tsx
import { createThirdwebClient } from "thirdweb";
import { useConnectModal } from "thirdweb/react";
 
const client = createThirdwebClient({
  clientId: "<your_client_id>",
});
 
function Example() {
  const { connect, isConnecting } = useConnectModal();
 
  async function handleConnect() {
    const wallet = await connect({ client }); // opens the connect modal
    console.log("connected to", wallet);
  }
 
  return <button onClick={handleConnect}> Connect </button>;
}
```

The returned `connect` method takes an object of type [UseConnectModalOptions](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps)as an argument to customize the Connect Modal UI. Refer to [UseConnectModalOptions](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available options.

```ts
function useConnectModal(): {
  connect: (props: UseConnectModalOptions) => Promise<Wallet>;
  isConnecting: boolean;
};
```

### Returns

```ts
let returnType: {
  connect: (props: UseConnectModalOptions) => Promise<Wallet>;
  isConnecting: boolean;
};
```
---

###### Connect SDK

## useDisconnect

Disconnect from given account

### Example

```jsx
import { useDisconnect, useActiveWallet } from "thirdweb/react";
 
function Example() {
  const { disconnect } = useDisconnect();
  const wallet = useActiveWallet();
 
  return (
    <button onClick={() => disconnect(wallet)}>Disconnect</button>
  );
}
```

```ts
function useDisconnect(): { disconnect: (wallet: Wallet) => void };
```

### Returns

```ts
let returnType: { disconnect: (wallet: Wallet) => void };
```

An object with a function to disconnect an account
---

###### Connect SDK

## useIsAutoConnecting

A hook to check if the auto connect is in progress.

### Example

```jsx
function Example() {
  const isAutoConnecting = useIsAutoConnecting();
 
  return <div> ... </div>;
}
```

```ts
function useIsAutoConnecting(): boolean;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the auto connect is in progress.
---

###### Connect SDK

## useSetActiveWallet

A hook that lets you set the active wallet.

### Example

```jsx
import { useSetActiveWallet } from "thirdweb/react";
 
const setActiveWallet = useSetActiveWallet();
 
// later in your code
await setActiveWallet(wallet);
```

```ts
function useSetActiveWallet(): (
  activeWallet: Wallet,
) => Promise<void>;
```

### Returns

```ts
let returnType: (activeWallet: Wallet) => Promise<void>;
```

A function that lets you set the active wallet.
---

###### Connect SDK

## useSwitchActiveWalletChain

Switch to blockchain with given chain id in the active wallet.

### Example

```jsx
import { useSwitchActiveWalletChain } from "thirdweb/react";
import { sepolia } from "thirdweb/chains";
 
const switchChain = useSwitchActiveWalletChain();
 
// later in your code
<button onClick={() => switchChain(sepolia)}>Switch Chain</button>;
```

```ts
function useSwitchActiveWalletChain(): (
  chain: Readonly,
) => Promise<void>;
```

### Returns

```ts
let returnType: (chain: Readonly) => Promise<void>;
```

A function to switch to blockchain with given chain id in the active wallet.
---
# Chain
---

###### Connect SDK

## useChainMetadata

Retrieves metadata for a chain such as name, icon, available faucets, block explorers, etc.

### Example

```javascript
import { useChainMetadata } from "thirdweb/react";
 
const { data: chainMetadata } = useChainMetadata(
  defineChain(11155111),
);
 
console.log("Name:", chainMetadata.name); // Sepolia
console.log("Faucets:", chainMetadata.faucets); // ["https://thirdweb.com/sepolia/faucet"]
console.log("Explorers:", chainMetadata.explorers); // ["https://sepolia.etherscan.io/"]
```

```ts
function useChainMetadata(
  chain?: Readonly<ChainOptions & { rpc: string }>,
): UseQueryResult<ChainMetadata>;
```

### Parameters

Chain to retrieve metadata for, see [defineChain](https://portal.thirdweb.com/references/typescript/v5/defineChain) for how to create a chain from a chain ID.

#### Type

```ts
let chain: Readonly<ChainOptions & { rpc: string }>;
```

### Returns

```ts
let returnType: UseQueryResult<ChainMetadata>;
```

A React Query result containing the chain metadata
---
# Contract
---

###### Connect SDK

## useContractEvents

Watches contract events and returns the parsed logs.

### Example

#### Using event extensions

The `thirdweb/extesions` export contains event definitions for many popular contracts. You can use these event definitions to watch for specific events with a type-safe API.

```jsx
import { useContractEvents } from "thirdweb/react";
import { tokensClaimedEvent } from "thirdweb/extensions/erc721";
 
const account = useActiveAccount();
const contractEvents = useContractEvents({
  contract,
  events: [tokensClaimedEvent({ claimer: account?.address })],
});
```

#### Using custom events

You can also watch for custom events by passing an array of [prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent).

```jsx
import { useContractEvents } from "thirdweb/react";
import { prepareEvent } from "thirdweb";
 
const myEvent = prepareEvent({
  signature: "event MyEvent(uint256 myArg)",
});
 
const contractEvents = useContractEvents({
  contract,
  events: [myEvent],
});
```

```ts
function useContractEvents(
  options: UseContractEventsOptions<abi, abiEvents>,
): UseQueryResult<ParseEventLogsResult<abiEvents, true>, Error>;
```

### Parameters

The options for watching contract events.

#### Type

```ts
let options: UseContractEventsOptions<abi, abiEvents>;
```

### Returns

```ts
let returnType: UseQueryResult<
  ParseEventLogsResult<abiEvents, true>,
  Error
>;
```

The contract events of the watched contract events.
---

###### Connect SDK

## useReadContract

### Signature#1

A hook to read state from a contract that automatically updates when the contract changes.

You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract.

#### Example

```jsx
import { getContract } from "thirdweb";
import { sepolia } from "thirdweb/chains";
import { useReadContract } from "thirdweb/react";
 
const contract = getContract({
  client,
  address: "0x...",
  chain: sepolia,
});
 
const { data, isLoading } = useReadContract({
  contract,
  method: "function tokenURI(uint256 tokenId) returns (string)"
  params: [1n],
});
```

```ts
function useReadContract(
  options: WithPickedOnceQueryOptions<
    ReadContractOptions<TAbi, TMethod>
  >,
): UseQueryResult<
  ReadContractResult<
    ParseMethod<ParseMethod<TAbi, TMethod>>["outputs"]
  >
>;
```

#### Parameters

The options for reading from a contract

##### Type

```ts
let options: WithPickedOnceQueryOptions<
  ReadContractOptions<TAbi, TMethod>
>;
```

#### Returns

```ts
let returnType: UseQueryResult<
  ReadContractResult<
    ParseMethod<ParseMethod<TAbi, TMethod>>["outputs"]
  >
>;
```

a UseQueryResult object.

### Signature#2

A hook to read state from a contract that automatically updates when the contract changes. You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract.

#### Example

Read a contract extension let you do complex contract queries with less code.

```jsx
import { useReadContract } from "thirdweb/react";
import { getOwnedNFTs } form "thirdweb/extensions/erc721";
 
const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });
```

```ts
function useReadContract(
  extension: Extension<TAbi, TParams, TResult>,
  options: WithPickedOnceQueryOptions<
    BaseTransactionOptions<TParams, TAbi>
  >,
): UseQueryResult<TResult>;
```

#### Parameters

An extension to call.

##### Type

```ts
let extension: Extension<TAbi, TParams, TResult>;
```

The read extension params.

##### Type

```ts
let options: WithPickedOnceQueryOptions<
  BaseTransactionOptions<TParams, TAbi>
>;
```

#### Returns

```ts
let returnType: UseQueryResult<TResult>;
```

a UseQueryResult object.
---
# Transactions
---

###### Connect SDK

## useEstimateGas

A hook to estimate the gas for a given transaction.

### Example

```jsx
import { useEstimateGas } from "thirdweb/react";
const { mutate: estimateGas, data: gasEstimate } = useEstimateGas();
 
// later
const estimatedGas = await estimateGas(tx);
```

```ts
function useEstimateGas(): UseMutationResult<
  bigint,
  Error,
  PreparedTransaction
>;
```

### Returns

```ts
let returnType: UseMutationResult<bigint, Error, PreparedTransaction>;
```

A mutation object to estimate gas.
---

###### Connect SDK

## useEstimateGasCost

A hook to estimate the gas cost in ether and wei for a given transaction.

### Example

```jsx
import { useEstimateGasCost } from "thirdweb/react";
const { mutate: estimateGasCost, data: gasEstimate } =
  useEstimateGas();
 
// later
const estimatedGas = await estimateGasCost(tx);
console.log("gas cost in ether", estimatedGas.ether);
```

```ts
function useEstimateGasCost(): UseMutationResult<
  EstimateGasCostResult,
  Error,
  PreparedTransaction
>;
```

### Returns

```ts
let returnType: UseMutationResult<
  EstimateGasCostResult,
  Error,
  PreparedTransaction
>;
```

A mutation object to estimate gas cost.
---

###### Connect SDK

## useSendAndConfirmTransaction

A hook to send a transaction.

### Example

```jsx
import { useSendAndConfirmTransaction } from "thirdweb/react";
const { mutate: sendAndConfirmTx, data: transactionReceipt } =
  useSendAndConfirmTransaction();
 
// later
sendAndConfirmTx(tx);
```

#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)

```tsx
import { useSendAndConfirmTransaction } from "thirdweb/react";
const mutation = useSendAndConfirmTransaction({
  gasless: {
    provider: "engine",
    relayerUrl:
      "https://thirdweb.engine-***.thirdweb.com/relayer/***",
    relayerForwarderAddress: "0x...",
  },
});
```

#### Gasless usage with OpenZeppelin

```tsx
import { useSendAndConfirmTransaction } from "thirdweb/react";
const mutation = useSendAndConfirmTransaction({
  gasless: {
    provider: "openzeppelin",
    relayerUrl: "https://...",
    relayerForwarderAddress: "0x...",
  },
});
```

```ts
function useSendAndConfirmTransaction(
  config: SendAndConfirmTransactionConfig,
): UseMutationResult<TransactionReceipt, Error, PreparedTransaction>;
```

### Parameters

#### Type

```ts
let config: SendAndConfirmTransactionConfig;
```

### Returns

```ts
let returnType: UseMutationResult<
  TransactionReceipt,
  Error,
  PreparedTransaction
>;
```

A mutation object to send a transaction.
---

###### Connect SDK

## useSendBatchTransaction

A hook to send a transaction.

### Example

```jsx
import { useSendBatchTransaction } from "thirdweb/react";
const { mutate: sendBatch, data: transactionResult } =
  useSendBatchTransaction();
 
// later
sendBatch([tx1, tx2]);
```

```ts
function useSendBatchTransaction(): UseMutationResult<
  {
    chain: Readonly;
    client: ThirdwebClient;
    maxBlocksWaitTime?: number;
    readonly transactionHash: `0x${string}`;
  },
  Error,
  Array<PreparedTransaction>
>;
```

### Returns

```ts
let returnType: UseMutationResult<
  {
    chain: Readonly;
    client: ThirdwebClient;
    maxBlocksWaitTime?: number;
    readonly transactionHash: `0x${string}`;
  },
  Error,
  Array<PreparedTransaction>
>;
```

A mutation object to send a transaction.
---

###### Connect SDK

## useSendTransaction

A hook to send a transaction with from the user's connected wallet.

You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/react/v5/extensions).

### Example

#### Sending a prepared contract call

```tsx
import { useSendTransaction } from "thirdweb/react";
import { getContract, prepareContractCall } from "thirdweb";
import { sepolia } from "thirdweb/chains";
 
const contract = getContract({
  address: "0x...",
  chain: sepolia,
  client,
});
 
const { mutate: sendTx, data: transactionResult } =
  useSendTransaction();
 
const onClick = () => {
  const transaction = prepareContractCall({
    contract,
    method: "function transfer(address to, uint256 value)",
    params: [to, value],
  });
  sendTx(transaction);
};
```

#### Using a write extension

```tsx
import { useSendTransaction } from "thirdweb/react";
import { mintTo } from "thirdweb/extensions/erc721";
 
const { mutate: sendTx, data: transactionResult } =
  useSendTransaction();
 
const onClick = () => {
  const transaction = mintTo({
    contract,
    to: "0x...",
    nft: {
      name: "NFT Name",
      description: "NFT Description",
      image: "https://example.com/image.png",
    },
  });
  sendTx(transaction);
};
```

#### Sending a prepared transaction

```tsx
import { useSendTransaction } from "thirdweb/react";
import { prepareTransaction } from "thirdweb";
import { sepolia } from "thirdweb/chains";
 
const { mutate: sendTx, data: transactionResult } =
  useSendTransaction();
 
const onClick = () => {
  // Send 0.1 SepoliaETH to an address
  const transaction = prepareTransaction({
    to: "0x...",
    value: toWei("0.1"),
    chain: sepolia,
    client: thirdwebClient,
    // Specify a token required for the transaction
    erc20Value: {
      amountWei: toWei("0.1"),
      tokenAddress: "0x...",
    },
  });
  sendTx(transaction);
};
```

```ts
function useSendTransaction(
  config: SendTransactionConfig,
): UseMutationResult<
  {
    chain: Readonly;
    client: ThirdwebClient;
    maxBlocksWaitTime?: number;
    readonly transactionHash: `0x${string}`;
  },
  Error,
  PreparedTransaction
>;
```

### Parameters

Configuration for the `useSendTransaction` hook. Refer to [SendTransactionConfig](https://portal.thirdweb.com/references/typescript/v5/SendTransactionConfig) for more details.

#### Type

```ts
let config: {
  gasless?: GaslessOptions;
  payModal?: SendTransactionPayModalConfig;
};
```

### Returns

```ts
let returnType: UseMutationResult<
  {
    chain: Readonly;
    client: ThirdwebClient;
    maxBlocksWaitTime?: number;
    readonly transactionHash: `0x${string}`;
  },
  Error,
  PreparedTransaction
>;
```

A UseMutationResult object to send a transaction.
---

###### Connect SDK

## useSimulateTransaction

A hook to simulate a transaction.

### Example

```jsx
import { useSimulateTransaction } from "thirdweb/react";
const { mutate: simulateTx } = useSimulateTransaction();
 
// later
const result = await simulateTx(tx);
```

```ts
function useSimulateTransaction(): UseMutationResult<
  any,
  Error,
  SimulateOptions<abi, abiFn>
>;
```

### Returns

```ts
let returnType: UseMutationResult<
  any,
  Error,
  SimulateOptions<abi, abiFn>
>;
```

A mutation object to simulate a transaction.
---

###### Connect SDK

## useWaitForReceipt

A hook to wait for a transaction receipt.

### Example

```jsx
import { useWaitForReceipt } from "thirdweb/react";
const { data: receipt, isLoading } = useWaitForReceipt({
  client,
  chain,
  transactionHash,
});
```

```ts
function useWaitForReceipt(
  options:
    | undefined
    | ({
        chain: Readonly;
        client: ThirdwebClient;
        maxBlocksWaitTime?: number;
        readonly transactionHash: `0x${string}`;
      } & { queryOptions?: { enabled?: boolean } }),
): UseQueryResult<TransactionReceipt>;
```

### Parameters

The options for waiting for a transaction receipt.

#### Type

```ts
let options:
  | undefined
  | ({
      chain: Readonly;
      client: ThirdwebClient;
      maxBlocksWaitTime?: number;
      readonly transactionHash: `0x${string}`;
    } & { queryOptions?: { enabled?: boolean } });
```

### Returns

```ts
let returnType: UseQueryResult<TransactionReceipt>;
```

a query object.
---
# Social API
---

###### Connect SDK

## useSocialProfiles

Fetches the wallet's available social profiles.

### Example

```tsx
import { useSocialProfiles } from "thirdweb/react";
const { data: profiles } = useSocialProfiles({
  client,
  address: "0x...",
});
```

```ts
function useSocialProfiles(options: {
  address: undefined | string;
  client: ThirdwebClient;
}): UseQueryResult<Array<SocialProfile>, Error>;
```

### Parameters

The options to use when fetching the social profiles.

#### Type

```ts
let options: { address: undefined | string; client: ThirdwebClient };
```

### Returns

```ts
let returnType: UseQueryResult<Array<SocialProfile>, Error>;
```

A React Query result containing the social profiles.
---
# Utils
---

###### Connect SDK

## useBlockNumber

Hook that watches for changes in the block number on a given chain.

### Example

```ts
import { useBlockNumber } from "thirdweb/react";
const blockNumber = useBlockNumber({ client, chain });
```

```ts
function useBlockNumber(
  options: UseBlockNumberOptions,
): undefined | bigint;
```

### Parameters

The options for the hook.

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
  enabled?: boolean;
  watch?: boolean;
};
```

### Returns

```ts
let returnType: undefined | bigint;
```

The latest block number.
---
# Miscellaneous
---

###### Connect SDK

## useBridgeRoutes

Hook that fetches available bridge routes with caching and retry logic

### Example

```tsx
const {
  data: routes,
  isLoading,
  error,
} = useBridgeRoutes({
  client: thirdwebClient,
  originChainId: 1,
  destinationChainId: 137,
  originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
});
```

```ts
function useBridgeRoutes(
  params: UseBridgeRoutesParams,
): UseQueryResult<Result, Error>;
```

### Parameters

Parameters for fetching routes including client and filter options

#### Type

```ts
let params: RoutesTypes.Options & { enabled?: boolean };
```

### Returns

```ts
let returnType: UseQueryResult<Result, Error>;
```

React Query result with routes data, loading state, and error handling
---

###### Connect SDK

## useBuyHistory

Hook to get the history of Buy transactions for a given wallet - This includes both "buy with crypto" and "buy with fiat" transactions.

This hook is a React Query wrapper of the [getBuyHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyHistory) function. You can also use that function directly

### Example

```tsx
import { useBuyHistory } from "thirdweb/react";
 
function Component() {
  const buyHistoryQuery = useBuyHistory(params);
  return <div> ... </div>;
}
```

```ts
function useBuyHistory(
  params?: BuyHistoryParams,
  queryParams?: BuyHistoryQueryOptions,
): UseQueryResult<BuyHistoryData>;
```

### Parameters

object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  count: number;
  start: number;
  walletAddress: string;
};
```

options to configure the react query

#### Type

```ts
let queryParams: BuyHistoryQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<BuyHistoryData>;
```

A React Query object which contains the data of type [BuyHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryData)
---

###### Connect SDK

## useBuyWithCryptoHistory

Deprecated

Hook to get the "Buy with crypto" transaction history for a given wallet address.

This hook is a React Query wrapper of the [getBuyWithCryptoHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoHistory) function. You can also use that function directly

### Example

```tsx
import { useBuyWithCryptoHistory } from "thirdweb/react";
 
function Component() {
  const buyWithCryptoHistory = useBuyWithCryptoHistory(params);
  return <div> ... </div>;
}
```

```ts
function useBuyWithCryptoHistory(
  params?: BuyWithCryptoHistoryParams,
  queryParams?: BuyWithCryptoHistoryQueryOptions,
): UseQueryResult<BuyWithCryptoHistoryData>;
```

### Parameters

object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  count: number;
  start: number;
  walletAddress: string;
};
```

options to configure the react query

#### Type

```ts
let queryParams: BuyWithCryptoHistoryQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithCryptoHistoryData>;
```

A React Query object which contains the data of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData)
---

###### Connect SDK

## useBuyWithCryptoQuote

Deprecated

Hook to get a price quote for performing a "Buy with crypto" transaction that allows users to buy a token with another token - aka a swap.

The price quote is an object of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote). This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc.

This hook is a React Query wrapper of the [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote) function. You can also use that function directly

Once you have the quote, you can use the [useSendTransaction](https://portal.thirdweb.com/references/typescript/v5/useSendTransaction) function to send the purchase and [useBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoStatus) function to get the status of the swap transaction.

### Example

```tsx
import {
  useBuyWithCryptoQuote,
  useBuyWithCryptoStatus,
  type BuyWithCryptoStatusQueryParams,
  useActiveAccount,
} from "thirdweb/react";
import { sendTransaction } from "thirdweb";
 
function Component() {
  const buyWithCryptoQuoteQuery = useBuyWithCryptoQuote(swapParams);
  const [buyTxHash, setBuyTxHash] = useState<
    BuyWithCryptoStatusQueryParams | undefined
  >();
  const buyWithCryptoStatusQuery = useBuyWithCryptoStatus(
    buyTxHash
      ? {
          client,
          transactionHash: buyTxHash,
        }
      : undefined,
  );
 
  async function handleBuyWithCrypto() {
    const account = useActiveAccount();
 
    // if approval is required
    if (buyWithCryptoQuoteQuery.data.approval) {
      const approveTx = await sendTransaction({
        transaction: swapQuote.data.approval,
        account: account,
      });
      await waitForApproval(approveTx);
    }
 
    // send the transaction to buy crypto
    // this promise is resolved when user confirms the transaction in the wallet and the transaction is sent to the blockchain
    const buyTx = await sendTransaction({
      transaction: swapQuote.data.transactionRequest,
      account: account,
    });
    await waitForApproval(buyTx);
 
    // set buyTx.transactionHash to poll the status of the swap transaction
    setBuyWithCryptoTx(buyTx.transactionHash);
  }
 
  return <button onClick={handleBuyWithCrypto}>Swap</button>;
}
```

```ts
function useBuyWithCryptoQuote(
  params?: GetBuyWithCryptoQuoteParams,
  queryParams?: BuyWithCryptoQuoteQueryOptions,
): UseQueryResult<BuyWithCryptoQuote>;
```

### Parameters

object of type [BuyWithCryptoQuoteQueryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuoteQueryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  fromAddress: string;
  fromChainId: number;
  fromTokenAddress: string;
  intentId?: string;
  maxSlippageBPS?: number;
  paymentLinkId?: string;
  purchaseData?: PurchaseData;
  toAddress: string;
  toChainId: number;
  toTokenAddress: string;
} & (
  | { fromAmount: string; toAmount?: never }
  | { fromAmount?: never; toAmount: string }
);
```

options to configure the react query

#### Type

```ts
let queryParams: BuyWithCryptoQuoteQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithCryptoQuote>;
```

A React Query object which contains the data of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote)
---

###### Connect SDK

## useBuyWithCryptoStatus

Deprecated

A hook to get a status of a "Buy with crypto" transaction to determine if the transaction is completed, failed or pending.

This hook is a React Query wrapper of the [getBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus) function. You can also use that function directly.

### Example

```tsx
import {
  useSendTransaction,
  useBuyWithCryptoQuote,
  useBuyWithCryptoStatus,
  type BuyWithCryptoStatusQueryParams,
  useActiveAccount,
} from "thirdweb/react";
import { sendTransaction } from "thirdweb";
 
function Component() {
  const buyWithCryptoQuoteQuery = useBuyWithCryptoQuote(swapParams);
  const [buyTxHash, setBuyTxHash] = useState<
    BuyWithCryptoStatusQueryParams | undefined
  >();
  const buyWithCryptoStatusQuery = useBuyWithCryptoStatus(
    buyTxHash
      ? {
          client,
          transactionHash: buyTxHash,
        }
      : undefined,
  );
  const account = useActiveAccount();
 
  async function handleBuyWithCrypto() {
    // if approval is required
    if (buyWithCryptoQuoteQuery.data.approval) {
      const approveTx = await sendTransaction({
        account: account,
        transaction: swapQuote.data.approval,
      });
      await waitForApproval(approveTx);
    }
 
    // send the transaction to buy crypto
    // this promise is resolved when user confirms the transaction in the wallet and the transaction is sent to the blockchain
    const buyTx = await sendTransactionMutation.mutateAsync({
      transaction: swapQuote.data.transactionRequest,
      account: account,
    });
    await waitForApproval(buyTx);
 
    // set buyTx.transactionHash to poll the status of the swap transaction
    setBuyWithCryptoTx(buyTx.transactionHash);
  }
 
  return <button onClick={handleBuyWithCrypto}>Swap</button>;
}
```

```ts
function useBuyWithCryptoStatus(
  params?: BuyWithCryptoTransaction,
): UseQueryResult<BuyWithCryptoStatus, Error>;
```

### Parameters

object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction)

#### Type

```ts
let params: {
  chainId: number;
  client: ThirdwebClient;
  transactionHash: string;
};
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithCryptoStatus, Error>;
```

A react query object which contains the data of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus)
---

###### Connect SDK

## useBuyWithFiatHistory

Deprecated

Hook to get the "Buy with Fiat" transaction history for a given wallet address.

This hook is a React Query wrapper of the [getBuyWithFiatHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatHistory) function. You can also use that function directly

### Example

```tsx
import { useBuyWithFiatHistory } from "thirdweb/react";
 
function Component() {
  const historyQuery = useBuyWithFiatHistory(params);
  return <div> ... </div>;
}
```

```ts
function useBuyWithFiatHistory(
  params?: BuyWithFiatHistoryParams,
  queryParams?: BuyWithFiatHistoryQueryOptions,
): UseQueryResult<BuyWithFiatHistoryData>;
```

### Parameters

object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  count: number;
  start: number;
  walletAddress: string;
};
```

options to configure the react query

#### Type

```ts
let queryParams: BuyWithFiatHistoryQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithFiatHistoryData>;
```

A React Query object which contains the data of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData)
---

###### Connect SDK

## useBuyWithFiatQuote

Deprecated

Hook to get a price quote for performing a "Buy with Fiat" transaction that allows users to buy a token with fiat currency.

The price quote is an object of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote). This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc.

This hook is a React Query wrapper of the [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function. You can also use that function directly

Once you have the `quote`, you can open a new window with `quote.onRampLink` to allow the user to buy the token with fiat currency. and [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus) function to start polling for the status of this transaction.

### Example

```ts
import { NATIVE_TOKEN_ADDRESS } from "thirdweb";
import { base } from "thirdweb/chains";
import { useBuyWithFiatQuote } from "thirdweb/react";
 
// get a quote for buying 0.01 base native token with USD fiat currency
function Example() {
  const quote = useBuyWithFiatQuote({
    client: client, // thirdweb client
    fromCurrencySymbol: "USD", // fiat currency symbol
    toChainId: base.id, // base chain id
    toAmount: "0.01", // amount of token to buy
    toTokenAddress: NATIVE_TOKEN_ADDRESS, // native token
    toAddress: "0x...", // user's wallet address
  });
 
  return (
    <div>
      {quote.data && (
        <a href={quote.data.onRampLink} target="_blank">
          open onramp provider
        </a>
      )}
    </div>
  );
}
```

```ts
function useBuyWithFiatQuote(
  params?: GetBuyWithFiatQuoteParams,
  queryOptions?: BuyWithFiatQuoteQueryOptions,
): UseQueryResult<BuyWithFiatQuote>;
```

### Parameters

object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  fromAddress: string;
  fromAmount?: string;
  fromCurrencySymbol: CurrencyMeta["shorthand"];
  isTestMode?: boolean;
  maxSlippageBPS?: number;
  onrampChainId?: number;
  onrampTokenAddress?: string;
  paymentLinkId?: string;
  preferredProvider?: FiatProvider;
  purchaseData?: PurchaseData;
  toAddress: string;
  toAmount?: string;
  toChainId: number;
  toGasAmountWei?: string;
  toTokenAddress: string;
};
```

#### Type

```ts
let queryOptions: BuyWithFiatQuoteQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithFiatQuote>;
```

A React Query object which contains the data of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote)
---

###### Connect SDK

## useBuyWithFiatStatus

Deprecated

A hook to get a status of a "Buy with Fiat" transaction to determine if the transaction is completed, failed or pending.

This hook is a React Query wrapper of the [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus) function. You can also use that function directly.

`useBuyWithFiatStatus` refetches the status using `getBuyWithFiatStatus` every 5 seconds.

### Example

```tsx
import { useBuyWithFiatStatus } from "thirdweb/react";
import { client } from "./client";
 
function Example() {
  const fiatStatus = useBuyWithFiatStatus({
    client: client, // thirdweb client
    intentId: "....", // get the intentId from quote ( quote.intentId )
  });
 
  console.log(fiatStatus.data);
 
  return <div>...</div>;
}
```

```ts
function useBuyWithFiatStatus(
  params?: WithPickedOnceQueryOptions<GetBuyWithFiatStatusParams>,
): UseQueryResult<BuyWithFiatStatus>;
```

### Parameters

object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction)

#### Type

```ts
let params: WithPickedOnceQueryOptions<GetBuyWithFiatStatusParams>;
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithFiatStatus>;
```

A react query object which contains the data of type [BuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus)
---

###### Connect SDK

## usePostOnRampQuote

When buying a token with fiat currency - It only involes doing on-ramp if the on-ramp provider supports buying the given destination token directly.

If the on-ramp provider does not support buying the destination token directly, user can be sent an intermediate token with fiat currency from the on-ramp provider which can be swapped to destination token onchain.

`usePostOnRampQuote` hook is used to get the quote for swapping the on-ramp token to destination token.

When you get a "Buy with Fiat" status of type `"CRYPTO_SWAP_REQUIRED"` from the [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus) hook, you can use `usePostOnRampQuote` hook to get the quote of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) for swapping the on-ramp token to destination token to complete the step-2 of the process.

Once you have the quote, you can start the Swap process by following the same steps as mentioned in the [useBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoQuote) documentation.

```ts
function usePostOnRampQuote(
  params?: GetPostOnRampQuoteParams,
  queryOptions?: PostOnRampQuoteQueryOptions,
): UseQueryResult<BuyWithCryptoQuote>;
```

### Parameters

object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams)

#### Type

```ts
let params: {
  buyWithFiatStatus: BuyWithFiatStatus;
  client: ThirdwebClient;
  paymentLinkId?: string;
};
```

#### Type

```ts
let queryOptions: PostOnRampQuoteQueryOptions;
```

### Returns

```ts
let returnType: UseQueryResult<BuyWithCryptoQuote>;
```

Object of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) which contains the information about the quote such as processing fees, estimated time, converted token amounts, etc.
---
**Core Functions**
---
# Extensions
---
## EIP1193
---

###### Connect SDK

## EIP1193.fromProvider

Creates a Thirdweb wallet from an EIP-1193 compatible provider.

This adapter allows you to use any EIP-1193 provider (like MetaMask, WalletConnect, etc.) as a Thirdweb wallet. It handles all the necessary conversions between the EIP-1193 interface and Thirdweb's wallet interface.

### Example

```ts
import { EIP1193 } from "thirdweb/wallets";
 
// Create a Thirdweb wallet from MetaMask's provider
const wallet = EIP1193.fromProvider({
  provider: window.ethereum,
  walletId: "io.metamask",
});
 
// Use like any other Thirdweb wallet
const account = await wallet.connect({
  client: createThirdwebClient({ clientId: "..." }),
});
 
// Sign messages
await account.signMessage({ message: "Hello World" });
 
// Send transactions
await account.sendTransaction({
  to: "0x...",
  value: 1000000000000000000n,
});
```

```ts
function fromProvider(options: FromEip1193AdapterOptions): Wallet;
```

### Parameters

Configuration options for creating the wallet adapter

#### Type

```ts
let options: {
  provider:
    | EIP1193Provider
    | ((params?: { chainId?: number }) => Promise<EIP1193Provider>);
  walletId?: WalletId;
};
```

### Returns

```ts
let returnType: {
  getAdminAccount?: () => Account | undefined;
  getAuthToken?: () => string | null;
  getConfig: () => CreateWalletArgs<TWalletId>[1];
  id: TWalletId;
  onConnectRequested?: () => Promise<void>;
  subscribe: WalletEmitter<TWalletId>["subscribe"];
  autoConnect: (
    options: WalletAutoConnectionOption<TWalletId>,
  ) => Promise<Account>;
  connect: (
    options: WalletConnectionOption<TWalletId>,
  ) => Promise<Account>;
  disconnect: () => Promise<void>;
  getAccount: () => undefined | Account;
  getChain: () =>
    | undefined
    | Readonly<ChainOptions & { rpc: string }>;
  switchChain: (chain: Readonly) => Promise<void>;
};
```

A Thirdweb wallet instance that wraps the EIP-1193 provider
---

###### Connect SDK

## EIP1193.toProvider

Converts a Thirdweb wallet into an EIP-1193 compatible provider.

This adapter allows you to use a Thirdweb wallet with any library or dApp that expects an EIP-1193 provider. The provider implements the standard EIP-1193 interface including request handling and event subscription.

### Example

```ts
import { EIP1193 } from "thirdweb/wallets";
 
// Create an EIP-1193 provider from a Thirdweb wallet
const provider = EIP1193.toProvider({
  wallet,
  chain: ethereum,
  client: createThirdwebClient({ clientId: "..." }),
});
 
// Use with any EIP-1193 compatible library
const accounts = await provider.request({
  method: "eth_requestAccounts",
});
 
// Listen for events
provider.on("accountsChanged", (accounts) => {
  console.log("Active accounts:", accounts);
});
```

```ts
function toProvider(
  options: ToEip1193ProviderOptions,
): EIP1193Provider;
```

### Parameters

Configuration options for creating the provider

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
  connectOverride?: (wallet: Wallet) => Promise<Account>;
  wallet: Wallet;
};
```

### Returns

```ts
let returnType: {
  request: (params: any) => Promise<any>;
  on: (event: any, listener: (params: any) => any) => void;
  removeListener: (
    event: any,
    listener: (params: any) => any,
  ) => void;
};
```

An EIP-1193 compatible provider that wraps the Thirdweb wallet
---
## DEPLOY
---

###### Connect SDK

## DEPLOY.prepareDirectDeployTransaction

Prepares a direct deploy transaction with ABI.

### Example

```ts
import { prepareDirectDeployTransaction } from "thirdweb/deploys";
import { ethereum } from "thirdweb/chains";
const tx = prepareDirectDeployTransaction({
  client,
  chain: ethereum,
  bytecode: "0x...",
  constructorAbi: {
    inputs: [{ type: "uint256", name: "value" }],
    type: "constructor",
  },
  constructorParams: [123],
});
```

```ts
function prepareDirectDeployTransaction(options: {
  abi: Abi;
  bytecode: `0x${string}`;
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  extraDataWithUri?: string;
}): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for preparing the transaction.

#### Type

```ts
let options: {
  abi: Abi;
  bytecode: `0x${string}`;
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  extraDataWithUri?: string;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

* The prepared transaction.
---

###### Connect SDK

## DEPLOY.computePublishedContractAddress

Predicts the implementation address of any published contract

### Example

```ts
import { computePublishedContractAddress } from "thirdweb/deploys";
 
const address = await computePublishedContractAddress({
  client,
  chain,
  contractId: "AccountFactory",
  constructorParams,
});
```

```ts
function computePublishedContractAddress(args: {
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  contractId: string;
  publisher?: string;
  salt?: string;
  version?: string;
}): Promise<string>;
```

### Parameters

The arguments for predicting the address of a published contract.

#### Type

```ts
let args: {
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  contractId: string;
  publisher?: string;
  salt?: string;
  version?: string;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

A promise that resolves to the predicted address of the contract.
---

###### Connect SDK

## DEPLOY.deployContract

Deploy a contract on a given chain

### Example

### Deploying a regular contract from ABI and bytecode

```ts
import { deployContract } from "thirdweb/deploys";
 
const address = await deployContract({
  client,
  chain,
  bytecode: "0x...",
  abi: contractAbi,
  constructorParams: {
    param1: "value1",
    param2: 123,
  },
  salt, // optional: salt enables deterministic deploys
});
```

### Deploying a contract deterministically

```ts
import { deployContract } from "thirdweb/deploys";
 
const address = await deployContract({
  client,
  chain,
  bytecode: "0x...",
  abi: contractAbi,
  constructorParams: {
    param1: "value1",
    param2: 123,
  },
  salt, // passing a salt will enable deterministic deploys
});
```

```ts
function deployContract(
  options: {
    abi: Abi;
    bytecode: `0x${string}`;
    chain: Readonly;
    client: ThirdwebClient;
    constructorParams?: Record<string, unknown>;
    extraDataWithUri?: string;
  } & {
    account: Account;
    extraDataWithUri?: `0x${string}`;
    isStylus?: boolean;
    salt?: string;
  },
): Promise<string>;
```

### Parameters

the deploy options

#### Type

```ts
let options: {
  abi: Abi;
  bytecode: `0x${string}`;
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  extraDataWithUri?: string;
} & {
  account: Account;
  extraDataWithUri?: `0x${string}`;
  isStylus?: boolean;
  salt?: string;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

* a promise that resolves to the deployed contract address
---

###### Connect SDK

## DEPLOY.deployERC1155Contract

Deploys an thirdweb ERC1155 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well.

### Example

```ts
import { deployERC1155Contract } from "thirdweb/deploys";
const contractAddress = await deployERC1155Contract({
 chain,
 client,
 account,
 type: "DropERC1155",
 params: {
   name: "MyEdition",
   description: "My edition contract",
   symbol: "ME",
});
```

```ts
function deployERC1155Contract(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: ERC1155ContractParams;
  type: ERC1155ContractType;
}): Promise<string>;
```

### Parameters

The deployment options.

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: ERC1155ContractParams;
  type: ERC1155ContractType;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The deployed contract address.
---

###### Connect SDK

## DEPLOY.deployERC20Contract

Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well.

### Example

```ts
import { deployERC20Contract } from "thirdweb/deploys";
const contractAddress = await deployERC20Contract({
 chain,
 client,
 account,
 type: "TokenERC20",
 params: {
   name: "MyToken",
   description: "My Token contract",
   symbol: "MT",
});
```

```ts
function deployERC20Contract(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: ERC20ContractParams;
  publisher?: string;
  type: ERC20ContractType;
}): Promise<string>;
```

### Parameters

The deployment options.

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: ERC20ContractParams;
  publisher?: string;
  type: ERC20ContractType;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The deployed contract address.
---

###### Connect SDK

## DEPLOY.deployERC721Contract

Deploys an thirdweb ERC721 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well.

### Example

```ts
import { deployERC721Contract } from "thirdweb/deploys";
const contractAddress = await deployERC721Contract({
 chain,
 client,
 account,
 type: "DropERC721",
 params: {
   name: "MyNFT",
   description: "My NFT contract",
   symbol: "NFT",
});
```

```ts
function deployERC721Contract(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: ERC721ContractParams;
  type: ERC721ContractType;
}): Promise<string>;
```

### Parameters

The deployment options.

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: ERC721ContractParams;
  type: ERC721ContractType;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The deployed contract address.
---

###### Connect SDK

## DEPLOY.deployPackContract

Deprecated

\[Pack contract is incompatible with Pectra update. Support for this contract is being removed in next release.\]

Deploy a thirdweb Pack contract

### Example

```ts
import { deployPackContract } from "thirdweb/extensions/deploy";
 
const packAddress = await deployPackContract({
  account,
  client,
  chain,
  params: {
    name: "Pack contract name",
    symbol: "PACK1155",
  },
});
```

```ts
function deployPackContract(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: PackContractParams;
}): Promise<string>;
```

### Parameters

params for deploying [Pack contract](https://thirdweb.com/thirdweb.eth/Pack)

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: PackContractParams;
};
```

### Returns

```ts
let returnType: Promise<string>;
```
---

###### Connect SDK

## DEPLOY.deployPublishedContract

Deploy an instance of a published contract on a given chain

### Example

### Deploying a published contract

```ts
import { deployPublishedContract } from "thirdweb/deploys";
 
const address = await deployPublishedContract({
  client,
  chain,
  account,
  contractId: "MyPublishedContract",
  contractParams: {
    param1: "value1",
    param2: 123,
  },
  publisher: "0x...", // optional, defaults to the thirdweb deployer
});
```

### Deploying a published contract deterministically

```ts
import { deployPublishedContract } from "thirdweb/deploys";
 
const address = await deployPublishedContract({
  client,
  chain,
  account,
  contractId: "MyPublishedContract",
  contractParams: {
    param1: "value1",
    param2: 123,
  },
  publisher: "0x...",
  salt: "your-salt", // this will deterministically deploy the contract at the same address on all chains
});
```

```ts
function deployPublishedContract(
  options: DeployPublishedContractOptions,
): Promise<string>;
```

### Parameters

the deploy options

#### Type

```ts
let options: {
  account: Account;
  chain: Chain;
  client: ThirdwebClient;
  contractId: string;
  contractParams?: Record<string, unknown>;
  implementationConstructorParams?: Record<string, unknown>;
  publisher?: string;
  salt?: string;
  version?: string;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

a promise that resolves to the deployed contract address
---

###### Connect SDK

## DEPLOY.deploySplitContract

Deploys a thirdweb [Split contract](https://thirdweb.com/thirdweb.eth/Split)On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well.

### Example

```ts
import { deploySplitContract } from "thirdweb/deploys";
const contractAddress = await deploySplitContract({
  chain,
  client,
  account,
  params: {
    name: "Split contract",
    payees: ["0x...123", "0x...456"],
    shares: [5100, 4900], // See type `SplitContractParams` for more context
  },
});
```

```ts
function deploySplitContract(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: SplitContractParams;
}): Promise<string>;
```

### Parameters

The deployment options.

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: SplitContractParams;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The deployed contract address.
---

###### Connect SDK

## DEPLOY.prepareDeterministicDeployTransaction

Deploy a contract deterministically - will maintain the same address across chains. This is meant to be used with published contracts configured with the 'direct deploy' method. Under the hood, this uses a keyless transaction with a common create2 factory.

### Example

```ts
import { prepareDeterministicDeployTransaction } from "thirdweb/deploys";
import { sepolia } from "thirdweb/chains";
 
const tx = prepareDeterministicDeployTransaction({
  client,
  chain: sepolia,
  contractId: "AccountFactory",
  constructorParams: [123],
});
```

```ts
function prepareDeterministicDeployTransaction(options: {
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  contractId: string;
  publisher?: string;
  salt?: string;
  version?: string;
}): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

the options to deploy the contract

#### Type

```ts
let options: {
  chain: Readonly;
  client: ThirdwebClient;
  constructorParams?: Record<string, unknown>;
  contractId: string;
  publisher?: string;
  salt?: string;
  version?: string;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

* the transaction to deploy the contract
---
## MARKETPLACE
---

###### Connect SDK

## MARKETPLACE.deployMarketplaceContract

Deploys a marketplace contract.

### Example

```ts
import { deployMarketplaceContract } from "thirdweb/deploys";
 
const address = await deployMarketplaceContract({
  client,
  chain,
  account,
  params: {
    name: "MarketplaceV3",
    description: "MarketplaceV3 deployed using thirdweb SDK",
    platformFeeRecipient:
      "0x21d514c90ee4E4e4Cd16Ce9185BF01F0F1eE4A04",
    platformFeeBps: 1000,
  },
});
```

```ts
function deployMarketplaceContract(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: MarketplaceContractParams;
  version?: string;
}): Promise<string>;
```

### Parameters

The options for deploying the marketplace contract.

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  params: MarketplaceContractParams;
  version?: string;
};
```

### Returns

```ts
let returnType: Promise<string>;
```
---

###### Connect SDK

## MARKETPLACE.acceptedOfferEvent

Creates an event object for the AcceptedOffer event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { acceptedOfferEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 acceptedOfferEvent({
 offeror: ...,
 offerId: ...,
 assetContract: ...,
})
],
});
```

```ts
function acceptedOfferEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "offeror";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "offerId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "seller"; readonly type: "address" },
    { readonly name: "quantityBought"; readonly type: "uint256" },
    { readonly name: "totalPricePaid"; readonly type: "uint256" },
  ];
  readonly name: "AcceptedOffer";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "offeror";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "offerId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "seller"; readonly type: "address" },
    { readonly name: "quantityBought"; readonly type: "uint256" },
    { readonly name: "totalPricePaid"; readonly type: "uint256" },
  ];
  readonly name: "AcceptedOffer";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.acceptOffer

Accepts an offer after performing necessary checks and validations. Throws an error if the offer is not active, the offeror's balance is insufficient, or the offeror's allowance is insufficient.

### Example

```ts
import { acceptOffer } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const acceptOfferTx = acceptOffer({
  contract,
  offerId: 1n,
});
 
await sendTransaction({ transaction, account });
```

```ts
function acceptOffer(
  options: BaseTransactionOptions<AcceptOfferParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for accepting the offer.

#### Type

```ts
let options: BaseTransactionOptions<AcceptOfferParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction object that can be sent to accept the offer.
---

###### Connect SDK

## MARKETPLACE.approveBuyerForListing

Prepares a transaction to call the "approveBuyerForListing" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { approveBuyerForListing } from "thirdweb/extensions/marketplace";
 
const transaction = approveBuyerForListing({
 contract,
 listingId: ...,
 buyer: ...,
 toApprove: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function approveBuyerForListing(
  options: BaseTransactionOptions<
    | ApproveBuyerForListingParams
    | { asyncParams: () => Promise<ApproveBuyerForListingParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "approveBuyerForListing" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | ApproveBuyerForListingParams
  | { asyncParams: () => Promise<ApproveBuyerForListingParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MARKETPLACE.approveCurrencyForListing

Prepares a transaction to call the "approveCurrencyForListing" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { approveCurrencyForListing } from "thirdweb/extensions/marketplace";
 
const transaction = approveCurrencyForListing({
 contract,
 listingId: ...,
 currency: ...,
 pricePerTokenInCurrency: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function approveCurrencyForListing(
  options: BaseTransactionOptions<
    | ApproveCurrencyForListingParams
    | { asyncParams: () => Promise<ApproveCurrencyForListingParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "approveCurrencyForListing" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | ApproveCurrencyForListingParams
  | { asyncParams: () => Promise<ApproveCurrencyForListingParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MARKETPLACE.auctionClosedEvent

Creates an event object for the AuctionClosed event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { auctionClosedEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 auctionClosedEvent({
 auctionId: ...,
 assetContract: ...,
 closer: ...,
})
],
});
```

```ts
function auctionClosedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "closer";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "auctionCreator"; readonly type: "address" },
    { readonly name: "winningBidder"; readonly type: "address" },
  ];
  readonly name: "AuctionClosed";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "closer";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "auctionCreator"; readonly type: "address" },
    { readonly name: "winningBidder"; readonly type: "address" },
  ];
  readonly name: "AuctionClosed";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.bidInAuction

Places a bid in an English auction.

### Example

```ts
import { bidInAuction } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = bidInAuction({
  contract,
  auctionId: 0n,
  bidAmount: "100",
});
 
await sendTransaction({ transaction, account });
```

```ts
function bidInAuction(
  options: BaseTransactionOptions<BidInAuctionParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for placing the bid.

#### Type

```ts
let options: BaseTransactionOptions<BidInAuctionParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that can be sent to place the bid.
---

###### Connect SDK

## MARKETPLACE.buyerApprovedForListingEvent

Creates an event object for the BuyerApprovedForListing event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { buyerApprovedForListingEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 buyerApprovedForListingEvent({
 listingId: ...,
 buyer: ...,
})
],
});
```

```ts
function buyerApprovedForListingEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "buyer";
      readonly type: "address";
    },
    { readonly name: "approved"; readonly type: "bool" },
  ];
  readonly name: "BuyerApprovedForListing";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "buyer";
      readonly type: "address";
    },
    { readonly name: "approved"; readonly type: "bool" },
  ];
  readonly name: "BuyerApprovedForListing";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.buyFromListing

Buys a listing from the marketplace.

### Example

```ts
import { buyFromListing } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = buyFromListing({
  contract,
  listingId: 1n,
  quantity: 1n,
  recipient: "0x...",
});
 
await sendTransaction({ transaction, account });
```

When using `buyFromListing` with Pay, the `erc20Value` will be automatically set to the listing currency.

```ts
function buyFromListing(
  options: BaseTransactionOptions<BuyFromListingParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for buying from a listing.

#### Type

```ts
let options: BaseTransactionOptions<BuyFromListingParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## MARKETPLACE.buyoutAuction

Buys out an English auction.

### Example

```ts
import { buyoutAuction } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = buyoutAuction({
  contract,
  auctionId: 0n,
});
 
await sendTransaction({ transaction, account });
```

```ts
function buyoutAuction(
  options: BaseTransactionOptions<BuyoutAuctionParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for buying out the auction.

#### Type

```ts
let options: BaseTransactionOptions<BuyoutAuctionParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that can be sent to buy out the auction.
---

###### Connect SDK

## MARKETPLACE.cancelAuction

Cancels an auction by providing the necessary options.

### Example

```ts
import { cancelAuction } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = cancelAuction({
  contract,
  auctionId: 0n,
});
 
await sendTransaction({ transaction, account });
```

```ts
function cancelAuction(
  options: BaseTransactionOptions<CancelAuctionParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for canceling the auction.

#### Type

```ts
let options: BaseTransactionOptions<CancelAuctionParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that can be sent to cancel the auction.
---

###### Connect SDK

## MARKETPLACE.cancelledAuctionEvent

Creates an event object for the CancelledAuction event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { cancelledAuctionEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 cancelledAuctionEvent({
 auctionCreator: ...,
 auctionId: ...,
})
],
});
```

```ts
function cancelledAuctionEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
  ];
  readonly name: "CancelledAuction";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
  ];
  readonly name: "CancelledAuction";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.cancelledListingEvent

Creates an event object for the CancelledListing event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { cancelledListingEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 cancelledListingEvent({
 listingCreator: ...,
 listingId: ...,
})
],
});
```

```ts
function cancelledListingEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
  ];
  readonly name: "CancelledListing";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
  ];
  readonly name: "CancelledListing";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.cancelledOfferEvent

Creates an event object for the CancelledOffer event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { cancelledOfferEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 cancelledOfferEvent({
 offeror: ...,
 offerId: ...,
})
],
});
```

```ts
function cancelledOfferEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "offeror";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "offerId";
      readonly type: "uint256";
    },
  ];
  readonly name: "CancelledOffer";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "offeror";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "offerId";
      readonly type: "uint256";
    },
  ];
  readonly name: "CancelledOffer";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.cancelListing

Prepares a transaction to call the "cancelListing" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { cancelListing } from "thirdweb/extensions/marketplace";
 
const transaction = cancelListing({
 contract,
 listingId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function cancelListing(
  options: BaseTransactionOptions<
    | CancelListingParams
    | { asyncParams: () => Promise<CancelListingParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "cancelListing" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CancelListingParams
  | { asyncParams: () => Promise<CancelListingParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MARKETPLACE.cancelOffer

Prepares a transaction to call the "cancelOffer" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { cancelOffer } from "thirdweb/extensions/marketplace";
 
const transaction = cancelOffer({
 contract,
 offerId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function cancelOffer(
  options: BaseTransactionOptions<
    | CancelOfferParams
    | { asyncParams: () => Promise<CancelOfferParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "cancelOffer" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CancelOfferParams
  | { asyncParams: () => Promise<CancelOfferParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MARKETPLACE.collectAuctionPayout

Prepares a transaction to call the "collectAuctionPayout" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { collectAuctionPayout } from "thirdweb/extensions/marketplace";
 
const transaction = collectAuctionPayout({
 contract,
 auctionId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function collectAuctionPayout(
  options: BaseTransactionOptions<
    | CollectAuctionPayoutParams
    | { asyncParams: () => Promise<CollectAuctionPayoutParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "collectAuctionPayout" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CollectAuctionPayoutParams
  | { asyncParams: () => Promise<CollectAuctionPayoutParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MARKETPLACE.collectAuctionTokens

Prepares a transaction to call the "collectAuctionTokens" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { collectAuctionTokens } from "thirdweb/extensions/marketplace";
 
const transaction = collectAuctionTokens({
 contract,
 auctionId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function collectAuctionTokens(
  options: BaseTransactionOptions<
    | CollectAuctionTokensParams
    | { asyncParams: () => Promise<CollectAuctionTokensParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "collectAuctionTokens" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CollectAuctionTokensParams
  | { asyncParams: () => Promise<CollectAuctionTokensParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MARKETPLACE.createAuction

Creates an auction.

### Example

```typescript
import { createAuction } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = createAuction({...});
 
await sendTransaction({ transaction, account });
```

```ts
function createAuction(
  options: BaseTransactionOptions<CreateAuctionParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for creating the auction.

#### Type

```ts
let options: BaseTransactionOptions<CreateAuctionParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The result of creating the auction.
---

###### Connect SDK

## MARKETPLACE.createListing

Creates a direct listing.

### Example

```typescript
import { createListing } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = createListing({
  assetContractAddress: "0x...", // the NFT contract address that you want to sell
  tokenId={0n}, // the token id you want to sell
  pricePerToken="0.1" // sell for 0.1 <native token>
});
 
await sendTransaction({ transaction, account });
```

```ts
function createListing(
  options: BaseTransactionOptions<CreateListingParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for creating the direct listing.

#### Type

```ts
let options: BaseTransactionOptions<CreateListingParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The result of creating the direct listing.
---

###### Connect SDK

## MARKETPLACE.currencyApprovedForListingEvent

Creates an event object for the CurrencyApprovedForListing event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { currencyApprovedForListingEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 currencyApprovedForListingEvent({
 listingId: ...,
 currency: ...,
})
],
});
```

```ts
function currencyApprovedForListingEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "currency";
      readonly type: "address";
    },
    { readonly name: "pricePerToken"; readonly type: "uint256" },
  ];
  readonly name: "CurrencyApprovedForListing";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "currency";
      readonly type: "address";
    },
    { readonly name: "pricePerToken"; readonly type: "uint256" },
  ];
  readonly name: "CurrencyApprovedForListing";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.currencyPriceForListing

Retrieves the currency price for a listing.

### Example

```ts
import { currencyPriceForListing } from "thirdweb/extensions/marketplace";
 
const price = await currencyPriceForListing({
  contract,
  listingId: 1n,
  currency: "0x...",
});
```

```ts
function currencyPriceForListing(
  options: BaseTransactionOptions<CurrencyPriceForListingParams>,
): Promise<bigint>;
```

### Parameters

The options for retrieving the currency price.

#### Type

```ts
let options: BaseTransactionOptions<CurrencyPriceForListingParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the currency price as a bigint.
---

###### Connect SDK

## MARKETPLACE.executeSale

Executes a sale for an English auction.

### Example

```ts
import { executeSale } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = executeSale({
  contract,
  auctionId: 0n,
});
 
await sendTransaction({ transaction, account });
```

```ts
function executeSale(
  options: BaseTransactionOptions<ExecuteSaleParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for executing the sale.

#### Type

```ts
let options: BaseTransactionOptions<ExecuteSaleParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that can be sent to execute the sale.
---

###### Connect SDK

## MARKETPLACE.getAllAuctions

Retrieves all auctions based on the provided options.

### Example

```ts
import { getAllAuctions } from "thirdweb/extensions/marketplace";
 
const listings = await getAllAuctions({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllAuctions(
  options: BaseTransactionOptions<GetAllAuctionParams>,
): Promise<Array<EnglishAuction>>;
```

### Parameters

The options for retrieving the auctions.

#### Type

```ts
let options: BaseTransactionOptions<GetAllAuctionParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  bidBufferBps: bigint;
  buyoutBidAmount: bigint;
  buyoutCurrencyValue: GetBalanceResult;
  creatorAddress: Address;
  currencyContractAddress: Address;
  endTimeInSeconds: bigint;
  id: bigint;
  minimumBidAmount: bigint;
  minimumBidCurrencyValue: GetBalanceResult;
  quantity: bigint;
  startTimeInSeconds: bigint;
  status: ListingStatus;
  timeBufferInSeconds: bigint;
  tokenId: bigint;
  type: "english-auction";
};
```

A promise that resolves to the auctions array.
---

###### Connect SDK

## MARKETPLACE.getAllListings

Retrieves all direct listings based on the provided options.

### Example

```ts
import { getAllListings } from "thirdweb/extensions/marketplace";
 
const listings = await getAllListings({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllListings(
  options: BaseTransactionOptions<GetAllListingParams>,
): Promise<Array<DirectListing>>;
```

### Parameters

The options for retrieving the listing.

#### Type

```ts
let options: BaseTransactionOptions<GetAllListingParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  creatorAddress: Address;
  currencyContractAddress: Address;
  currencyValuePerToken: GetBalanceResult;
  endTimeInSeconds: bigint;
  id: bigint;
  isReservedListing: boolean;
  pricePerToken: bigint;
  quantity: bigint;
  startTimeInSeconds: bigint;
  status: ListingStatus;
  tokenId: bigint;
  type: "direct-listing";
};
```

A promise that resolves to the direct listings array.
---

###### Connect SDK

## MARKETPLACE.getAllOffers

Retrieves all offers based on the provided options.

### Example

```ts
import { getAllOffers } from "thirdweb/extensions/marketplace";
 
const listings = await getAllOffers({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllOffers(
  options: BaseTransactionOptions<GetAllOffersParams>,
): Promise<Array<Offer>>;
```

### Parameters

The options for retrieving the offers.

#### Type

```ts
let options: BaseTransactionOptions<GetAllOffersParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  currencyContractAddress: Address;
  currencyValue: GetBalanceResult;
  endTimeInSeconds: bigint;
  id: bigint;
  offerorAddress: Address;
  quantity: bigint;
  status: ListingStatus;
  tokenId: bigint;
  totalPrice: bigint;
};
```

A promise that resolves to the offers array.
---

###### Connect SDK

## MARKETPLACE.getAllValidAuctions

Retrieves all valid auctions based on the provided options.

### Example

```ts
import { getAllValidAuctions } from "thirdweb/extensions/marketplace";
 
const validAuctions = await getAllValidAuctions({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllValidAuctions(
  options: BaseTransactionOptions<GetAllValidAuctionParams>,
): Promise<Array<EnglishAuction>>;
```

### Parameters

The options for retrieving the listing.

#### Type

```ts
let options: BaseTransactionOptions<GetAllValidAuctionParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  bidBufferBps: bigint;
  buyoutBidAmount: bigint;
  buyoutCurrencyValue: GetBalanceResult;
  creatorAddress: Address;
  currencyContractAddress: Address;
  endTimeInSeconds: bigint;
  id: bigint;
  minimumBidAmount: bigint;
  minimumBidCurrencyValue: GetBalanceResult;
  quantity: bigint;
  startTimeInSeconds: bigint;
  status: ListingStatus;
  timeBufferInSeconds: bigint;
  tokenId: bigint;
  type: "english-auction";
};
```

A promise that resolves to the valid auctions array.
---

###### Connect SDK

## MARKETPLACE.getAllValidListings

Retrieves all valid direct listings based on the provided options.

### Example

```ts
import { getAllValidListings } from "thirdweb/extensions/marketplace";
 
const validListings = await getAllValidListings({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllValidListings(
  options: BaseTransactionOptions<GetAllValidListingParams>,
): Promise<Array<DirectListing>>;
```

### Parameters

The options for retrieving the valid listing.

#### Type

```ts
let options: BaseTransactionOptions<GetAllValidListingParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  creatorAddress: Address;
  currencyContractAddress: Address;
  currencyValuePerToken: GetBalanceResult;
  endTimeInSeconds: bigint;
  id: bigint;
  isReservedListing: boolean;
  pricePerToken: bigint;
  quantity: bigint;
  startTimeInSeconds: bigint;
  status: ListingStatus;
  tokenId: bigint;
  type: "direct-listing";
};
```

A promise that resolves to the direct listings array.
---

###### Connect SDK

## MARKETPLACE.getAllValidOffers

Retrieves all valid offers based on the provided options.

### Example

```ts
import { getAllValidOffers } from "thirdweb/extensions/marketplace";
 
const validOffers = await getAllValidOffers({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllValidOffers(
  options: BaseTransactionOptions<GetAllValidOffersParams>,
): Promise<Array<Offer>>;
```

### Parameters

The options for retrieving the valid offers.

#### Type

```ts
let options: BaseTransactionOptions<GetAllValidOffersParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  currencyContractAddress: Address;
  currencyValue: GetBalanceResult;
  endTimeInSeconds: bigint;
  id: bigint;
  offerorAddress: Address;
  quantity: bigint;
  status: ListingStatus;
  tokenId: bigint;
  totalPrice: bigint;
};
```

A promise that resolves to the offers array.
---

###### Connect SDK

## MARKETPLACE.getAuction

Retrieves an auction listing based on the provided options.

### Example

```ts
import { getListing } from "thirdweb/extensions/marketplace";
 
const listing = await getListing({ contract, listingId: 1n });
```

```ts
function getAuction(
  options: BaseTransactionOptions<GetAuctionParams>,
): Promise<EnglishAuction>;
```

### Parameters

The options for retrieving the listing.

#### Type

```ts
let options: BaseTransactionOptions<GetAuctionParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  bidBufferBps: bigint;
  buyoutBidAmount: bigint;
  buyoutCurrencyValue: GetBalanceResult;
  creatorAddress: Address;
  currencyContractAddress: Address;
  endTimeInSeconds: bigint;
  id: bigint;
  minimumBidAmount: bigint;
  minimumBidCurrencyValue: GetBalanceResult;
  quantity: bigint;
  startTimeInSeconds: bigint;
  status: ListingStatus;
  timeBufferInSeconds: bigint;
  tokenId: bigint;
  type: "english-auction";
};
```

A promise that resolves to the direct listing.
---

###### Connect SDK

## MARKETPLACE.getListing

Retrieves a direct listing based on the provided options.

### Example

```ts
import { getListing } from "thirdweb/extensions/marketplace";
 
const listing = await getListing({ contract, listingId: 1n });
```

```ts
function getListing(
  options: BaseTransactionOptions<GetListingParams>,
): Promise<DirectListing>;
```

### Parameters

The options for retrieving the listing.

#### Type

```ts
let options: BaseTransactionOptions<GetListingParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  creatorAddress: Address;
  currencyContractAddress: Address;
  currencyValuePerToken: GetBalanceResult;
  endTimeInSeconds: bigint;
  id: bigint;
  isReservedListing: boolean;
  pricePerToken: bigint;
  quantity: bigint;
  startTimeInSeconds: bigint;
  status: ListingStatus;
  tokenId: bigint;
  type: "direct-listing";
};
```

A promise that resolves to the direct listing.
---

###### Connect SDK

## MARKETPLACE.getOffer

Retrieves an offer based on the provided options.

### Example

```ts
import { getOffer } from "thirdweb/extensions/marketplace";
 
const listing = await getOffer({ contract, listingId: 1n });
```

```ts
function getOffer(
  options: BaseTransactionOptions<GetOfferParams>,
): Promise<Offer>;
```

### Parameters

The options for retrieving the offer.

#### Type

```ts
let options: BaseTransactionOptions<GetOfferParams>;
```

### Returns

```ts
let returnType: {
  asset: NFT;
  assetContractAddress: Address;
  currencyContractAddress: Address;
  currencyValue: GetBalanceResult;
  endTimeInSeconds: bigint;
  id: bigint;
  offerorAddress: Address;
  quantity: bigint;
  status: ListingStatus;
  tokenId: bigint;
  totalPrice: bigint;
};
```

A promise that resolves to the offer.
---

###### Connect SDK

## MARKETPLACE.getWinningBid

Retrieves the winning bid information for a given auction.

### Example

```ts
import { getWinningBid } from "thirdweb/extensions/marketplace";
 
const winningBid = await getWinningBid({
  contract,
  auctionId: 0n,
});
```

```ts
function getWinningBid(
  options: BaseTransactionOptions<GetWinningBidParams>,
): Promise<
  | undefined
  | {
      bidAmountWei: bigint;
      bidderAddress: string;
      currencyAddress: string;
      currencyValue: CurrencyValue;
    }
>;
```

### Parameters

The options for retrieving the winning bid.

#### Type

```ts
let options: BaseTransactionOptions<GetWinningBidParams>;
```

### Returns

```ts
let returnType: Promise<
  | undefined
  | {
      bidAmountWei: bigint;
      bidderAddress: string;
      currencyAddress: string;
      currencyValue: CurrencyValue;
    }
>;
```

The winning bid information, or undefined if there is no winning bid.
---

###### Connect SDK

## MARKETPLACE.isBidInAuctionSupported

Checks if the `bidInAuction` method is supported by the given contract.

### Example

```ts
import { isBidInAuctionSupported } from "thirdweb/extensions/marketplace";
 
const supported = isBidInAuctionSupported(["0x..."]);
```

```ts
function isBidInAuctionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `bidInAuction` method is supported.
---

###### Connect SDK

## MARKETPLACE.isBuyerApprovedForListing

Checks if the buyer is approved for a listing.

### Example

```ts
import { isBuyerApprovedForListing } from "thirdweb/extensions/marketplace";
 
const isApproved = await isBuyerApprovedForListing({
  contract,
  listingId: 1n,
  buyer: "0x...",
});
```

```ts
function isBuyerApprovedForListing(
  options: BaseTransactionOptions<IsBuyerApprovedForListingParams>,
): Promise<boolean>;
```

### Parameters

The options for checking buyer approval.

#### Type

```ts
let options: BaseTransactionOptions<IsBuyerApprovedForListingParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A promise that resolves to a boolean indicating whether the buyer is approved for the listing.
---

###### Connect SDK

## MARKETPLACE.isBuyFromListingSupported

Checks if the `buyFromListing` method is supported by the given contract.

### Example

```ts
import { isBuyFromListingSupported } from "thirdweb/extensions/marketplace";
 
const supported = isBuyFromListingSupported(["0x..."]);
```

```ts
function isBuyFromListingSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `buyFromListing` method is supported.
---

###### Connect SDK

## MARKETPLACE.isCancelAuctionSupported

Checks if the `cancelAuction` method is supported by the given contract.

### Example

```ts
import { isCancelAuctionSupported } from "thirdweb/extensions/marketplace";
 
const supported = isCancelAuctionSupported(["0x..."]);
```

```ts
function isCancelAuctionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `cancelAuction` method is supported.
---

###### Connect SDK

## MARKETPLACE.isCancelListingSupported

Checks if the `cancelListing` method is supported by the given contract.

### Example

```ts
import { isCancelListingSupported } from "thirdweb/extensions/marketplace";
 
const supported = isCancelListingSupported(["0x..."]);
```

```ts
function isCancelListingSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `cancelListing` method is supported.
---

###### Connect SDK

## MARKETPLACE.isCreateAuctionSupported

Checks if the `createAuction` method is supported by the given contract.

### Example

```ts
import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace";
 
const supported = isCreateAuctionSupported(["0x..."]);
```

```ts
function isCreateAuctionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `createAuction` method is supported.
---

###### Connect SDK

## MARKETPLACE.isCreateListingSupported

Checks if the `createListing` method is supported by the given contract.

### Example

```ts
import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace";
 
const supported = isCreateAuctionSupported(["0x..."]);
```

```ts
function isCreateListingSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `createListing` method is supported.
---

###### Connect SDK

## MARKETPLACE.isCurrencyApprovedForListing

Calls the "isCurrencyApprovedForListing" function on the contract.

### Example

```ts
import { isCurrencyApprovedForListing } from "thirdweb/extensions/marketplace";
 
const result = await isCurrencyApprovedForListing({
 contract,
 listingId: ...,
 currency: ...,
});
```

```ts
function isCurrencyApprovedForListing(
  options: BaseTransactionOptions<IsCurrencyApprovedForListingParams>,
): Promise<boolean>;
```

### Parameters

The options for the isCurrencyApprovedForListing function.

#### Type

```ts
let options: BaseTransactionOptions<IsCurrencyApprovedForListingParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## MARKETPLACE.isGetAuctionSupported

Checks if the `getAuction` method is supported by the given contract.

### Example

```ts
import { isGetAuctionSupported } from "thirdweb/extensions/marketplace";
 
const supported = isGetAuctionSupported(["0x..."]);
```

```ts
function isGetAuctionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAuction` method is supported.
---

###### Connect SDK

## MARKETPLACE.isGetListingSupported

Checks if the `isGetListingSupported` method is supported by the given contract.

### Example

```ts
import { isGetListingSupported } from "thirdweb/extensions/marketplace";
 
const supported = isGetListingSupported(["0x..."]);
```

```ts
function isGetListingSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isGetListingSupported` method is supported.
---

###### Connect SDK

## MARKETPLACE.isGetWinningBidSupported

Checks if the `getWinningBid` method is supported by the given contract.

### Example

```ts
import { isGetWinningBidSupported } from "thirdweb/extensions/marketplace";
 
const supported = isGetWinningBidSupported(["0x..."]);
```

```ts
function isGetWinningBidSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getWinningBid` method is supported.
---

###### Connect SDK

## MARKETPLACE.isNewWinningBid

Calls the "isNewWinningBid" function on the contract.

### Example

```ts
import { isNewWinningBid } from "thirdweb/extensions/marketplace";
 
const result = await isNewWinningBid({
 contract,
 auctionId: ...,
 bidAmount: ...,
});
```

```ts
function isNewWinningBid(
  options: BaseTransactionOptions<IsNewWinningBidParams>,
): Promise<boolean>;
```

### Parameters

The options for the isNewWinningBid function.

#### Type

```ts
let options: BaseTransactionOptions<IsNewWinningBidParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## MARKETPLACE.makeOffer

Makes an offer for any asset (ERC721 or ERC1155).

### Example

```ts
import { makeOffer } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const offerTx = makeOffer({
  contract,
  assetContractAddress: "0x1234567890123456789012345678901234567890",
  tokenId: 1n,
  currencyContractAddress:
    "0x1234567890123456789012345678901234567890",
  offerExpiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24),
  totalOffer: "1.0",
});
 
await sendTransaction({ transaction, account });
```

```ts
function makeOffer(
  options: BaseTransactionOptions<MakeOfferParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for making the offer.

#### Type

```ts
let options: BaseTransactionOptions<MakeOfferParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction object that can be sent to make the offer.
---

###### Connect SDK

## MARKETPLACE.newAuctionEvent

Creates an event object for the NewAuction event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { newAuctionEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 newAuctionEvent({
 auctionCreator: ...,
 auctionId: ...,
 assetContract: ...,
})
],
});
```

```ts
function newAuctionEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "auctionId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        {
          readonly name: "minimumBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "buyoutBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "timeBufferInSeconds";
          readonly type: "uint64";
        },
        { readonly name: "bidBufferBps"; readonly type: "uint64" },
        { readonly name: "startTimestamp"; readonly type: "uint64" },
        { readonly name: "endTimestamp"; readonly type: "uint64" },
        { readonly name: "auctionCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
      ];
      readonly name: "auction";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewAuction";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "auctionId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        {
          readonly name: "minimumBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "buyoutBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "timeBufferInSeconds";
          readonly type: "uint64";
        },
        { readonly name: "bidBufferBps"; readonly type: "uint64" },
        { readonly name: "startTimestamp"; readonly type: "uint64" },
        { readonly name: "endTimestamp"; readonly type: "uint64" },
        { readonly name: "auctionCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
      ];
      readonly name: "auction";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewAuction";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.newBidEvent

Creates an event object for the NewBid event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { newBidEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 newBidEvent({
 auctionId: ...,
 bidder: ...,
 assetContract: ...,
})
],
});
```

```ts
function newBidEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "bidder";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    { readonly name: "bidAmount"; readonly type: "uint256" },
    {
      readonly components: readonly [
        { readonly name: "auctionId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        {
          readonly name: "minimumBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "buyoutBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "timeBufferInSeconds";
          readonly type: "uint64";
        },
        { readonly name: "bidBufferBps"; readonly type: "uint64" },
        { readonly name: "startTimestamp"; readonly type: "uint64" },
        { readonly name: "endTimestamp"; readonly type: "uint64" },
        { readonly name: "auctionCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
      ];
      readonly name: "auction";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewBid";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "auctionId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "bidder";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    { readonly name: "bidAmount"; readonly type: "uint256" },
    {
      readonly components: readonly [
        { readonly name: "auctionId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        {
          readonly name: "minimumBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "buyoutBidAmount";
          readonly type: "uint256";
        },
        {
          readonly name: "timeBufferInSeconds";
          readonly type: "uint64";
        },
        { readonly name: "bidBufferBps"; readonly type: "uint64" },
        { readonly name: "startTimestamp"; readonly type: "uint64" },
        { readonly name: "endTimestamp"; readonly type: "uint64" },
        { readonly name: "auctionCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
      ];
      readonly name: "auction";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewBid";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.newListingEvent

Creates an event object for the NewListing event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { newListingEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 newListingEvent({
 listingCreator: ...,
 listingId: ...,
 assetContract: ...,
})
],
});
```

```ts
function newListingEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "listingId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "startTimestamp"; readonly type: "uint128" },
        { readonly name: "endTimestamp"; readonly type: "uint128" },
        { readonly name: "listingCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
        { readonly name: "reserved"; readonly type: "bool" },
      ];
      readonly name: "listing";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewListing";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "listingId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "startTimestamp"; readonly type: "uint128" },
        { readonly name: "endTimestamp"; readonly type: "uint128" },
        { readonly name: "listingCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
        { readonly name: "reserved"; readonly type: "bool" },
      ];
      readonly name: "listing";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewListing";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.newOfferEvent

Creates an event object for the NewOffer event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { newOfferEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 newOfferEvent({
 offeror: ...,
 offerId: ...,
 assetContract: ...,
})
],
});
```

```ts
function newOfferEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "offeror";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "offerId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "offerId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "totalPrice"; readonly type: "uint256" },
        {
          readonly name: "expirationTimestamp";
          readonly type: "uint256";
        },
        { readonly name: "offeror"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
      ];
      readonly name: "offer";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewOffer";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "offeror";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "offerId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "offerId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "totalPrice"; readonly type: "uint256" },
        {
          readonly name: "expirationTimestamp";
          readonly type: "uint256";
        },
        { readonly name: "offeror"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
      ];
      readonly name: "offer";
      readonly type: "tuple";
    },
  ];
  readonly name: "NewOffer";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.newSaleEvent

Creates an event object for the NewSale event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { newSaleEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 newSaleEvent({
 listingCreator: ...,
 listingId: ...,
 assetContract: ...,
})
],
});
```

```ts
function newSaleEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "buyer"; readonly type: "address" },
    { readonly name: "quantityBought"; readonly type: "uint256" },
    { readonly name: "totalPricePaid"; readonly type: "uint256" },
  ];
  readonly name: "NewSale";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "buyer"; readonly type: "address" },
    { readonly name: "quantityBought"; readonly type: "uint256" },
    { readonly name: "totalPricePaid"; readonly type: "uint256" },
  ];
  readonly name: "NewSale";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.totalAuctions

Calls the "totalAuctions" function on the contract.

### Example

```ts
import { totalAuctions } from "thirdweb/extensions/marketplace";
 
const result = await totalAuctions({
  contract,
});
```

```ts
function totalAuctions(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalAuctions function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MARKETPLACE.totalListings

Calls the "totalListings" function on the contract.

### Example

```ts
import { totalListings } from "thirdweb/extensions/marketplace";
 
const result = await totalListings({
  contract,
});
```

```ts
function totalListings(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalListings function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MARKETPLACE.totalOffers

Calls the "totalOffers" function on the contract.

### Example

```ts
import { totalOffers } from "thirdweb/extensions/marketplace";
 
const result = await totalOffers({
  contract,
});
```

```ts
function totalOffers(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalOffers function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MARKETPLACE.updatedListingEvent

Creates an event object for the UpdatedListing event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { updatedListingEvent } from "thirdweb/extensions/marketplace";
 
const events = await getContractEvents({
contract,
events: [
 updatedListingEvent({
 listingCreator: ...,
 listingId: ...,
 assetContract: ...,
})
],
});
```

```ts
function updatedListingEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "listingId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "startTimestamp"; readonly type: "uint128" },
        { readonly name: "endTimestamp"; readonly type: "uint128" },
        { readonly name: "listingCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
        { readonly name: "reserved"; readonly type: "bool" },
      ];
      readonly name: "listing";
      readonly type: "tuple";
    },
  ];
  readonly name: "UpdatedListing";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "listingCreator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "listingId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "assetContract";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "listingId"; readonly type: "uint256" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "startTimestamp"; readonly type: "uint128" },
        { readonly name: "endTimestamp"; readonly type: "uint128" },
        { readonly name: "listingCreator"; readonly type: "address" },
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "status"; readonly type: "uint8" },
        { readonly name: "reserved"; readonly type: "bool" },
      ];
      readonly name: "listing";
      readonly type: "tuple";
    },
  ];
  readonly name: "UpdatedListing";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MARKETPLACE.updateListing

Updates an existing direct listing.

### Example

```typescript
import { updateListing } from "thirdweb/extensions/marketplace";
import { sendTransaction } from "thirdweb";
 
const transaction = updateListing({...});
 
await sendTransaction({ transaction, account });
```

```ts
function updateListing(
  options: BaseTransactionOptions<UpdateListingParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for updating the direct listing.

#### Type

```ts
let options: BaseTransactionOptions<UpdateListingParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The result of updating the direct listing.
---
## AIRDROP
---

###### Connect SDK

## AIRDROP.airdropERC1155

Prepares a transaction to call the "airdropERC1155" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropERC1155 } from "thirdweb/extensions/airdrop";
 
const transaction = airdropERC1155({
 contract,
 tokenAddress: ...,
 contents: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropERC1155(
  options: BaseTransactionOptions<
    | AirdropERC1155Params
    | { asyncParams: () => Promise<AirdropERC1155Params> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropERC1155" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropERC1155Params
  | { asyncParams: () => Promise<AirdropERC1155Params> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.airdropERC1155WithSignature

Prepares a transaction to call the "airdropERC1155WithSignature" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropERC1155WithSignature } from "thirdweb/extensions/airdrop";
 
const transaction = airdropERC1155WithSignature({
 contract,
 req: ...,
 signature: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropERC1155WithSignature(
  options: BaseTransactionOptions<
    | AirdropERC1155WithSignatureParams
    | {
        asyncParams: () => Promise<AirdropERC1155WithSignatureParams>;
      }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropERC1155WithSignature" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropERC1155WithSignatureParams
  | { asyncParams: () => Promise<AirdropERC1155WithSignatureParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.airdropERC20

Prepares a transaction to call the "airdropERC20" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropERC20 } from "thirdweb/extensions/airdrop";
 
const transaction = airdropERC20({
 contract,
 tokenAddress: ...,
 contents: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropERC20(
  options: BaseTransactionOptions<
    | AirdropERC20Params
    | { asyncParams: () => Promise<AirdropERC20Params> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropERC20" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropERC20Params
  | { asyncParams: () => Promise<AirdropERC20Params> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.airdropERC20WithSignature

Prepares a transaction to call the "airdropERC20WithSignature" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropERC20WithSignature } from "thirdweb/extensions/airdrop";
 
const transaction = airdropERC20WithSignature({
 contract,
 req: ...,
 signature: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropERC20WithSignature(
  options: BaseTransactionOptions<
    | AirdropERC20WithSignatureParams
    | { asyncParams: () => Promise<AirdropERC20WithSignatureParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropERC20WithSignature" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropERC20WithSignatureParams
  | { asyncParams: () => Promise<AirdropERC20WithSignatureParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.airdropERC721

Prepares a transaction to call the "airdropERC721" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropERC721 } from "thirdweb/extensions/airdrop";
 
const transaction = airdropERC721({
 contract,
 tokenAddress: ...,
 contents: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropERC721(
  options: BaseTransactionOptions<
    | AirdropERC721Params
    | { asyncParams: () => Promise<AirdropERC721Params> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropERC721" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropERC721Params
  | { asyncParams: () => Promise<AirdropERC721Params> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.airdropERC721WithSignature

Prepares a transaction to call the "airdropERC721WithSignature" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropERC721WithSignature } from "thirdweb/extensions/airdrop";
 
const transaction = airdropERC721WithSignature({
 contract,
 req: ...,
 signature: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropERC721WithSignature(
  options: BaseTransactionOptions<
    | AirdropERC721WithSignatureParams
    | { asyncParams: () => Promise<AirdropERC721WithSignatureParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropERC721WithSignature" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropERC721WithSignatureParams
  | { asyncParams: () => Promise<AirdropERC721WithSignatureParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.airdropNativeToken

Prepares a transaction to call the "airdropNativeToken" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { airdropNativeToken } from "thirdweb/extensions/airdrop";
 
const transaction = airdropNativeToken({
 contract,
 contents: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function airdropNativeToken(
  options: BaseTransactionOptions<
    | AirdropNativeTokenParams
    | { asyncParams: () => Promise<AirdropNativeTokenParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "airdropNativeToken" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | AirdropNativeTokenParams
  | { asyncParams: () => Promise<AirdropNativeTokenParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.claimERC1155

Claim airdrop of ERC1155 tokens for allowlisted addresses. (Pull based airdrop)

### Example

```ts
import { claimERC1155 } from "thirdweb/extensions/airdrop";
import { sendTransaction } from "thirdweb";
 
const tokenAddress = "0x..."; // Address of airdropped tokens to claim
const recipient = "0x..."; // Address of the allowlisted recipient
 
const claimTransaction = claimERC1155({
  contract,
  tokenAddress,
  recipient,
});
 
await sendTransaction({ claimTransaction, account });
```

```ts
function claimERC1155(
  options: BaseTransactionOptions<ClaimERC1155Params>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<ClaimERC1155Params>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## AIRDROP.claimERC20

Claim airdrop of ERC20 tokens for allowlisted addresses. (Pull based airdrop)

### Example

```ts
import { claimERC20 } from "thirdweb/extensions/airdrop";
import { sendTransaction } from "thirdweb";
 
const tokenAddress = "0x..."; // Address of airdropped tokens to claim
const recipient = "0x..."; // Address of the allowlisted recipient
 
const claimTransaction = claimERC20({
  contract,
  tokenAddress,
  recipient,
});
 
await sendTransaction({ claimTransaction, account });
```

```ts
function claimERC20(
  options: BaseTransactionOptions<ClaimERC20Params>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<ClaimERC20Params>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## AIRDROP.claimERC721

Claim airdrop of ERC721 tokens for allowlisted addresses. (Pull based airdrop)

### Example

```ts
import { claimERC721 } from "thirdweb/extensions/airdrop";
import { sendTransaction } from "thirdweb";
 
const tokenAddress = "0x..."; // Address of airdropped tokens to claim
const recipient = "0x..."; // Address of the allowlisted recipient
 
const claimTransaction = claimERC721({
  contract,
  tokenAddress,
  recipient,
});
 
await sendTransaction({ claimTransaction, account });
```

```ts
function claimERC721(
  options: BaseTransactionOptions<ClaimERC721Params>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<ClaimERC721Params>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## AIRDROP.fetchProofsERC1155

Retrieves the claim merkle proof for the provided address.

### Example

```ts
import { fetchProofsERCC1155 } from "thirdweb/extensions/airdrop";
import { getContract, defineChain } from "thirdweb";
 
const TOKEN = getContracct({
  client,
  chain: defineChain(1),
  address: "0x...",
});
 
const merkleRoot = await tokenMerkleRoot({
  contract: TOKEN,
  tokenAddress: TOKEN.address,
});
 
const proof = await fetchProofsERC1155({
  contract: TOKEN,
  recipient: "0x...",
  merkleRoot,
});
```

```ts
function fetchProofsERC1155(options: {
  contract: Readonly;
  merkleRoot: string;
  recipient: string;
}): Promise<null | ClaimProofERC1155>;
```

### Parameters

#### Type

```ts
let options: {
  contract: Readonly;
  merkleRoot: string;
  recipient: string;
};
```

### Returns

```ts
let returnType: Promise<null | ClaimProofERC1155>;
```

A promise that resolves to the proof or null if the recipient is not in the allowlist
---

###### Connect SDK

## AIRDROP.fetchProofsERC20

Retrieves the claim merkle proof for the provided address.

### Example

```ts
import { fetchProofsERCC20 } from "thirdweb/extensions/airdrop";
import { getContract, defineChain } from "thirdweb";
 
const TOKEN = getContracct({
  client,
  chain: defineChain(1),
  address: "0x...",
});
 
const merkleRoot = await tokenMerkleRoot({
  contract: TOKEN,
  tokenAddress: TOKEN.address,
});
 
const proof = await fetchProofsERC20({
  contract: TOKEN,
  recipient: "0x...",
  merkleRoot,
});
```

```ts
function fetchProofsERC20(options: {
  contract: Readonly;
  merkleRoot: string;
  recipient: string;
  tokenDecimals: number;
}): Promise<null | ClaimProofERC20>;
```

### Parameters

#### Type

```ts
let options: {
  contract: Readonly;
  merkleRoot: string;
  recipient: string;
  tokenDecimals: number;
};
```

### Returns

```ts
let returnType: Promise<null | ClaimProofERC20>;
```

A promise that resolves to the proof or null if the recipient is not in the allowlist
---

###### Connect SDK

## AIRDROP.fetchProofsERC721

Retrieves the claim merkle proof for the provided address.

### Example

```ts
import { fetchProofsERC721 } from "thirdweb/extensions/airdrop";
import { getContract, defineChain } from "thirdweb";
 
const NFT = getContracct({
  client,
  chain: defineChain(1),
  address: "0x...",
});
 
const merkleRoot = await tokenMerkleRoot({
  contract: NFT,
  tokenAddress: NFT.address,
});
 
const proof = await fetchProofsERC721({
  contract: NFT,
  recipient: "0x...",
  merkleRoot,
});
```

```ts
function fetchProofsERC721(options: {
  contract: Readonly;
  merkleRoot: string;
  recipient: string;
}): Promise<null | ClaimProofERC721>;
```

### Parameters

#### Type

```ts
let options: {
  contract: Readonly;
  merkleRoot: string;
  recipient: string;
};
```

### Returns

```ts
let returnType: Promise<null | ClaimProofERC721>;
```

A promise that resolves to the proof or null if the recipient is not in the allowlist
---

###### Connect SDK

## AIRDROP.generateAirdropSignatureERC1155

Generates the req and signature for sending ERC1155 airdrop.

### Example

```ts
import {
  airdropERC1155WithSignature,
  generateAirdropSignatureERC1155,
} from "thirdweb/extensions/airdrop";
 
// list of recipients, tokenIds and amounts to airdrop for each recipient
const contents = [
  { recipient: "0x...", tokenId: 0, amount: 10n },
  { recipient: "0x...", tokenId: 0, amount: 15n },
  { recipient: "0x...", tokenId: 0, amount: 20n },
];
 
const { req, signature } = await generateAirdropSignatureERC1155({
  account,
  contract,
  airdropRequest: {
    tokenAddress: "0x...", // address of the ERC1155 token to airdrop
    contents,
  },
});
 
const transaction = airdropERC1155WithSignature({
  contract,
  req,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function generateAirdropSignatureERC1155(options: GenerateAirdropERC1155SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
```

### Parameters

The options for the airdrop.

#### Type

```ts
let options: {
  account: Account;
  airdropRequest: GenerateReqInput;
  contract: ThirdwebContract;
};
```

### Returns

```ts
let returnType: Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
```

A promise that resolves to the req and signature.
---

###### Connect SDK

## AIRDROP.generateAirdropSignatureERC20

Generates the req and signature for sending ERC20 airdrop.

### Example

```ts
import {
  airdropERC20WithSignature,
  generateAirdropSignatureERC20,
} from "thirdweb/extensions/airdrop";
 
// list of recipients and amounts to airdrop for each recipient
const contents = [
  { recipient: "0x...", amount: 10n }, // amount in wei
  { recipient: "0x...", amount: 15n }, // amount in wei
  { recipient: "0x...", amount: 20n }, // amount in wei
];
 
const { req, signature } = await generateAirdropSignatureERC20({
  account,
  contract,
  airdropRequest: {
    tokenAddress: "0x...", // address of the ERC20 token to airdrop
    contents,
  },
});
 
const transaction = airdropERC20WithSignature({
  contract,
  req,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function generateAirdropSignatureERC20(options: GenerateAirdropERC20SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
```

### Parameters

The options for the airdrop.

#### Type

```ts
let options: {
  account: Account;
  airdropRequest: GenerateReqInput;
  contract: ThirdwebContract;
};
```

### Returns

```ts
let returnType: Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
```

A promise that resolves to the req and signature.
---

###### Connect SDK

## AIRDROP.generateAirdropSignatureERC721

Generates the req and signature for sending ERC721 airdrop.

### Example

```ts
import {
  airdropERC721WithSignature,
  generateAirdropSignatureERC721,
} from "thirdweb/extensions/airdrop";
 
// list of recipients and tokenIds to airdrop for each recipient
const contents = [
  { recipient: "0x...", tokenId: 0 },
  { recipient: "0x...", tokenId: 1 },
  { recipient: "0x...", tokenId: 2 },
];
 
const { req, signature } = await generateAirdropSignatureERC721({
  account,
  contract,
  airdropRequest: {
    tokenAddress: "0x...", // address of the ERC721 token to airdrop
    contents,
  },
});
 
const transaction = airdropERC721WithSignature({
  contract,
  req,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function generateAirdropSignatureERC721(options: GenerateAirdropERC721SignatureOptions) : Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
```

### Parameters

The options for the airdrop.

#### Type

```ts
let options: {
  account: Account;
  airdropRequest: GenerateReqInput;
  contract: ThirdwebContract;
};
```

### Returns

```ts
let returnType: Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
```

A promise that resolves to the req and signature.
---

###### Connect SDK

## AIRDROP.generateMerkleTreeInfoERC1155

Generate merkle tree for a given snapshot.

### Example

```ts
import { generateMerkleTreeInfoERC1155 } from "thirdweb/extensions/airdrop";
 
// snapshot / allowlist of airdrop recipients and amounts
const snapshot = [
  { recipient: "0x...", tokenId: 0, amount: 10 },
  { recipient: "0x...", tokenId: 1, amount: 12 },
  { recipient: "0x...", tokenId: 2, amount: 15 },
];
 
const tokenAddress = "0x..."; // Address of ERC1155 airdrop token
 
const { merkleRoot, snapshotUri } =
  await generateMerkleTreeInfoERC1155({
    contract,
    tokenAddress,
    snapshot,
  });
 
// Optional next steps {See: saveSnapshot and setMerkleRoot functions}
// - Save snapshot on-chain (on the airdrop contract uri)
// - Set merkle root on the contract to enable claiming
```

```ts
function generateMerkleTreeInfoERC1155(
  options: BaseTransactionOptions<GenerateMerkleTreeInfoERC1155Params>,
): Promise<{ merkleRoot: string; snapshotUri: string }>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<GenerateMerkleTreeInfoERC1155Params>;
```

### Returns

```ts
let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>;
```

A promise that resolves to the merkle-root and snapshot-uri.
---

###### Connect SDK

## AIRDROP.generateMerkleTreeInfoERC20

Generate merkle tree for a given snapshot.

### Example

```ts
import { generateMerkleTreeInfoERC20 } from "thirdweb/extensions/airdrop";
 
// snapshot / allowlist of airdrop recipients and amounts
const snapshot = [
  { recipient: "0x...", amount: 10 },
  { recipient: "0x...", amount: 15 },
  { recipient: "0x...", amount: 20 },
];
 
const tokenAddress = "0x..."; // Address of ERC20 airdrop token
 
const { merkleRoot, snapshotUri } = await generateMerkleTreeInfoERC20(
  {
    contract,
    tokenAddress,
    snapshot,
  },
);
 
// Optional next steps {See: saveSnapshot and setMerkleRoot functions}
// - Save snapshot on-chain (on the airdrop contract uri)
// - Set merkle root on the contract to enable claiming
```

```ts
function generateMerkleTreeInfoERC20(
  options: BaseTransactionOptions<GenerateMerkleTreeInfoERC20Params>,
): Promise<{ merkleRoot: string; snapshotUri: string }>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<GenerateMerkleTreeInfoERC20Params>;
```

### Returns

```ts
let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>;
```

A promise that resolves to the merkle-root and snapshot-uri.
---

###### Connect SDK

## AIRDROP.generateMerkleTreeInfoERC721

Generate merkle tree for a given snapshot.

### Example

```ts
import { generateMerkleTreeInfoERC721 } from "thirdweb/extensions/airdrop";
 
// snapshot / allowlist of airdrop recipients and amounts
const snapshot = [
  { recipient: "0x...", tokenId: 0 },
  { recipient: "0x...", tokenId: 1 },
  { recipient: "0x...", tokenId: 2 },
];
 
const tokenAddress = "0x..."; // Address of ERC721 airdrop token
 
const { merkleRoot, snapshotUri } =
  await generateMerkleTreeInfoERC721({
    contract,
    tokenAddress,
    snapshot,
  });
 
// Optional next steps {See: saveSnapshot and setMerkleRoot functions}
// - Save snapshot on-chain (on the airdrop contract uri)
// - Set merkle root on the contract to enable claiming
```

```ts
function generateMerkleTreeInfoERC721(
  options: BaseTransactionOptions<GenerateMerkleTreeInfoERC721Params>,
): Promise<{ merkleRoot: string; snapshotUri: string }>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<GenerateMerkleTreeInfoERC721Params>;
```

### Returns

```ts
let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>;
```

A promise that resolves to the merkle-root and snapshot-uri.
---

###### Connect SDK

## AIRDROP.isClaimed

Calls the "isClaimed" function on the contract.

### Example

```ts
import { isClaimed } from "thirdweb/extensions/airdrop";
 
const result = await isClaimed({
 contract,
 receiver: ...,
 token: ...,
 tokenId: ...,
});
```

```ts
function isClaimed(
  options: BaseTransactionOptions<IsClaimedParams>,
): Promise<boolean>;
```

### Parameters

The options for the isClaimed function.

#### Type

```ts
let options: BaseTransactionOptions<IsClaimedParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## AIRDROP.saveSnapshot

Generate merkle tree for a given snapshot and save the info on-chain.

### Example

```ts
// This is ERC20 example. Should import and use other ERC variants as needed
 
import { generateMerkleTreeInfoERC20, saveSnapshot, setMerkleRoot } from "thirdweb/extensions/airdrop";
 
// snapshot / allowlist of airdrop recipients and amounts
const snapshot = [
   { recipient: "0x...", amount: 10 },
   { recipient: "0x...", amount: 15 },
   { recipient: "0x...", amount: 20 },
];
 
const tokenAddress = "0x..." // Address of airdrop token
 
const { merkleRoot, snapshotUri } = await generateMerkleTreeInfoERC20({
   contract,
   tokenAddress,
   snapshot
});
 
const saveSnapshotTransaction = saveSnapshot({
  contract,
  merkleRoot,
  snapshotUri,
});
await sendTransaction({ saveSnapshotTransaction, account });
 
const setMerkleRootTransaction = setMerkleRoot({
  contract,
  token,
  tokenMerkleRoot: merkleRoot as `0x${string}`,
  resetClaimStatus: false // toggle as needed
  signature,
});
await sendTransaction({ setMerkleRootTransaction, account });
```

```ts
function saveSnapshot(
  options: BaseTransactionOptions<SaveSnapshotParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<SaveSnapshotParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## AIRDROP.setMerkleRoot

Prepares a transaction to call the "setMerkleRoot" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setMerkleRoot } from "thirdweb/extensions/airdrop";
 
const transaction = setMerkleRoot({
 contract,
 token: ...,
 tokenMerkleRoot: ...,
 resetClaimStatus: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setMerkleRoot(
  options: BaseTransactionOptions<
    | SetMerkleRootParams
    | { asyncParams: () => Promise<SetMerkleRootParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setMerkleRoot" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetMerkleRootParams
  | { asyncParams: () => Promise<SetMerkleRootParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## AIRDROP.tokenConditionId

Calls the "tokenConditionId" function on the contract.

### Example

```ts
import { tokenConditionId } from "thirdweb/extensions/airdrop";
 
const result = await tokenConditionId({
 contract,
 tokenAddress: ...,
});
```

```ts
function tokenConditionId(
  options: BaseTransactionOptions<TokenConditionIdParams>,
): Promise<bigint>;
```

### Parameters

The options for the tokenConditionId function.

#### Type

```ts
let options: BaseTransactionOptions<TokenConditionIdParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## AIRDROP.tokenMerkleRoot

Calls the "tokenMerkleRoot" function on the contract.

### Example

```ts
import { tokenMerkleRoot } from "thirdweb/extensions/airdrop";
 
const result = await tokenMerkleRoot({
 contract,
 tokenAddress: ...,
});
```

```ts
function tokenMerkleRoot(
  options: BaseTransactionOptions<TokenMerkleRootParams>,
): Promise<`0x${string}`>;
```

### Parameters

The options for the tokenMerkleRoot function.

#### Type

```ts
let options: BaseTransactionOptions<TokenMerkleRootParams>;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---
## COMMON
---

###### Connect SDK

## COMMON.contractURI

Calls the "contractURI" function on the contract.

### Example

```ts
import { contractURI } from "thirdweb/extensions/common";
 
const result = await contractURI({
  contract,
});
```

```ts
function contractURI(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the contractURI function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## COMMON.getContractMetadata

Retrieves the contract metadata including name and symbol.

### Example

```ts
import { getContractMetadata } from "thirdweb/extensions/common";
const metadata = await getContractMetadata({ contract });
```

```ts
function getContractMetadata(
  options: BaseTransactionOptions,
): Promise<{ name: string; symbol: string }>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<{ name: string; symbol: string }>;
```

A promise that resolves to an object containing the resolved metadata, name, and symbol.
---

###### Connect SDK

## COMMON.getDefaultRoyaltyInfo

Calls the "getDefaultRoyaltyInfo" function on the contract.

### Example

```ts
import { getDefaultRoyaltyInfo } from "thirdweb/extensions/common";
 
const result = await getDefaultRoyaltyInfo({
  contract,
});
```

```ts
function getDefaultRoyaltyInfo(
  options: BaseTransactionOptions,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getDefaultRoyaltyInfo function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## COMMON.getPlatformFeeInfo

Calls the "getPlatformFeeInfo" function on the contract.

### Example

```ts
import { getPlatformFeeInfo } from "thirdweb/extensions/common";
 
const result = await getPlatformFeeInfo({
  contract,
});
```

```ts
function getPlatformFeeInfo(
  options: BaseTransactionOptions,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getPlatformFeeInfo function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## COMMON.getRoyaltyInfoForToken

Calls the "getRoyaltyInfoForToken" function on the contract.

### Example

```ts
import { getRoyaltyInfoForToken } from "thirdweb/extensions/common";
 
const result = await getRoyaltyInfoForToken({
 contract,
 tokenId: ...,
});
```

```ts
function getRoyaltyInfoForToken(
  options: BaseTransactionOptions<GetRoyaltyInfoForTokenParams>,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getRoyaltyInfoForToken function.

#### Type

```ts
let options: BaseTransactionOptions<GetRoyaltyInfoForTokenParams>;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## COMMON.isGetContractMetadataSupported

Checks if the `contractURI` method is supported by the given contract.

### Example

```ts
import { isContractURISupported } from "thirdweb/extensions/common";
const supported = isContractURISupported(["0x..."]);
```

```ts
function isGetContractMetadataSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `contractURI` method is supported.
---

###### Connect SDK

## COMMON.isGetDefaultRoyaltyInfoSupported

Checks if the `getDefaultRoyaltyInfo` method is supported by the given contract.

### Example

```ts
import { isGetDefaultRoyaltyInfoSupported } from "thirdweb/extensions/common";
const supported = isGetDefaultRoyaltyInfoSupported(["0x..."]);
```

```ts
function isGetDefaultRoyaltyInfoSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getDefaultRoyaltyInfo` method is supported.
---

###### Connect SDK

## COMMON.isGetPlatformFeeInfoSupported

Checks if the `getPlatformFeeInfo` method is supported by the given contract.

### Example

```ts
import { isGetPlatformFeeInfoSupported } from "thirdweb/extensions/common";
const supported = isGetPlatformFeeInfoSupported(["0x..."]);
```

```ts
function isGetPlatformFeeInfoSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getPlatformFeeInfo` method is supported.
---

###### Connect SDK

## COMMON.isGetRoyaltyInfoForTokenSupported

Checks if the `getRoyaltyInfoForToken` method is supported by the given contract.

### Example

```ts
import { isGetRoyaltyInfoForTokenSupported } from "thirdweb/extensions/common";
const supported = isGetRoyaltyInfoForTokenSupported(["0x..."]);
```

```ts
function isGetRoyaltyInfoForTokenSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getRoyaltyInfoForToken` method is supported.
---

###### Connect SDK

## COMMON.isMulticallSupported

Checks if the `multicall` method is supported by the given contract.

### Example

```ts
import { isMulticallSupported } from "thirdweb/extensions/common";
 
const supported = isMulticallSupported(["0x..."]);
```

```ts
function isMulticallSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `multicall` method is supported.
---

###### Connect SDK

## COMMON.isNameSupported

Checks if the `name` method is supported by the given contract.

### Example

```ts
import { isNameSupported } from "thirdweb/extensions/common";
const supported = isNameSupported(["0x..."]);
```

```ts
function isNameSupported(availableSelectors: Array<string>): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `name` method is supported.
---

###### Connect SDK

## COMMON.isOwnerSupported

Checks if the `owner` method is supported by the given contract.

### Example

```ts
import { isOwnerSupported } from "thirdweb/extensions/common";
const supported = isOwnerSupported(["0x..."]);
```

```ts
function isOwnerSupported(availableSelectors: Array<string>): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `owner` method is supported.
---

###### Connect SDK

## COMMON.isPrimarySaleRecipientSupported

Checks if the `primarySaleRecipient` method is supported by the given contract.

### Example

```ts
import { isPrimarySaleRecipientSupported } from "thirdweb/extensions/common";
const supported = isPrimarySaleRecipientSupported(["0x..."]);
```

```ts
function isPrimarySaleRecipientSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `primarySaleRecipient` method is supported.
---

###### Connect SDK

## COMMON.isSetContractURISupported

Checks if the `setContractURI` method is supported by the given contract.

### Example

```ts
import { isSetContractURISupported } from "thirdweb/extensions/common";
 
const supported = isSetContractURISupported(["0x..."]);
```

```ts
function isSetContractURISupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setContractURI` method is supported.
---

###### Connect SDK

## COMMON.isSetDefaultRoyaltyInfoSupported

Checks if the `setDefaultRoyaltyInfo` method is supported by the given contract.

### Example

```ts
import { isSetDefaultRoyaltyInfoSupported } from "thirdweb/extensions/common";
 
const supported = isSetDefaultRoyaltyInfoSupported(["0x..."]);
```

```ts
function isSetDefaultRoyaltyInfoSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setDefaultRoyaltyInfo` method is supported.
---

###### Connect SDK

## COMMON.isSetPlatformFeeInfoSupported

Checks if the `setPlatformFeeInfo` method is supported by the given contract.

### Example

```ts
import { isSetPlatformFeeInfoSupported } from "thirdweb/extensions/common";
 
const supported = isSetPlatformFeeInfoSupported(["0x..."]);
```

```ts
function isSetPlatformFeeInfoSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setPlatformFeeInfo` method is supported.
---

###### Connect SDK

## COMMON.isSetPrimarySaleRecipientSupported

Checks if the `setPrimarySaleRecipient` method is supported by the given contract.

### Example

```ts
import { isSetPrimarySaleRecipientSupported } from "thirdweb/extensions/common";
 
const supported = isSetPrimarySaleRecipientSupported(["0x..."]);
```

```ts
function isSetPrimarySaleRecipientSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setPrimarySaleRecipient` method is supported.
---

###### Connect SDK

## COMMON.isSetRoyaltyInfoForTokenSupported

Checks if the `setRoyaltyInfoForToken` method is supported by the given contract.

### Example

```ts
import { isSetRoyaltyInfoForTokenSupported } from "thirdweb/extensions/common";
 
const supported = isSetRoyaltyInfoForTokenSupported(["0x..."]);
```

```ts
function isSetRoyaltyInfoForTokenSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setRoyaltyInfoForToken` method is supported.
---

###### Connect SDK

## COMMON.isSymbolSupported

Checks if the `symbol` method is supported by the given contract.

### Example

```ts
import { isSymbolSupported } from "thirdweb/extensions/common";
const supported = isSymbolSupported(["0x..."]);
```

```ts
function isSymbolSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `symbol` method is supported.
---

###### Connect SDK

## COMMON.multicall

Prepares a transaction to call the "multicall" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { multicall } from "thirdweb/extensions/common";
 
const transaction = multicall({
 contract,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function multicall(
  options: BaseTransactionOptions<
    MulticallParams | { asyncParams: () => Promise<MulticallParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "multicall" function.

#### Type

```ts
let options: BaseTransactionOptions<
  MulticallParams | { asyncParams: () => Promise<MulticallParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.name

Retrieves the name associated with the given contract.

### Example

```ts
import { name } from "thirdweb/extensions/common";
 
const contractName = await name({ contract });
```

```ts
function name(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

A promise that resolves to the name associated with the contract.
---

###### Connect SDK

## COMMON.owner

Calls the "owner" function on the contract.

### Example

```ts
import { owner } from "thirdweb/extensions/common";
 
const result = await owner({
  contract,
});
```

```ts
function owner(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the owner function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## COMMON.ownerUpdatedEvent

Creates an event object for the OwnerUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { ownerUpdatedEvent } from "thirdweb/extensions/common";
 
const events = await getContractEvents({
contract,
events: [
 ownerUpdatedEvent({
 prevOwner: ...,
 newOwner: ...,
})
],
});
```

```ts
function ownerUpdatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "prevOwner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "newOwner";
      readonly type: "address";
    },
  ];
  readonly name: "OwnerUpdated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "prevOwner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "newOwner";
      readonly type: "address";
    },
  ];
  readonly name: "OwnerUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## COMMON.primarySaleRecipient

Calls the "primarySaleRecipient" function on the contract.

### Example

```ts
import { primarySaleRecipient } from "thirdweb/extensions/common";
 
const result = await primarySaleRecipient({
  contract,
});
```

```ts
function primarySaleRecipient(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the primarySaleRecipient function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## COMMON.setContractMetadata

Sets the metadata for a contract.

### Example

```ts
import { setContractMetadata } from "@thirdweb/extensions/common";
import { sendTransaction } from "thirdweb";
 
const transaction = setContractMetadata({
  contract,
  name: "My NFT",
  symbol: "NFT",
});
 
// Send the transaction
await sendTransaction({
  transaction,
  account,
});
```

```ts
function setContractMetadata(
  options: BaseTransactionOptions<SetContractMetadataParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for setting the contract metadata.

#### Type

```ts
let options: BaseTransactionOptions<SetContractMetadataParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

* The prepared transaction to set the contract metadata.
---

###### Connect SDK

## COMMON.setContractURI

Prepares a transaction to call the "setContractURI" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setContractURI } from "thirdweb/extensions/common";
 
const transaction = setContractURI({
 contract,
 uri: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setContractURI(
  options: BaseTransactionOptions<
    | SetContractURIParams
    | { asyncParams: () => Promise<SetContractURIParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setContractURI" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetContractURIParams
  | { asyncParams: () => Promise<SetContractURIParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.setDefaultRoyaltyInfo

Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setDefaultRoyaltyInfo } from "thirdweb/extensions/common";
 
const transaction = setDefaultRoyaltyInfo({
 contract,
 royaltyRecipient: ...,
 royaltyBps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setDefaultRoyaltyInfo(
  options: BaseTransactionOptions<
    | SetDefaultRoyaltyInfoParams
    | { asyncParams: () => Promise<SetDefaultRoyaltyInfoParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setDefaultRoyaltyInfo" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetDefaultRoyaltyInfoParams
  | { asyncParams: () => Promise<SetDefaultRoyaltyInfoParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.setOwner

Prepares a transaction to call the "setOwner" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setOwner } from "thirdweb/extensions/common";
 
const transaction = setOwner({
 contract,
 newOwner: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setOwner(
  options: BaseTransactionOptions<
    SetOwnerParams | { asyncParams: () => Promise<SetOwnerParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setOwner" function.

#### Type

```ts
let options: BaseTransactionOptions<
  SetOwnerParams | { asyncParams: () => Promise<SetOwnerParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.setPlatformFeeInfo

Prepares a transaction to call the "setPlatformFeeInfo" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setPlatformFeeInfo } from "thirdweb/extensions/common";
 
const transaction = setPlatformFeeInfo({
 contract,
 platformFeeRecipient: ...,
 platformFeeBps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setPlatformFeeInfo(
  options: BaseTransactionOptions<
    | SetPlatformFeeInfoParams
    | { asyncParams: () => Promise<SetPlatformFeeInfoParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setPlatformFeeInfo" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetPlatformFeeInfoParams
  | { asyncParams: () => Promise<SetPlatformFeeInfoParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.setPrimarySaleRecipient

Prepares a transaction to call the "setPrimarySaleRecipient" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setPrimarySaleRecipient } from "thirdweb/extensions/common";
 
const transaction = setPrimarySaleRecipient({
 contract,
 saleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setPrimarySaleRecipient(
  options: BaseTransactionOptions<
    | SetPrimarySaleRecipientParams
    | { asyncParams: () => Promise<SetPrimarySaleRecipientParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setPrimarySaleRecipient" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetPrimarySaleRecipientParams
  | { asyncParams: () => Promise<SetPrimarySaleRecipientParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.setRoyaltyInfoForToken

Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setRoyaltyInfoForToken } from "thirdweb/extensions/common";
 
const transaction = setRoyaltyInfoForToken({
 contract,
 tokenId: ...,
 recipient: ...,
 bps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setRoyaltyInfoForToken(
  options: BaseTransactionOptions<
    | SetRoyaltyInfoForTokenParams
    | { asyncParams: () => Promise<SetRoyaltyInfoForTokenParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setRoyaltyInfoForToken" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetRoyaltyInfoForTokenParams
  | { asyncParams: () => Promise<SetRoyaltyInfoForTokenParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## COMMON.symbol

Retrieves the name associated with the given contract.

### Example

```ts
import { symbol } from "thirdweb/extensions/common";
 
const contractSymbol = await symbol({ contract });
```

```ts
function symbol(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

A promise that resolves to the name associated with the contract.
---
## ENS
---

###### Connect SDK

## ENS.parseNftUri

Parses an NFT URI.

### Example

```ts
import { parseNftUri } from "thirdweb/utils/ens";
const nftUri = await parseNftUri({
  client,
  uri: "eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063",
});
 
console.log(nftUri); // ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/
```

```ts
function parseNftUri(options: {
  client: ThirdwebClient;
  uri: string;
}): Promise<null | string>;
```

### Parameters

The options for parsing an NFT URI.

#### Type

```ts
let options: { client: ThirdwebClient; uri: string };
```

### Returns

```ts
let returnType: Promise<null | string>;
```

A promise that resolves to the NFT URI, or null if the URI could not be parsed.
---

###### Connect SDK

## ENS.parseAvatarRecord

Parses an ENS or similar avatar record. Supports NFT URIs, IPFS scheme, and HTTPS URIs.

### Example

```ts
import { parseAvatarRecord } from "thirdweb/utils/ens";
const avatarUrl = await parseAvatarRecord({
  client,
  uri: "ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/",
});
 
console.log(avatarUrl); // "https://ipfs.io/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/"
 
const avatarUrl2 = await parseAvatarRecord({
  client,
  uri: "eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063",
});
 
console.log(avatarUrl2); // "https://opensea.io/assets/0xb32979486938aa9694bfc898f35dbed459f44424/10063"
```

```ts
function parseAvatarRecord(
  options: ParseAvatarOptions,
): Promise<null | string>;
```

### Parameters

The options for parsing an ENS avatar record.

#### Type

```ts
let options: { client: ThirdwebClient; uri: string };
```

### Returns

```ts
let returnType: Promise<null | string>;
```

A promise that resolves to the avatar URL, or null if the URI could not be parsed.
---

###### Connect SDK

## ENS.resolveAddress

Resolves an ENS name to an Ethereum address.

### Example

```ts
import { resolveAddress } from "thirdweb/extensions/ens";
const address = await resolveAddress({
  client,
  name: "vitalik.eth",
});
```

Resolve an address to a Basename.

```ts
import {
  resolveAddress,
  BASENAME_RESOLVER_ADDRESS,
} from "thirdweb/extensions/ens";
import { base } from "thirdweb/chains";
const address = await resolveAddress({
  client,
  name: "myk.base.eth",
  resolverAddress: BASENAME_RESOLVER_ADDRESS,
  resolverChain: base,
});
```

```ts
function resolveAddress(
  options: ResolveAddressOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for resolving an ENS address.

#### Type

```ts
let options: {
  client: ThirdwebClient;
  name: string;
  resolverAddress?: string;
  resolverChain?: Chain;
};
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the Ethereum address.
---

###### Connect SDK

## ENS.resolveAvatar

Resolves an ENS name to the avatar URL.

### Example

```ts
import { resolveAvatar } from "thirdweb/extensions/ens";
const address = await resolveAvatar({
  client,
  name: "vitalik.eth",
});
```

```ts
function resolveAvatar(
  options: ResolveAvatarOptions,
): Promise<null | string>;
```

### Parameters

The options for resolving an ENS address.

#### Type

```ts
let options: {
  client: ThirdwebClient;
  name: string;
  resolverAddress?: string;
  resolverChain?: Chain;
};
```

### Returns

```ts
let returnType: Promise<null | string>;
```

A promise that resolves to the avatar url, or null if not set.
---

###### Connect SDK

## ENS.resolveL2Name

Resolves the L2 name for a specified address.

### Example

```ts
import { resolveL2Name } from "thirdweb/extensions/ens";
const name = await resolveL2Name({
  client,
  address: "0x1234...",
  resolverAddress: "0x...",
  resolverChain: base,
});
```

Resolve a Basename.

```ts
import {
  resolveL2Name,
  BASENAME_RESOLVER_ADDRESS,
} from "thirdweb/extensions/ens";
import { base } from "thirdweb/chains";
const name = await resolveL2Name({
  client,
  address: "0x1234...",
  resolverAddress: BASENAME_RESOLVER_ADDRESS,
  resolverChain: base,
});
```

```ts
function resolveL2Name(
  options: ResolveL2NameOptions,
): Promise<null | string>;
```

### Parameters

The options for resolving an L2 ENS address.

#### Type

```ts
let options: {
  address: Address;
  client: ThirdwebClient;
  resolverAddress: string;
  resolverChain: Chain;
};
```

### Returns

```ts
let returnType: Promise<null | string>;
```

A promise that resolves to the Ethereum address.
---

###### Connect SDK

## ENS.resolveName

Resolves the primary name for a specified address.

### Example

```ts
import { resolveName } from "thirdweb/extensions/ens";
const name = await resolveName({
  client,
  address: "0x1234...",
});
```

```ts
function resolveName(
  options: ResolveNameOptions,
): Promise<null | string>;
```

### Parameters

The options for resolving an ENS address.

#### Type

```ts
let options: {
  address: Address;
  client: ThirdwebClient;
  resolverAddress?: string;
  resolverChain?: Chain;
};
```

### Returns

```ts
let returnType: Promise<null | string>;
```

A promise that resolves to the Ethereum address.
---

###### Connect SDK

## ENS.resolveText

Resolves an ENS name and key to the specified record.

### Example

```ts
import { resolveText } from "thirdweb/extensions/ens";
const twitterUsername = await resolveText({
  client,
  name: "vitalik.eth",
  key: "com.twitter",
});
```

```ts
function resolveText(
  options: ResolveTextOptions,
): Promise<null | string>;
```

### Parameters

The options for resolving an ENS address.

#### Type

```ts
let options: {
  client: ThirdwebClient;
  key: string;
  name: string;
  resolverAddress?: string;
  resolverChain?: Chain;
};
```

### Returns

```ts
let returnType: Promise<null | string>;
```

A promise that resolves to the text record.
---
## ERC1155
---

###### Connect SDK

## ERC1155.approvalForAllEvent

Creates an event object for the ApprovalForAll event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { approvalForAllEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 approvalForAllEvent({
 _owner: ...,
 _operator: ...,
})
],
});
```

```ts
function approvalForAllEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "_owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_operator";
      readonly type: "address";
    },
    { readonly name: "_approved"; readonly type: "bool" },
  ];
  readonly name: "ApprovalForAll";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "_owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_operator";
      readonly type: "address";
    },
    { readonly name: "_approved"; readonly type: "bool" },
  ];
  readonly name: "ApprovalForAll";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.balanceOf

Calls the "balanceOf" function on the contract.

### Example

```ts
import { balanceOf } from "thirdweb/extensions/erc1155";
 
const result = await balanceOf({
 contract,
 owner: ...,
 tokenId: ...,
});
```

```ts
function balanceOf(
  options: BaseTransactionOptions<BalanceOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the balanceOf function.

#### Type

```ts
let options: BaseTransactionOptions<BalanceOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.balanceOfBatch

Calls the "balanceOfBatch" function on the contract.

### Example

```ts
import { balanceOfBatch } from "thirdweb/extensions/erc1155";
 
const result = await balanceOfBatch({
 contract,
 owners: ...,
 tokenIds: ...,
});
```

```ts
function balanceOfBatch(options: BaseTransactionOptions<BalanceOfBatchParams>) : Promise<readonly Array<bigint>>
```

### Parameters

The options for the balanceOfBatch function.

#### Type

```ts
let options: BaseTransactionOptions<BalanceOfBatchParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<bigint>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.batchMetadataUpdateEvent

Creates an event object for the BatchMetadataUpdate event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { batchMetadataUpdateEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
  contract,
  events: [batchMetadataUpdateEvent()],
});
```

```ts
function batchMetadataUpdateEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "_fromTokenId"; readonly type: "uint256" },
    { readonly name: "_toTokenId"; readonly type: "uint256" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "_fromTokenId"; readonly type: "uint256" },
    { readonly name: "_toTokenId"; readonly type: "uint256" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.burn

Prepares a transaction to call the "burn" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { burn } from "thirdweb/extensions/erc1155";
 
const transaction = burn({
 contract,
 account: ...,
 id: ...,
 value: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function burn(
  options: BaseTransactionOptions<
    BurnParams | { asyncParams: () => Promise<BurnParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "burn" function.

#### Type

```ts
let options: BaseTransactionOptions<
  BurnParams | { asyncParams: () => Promise<BurnParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.burnBatch

Prepares a transaction to call the "burnBatch" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { burnBatch } from "thirdweb/extensions/erc1155";
 
const transaction = burnBatch({
 contract,
 account: ...,
 ids: ...,
 values: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function burnBatch(
  options: BaseTransactionOptions<
    BurnBatchParams | { asyncParams: () => Promise<BurnBatchParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "burnBatch" function.

#### Type

```ts
let options: BaseTransactionOptions<
  BurnBatchParams | { asyncParams: () => Promise<BurnBatchParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.canClaim

Check if a user can claim a drop. This method is only available on the `DropERC1155` contract.

### Example

```ts
const claimResult = await canClaim({
  contract: contract,
  claimer: "0x1234567890123456789012345678901234567890",
  quantity: "1",
  tokenId: 0n,
});
```

```ts
function canClaim(
  options: BaseTransactionOptions<CanClaimParams>,
): Promise<CanClaimResult>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: BaseTransactionOptions<CanClaimParams>;
```

### Returns

```ts
let returnType: { reason?: string; result: boolean };
```

Whether the user can claim the drop.
---

###### Connect SDK

## ERC1155.claimCondition

Calls the "claimCondition" function on the contract.

### Example

```ts
import { claimCondition } from "thirdweb/extensions/erc1155";
 
const result = await claimCondition({
 contract,
 tokenId: ...,
});
```

```ts
function claimCondition(
  options: BaseTransactionOptions<ClaimConditionParams>,
): Promise<
  readonly [
    bigint,
    bigint,
    bigint,
    bigint,
    `0x${string}`,
    bigint,
    string,
    string,
  ]
>;
```

### Parameters

The options for the claimCondition function.

#### Type

```ts
let options: BaseTransactionOptions<ClaimConditionParams>;
```

### Returns

```ts
let returnType: Promise<
  readonly [
    bigint,
    bigint,
    bigint,
    bigint,
    `0x${string}`,
    bigint,
    string,
    string,
  ]
>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.claimTo

Claim ERC1155 NFTs to a specified address This method is only available on the `DropERC1155` contract.

### Example

#### Basic usage

```ts
import { claimTo } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = claimTo({
  contract,
  to: "0x...",
  tokenId: 0n,
  quantity: 1n,
});
 
await sendTransaction({ transaction, account });
```

#### For Drops with allowlists

You need to specify the claimer address as the `from` param to avoid any issue with the allowlist

```ts
const transaction = claimTo({
  contract,
  to: "0x...",
  tokenId: 0n,
  quantity: 1n,
  from: "0x...", // address of the one claiming
});
```

```ts
function claimTo(
  options: BaseTransactionOptions<ClaimToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transaction

#### Type

```ts
let options: BaseTransactionOptions<ClaimToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The prepared transaction
---

###### Connect SDK

## ERC1155.createPack

Prepares a transaction to call the "createPack" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { createPack } from "thirdweb/extensions/erc1155";
 
const transaction = createPack({
 contract,
 contents: ...,
 numOfRewardUnits: ...,
 packUri: ...,
 openStartTimestamp: ...,
 amountDistributedPerOpen: ...,
 recipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function createPack(
  options: BaseTransactionOptions<
    | CreatePackParams
    | { asyncParams: () => Promise<CreatePackParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "createPack" function.

#### Type

```ts
let options: BaseTransactionOptions<
  CreatePackParams | { asyncParams: () => Promise<CreatePackParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.encodeSafeTransferFrom

Encodes the "safeTransferFrom" function into a Hex string with its parameters.

### Example

```ts
import { encodeSafeTransferFrom } from "thirdweb/extensions/erc1155";
const result = encodeSafeTransferFrom({
 from: ...,
 to: ...,
 tokenId: ...,
 value: ...,
 data: ...,
});
```

```ts
function encodeSafeTransferFrom(
  options: SafeTransferFromParams,
): `0xf242432a${string}`;
```

### Parameters

The options for the safeTransferFrom function.

#### Type

```ts
let options: WithOverrides<{
  data: AbiParameterToPrimitiveType<{ name: "_data"; type: "bytes" }>;
  from: AbiParameterToPrimitiveType<{
    name: "_from";
    type: "address";
  }>;
  to: AbiParameterToPrimitiveType<{ name: "_to"; type: "address" }>;
  tokenId: AbiParameterToPrimitiveType<{
    name: "tokenId";
    type: "uint256";
  }>;
  value: AbiParameterToPrimitiveType<{
    name: "_value";
    type: "uint256";
  }>;
}>;
```

### Returns

```ts
let returnType: `0xf242432a${string}`;
```

The encoded hexadecimal string.
---

###### Connect SDK

## ERC1155.freezeMetadata

Prepares a transaction to call the "freezeMetadata" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { freezeMetadata } from "thirdweb/extensions/erc1155";
 
const transaction = freezeMetadata();
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function freezeMetadata(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "freezeMetadata" function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.generateMintSignature

Generates the payload and signature for minting an ERC1155 token.

### Example

```ts
import {
  mintWithSignature,
  generateMintSignature,
} from "thirdweb/extensions/erc1155";
 
const { payload, signature } = await generateMintSignature({
  account,
  contract,
  mintRequest: {
    to: "0x...",
    quantity: 10n,
    metadata: {
      name: "My NFT",
      description: "This is my NFT",
      image: "https://example.com/image.png",
    },
  },
});
 
const transaction = mintWithSignature({
  contract,
  payload,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function generateMintSignature(
  options: GenerateMintSignatureOptions,
): Promise<{
  payload: {
    currency: string;
    pricePerToken: bigint;
    primarySaleRecipient: string;
    quantity: bigint;
    royaltyBps: bigint;
    royaltyRecipient: string;
    to: string;
    tokenId: bigint;
    uid: `0x${string}`;
    uri: string;
    validityEndTimestamp: bigint;
    validityStartTimestamp: bigint;
  };
  signature: `0x${string}`;
}>;
```

### Parameters

The options for the minting process.

#### Type

```ts
let options: {
  account: Account;
  contract: ThirdwebContract;
  contractType?: "TokenERC1155" | "SignatureMintERC1155";
  mintRequest: GeneratePayloadInput;
};
```

### Returns

```ts
let returnType: Promise<{
  payload: {
    currency: string;
    pricePerToken: bigint;
    primarySaleRecipient: string;
    quantity: bigint;
    royaltyBps: bigint;
    royaltyRecipient: string;
    to: string;
    tokenId: bigint;
    uid: `0x${string}`;
    uri: string;
    validityEndTimestamp: bigint;
    validityStartTimestamp: bigint;
  };
  signature: `0x${string}`;
}>;
```

A promise that resolves to the payload and signature.
---

###### Connect SDK

## ERC1155.getActiveClaimCondition

Retrieves the active claim condition. This method is only available on the `DropERC1155` contract.

### Example

```ts
import { getActiveClaimCondition } from "thirdweb/extensions/erc1155";
const activeClaimCondition = await getActiveClaimCondition({
  contract,
  tokenId,
});
```

```ts
function getActiveClaimCondition(
  options: BaseTransactionOptions<GetActiveClaimConditionIdParams>,
): Promise<ClaimCondition>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<GetActiveClaimConditionIdParams>;
```

### Returns

```ts
let returnType: Promise<ClaimCondition>;
```

A promise that resolves to the active claim condition.
---

###### Connect SDK

## ERC1155.getClaimConditionById

Calls the "getClaimConditionById" function on the contract.

### Example

```ts
import { getClaimConditionById } from "thirdweb/extensions/erc1155";
 
const result = await getClaimConditionById({
 contract,
 tokenId: ...,
 conditionId: ...,
});
```

```ts
function getClaimConditionById(
  options: BaseTransactionOptions<GetClaimConditionByIdParams>,
): Promise<{
  currency: string;
  maxClaimableSupply: bigint;
  merkleRoot: `0x${string}`;
  metadata: string;
  pricePerToken: bigint;
  quantityLimitPerWallet: bigint;
  startTimestamp: bigint;
  supplyClaimed: bigint;
}>;
```

### Parameters

The options for the getClaimConditionById function.

#### Type

```ts
let options: BaseTransactionOptions<GetClaimConditionByIdParams>;
```

### Returns

```ts
let returnType: Promise<{
  currency: string;
  maxClaimableSupply: bigint;
  merkleRoot: `0x${string}`;
  metadata: string;
  pricePerToken: bigint;
  quantityLimitPerWallet: bigint;
  startTimestamp: bigint;
  supplyClaimed: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.getClaimConditions

Retrieves all claim conditions. This method is only available on the `DropERC1155` contract.

### Example

```ts
import { getClaimConditions } from "thirdweb/extensions/erc1155";
const conditions = await getClaimConditions({
  contract,
  tokenId: 1n,
});
```

```ts
function getClaimConditions(
  options: {
    contract: Readonly<ContractOptions<any, `0x${string}`>>;
  } & GetClaimConditionsParams & { singlePhaseDrop?: boolean },
): Promise<Array<ClaimCondition>>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: {
  contract: Readonly<ContractOptions<any, `0x${string}`>>;
} & GetClaimConditionsParams & { singlePhaseDrop?: boolean };
```

### Returns

```ts
let returnType: Promise<Array<ClaimCondition>>;
```

A promise that resolves to all claim conditions.
---

###### Connect SDK

## ERC1155.getNFT

Retrieves information about a specific ERC1155 non-fungible token (NFT).

### Example

```ts
import { getNFT } from "thirdweb/extensions/erc1155";
const nft = await getNFT({
  contract,
  tokenId: 1n,
});
```

```ts
function getNFT(
  options: BaseTransactionOptions<GetNFTParams>,
): Promise<NFT>;
```

### Parameters

The options for retrieving the NFT.

#### Type

```ts
let options: BaseTransactionOptions<GetNFTParams>;
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```

A promise that resolves to the NFT object.
---

###### Connect SDK

## ERC1155.getNFTs

Retrieves an array of NFTs ("ERC1155") based on the provided options.

### Example

```ts
import { getNFTs } from "thirdweb/extensions/erc1155";
const nfts = await getNFTs({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getNFTs(
  options: BaseTransactionOptions<GetNFTsParams>,
): Promise<Array<NFT>>;
```

### Parameters

The options for retrieving the NFTs.

#### Type

```ts
let options: BaseTransactionOptions<GetNFTsParams>;
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```

A promise that resolves to an array of NFTs.
---

###### Connect SDK

## ERC1155.getOwnedNFTs

Retrieves the owned ERC1155 NFTs for a given wallet address.

### Example

```ts
import { getOwnedNFTs } from "thirdweb/extensions/erc1155";
const nfts = await getOwnedNFTs({
  contract,
  start: 0,
  count: 10,
  address: "0x123...",
});
```

```ts
function getOwnedNFTs(
  options: BaseTransactionOptions<GetOwnedNFTsParams>,
): Promise<Array<NFT & { quantityOwned: bigint }>>;
```

### Parameters

The transaction options and parameters.

#### Type

```ts
let options: BaseTransactionOptions<GetOwnedNFTsParams>;
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```

A promise that resolves to an array of ERC1155 NFTs owned by the wallet address, along with the quantity owned.
---

###### Connect SDK

## ERC1155.getOwnedTokenIds

Retrieves the owned ERC1155 tokenIds & the owned balance of each tokenId for a given wallet address.

### Example

```ts
import { getOwnedNFTs } from "thirdweb/extensions/erc1155";
const ownedTokenIds = await getOwnedTokenIds({
  contract,
  start: 0,
  count: 10,
  address: "0x123...",
});
```

```ts
function getOwnedTokenIds(
  options: BaseTransactionOptions<GetOwnedTokenIdsParams>,
): Promise<Array<{ balance: bigint; tokenId: bigint }>>;
```

### Parameters

The transaction options and parameters.

#### Type

```ts
let options: BaseTransactionOptions<GetOwnedTokenIdsParams>;
```

### Returns

```ts
let returnType: Promise<Array<{ balance: bigint; tokenId: bigint }>>;
```

A promise that resolves to an array of ERC1155 NFTs owned by the wallet address, along with the quantity owned.
---

###### Connect SDK

## ERC1155.isApprovedForAll

Calls the "isApprovedForAll" function on the contract.

### Example

```ts
import { isApprovedForAll } from "thirdweb/extensions/erc1155";
 
const result = await isApprovedForAll({
 contract,
 owner: ...,
 operator: ...,
});
```

```ts
function isApprovedForAll(
  options: BaseTransactionOptions<IsApprovedForAllParams>,
): Promise<boolean>;
```

### Parameters

The options for the isApprovedForAll function.

#### Type

```ts
let options: BaseTransactionOptions<IsApprovedForAllParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.isBurnSupported

Checks if the `burn` method is supported by the given contract.

### Example

```ts
import { isBurnSupported } from "thirdweb/extensions/erc1155";
 
const supported = isBurnSupported(["0x..."]);
```

```ts
function isBurnSupported(availableSelectors: Array<string>): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `burn` method is supported.
---

###### Connect SDK

## ERC1155.isClaimToSupported

Checks if the `claimTo` method is supported by the given contract.

### Example

```ts
import { isClaimToSupported } from "thirdweb/extensions/erc1155";
 
const supported = isClaimToSupported(["0x..."]);
```

```ts
function isClaimToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `claimTo` method is supported.
---

###### Connect SDK

## ERC1155.isERC1155

Check if a contract supports the ERC1155 interface.

### Example

```ts
import { isERC1155 } from "thirdweb/extensions/erc1155";
const result = await isERC1155({ contract });
```

```ts
function isERC1155(options: BaseTransactionOptions): Promise<boolean>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean indicating whether the contract supports the ERC1155 interface.
---

###### Connect SDK

## ERC1155.isGetActiveClaimConditionSupported

Checks if the `getActiveClaimCondition` method is supported by the given contract.

### Example

```ts
import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc1155";
 
const supported = isGetActiveClaimConditionSupported(["0x..."]);
```

```ts
function isGetActiveClaimConditionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getActiveClaimCondition` method is supported.
---

###### Connect SDK

## ERC1155.isGetClaimConditionByIdSupported

Checks if the `getClaimConditionById` method is supported by the given contract.

### Example

```ts
import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc1155";
const supported = isGetClaimConditionByIdSupported(["0x..."]);
```

```ts
function isGetClaimConditionByIdSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getClaimConditionById` method is supported.
---

###### Connect SDK

## ERC1155.isGetClaimConditionsSupported

Checks if the `getClaimConditions` method is supported by the given contract.

### Example

```ts
import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc1155";
 
const supported = isGetClaimConditionsSupported(["0x..."]);
```

```ts
function isGetClaimConditionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getClaimConditions` method is supported.
---

###### Connect SDK

## ERC1155.isGetNFTsSupported

Checks if the `getNFTs` method is supported by the given contract.

### Example

```ts
import { isGetNFTsSupported } from "thirdweb/extensions/erc721";
 
const supported = isGetNFTsSupported(["0x..."]);
```

```ts
function isGetNFTsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getNFTs` method is supported.
---

###### Connect SDK

## ERC1155.isGetNFTSupported

Checks if the `uri` method is supported by the given contract.

### Example

```ts
import { isUriSupported } from "thirdweb/extensions/erc1155";
const supported = isUriSupported(["0x..."]);
```

```ts
function isGetNFTSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `uri` method is supported.
---

###### Connect SDK

## ERC1155.isLazyMintSupported

Checks if the `lazyMint` method is supported by the given contract.

### Example

```ts
import { isLazyMintSupported } from "thirdweb/extensions/erc1155";
 
const supported = isLazyMintSupported(["0x..."]);
```

```ts
function isLazyMintSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `lazyMint` method is supported.
---

###### Connect SDK

## ERC1155.isMintAdditionalSupplyToSupported

Checks if the `mintAdditionalSupplyTo` method is supported by the given contract.

### Example

```ts
import { isMintAdditionalSupplyToSupported } from "thirdweb/extensions/erc1155";
 
const supported = isMintAdditionalSupplyToSupported(["0x..."]);
```

```ts
function isMintAdditionalSupplyToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `mintAdditionalSupplyTo` method is supported.
---

###### Connect SDK

## ERC1155.isMintToSupported

Checks if the `mintTo` method is supported by the given contract.

### Example

```ts
import { isMintToSupported } from "thirdweb/extensions/erc1155";
 
const supported = isMintToSupported(["0x..."]);
```

```ts
function isMintToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `mintTo` method is supported.
---

###### Connect SDK

## ERC1155.isNextTokenIdToMintSupported

Checks if the `nextTokenIdToMint` method is supported by the given contract.

### Example

```ts
import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc1155";
const supported = isNextTokenIdToMintSupported(["0x..."]);
```

```ts
function isNextTokenIdToMintSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `nextTokenIdToMint` method is supported.
---

###### Connect SDK

## ERC1155.isResetClaimEligibilitySupported

Checks if the `resetClaimEligibility` method is supported by the given contract.

### Example

```ts
import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc1155";
 
const supported = isResetClaimEligibilitySupported(["0x..."]);
```

```ts
function isResetClaimEligibilitySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `resetClaimEligibility` method is supported.
---

###### Connect SDK

## ERC1155.isSetClaimConditionsSupported

Checks if the `setClaimConditions` method is supported by the given contract.

### Example

```ts
import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc1155";
 
const supported = isSetClaimConditionsSupported(["0x..."]);
```

```ts
function isSetClaimConditionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setClaimConditions` method is supported.
---

###### Connect SDK

## ERC1155.isTotalSupplySupported

Checks if the `totalSupply` method is supported by the given contract.

### Example

```ts
import { isTotalSupplySupported } from "thirdweb/extensions/erc1155";
const supported = isTotalSupplySupported(["0x..."]);
```

```ts
function isTotalSupplySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `totalSupply` method is supported.
---

###### Connect SDK

## ERC1155.isUpdateTokenURISupported

Checks if the `setTokenURI` method is supported by the given contract.

### Example

```ts
import { isSetTokenURISupported } from "thirdweb/extensions/erc1155";
 
const supported = isSetTokenURISupported(["0x..."]);
```

```ts
function isUpdateTokenURISupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setTokenURI` method is supported.
---

###### Connect SDK

## ERC1155.lazyMint

Lazily mints ERC1155 tokens. This method is only available on the `DropERC1155` contract.

### Example

```ts
import { lazyMint } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = lazyMint({
  contract,
  nfts: [
    {
      name: "My NFT",
      description: "This is my NFT",
      image: "https://example.com/image.png",
    },
  ],
});
 
await sendTransaction({ transaction, account });
```

```ts
function lazyMint(
  options: BaseTransactionOptions<LazyMintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the lazy minting process.

#### Type

```ts
let options: BaseTransactionOptions<LazyMintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the prepared contract call.
---

###### Connect SDK

## ERC1155.metadataFrozenEvent

Creates an event object for the MetadataFrozen event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { metadataFrozenEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
  contract,
  events: [metadataFrozenEvent()],
});
```

```ts
function metadataFrozenEvent(): PreparedEvent<{
  readonly inputs: readonly [];
  readonly name: "MetadataFrozen";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [];
  readonly name: "MetadataFrozen";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.metadataUpdateEvent

Creates an event object for the MetadataUpdate event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { metadataUpdateEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
  contract,
  events: [metadataUpdateEvent()],
});
```

```ts
function metadataUpdateEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "_tokenId"; readonly type: "uint256" },
  ];
  readonly name: "MetadataUpdate";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "_tokenId"; readonly type: "uint256" },
  ];
  readonly name: "MetadataUpdate";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.mintAdditionalSupplyTo

Mints a "supply" number of additional ERC1155 tokens to the specified "to" address. This method is only available on the `TokenERC1155` contract.

### Example

```ts
import { mintAdditionalSupplyTo } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = mintAdditionalSupplyTo({
  contract,
  to: "0x...",
  tokenId: 1n,
  supply: 10n,
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintAdditionalSupplyTo(
  options: BaseTransactionOptions<MintAdditionalSupplyToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<MintAdditionalSupplyToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC1155.mintAdditionalSupplyToBatch

This extension batches multiple `mintAdditionalSupplyToBatch` extensions into one single multicall. This method is only available on the `TokenERC1155` contract. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on.

You are recommended to experiment with the number to figure out the best number for your chain of choice.

### Example

```ts
import { mintAdditionalSupplyToBatch } from "thirdweb/extensions/erc1155";
 
const transaction = mintAdditionalSupplyToBatch({
  contract,
  nfts: [
    { tokenId: 0n, supply: 99n, to: account.address },
    { tokenId: 1n, supply: 98n, to: account.address },
    { tokenId: 2n, supply: 97n, to: account.address },
  ],
});
```

```ts
function mintAdditionalSupplyToBatch(
  options: BaseTransactionOptions<MintAdditionalSupplyToBatchParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<MintAdditionalSupplyToBatchParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```
---

###### Connect SDK

## ERC1155.mintTo

Mints a "supply" number of new ERC1155 tokens to the specified "to" address. This method is only available on the `TokenERC1155` contract. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI.

### Example

```ts
import { mintTo } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = mintTo({
  contract,
  to: "0x...",
  supply: 10n,
  nft: {
    name: "My NFT",
    description: "This is my NFT",
    image: "https://example.com/image.png",
  },
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintTo(
  options: BaseTransactionOptions<MintToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<MintToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC1155.mintToBatch

This extension batches multiple `mintTo` extensions into one single multicall. This method is only available on the `TokenERC1155` contract. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on.

You are recommended to experiment with the number to figure out the best number for your chain of choice.

### Example

```ts
import { mintBatchTo } from "thirdweb/extension/erc1155";
 
const transaction = mintToBatch({
  contract: editionContract,
  to: "0x...",
  nfts: [
    {
      metadata: {
        name: "Token #0",
        image: "...",
        attributes: [],
      },
      supply: 100n,
    },
    {
      metadata: {
        name: "Token #1",
        image: "...",
        attributes: [],
      },
      supply: 111n,
    },
  ],
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintToBatch(
  options: BaseTransactionOptions<MintToBatchParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

the transaction options

#### Type

```ts
let options: BaseTransactionOptions<MintToBatchParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC1155.mintWithSignature

Mints a new ERC1155 token with the given minter signature This method is only available on the `TokenERC1155` contract.

### Example

```ts
import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const { payload, signature } = await generateMintSignature(...)
 
const transaction = mintWithSignature({
  contract,
  payload,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function mintWithSignature(
  options: BaseTransactionOptions<MintWithSignatureParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<MintWithSignatureParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC1155.nextTokenId

Calls the "nextTokenId" function on the contract.

### Example

```ts
import { nextTokenId } from "thirdweb/extensions/erc1155";
 
const result = await nextTokenId({
  contract,
});
```

```ts
function nextTokenId(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the nextTokenId function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.nextTokenIdToMint

Calls the "nextTokenIdToMint" function on the contract.

### Example

```ts
import { nextTokenIdToMint } from "thirdweb/extensions/erc1155";
 
const result = await nextTokenIdToMint({
  contract,
});
```

```ts
function nextTokenIdToMint(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the nextTokenIdToMint function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.openPack

Prepares a transaction to call the "openPack" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { openPack } from "thirdweb/extensions/erc1155";
 
const transaction = openPack({
 contract,
 packId: ...,
 amountToOpen: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function openPack(
  options: BaseTransactionOptions<
    OpenPackParams | { asyncParams: () => Promise<OpenPackParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "openPack" function.

#### Type

```ts
let options: BaseTransactionOptions<
  OpenPackParams | { asyncParams: () => Promise<OpenPackParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.packCreatedEvent

Creates an event object for the PackCreated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { packCreatedEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 packCreatedEvent({
 packId: ...,
})
],
});
```

```ts
function packCreatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackCreated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackCreated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.packOpenedEvent

Creates an event object for the PackOpened event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { packOpenedEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 packOpenedEvent({
 packId: ...,
 opener: ...,
})
],
});
```

```ts
function packOpenedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "opener";
      readonly type: "address";
    },
    { readonly name: "numOfPacksOpened"; readonly type: "uint256" },
    {
      readonly components: readonly [
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "totalAmount"; readonly type: "uint256" },
      ];
      readonly name: "rewardUnitsDistributed";
      readonly type: "tuple[]";
    },
  ];
  readonly name: "PackOpened";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "opener";
      readonly type: "address";
    },
    { readonly name: "numOfPacksOpened"; readonly type: "uint256" },
    {
      readonly components: readonly [
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "totalAmount"; readonly type: "uint256" },
      ];
      readonly name: "rewardUnitsDistributed";
      readonly type: "tuple[]";
    },
  ];
  readonly name: "PackOpened";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.packUpdatedEvent

Creates an event object for the PackUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { packUpdatedEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 packUpdatedEvent({
 packId: ...,
})
],
});
```

```ts
function packUpdatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackUpdated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.resetClaimEligibility

Reset the claim eligibility for all users. This method is only available on the `DropERC1155` contract.

### Example

```ts
import { resetClaimEligibility } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = resetClaimEligibility({
  contract,
});
 
await sendTransaction({ transaction, account });
```

```ts
function resetClaimEligibility(
  options: {
    contract: Readonly<ContractOptions<any, `0x${string}`>>;
  } & GetClaimConditionsParams & { singlePhaseDrop?: boolean },
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: {
  contract: Readonly<ContractOptions<any, `0x${string}`>>;
} & GetClaimConditionsParams & { singlePhaseDrop?: boolean };
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC1155.safeBatchTransferFrom

Prepares a transaction to call the "safeBatchTransferFrom" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { safeBatchTransferFrom } from "thirdweb/extensions/erc1155";
 
const transaction = safeBatchTransferFrom({
 contract,
 from: ...,
 to: ...,
 tokenIds: ...,
 values: ...,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function safeBatchTransferFrom(
  options: BaseTransactionOptions<
    | SafeBatchTransferFromParams
    | { asyncParams: () => Promise<SafeBatchTransferFromParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "safeBatchTransferFrom" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SafeBatchTransferFromParams
  | { asyncParams: () => Promise<SafeBatchTransferFromParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.safeTransferFrom

Prepares a transaction to call the "safeTransferFrom" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { safeTransferFrom } from "thirdweb/extensions/erc1155";
 
const transaction = safeTransferFrom({
 contract,
 from: ...,
 to: ...,
 tokenId: ...,
 value: ...,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function safeTransferFrom(
  options: BaseTransactionOptions<
    | SafeTransferFromParams
    | { asyncParams: () => Promise<SafeTransferFromParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "safeTransferFrom" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SafeTransferFromParams
  | { asyncParams: () => Promise<SafeTransferFromParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.setApprovalForAll

Prepares a transaction to call the "setApprovalForAll" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setApprovalForAll } from "thirdweb/extensions/erc1155";
 
const transaction = setApprovalForAll({
 contract,
 operator: ...,
 approved: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setApprovalForAll(
  options: BaseTransactionOptions<
    | SetApprovalForAllParams
    | { asyncParams: () => Promise<SetApprovalForAllParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setApprovalForAll" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetApprovalForAllParams
  | { asyncParams: () => Promise<SetApprovalForAllParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.setClaimConditions

Set the claim conditions for a ERC1155 drop This method is only available on the `DropERC1155` contract.

### Example

```ts
import { setClaimConditions } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = setClaimConditions({
  contract,
  tokenId: 0n,
  phases: [
    {
      maxClaimableSupply: 100n,
      maxClaimablePerWallet: 1n,
      currencyAddress: "0x...",
      price: 0.1,
      startTime: new Date(),
    },
  ],
});
 
await sendTransaction({ transaction, account });
```

```ts
function setClaimConditions(
  options: BaseTransactionOptions<SetClaimConditionsParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<SetClaimConditionsParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC1155.setTokenURI

Prepares a transaction to call the "setTokenURI" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setTokenURI } from "thirdweb/extensions/erc1155";
 
const transaction = setTokenURI({
 contract,
 tokenId: ...,
 uri: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTokenURI(
  options: BaseTransactionOptions<
    | SetTokenURIParams
    | { asyncParams: () => Promise<SetTokenURIParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTokenURI" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTokenURIParams
  | { asyncParams: () => Promise<SetTokenURIParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC1155.tokensClaimedEvent

Creates an event object for the TokensClaimed event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensClaimedEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 tokensClaimedEvent({
 claimConditionIndex: ...,
 claimer: ...,
 receiver: ...,
})
],
});
```

```ts
function tokensClaimedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "claimConditionIndex";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "claimer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "quantityClaimed"; readonly type: "uint256" },
  ];
  readonly name: "TokensClaimed";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "claimConditionIndex";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "claimer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "quantityClaimed"; readonly type: "uint256" },
  ];
  readonly name: "TokensClaimed";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.tokensLazyMintedEvent

Creates an event object for the TokensLazyMinted event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensLazyMintedEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 tokensLazyMintedEvent({
 startTokenId: ...,
})
],
});
```

```ts
function tokensLazyMintedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "startTokenId";
      readonly type: "uint256";
    },
    { readonly name: "endTokenId"; readonly type: "uint256" },
    { readonly name: "baseURI"; readonly type: "string" },
    { readonly name: "encryptedBaseURI"; readonly type: "bytes" },
  ];
  readonly name: "TokensLazyMinted";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "startTokenId";
      readonly type: "uint256";
    },
    { readonly name: "endTokenId"; readonly type: "uint256" },
    { readonly name: "baseURI"; readonly type: "string" },
    { readonly name: "encryptedBaseURI"; readonly type: "bytes" },
  ];
  readonly name: "TokensLazyMinted";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.tokensMintedWithSignatureEvent

Creates an event object for the TokensMintedWithSignature event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 tokensMintedWithSignatureEvent({
 signer: ...,
 mintedTo: ...,
 tokenIdMinted: ...,
})
],
});
```

```ts
function tokensMintedWithSignatureEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenIdMinted";
      readonly type: "uint256";
    },
    {
      readonly components: readonly [
        { readonly name: "to"; readonly type: "address" },
        {
          readonly name: "royaltyRecipient";
          readonly type: "address";
        },
        { readonly name: "royaltyBps"; readonly type: "uint256" },
        {
          readonly name: "primarySaleRecipient";
          readonly type: "address";
        },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "uri"; readonly type: "string" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        {
          readonly name: "validityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "validityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "mintRequest";
      readonly type: "tuple";
    },
  ];
  readonly name: "TokensMintedWithSignature";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenIdMinted";
      readonly type: "uint256";
    },
    {
      readonly components: readonly [
        { readonly name: "to"; readonly type: "address" },
        {
          readonly name: "royaltyRecipient";
          readonly type: "address";
        },
        { readonly name: "royaltyBps"; readonly type: "uint256" },
        {
          readonly name: "primarySaleRecipient";
          readonly type: "address";
        },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "uri"; readonly type: "string" },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        {
          readonly name: "validityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "validityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "mintRequest";
      readonly type: "tuple";
    },
  ];
  readonly name: "TokensMintedWithSignature";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.totalSupply

Calls the "totalSupply" function on the contract.

### Example

```ts
import { totalSupply } from "thirdweb/extensions/erc1155";
 
const result = await totalSupply({
 contract,
 id: ...,
});
```

```ts
function totalSupply(
  options: BaseTransactionOptions<TotalSupplyParams>,
): Promise<bigint>;
```

### Parameters

The options for the totalSupply function.

#### Type

```ts
let options: BaseTransactionOptions<TotalSupplyParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC1155.transferBatchEvent

Creates an event object for the TransferBatch event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { transferBatchEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 transferBatchEvent({
 _operator: ...,
 _from: ...,
 _to: ...,
})
],
});
```

```ts
function transferBatchEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "_operator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_to";
      readonly type: "address";
    },
    { readonly name: "tokenIds"; readonly type: "uint256[]" },
    { readonly name: "_values"; readonly type: "uint256[]" },
  ];
  readonly name: "TransferBatch";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "_operator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_to";
      readonly type: "address";
    },
    { readonly name: "tokenIds"; readonly type: "uint256[]" },
    { readonly name: "_values"; readonly type: "uint256[]" },
  ];
  readonly name: "TransferBatch";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.transferSingleEvent

Creates an event object for the TransferSingle event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { transferSingleEvent } from "thirdweb/extensions/erc1155";
 
const events = await getContractEvents({
contract,
events: [
 transferSingleEvent({
 _operator: ...,
 _from: ...,
 _to: ...,
})
],
});
```

```ts
function transferSingleEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "_operator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_to";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "_value"; readonly type: "uint256" },
  ];
  readonly name: "TransferSingle";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "_operator";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "_to";
      readonly type: "address";
    },
    { readonly name: "tokenId"; readonly type: "uint256" },
    { readonly name: "_value"; readonly type: "uint256" },
  ];
  readonly name: "TransferSingle";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC1155.updateMetadata

Update the metadata of the single token in an Edition Drop (DropERC1155) collection For Edition contracts, use `setTokenURI`

### Example

```ts
import { updateMetadata } from "thirdweb/extensions/erc1155";
import { sendTransaction } from "thirdweb";
 
const transaction = updateMetadata({
  contract,
  targetTokenId: 0n,
  client: thirdwebClient,
  newMetadata: {
    name: "this is the new nft name",
    description: "...",
    image: "new image uri",
    // ...
  },
});
 
await sendTransaction({ transaction, account });
```

```ts
function updateMetadata(
  options: BaseTransactionOptions<UpdateMetadataParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<UpdateMetadataParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC1155.updateTokenURI

This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI), which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput), upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method. This method is only available on the `TokenERC1155` contract.

This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update.

### Example

```ts
import { updateTokenURI } from "thirdweb/extensions/erc1155";
 
const transaction = updateTokenURI({
  tokenId: 0n,
  nft: {
    name: "new name",
    description: "new description",
    image: "https://image-host.com/new-image.png",
  },
});
```

```ts
function updateTokenURI(
  options: BaseTransactionOptions<UpdateTokenURIParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<UpdateTokenURIParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction from `setTokenURI`
---

###### Connect SDK

## ERC1155.uri

Calls the "uri" function on the contract.

### Example

```ts
import { uri } from "thirdweb/extensions/erc1155";
 
const result = await uri({
 contract,
 tokenId: ...,
});
```

```ts
function uri(
  options: BaseTransactionOptions<UriParams>,
): Promise<string>;
```

### Parameters

The options for the uri function.

#### Type

```ts
let options: BaseTransactionOptions<UriParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---
## ERC721
---

###### Connect SDK

## ERC721.isUpdateMetadataSupported

Checks if the `updateMetadata` method is supported by the given contract.

### Example

```ts
import { isUpdateMetadataSupported } from "thirdweb/extensions/erc721";
 
const supported = isUpdateMetadataSupported(["0x..."]);
```

```ts
function isUpdateMetadataSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `updateMetadata` method is supported.
---

###### Connect SDK

## ERC721.isGetClaimConditionsSupported

Checks if the `getClaimConditions` method is supported by the given contract.

### Example

```ts
import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc721";
 
const supported = isGetClaimConditionsSupported(["0x..."]);
```

```ts
function isGetClaimConditionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getClaimConditions` method is supported.
---

###### Connect SDK

## ERC721.approvalEvent

Creates an event object for the Approval event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { approvalEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 approvalEvent({
 owner: ...,
 approved: ...,
 tokenId: ...,
})
],
});
```

```ts
function approvalEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "approved";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenId";
      readonly type: "uint256";
    },
  ];
  readonly name: "Approval";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "approved";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenId";
      readonly type: "uint256";
    },
  ];
  readonly name: "Approval";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.approvalForAllEvent

Creates an event object for the ApprovalForAll event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { approvalForAllEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 approvalForAllEvent({
 owner: ...,
 operator: ...,
})
],
});
```

```ts
function approvalForAllEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "operator";
      readonly type: "address";
    },
    { readonly name: "approved"; readonly type: "bool" },
  ];
  readonly name: "ApprovalForAll";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "operator";
      readonly type: "address";
    },
    { readonly name: "approved"; readonly type: "bool" },
  ];
  readonly name: "ApprovalForAll";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.approve

Prepares a transaction to call the "approve" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { approve } from "thirdweb/extensions/erc721";
 
const transaction = approve({
 contract,
 to: ...,
 tokenId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function approve(
  options: BaseTransactionOptions<
    ApproveParams | { asyncParams: () => Promise<ApproveParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "approve" function.

#### Type

```ts
let options: BaseTransactionOptions<
  ApproveParams | { asyncParams: () => Promise<ApproveParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC721.balanceOf

Calls the "balanceOf" function on the contract.

### Example

```ts
import { balanceOf } from "thirdweb/extensions/erc721";
 
const result = await balanceOf({
 contract,
 owner: ...,
});
```

```ts
function balanceOf(
  options: BaseTransactionOptions<BalanceOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the balanceOf function.

#### Type

```ts
let options: BaseTransactionOptions<BalanceOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.burn

Prepares a transaction to call the "burn" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { burn } from "thirdweb/extensions/erc721";
 
const transaction = burn({
 contract,
 tokenId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function burn(
  options: BaseTransactionOptions<
    BurnParams | { asyncParams: () => Promise<BurnParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "burn" function.

#### Type

```ts
let options: BaseTransactionOptions<
  BurnParams | { asyncParams: () => Promise<BurnParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC721.canClaim

Check if a user can claim a drop.

This method is only available on the `DropERC721` contract.

### Example

```ts
const claimResult = await canClaim({
  contract: contract,
  claimer: "0x1234567890123456789012345678901234567890",
  quantity: "1",
});
```

```ts
function canClaim(
  options: BaseTransactionOptions<CanClaimParams>,
): Promise<CanClaimResult>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: BaseTransactionOptions<CanClaimParams>;
```

### Returns

```ts
let returnType: { reason?: string; result: boolean };
```

Whether the user can claim the drop.
---

###### Connect SDK

## ERC721.claimConditionsUpdatedEvent

Creates an event object for the ClaimConditionsUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { claimConditionsUpdatedEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
  contract,
  events: [claimConditionsUpdatedEvent()],
});
```

```ts
function claimConditionsUpdatedEvent(): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly components: readonly [
        { readonly name: "startTimestamp"; readonly type: "uint256" },
        {
          readonly name: "maxClaimableSupply";
          readonly type: "uint256";
        },
        { readonly name: "supplyClaimed"; readonly type: "uint256" },
        {
          readonly name: "quantityLimitPerWallet";
          readonly type: "uint256";
        },
        { readonly name: "merkleRoot"; readonly type: "bytes32" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "metadata"; readonly type: "string" },
      ];
      readonly name: "claimConditions";
      readonly type: "tuple[]";
    },
    { readonly name: "resetEligibility"; readonly type: "bool" },
  ];
  readonly name: "ClaimConditionsUpdated";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly components: readonly [
        { readonly name: "startTimestamp"; readonly type: "uint256" },
        {
          readonly name: "maxClaimableSupply";
          readonly type: "uint256";
        },
        { readonly name: "supplyClaimed"; readonly type: "uint256" },
        {
          readonly name: "quantityLimitPerWallet";
          readonly type: "uint256";
        },
        { readonly name: "merkleRoot"; readonly type: "bytes32" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "metadata"; readonly type: "string" },
      ];
      readonly name: "claimConditions";
      readonly type: "tuple[]";
    },
    { readonly name: "resetEligibility"; readonly type: "bool" },
  ];
  readonly name: "ClaimConditionsUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.claimTo

Claim ERC721 NFTs to a specified address This method is only available on the `DropERC721` contract.

### Example

#### Basic usage

```ts
import { claimTo } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
 
const transaction = claimTo({
  contract,
  to: "0x...",
  quantity: 1n,
});
 
await sendTransaction({ transaction, account });
```

#### For Drops with allowlists

You need to specify the claimer address as the `from` param to avoid any issue with the allowlist

```ts
const transaction = claimTo({
  contract,
  to: "0x...",
  quantity: 1n,
  from: "0x...", // address of the one claiming
});
```

```ts
function claimTo(
  options: BaseTransactionOptions<ClaimToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transaction

#### Type

```ts
let options: BaseTransactionOptions<ClaimToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves with the submitted transaction hash.
---

###### Connect SDK

## ERC721.claimToBatch

This extension batches multiple `claimTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can claim per transaction. This limit varies depends on the network that you are transacting on. This method is only available on the `DropERC721` contract.

You are recommended to experiment with the number to figure out the best number for your chain of choice.

### Example

```ts
import { claimToBatch } from "thirdweb/extensions/erc721";
 
const transaction = claimToBatch({
  contract: nftDropContract,
  from: claimer.address, // address of the one calling this transaction
  content: [
    { to: "0x...1", quantity: 1n },
    { to: "0x...2", quantity: 12n },
    { to: "0x...3", quantity: 2n },
  ],
});
```

```ts
function claimToBatch(
  options: BaseTransactionOptions<ClaimToBatchParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

the transaction options

#### Type

```ts
let options: BaseTransactionOptions<ClaimToBatchParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC721.createDelayedRevealBatch

Creates a batch of encrypted NFTs that can be revealed at a later time. This method is only available on the `DropERC721` contract.

### Example

```ts
import { createDelayedRevealBatch } from "thirdweb/extensions/erc721";
 
const placeholderNFT = {
  name: "Hidden NFT",
  description: "Will be revealed next week!"
};
 
const realNFTs = [{
  name: "Common NFT #1",
  description: "Common NFT, one of many.",
  image: ipfs://...,
}, {
  name: "Super Rare NFT #2",
  description: "You got a Super Rare NFT!",
  image: ipfs://...,
}];
 
const transaction = createDelayedRevealBatch({
 contract,
 placeholderMetadata: placeholderNFT,
 metadata: realNFTs,
 password: "password123",
});
 
const { transactionHash } = await sendTransaction({ transaction, account });
```

```ts
function createDelayedRevealBatch(
  options: BaseTransactionOptions<CreateDelayedRevealBatchParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

{CreateDelayedRevealBatchParams} - The delayed reveal options.

#### Type

```ts
let options: BaseTransactionOptions<CreateDelayedRevealBatchParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The prepared transaction to send.
---

###### Connect SDK

## ERC721.generateMintSignature

Generates the payload and signature for minting an ERC721 token.

### Example

```ts
import {
  mintWithSignature,
  generateMintSignature,
} from "thirdweb/extensions/erc721";
 
const { payload, signature } = await generateMintSignature({
  account,
  contract,
  mintRequest: {
    to: "0x...",
    metadata: {
      name: "My NFT",
      description: "This is my NFT",
      image: "https://example.com/image.png",
    },
  },
});
 
const transaction = mintWithSignature({
  contract,
  payload,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function generateMintSignature(
  options: GenerateMintSignatureOptions<T>,
): Promise<SignPayloadResult<T>>;
```

### Parameters

The options for the minting process.

#### Type

```ts
let options: GenerateMintSignatureOptions<T>;
```

### Returns

```ts
let returnType: Promise<SignPayloadResult<T>>;
```

A promise that resolves to the payload and signature.
---

###### Connect SDK

## ERC721.getActiveClaimCondition

Retrieves the active claim condition. This method is only available on the `DropERC721` contract.

### Example

```ts
import { getActiveClaimCondition } from "thirdweb/extensions/erc721";
const activeClaimCondition = await getActiveClaimCondition({
  contract,
});
```

```ts
function getActiveClaimCondition(
  options: BaseTransactionOptions,
): Promise<ClaimCondition>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<ClaimCondition>;
```

A promise that resolves to the active claim condition.
---

###### Connect SDK

## ERC721.getActiveClaimConditionId

Calls the "getActiveClaimConditionId" function on the contract.

### Example

```ts
import { getActiveClaimConditionId } from "thirdweb/extensions/erc721";
 
const result = await getActiveClaimConditionId({
  contract,
});
```

```ts
function getActiveClaimConditionId(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getActiveClaimConditionId function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.getAllOwners

Retrieves the owners of all ERC721 tokens within a specified range.

### Example

```ts
import { getAllOwners } from "thirdweb/extensions/erc721";
const owners = await getAllOwners({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getAllOwners(
  options: BaseTransactionOptions<GetAllOwnersParams>,
): Promise<Array<{ owner: string; tokenId: bigint }>>;
```

### Parameters

The options for retrieving the owners.

#### Type

```ts
let options: BaseTransactionOptions<GetAllOwnersParams>;
```

### Returns

```ts
let returnType: Promise<Array<{ owner: string; tokenId: bigint }>>;
```

A promise that resolves to an array of objects containing the token ID and owner address.
---

###### Connect SDK

## ERC721.getApproved

Calls the "getApproved" function on the contract.

### Example

```ts
import { getApproved } from "thirdweb/extensions/erc721";
 
const result = await getApproved({
 contract,
 tokenId: ...,
});
```

```ts
function getApproved(
  options: BaseTransactionOptions<GetApprovedParams>,
): Promise<string>;
```

### Parameters

The options for the getApproved function.

#### Type

```ts
let options: BaseTransactionOptions<GetApprovedParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.getBatchesToReveal

Retrieves the batches available to reveal in an NFT contract.

### Example

```ts
import { getBatchesToReveal } from "thirdweb/extensions/erc721";
 
const batches = await getBatchesToReveal({ contract: contract });
 
const { transactionHash } = await sendTransaction({
  transaction,
  account,
});
```

```ts
function getBatchesToReveal(
  options: BaseTransactionOptions,
): Promise<Array<BatchToReveal>>;
```

### Parameters

{BaseTransactionOptions} - The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: {
  batchId: bigint;
  batchUri: string;
  placeholderMetadata: undefined | NFTMetadata;
};
```

A promise resolving to an array of unrevealed batches.

Use the `batchId` and corresponding password for each batch to reveal it with `reveal`. reveal
---

###### Connect SDK

## ERC721.getClaimConditionById

Calls the "getClaimConditionById" function on the contract.

### Example

```ts
import { getClaimConditionById } from "thirdweb/extensions/erc721";
 
const result = await getClaimConditionById({
 contract,
 conditionId: ...,
});
```

```ts
function getClaimConditionById(
  options: BaseTransactionOptions<GetClaimConditionByIdParams>,
): Promise<{
  currency: string;
  maxClaimableSupply: bigint;
  merkleRoot: `0x${string}`;
  metadata: string;
  pricePerToken: bigint;
  quantityLimitPerWallet: bigint;
  startTimestamp: bigint;
  supplyClaimed: bigint;
}>;
```

### Parameters

The options for the getClaimConditionById function.

#### Type

```ts
let options: BaseTransactionOptions<GetClaimConditionByIdParams>;
```

### Returns

```ts
let returnType: Promise<{
  currency: string;
  maxClaimableSupply: bigint;
  merkleRoot: `0x${string}`;
  metadata: string;
  pricePerToken: bigint;
  quantityLimitPerWallet: bigint;
  startTimestamp: bigint;
  supplyClaimed: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.getClaimConditions

Retrieves all claim conditions.

This method is only available on the `DropERC721` contract.

### Example

```ts
import { getClaimConditions } from "thirdweb/extensions/erc721";
const conditions = await getClaimConditions({ contract });
```

```ts
function getClaimConditions(
  options: BaseTransactionOptions,
): Promise<Array<ClaimCondition>>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<Array<ClaimCondition>>;
```

A promise that resolves to all claim conditions.
---

###### Connect SDK

## ERC721.getNFT

Retrieves information about a specific ERC721 non-fungible token (NFT).

### Example

```ts
import { getNFT } from "thirdweb/extensions/erc721";
const nft = await getNFT({
  contract,
  tokenId: 1n,
});
```

```ts
function getNFT(
  options: BaseTransactionOptions<{
    includeOwner?: boolean;
    tokenByIndex?: boolean;
    tokenId: bigint;
    useIndexer?: boolean;
  }>,
): Promise<NFT>;
```

### Parameters

The options for retrieving the NFT.

#### Type

```ts
let options: BaseTransactionOptions<{
  includeOwner?: boolean;
  tokenByIndex?: boolean;
  tokenId: bigint;
  useIndexer?: boolean;
}>;
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```

A promise that resolves to the NFT object.
---

###### Connect SDK

## ERC721.getNFTs

Retrieves an array of NFTs ("ERC721") based on the provided options.

### Example

```ts
import { getNFTs } from "thirdweb/extensions/erc721";
const nfts = await getNFTs({
  contract,
  start: 0,
  count: 10,
});
```

```ts
function getNFTs(
  options: BaseTransactionOptions<GetNFTsParams>,
): Promise<Array<NFT>>;
```

### Parameters

The options for retrieving the NFTs.

#### Type

```ts
let options: BaseTransactionOptions<GetNFTsParams>;
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```

A promise that resolves to an array of NFTs.
---

###### Connect SDK

## ERC721.getOwnedNFTs

Retrieves the owned NFTs for a given owner. This extension only works with ERC721 contracts that support the [tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method

### Example

```ts
import { getOwnedNFTs } from "thirdweb/extensions/erc721";
 
const ownedNFTs = await getOwnedNFTs({
  contract,
  owner: "0x1234...",
});
```

```ts
function getOwnedNFTs(
  options: BaseTransactionOptions<GetOwnedNFTsParams>,
): Promise<Array<NFT>>;
```

### Parameters

The options for retrieving the owned NFTs.

#### Type

```ts
let options: BaseTransactionOptions<GetOwnedNFTsParams>;
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```

A promise that resolves to an array of NFTs owned by the specified owner.
---

###### Connect SDK

## ERC721.getOwnedTokenIds

Retrieves the token IDs owned by a specific address.

### Example

```ts
import { getOwnedTokenIds } from "thirdweb/extensions/erc721";
 
const ownedTokenIds = await getOwnedTokenIds({
  contract,
  owner: "0x1234...",
});
```

```ts
function getOwnedTokenIds(
  options: BaseTransactionOptions<BalanceOfParams>,
): Promise<Array<bigint>>;
```

### Parameters

The options for retrieving the owned token IDs.

#### Type

```ts
let options: BaseTransactionOptions<BalanceOfParams>;
```

### Returns

```ts
let returnType: Promise<Array<bigint>>;
```

A promise that resolves to an array of bigint representing the owned token IDs.
---

###### Connect SDK

## ERC721.getTotalClaimedSupply

Retrieves the total claimed supply of ERC721 tokens.

### Example

```ts
import { getTotalClaimedSupply } from "thirdweb/extensions/erc721";
 
const totalClaimedSupply = await getTotalClaimedSupply({
  contract,
});
```

```ts
function getTotalClaimedSupply(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The base transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the total claimed supply as a bigint.
---

###### Connect SDK

## ERC721.getTotalUnclaimedSupply

Retrieves the total unclaimed supply of ERC721 tokens.

### Example

```ts
import { getTotalUnclaimedSupply } from "thirdweb/extensions/erc721";
 
const totalUnclaimedSupply = await getTotalUnclaimedSupply({
  contract,
});
```

```ts
function getTotalUnclaimedSupply(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The base transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the total unclaimed supply as a bigint.
---

###### Connect SDK

## ERC721.isApprovedForAll

Calls the "isApprovedForAll" function on the contract.

### Example

```ts
import { isApprovedForAll } from "thirdweb/extensions/erc721";
 
const result = await isApprovedForAll({
 contract,
 owner: ...,
 operator: ...,
});
```

```ts
function isApprovedForAll(
  options: BaseTransactionOptions<IsApprovedForAllParams>,
): Promise<boolean>;
```

### Parameters

The options for the isApprovedForAll function.

#### Type

```ts
let options: BaseTransactionOptions<IsApprovedForAllParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.isBurnSupported

Checks if the `burn` method is supported by the given contract.

### Example

```ts
import { isBurnSupported } from "thirdweb/extensions/erc721";
 
const supported = isBurnSupported(["0x..."]);
```

```ts
function isBurnSupported(availableSelectors: Array<string>): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `burn` method is supported.
---

###### Connect SDK

## ERC721.isClaimToSupported

Checks if the `claimTo` method is supported by the given contract.

### Example

```ts
import { isClaimToSupported } from "thirdweb/extensions/erc721";
 
const supported = isClaimToSupported(["0x..."]);
```

```ts
function isClaimToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `claimTo` method is supported.
---

###### Connect SDK

## ERC721.isCreateDelayedRevealBatchSupported

Checks if the `createDelayedRevealBatch` method is supported by the given contract.

### Example

```ts
import { isCreateDelayedRevealBatchSupported } from "thirdweb/extensions/erc721";
const supported = isCreateDelayedRevealBatchSupported(["0x..."]);
```

```ts
function isCreateDelayedRevealBatchSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `createDelayedRevealBatch` method is supported.
---

###### Connect SDK

## ERC721.isERC721

Check if a contract supports the ERC721 interface.

### Example

```ts
import { isERC721 } from "thirdweb/extensions/erc721";
const result = await isERC721({ contract });
```

```ts
function isERC721(options: BaseTransactionOptions): Promise<boolean>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean indicating whether the contract supports the ERC721 interface.
---

###### Connect SDK

## ERC721.isGetActiveClaimConditionIdSupported

Checks if the `getActiveClaimConditionId` method is supported by the given contract.

### Example

```ts
import { isGetActiveClaimConditionIdSupported } from "thirdweb/extensions/erc721";
const supported = isGetActiveClaimConditionIdSupported(["0x..."]);
```

```ts
function isGetActiveClaimConditionIdSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getActiveClaimConditionId` method is supported.
---

###### Connect SDK

## ERC721.isGetActiveClaimConditionSupported

Checks if the `getActiveClaimCondition` method is supported by the given contract. This method is only available on the `DropERC721` contract.

### Example

```ts
import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc721";
 
const supported = isGetActiveClaimConditionSupported(["0x..."]);
```

```ts
function isGetActiveClaimConditionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getActiveClaimCondition` method is supported.
---

###### Connect SDK

## ERC721.isGetApprovedSupported

Checks if the `getApproved` method is supported by the given contract.

### Example

```ts
import { isGetApprovedSupported } from "thirdweb/extensions/erc721";
const supported = isGetApprovedSupported(["0x..."]);
```

```ts
function isGetApprovedSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getApproved` method is supported.
---

###### Connect SDK

## ERC721.isGetBatchesToRevealSupported

Checks if the `getBatchesToReveal` method is supported by the given contract.

### Example

```ts
import { isGetBatchesToRevealSupported } from "thirdweb/extensions/erc721";
 
const supported = isGetBatchesToRevealSupported(["0x..."]);
```

```ts
function isGetBatchesToRevealSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getBatchesToReveal` method is supported.
---

###### Connect SDK

## ERC721.isGetClaimConditionByIdSupported

Checks if the `getClaimConditionById` method is supported by the given contract.

### Example

```ts
import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc721";
const supported = isGetClaimConditionByIdSupported(["0x..."]);
```

```ts
function isGetClaimConditionByIdSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getClaimConditionById` method is supported.
---

###### Connect SDK

## ERC721.isGetClaimConditionsSupported

Checks if the `getClaimConditions` method is supported by the given contract.

### Example

```ts
import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc721";
 
const supported = isGetClaimConditionsSupported(["0x..."]);
```

```ts
function isGetClaimConditionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getClaimConditions` method is supported.
---

###### Connect SDK

## ERC721.isGetNFTsSupported

Checks if the `getNFTs` method is supported by the given contract.

### Example

```ts
import { isGetNFTsSupported } from "thirdweb/extensions/erc721";
 
const supported = isGetNFTsSupported(["0x..."]);
```

```ts
function isGetNFTsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getNFTs` method is supported.
---

###### Connect SDK

## ERC721.isGetNFTSupported

Checks if the `tokenURI` method is supported by the given contract.

### Example

```ts
import { isTokenURISupported } from "thirdweb/extensions/erc721";
const supported = isTokenURISupported(["0x..."]);
```

```ts
function isGetNFTSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `tokenURI` method is supported.
---

###### Connect SDK

## ERC721.isLazyMintSupported

Checks if the `lazyMint` method is supported by the given contract.

### Example

```ts
import { isLazyMintSupported } from "thirdweb/extensions/erc721";
 
const supported = isLazyMintSupported(["0x..."]);
```

```ts
function isLazyMintSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `lazyMint` method is supported.
---

###### Connect SDK

## ERC721.isMintToSupported

Checks if the `mintTo` method is supported by the given contract.

### Example

```ts
import { isMintToSupported } from "thirdweb/extensions/erc721";
 
const supported = isMintToSupported(["0x..."]);
```

```ts
function isMintToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `mintTo` method is supported.
---

###### Connect SDK

## ERC721.isNextTokenIdToMintSupported

Checks if the `nextTokenIdToMint` method is supported by the given contract.

### Example

```ts
import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc721";
const supported = isNextTokenIdToMintSupported(["0x..."]);
```

```ts
function isNextTokenIdToMintSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `nextTokenIdToMint` method is supported.
---

###### Connect SDK

## ERC721.isResetClaimEligibilitySupported

Checks if the `resetClaimEligibility` method is supported by the given contract.

### Example

```ts
import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc721";
 
const supported = isResetClaimEligibilitySupported(["0x..."]);
```

```ts
function isResetClaimEligibilitySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `resetClaimEligibility` method is supported.
---

###### Connect SDK

## ERC721.isRevealSupported

Checks if the `reveal` method is supported by the given contract.

### Example

```ts
import { isRevealSupported } from "thirdweb/extensions/erc721";
 
const supported = isRevealSupported(["0x..."]);
```

```ts
function isRevealSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `reveal` method is supported.
---

###### Connect SDK

## ERC721.isSetClaimConditionsSupported

Checks if the `setClaimConditions` method is supported by the given contract.

### Example

```ts
import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc721";
 
const supported = isSetClaimConditionsSupported(["0x..."]);
```

```ts
function isSetClaimConditionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setClaimConditions` method is supported.
---

###### Connect SDK

## ERC721.isSetSharedMetadataSupported

Checks if the `setSharedMetadata` method is supported by the given contract.

### Example

```ts
import { isSetSharedMetadataSupported } from "thirdweb/extensions/erc721";
 
const supported = isSetSharedMetadataSupported(["0x..."]);
```

```ts
function isSetSharedMetadataSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setSharedMetadata` method is supported.
---

###### Connect SDK

## ERC721.isSharedMetadataSupported

Checks if the `sharedMetadata` method is supported by the given contract.

### Example

```ts
import { isSharedMetadataSupported } from "thirdweb/extensions/erc721";
const supported = isSharedMetadataSupported(["0x..."]);
```

```ts
function isSharedMetadataSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `sharedMetadata` method is supported.
---

###### Connect SDK

## ERC721.isTokenByIndexSupported

Checks if the `tokenByIndex` method is supported by the given contract.

### Example

```ts
import { isTokenByIndexSupported } from "thirdweb/extensions/erc721";
const supported = isTokenByIndexSupported(["0x..."]);
```

```ts
function isTokenByIndexSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `tokenByIndex` method is supported.
---

###### Connect SDK

## ERC721.isTotalSupplySupported

Checks if the `totalSupply` method is supported by the given contract.

### Example

```ts
import { isTotalSupplySupported } from "thirdweb/extensions/erc721";
const supported = isTotalSupplySupported(["0x..."]);
```

```ts
function isTotalSupplySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `totalSupply` method is supported.
---

###### Connect SDK

## ERC721.isUpdateMetadataSupported

Checks if the `updateMetadata` method is supported by the given contract.

### Example

```ts
import { isUpdateMetadataSupported } from "thirdweb/extensions/erc721";
 
const supported = isUpdateMetadataSupported(["0x..."]);
```

```ts
function isUpdateMetadataSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `updateMetadata` method is supported.
---

###### Connect SDK

## ERC721.isUpdateTokenURISupported

Checks if the `setTokenURI` method is supported by the given contract.

### Example

```ts
import { isSetTokenURISupported } from "thirdweb/extensions/erc721";
 
const supported = isSetTokenURISupported(["0x..."]);
```

```ts
function isUpdateTokenURISupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setTokenURI` method is supported.
---

###### Connect SDK

## ERC721.lazyMint

Lazily mints ERC721 tokens. This method is only available on the `DropERC721` contract.

### Example

```ts
import { lazyMint } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
 
const transaction = lazyMint({
  contract,
  nfts: [
    {
      name: "My NFT",
      description: "This is my NFT",
      image: "https://example.com/image.png",
    },
  ],
});
 
await sendTransaction({ transaction, account });
```

```ts
function lazyMint(
  options: BaseTransactionOptions<LazyMintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the lazy minting process.

#### Type

```ts
let options: BaseTransactionOptions<LazyMintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the prepared contract call.
---

###### Connect SDK

## ERC721.mintTo

Mints a new ERC721 token and assigns it to the specified address. This method is only available on the `TokenERC721` contract.

If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI.

### Example

```ts
import { mintTo } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
 
const transaction = mintTo({
  contract,
  to: "0x...",
  nft: {
    name: "My NFT",
    description: "This is my NFT",
    image: "https://example.com/image.png",
  },
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintTo(
  options: BaseTransactionOptions<MintToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<MintToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC721.mintWithSignature

Mints a new ERC721 token with the given minter signature This method is only available on the `TokenERC721` contract.

### Example

```ts
import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
 
const { payload, signature } = await generateMintSignature(...)
 
const transaction = mintWithSignature({
  contract,
  payload,
  signature,
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintWithSignature(
  options: BaseTransactionOptions<
    | {
        payload: {
          currency: string;
          pricePerToken: bigint;
          primarySaleRecipient: string;
          quantity: bigint;
          royaltyBps: bigint;
          royaltyRecipient: string;
          to: string;
          uid: `0x${string}`;
          uri: string;
          validityEndTimestamp: bigint;
          validityStartTimestamp: bigint;
        };
        signature: `0x${string}`;
      }
    | {
        payload: {
          currency: string;
          price: bigint;
          primarySaleRecipient: string;
          royaltyBps: bigint;
          royaltyRecipient: string;
          to: string;
          uid: `0x${string}`;
          uri: string;
          validityEndTimestamp: bigint;
          validityStartTimestamp: bigint;
        };
        signature: `0x${string}`;
      }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<
  | {
      payload: {
        currency: string;
        pricePerToken: bigint;
        primarySaleRecipient: string;
        quantity: bigint;
        royaltyBps: bigint;
        royaltyRecipient: string;
        to: string;
        uid: `0x${string}`;
        uri: string;
        validityEndTimestamp: bigint;
        validityStartTimestamp: bigint;
      };
      signature: `0x${string}`;
    }
  | {
      payload: {
        currency: string;
        price: bigint;
        primarySaleRecipient: string;
        royaltyBps: bigint;
        royaltyRecipient: string;
        to: string;
        uid: `0x${string}`;
        uri: string;
        validityEndTimestamp: bigint;
        validityStartTimestamp: bigint;
      };
      signature: `0x${string}`;
    }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC721.nextTokenIdToMint

Calls the "nextTokenIdToMint" function on the contract.

### Example

```ts
import { nextTokenIdToMint } from "thirdweb/extensions/erc721";
 
const result = await nextTokenIdToMint({
  contract,
});
```

```ts
function nextTokenIdToMint(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the nextTokenIdToMint function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.ownerOf

Calls the "ownerOf" function on the contract.

### Example

```ts
import { ownerOf } from "thirdweb/extensions/erc721";
 
const result = await ownerOf({
 contract,
 tokenId: ...,
});
```

```ts
function ownerOf(
  options: BaseTransactionOptions<OwnerOfParams>,
): Promise<string>;
```

### Parameters

The options for the ownerOf function.

#### Type

```ts
let options: BaseTransactionOptions<OwnerOfParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.resetClaimEligibility

Reset the claim eligibility for all users. This method is only available on the `DropERC721` contract.

### Example

```ts
import { resetClaimEligibility } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
 
const transaction = resetClaimEligibility({
  contract,
});
 
await sendTransaction({ transaction, account });
```

```ts
function resetClaimEligibility(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC721.reveal

Reveals a previously lazy minted batch of NFTs. This method is only available on the `DropERC721` contract.

### Example

```ts
import { reveal } from "thirdweb/extensions/erc721";
 
const transaction = await reveal({
  contract: contract,
  batchId: 0,
  password: "password",
});
 
const { transactionHash } = await sendTransaction({
  transaction,
  account,
});
```

```ts
function reveal(
  options: BaseTransactionOptions<RevealParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

{RevealParams} - The reveal parameters.

#### Type

```ts
let options: BaseTransactionOptions<RevealParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The prepared transaction to send.
---

###### Connect SDK

## ERC721.setApprovalForAll

Prepares a transaction to call the "setApprovalForAll" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setApprovalForAll } from "thirdweb/extensions/erc721";
 
const transaction = setApprovalForAll({
 contract,
 operator: ...,
 approved: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setApprovalForAll(
  options: BaseTransactionOptions<
    | SetApprovalForAllParams
    | { asyncParams: () => Promise<SetApprovalForAllParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setApprovalForAll" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetApprovalForAllParams
  | { asyncParams: () => Promise<SetApprovalForAllParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC721.setClaimConditions

Set the claim conditions for a ERC721 drop This method is only available on the `DropERC721` contract.

### Example

```ts
import { setClaimConditions } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
 
const transaction = setClaimConditions({
  contract,
  phases: [
    {
      maxClaimableSupply: 100n,
      maxClaimablePerWallet: 1n,
      currencyAddress: "0x...",
      price: 0.1,
      startTime: new Date(),
    },
  ],
});
 
await sendTransaction({ transaction, account });
```

```ts
function setClaimConditions(
  options: BaseTransactionOptions<SetClaimConditionsParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<SetClaimConditionsParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC721.setSharedMetadata

Sets the shared metadata for a OpenEdition contract.

```ts
function setSharedMetadata(
  options: BaseTransactionOptions<SetSharedMetadataParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: BaseTransactionOptions<SetSharedMetadataParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The prepared transaction.
---

###### Connect SDK

## ERC721.setTokenURI

Prepares a transaction to call the "setTokenURI" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setTokenURI } from "thirdweb/extensions/erc721";
 
const transaction = setTokenURI({
 contract,
 tokenId: ...,
 uri: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTokenURI(
  options: BaseTransactionOptions<
    | SetTokenURIParams
    | { asyncParams: () => Promise<SetTokenURIParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTokenURI" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTokenURIParams
  | { asyncParams: () => Promise<SetTokenURIParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC721.sharedMetadata

Calls the "sharedMetadata" function on the contract.

### Example

```ts
import { sharedMetadata } from "thirdweb/extensions/erc721";
 
const result = await sharedMetadata({
  contract,
});
```

```ts
function sharedMetadata(
  options: BaseTransactionOptions,
): Promise<readonly [string, string, string, string]>;
```

### Parameters

The options for the sharedMetadata function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [string, string, string, string]>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.sharedMetadataUpdatedEvent

Creates an event object for the SharedMetadataUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { sharedMetadataUpdatedEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
  contract,
  events: [sharedMetadataUpdatedEvent()],
});
```

```ts
function sharedMetadataUpdatedEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "name"; readonly type: "string" },
    { readonly name: "description"; readonly type: "string" },
    { readonly name: "imageURI"; readonly type: "string" },
    { readonly name: "animationURI"; readonly type: "string" },
  ];
  readonly name: "SharedMetadataUpdated";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "name"; readonly type: "string" },
    { readonly name: "description"; readonly type: "string" },
    { readonly name: "imageURI"; readonly type: "string" },
    { readonly name: "animationURI"; readonly type: "string" },
  ];
  readonly name: "SharedMetadataUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.startTokenId

Calls the "startTokenId" function on the contract.

### Example

```ts
import { startTokenId } from "thirdweb/extensions/erc721";
 
const result = await startTokenId({
  contract,
});
```

```ts
function startTokenId(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the startTokenId function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.tokenOfOwnerByIndex

Calls the "tokenOfOwnerByIndex" function on the contract.

### Example

```ts
import { tokenOfOwnerByIndex } from "thirdweb/extensions/erc721";
 
const result = await tokenOfOwnerByIndex({
 contract,
 owner: ...,
 index: ...,
});
```

```ts
function tokenOfOwnerByIndex(
  options: BaseTransactionOptions<TokenOfOwnerByIndexParams>,
): Promise<bigint>;
```

### Parameters

The options for the tokenOfOwnerByIndex function.

#### Type

```ts
let options: BaseTransactionOptions<TokenOfOwnerByIndexParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.tokensClaimedEvent

Creates an event object for the TokensClaimed event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensClaimedEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 tokensClaimedEvent({
 claimConditionIndex: ...,
 claimer: ...,
 receiver: ...,
})
],
});
```

```ts
function tokensClaimedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "claimConditionIndex";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "claimer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    { readonly name: "startTokenId"; readonly type: "uint256" },
    { readonly name: "quantityClaimed"; readonly type: "uint256" },
  ];
  readonly name: "TokensClaimed";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "claimConditionIndex";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "claimer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    { readonly name: "startTokenId"; readonly type: "uint256" },
    { readonly name: "quantityClaimed"; readonly type: "uint256" },
  ];
  readonly name: "TokensClaimed";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.tokensLazyMintedEvent

Creates an event object for the TokensLazyMinted event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensLazyMintedEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 tokensLazyMintedEvent({
 startTokenId: ...,
})
],
});
```

```ts
function tokensLazyMintedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "startTokenId";
      readonly type: "uint256";
    },
    { readonly name: "endTokenId"; readonly type: "uint256" },
    { readonly name: "baseURI"; readonly type: "string" },
    { readonly name: "encryptedBaseURI"; readonly type: "bytes" },
  ];
  readonly name: "TokensLazyMinted";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "startTokenId";
      readonly type: "uint256";
    },
    { readonly name: "endTokenId"; readonly type: "uint256" },
    { readonly name: "baseURI"; readonly type: "string" },
    { readonly name: "encryptedBaseURI"; readonly type: "bytes" },
  ];
  readonly name: "TokensLazyMinted";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.tokensMintedWithSignatureEvent

Creates an event object for the TokensMintedWithSignature event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 tokensMintedWithSignatureEvent({
 signer: ...,
 mintedTo: ...,
 tokenIdMinted: ...,
})
],
});
```

```ts
function tokensMintedWithSignatureEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenIdMinted";
      readonly type: "uint256";
    },
    {
      readonly components: readonly [
        { readonly name: "to"; readonly type: "address" },
        {
          readonly name: "royaltyRecipient";
          readonly type: "address";
        },
        { readonly name: "royaltyBps"; readonly type: "uint256" },
        {
          readonly name: "primarySaleRecipient";
          readonly type: "address";
        },
        { readonly name: "uri"; readonly type: "string" },
        { readonly name: "price"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        {
          readonly name: "validityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "validityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "mintpayload";
      readonly type: "tuple";
    },
  ];
  readonly name: "TokensMintedWithSignature";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenIdMinted";
      readonly type: "uint256";
    },
    {
      readonly components: readonly [
        { readonly name: "to"; readonly type: "address" },
        {
          readonly name: "royaltyRecipient";
          readonly type: "address";
        },
        { readonly name: "royaltyBps"; readonly type: "uint256" },
        {
          readonly name: "primarySaleRecipient";
          readonly type: "address";
        },
        { readonly name: "uri"; readonly type: "string" },
        { readonly name: "price"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        {
          readonly name: "validityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "validityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "mintpayload";
      readonly type: "tuple";
    },
  ];
  readonly name: "TokensMintedWithSignature";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.tokensOfOwner

Calls the "tokensOfOwner" function on the contract.

### Example

```ts
import { tokensOfOwner } from "thirdweb/extensions/erc721";
 
const result = await tokensOfOwner({
 contract,
 owner: ...,
});
```

```ts
function tokensOfOwner(options: BaseTransactionOptions<TokensOfOwnerParams>) : Promise<readonly Array<bigint>>
```

### Parameters

The options for the tokensOfOwner function.

#### Type

```ts
let options: BaseTransactionOptions<TokensOfOwnerParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<bigint>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.tokenURI

Calls the "tokenURI" function on the contract.

### Example

```ts
import { tokenURI } from "thirdweb/extensions/erc721";
 
const result = await tokenURI({
 contract,
 tokenId: ...,
});
```

```ts
function tokenURI(
  options: BaseTransactionOptions<TokenURIParams>,
): Promise<string>;
```

### Parameters

The options for the tokenURI function.

#### Type

```ts
let options: BaseTransactionOptions<TokenURIParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.tokenURIRevealedEvent

Creates an event object for the TokenURIRevealed event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokenURIRevealedEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 tokenURIRevealedEvent({
 index: ...,
})
],
});
```

```ts
function tokenURIRevealedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "index";
      readonly type: "uint256";
    },
    { readonly name: "revealedURI"; readonly type: "string" },
  ];
  readonly name: "TokenURIRevealed";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "index";
      readonly type: "uint256";
    },
    { readonly name: "revealedURI"; readonly type: "string" },
  ];
  readonly name: "TokenURIRevealed";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.totalSupply

Calls the "totalSupply" function on the contract.

### Example

```ts
import { totalSupply } from "thirdweb/extensions/erc721";
 
const result = await totalSupply({
  contract,
});
```

```ts
function totalSupply(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalSupply function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC721.transferEvent

Creates an event object for the Transfer event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { transferEvent } from "thirdweb/extensions/erc721";
 
const events = await getContractEvents({
contract,
events: [
 transferEvent({
 from: ...,
 to: ...,
 tokenId: ...,
})
],
});
```

```ts
function transferEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenId";
      readonly type: "uint256";
    },
  ];
  readonly name: "Transfer";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "tokenId";
      readonly type: "uint256";
    },
  ];
  readonly name: "Transfer";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC721.transferFrom

Prepares a transaction to call the "transferFrom" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { transferFrom } from "thirdweb/extensions/erc721";
 
const transaction = transferFrom({
 contract,
 from: ...,
 to: ...,
 tokenId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function transferFrom(
  options: BaseTransactionOptions<
    | TransferFromParams
    | { asyncParams: () => Promise<TransferFromParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "transferFrom" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | TransferFromParams
  | { asyncParams: () => Promise<TransferFromParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC721.updateMetadata

Update the metadata of the single token in an NFT Drop (DropERC721) collection For NFT Collection, please use `setTokenURI`

### Example

```ts
import { updateMetadata } from "thirdweb/extensions/erc721";
 
const transaction = updateMetadata({
  contract,
  targetTokenId: 0n,
  client: thirdwebClient,
  newMetadata: {
    name: "this is the new nft name",
    description: "...",
    image: "new image uri",
    // ...
  },
});
```

```ts
function updateMetadata(
  options: BaseTransactionOptions<UpdateMetadataParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<UpdateMetadataParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC721.updateTokenURI

This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI), which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput), upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method.

This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update. This method is only available on the `TokenERC721` contract.

### Example

```ts
import { updateTokenURI } from "thirdweb/extensions/erc721";
 
const transaction = updateTokenURI({
  tokenId: 0n,
  nft: {
    name: "new name",
    description: "new description",
    image: "https://image-host.com/new-image.png",
  },
});
```

```ts
function updateTokenURI(
  options: BaseTransactionOptions<UpdateTokenURIParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<UpdateTokenURIParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction from `setTokenURI`
---
## ERC1271
---

###### Connect SDK

## ERC1271.checkContractWalletSignature

Deprecated

Use `verifySignature` instead

Checks if a contract wallet signature is valid.

### Example

```ts
import { checkContractWalletSignature } from "thirdweb/extensions/erc1271";
const isValid = await checkContractWalletSignature({
  contract: myContract,
  message: "hello world",
  signature: "0x...",
});
```

```ts
function checkContractWalletSignature(
  options: CheckContractWalletSignatureOptions,
): Promise<boolean>;
```

### Parameters

The options for the checkContractWalletSignature function.

#### Type

```ts
let options: {
  contract: ThirdwebContract;
  message: SignableMessage;
  signature: string;
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A promise that resolves with a boolean indicating if the signature is valid.
---

###### Connect SDK

## ERC1271.checkContractWalletSignedTypedData

Deprecated

Use `verifyTypedData` instead

Checks if a contract wallet signature is valid.

### Example

```ts
import { checkContractWalletSignedTypedData } from "thirdweb/extensions/erc1271";
const isValid = await checkContractWalletSignedTypedData({
 contract: myContract,
 data: {
  primaryType: "EIP712Domain",
  domain: {
    name: "Example",
    version: "1",
    chainId: 1,
    verifyingContract: myContract.address,
  },
});
```

```ts
function checkContractWalletSignedTypedData(
  options: CheckContractWalletSignTypedDataOptions<
    typedData,
    primaryType
  >,
): Promise<boolean>;
```

### Parameters

The options for the checkContractWalletSignature function.

#### Type

```ts
let options: CheckContractWalletSignTypedDataOptions<
  typedData,
  primaryType
>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A promise that resolves with a boolean indicating if the signature is valid.
---
## ERC20
---

###### Connect SDK

## ERC20.allowance

Calls the "allowance" function on the contract.

### Example

```ts
import { allowance } from "thirdweb/extensions/erc20";
 
const result = await allowance({
 contract,
 owner: ...,
 spender: ...,
});
```

```ts
function allowance(
  options: BaseTransactionOptions<AllowanceParams>,
): Promise<bigint>;
```

### Parameters

The options for the allowance function.

#### Type

```ts
let options: BaseTransactionOptions<AllowanceParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC20.approvalEvent

Creates an event object for the Approval event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { approvalEvent } from "thirdweb/extensions/erc20";
 
const events = await getContractEvents({
contract,
events: [
 approvalEvent({
 owner: ...,
 spender: ...,
})
],
});
```

```ts
function approvalEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "spender";
      readonly type: "address";
    },
    { readonly name: "value"; readonly type: "uint256" },
  ];
  readonly name: "Approval";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "spender";
      readonly type: "address";
    },
    { readonly name: "value"; readonly type: "uint256" },
  ];
  readonly name: "Approval";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC20.approve

Approves the spending of tokens by a specific address.

### Example

```ts
import { approve } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = await approve({
  contract,
  spender: "0x...",
  amount: 100,
});
 
await sendTransaction({ transaction, account });
```

```ts
function approve(
  options: BaseTransactionOptions<ApproveParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<ApproveParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC20.balanceOf

Calls the "balanceOf" function on the contract.

### Example

```ts
import { balanceOf } from "thirdweb/extensions/erc20";
 
const result = await balanceOf({
 contract,
 address: ...,
});
```

```ts
function balanceOf(
  options: BaseTransactionOptions<BalanceOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the balanceOf function.

#### Type

```ts
let options: BaseTransactionOptions<BalanceOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC20.burn

Prepares a transaction to call the "burn" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { burn } from "thirdweb/extensions/erc20";
 
const transaction = burn({
 contract,
 amount: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function burn(
  options: BaseTransactionOptions<
    BurnParams | { asyncParams: () => Promise<BurnParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "burn" function.

#### Type

```ts
let options: BaseTransactionOptions<
  BurnParams | { asyncParams: () => Promise<BurnParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC20.burnFrom

Prepares a transaction to call the "burnFrom" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { burnFrom } from "thirdweb/extensions/erc20";
 
const transaction = burnFrom({
 contract,
 account: ...,
 amount: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function burnFrom(
  options: BaseTransactionOptions<
    BurnFromParams | { asyncParams: () => Promise<BurnFromParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "burnFrom" function.

#### Type

```ts
let options: BaseTransactionOptions<
  BurnFromParams | { asyncParams: () => Promise<BurnFromParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC20.canClaim

Check if a user can claim a drop. This method is only available on the `DropERC20` contract.

### Example

```ts
const claimResult = await canClaim({
  contract: contract,
  claimer: "0x1234567890123456789012345678901234567890",
  quantity: "1",
});
```

```ts
function canClaim(
  options: BaseTransactionOptions<CanClaimParams>,
): Promise<CanClaimResult>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: BaseTransactionOptions<CanClaimParams>;
```

### Returns

```ts
let returnType: { reason?: string; result: boolean };
```

Whether the user can claim the drop.
---

###### Connect SDK

## ERC20.claimConditionsUpdatedEvent

Creates an event object for the ClaimConditionsUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { claimConditionsUpdatedEvent } from "thirdweb/extensions/erc20";
 
const events = await getContractEvents({
  contract,
  events: [claimConditionsUpdatedEvent()],
});
```

```ts
function claimConditionsUpdatedEvent(): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly components: readonly [
        { readonly name: "startTimestamp"; readonly type: "uint256" },
        {
          readonly name: "maxClaimableSupply";
          readonly type: "uint256";
        },
        { readonly name: "supplyClaimed"; readonly type: "uint256" },
        {
          readonly name: "quantityLimitPerWallet";
          readonly type: "uint256";
        },
        { readonly name: "merkleRoot"; readonly type: "bytes32" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "metadata"; readonly type: "string" },
      ];
      readonly name: "claimConditions";
      readonly type: "tuple[]";
    },
    { readonly name: "resetEligibility"; readonly type: "bool" },
  ];
  readonly name: "ClaimConditionsUpdated";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly components: readonly [
        { readonly name: "startTimestamp"; readonly type: "uint256" },
        {
          readonly name: "maxClaimableSupply";
          readonly type: "uint256";
        },
        { readonly name: "supplyClaimed"; readonly type: "uint256" },
        {
          readonly name: "quantityLimitPerWallet";
          readonly type: "uint256";
        },
        { readonly name: "merkleRoot"; readonly type: "bytes32" },
        { readonly name: "pricePerToken"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        { readonly name: "metadata"; readonly type: "string" },
      ];
      readonly name: "claimConditions";
      readonly type: "tuple[]";
    },
    { readonly name: "resetEligibility"; readonly type: "bool" },
  ];
  readonly name: "ClaimConditionsUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC20.claimTo

Claim ERC20 NFTs to a specified address This method is only available on the `DropERC20` contract.

### Example

#### Basic usage

```ts
import { claimTo } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = claimTo({
  contract,
  to: "0x...",
  quantity: 100n,
});
 
await sendTransaction({ transaction, account });
```

#### For Drops with allowlists

You need to specify the claimer address as the `from` param to avoid any issue with the allowlist

```ts
const transaction = claimTo({
  contract,
  to: "0x...",
  quantity: 100n,
  from: "0x...", // address of the one claiming
});
```

```ts
function claimTo(
  options: BaseTransactionOptions<ClaimToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transaction

#### Type

```ts
let options: BaseTransactionOptions<ClaimToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves with the submitted transaction hash.
---

###### Connect SDK

## ERC20.decimals

Retrieves the number of decimal places for a given ERC20 contract.

### Example

```ts
import { decimals } from "thirdweb/extensions/erc20";
 
const tokenDecimals = await decimals({ contract });
```

```ts
function decimals(options: BaseTransactionOptions): Promise<number>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<number>;
```

A promise that resolves to the number of decimal places.
---

###### Connect SDK

## ERC20.delegate

Prepares a transaction to call the "delegate" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { delegate } from "thirdweb/extensions/erc20";
 
const transaction = delegate({
 contract,
 delegatee: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function delegate(
  options: BaseTransactionOptions<
    DelegateParams | { asyncParams: () => Promise<DelegateParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "delegate" function.

#### Type

```ts
let options: BaseTransactionOptions<
  DelegateParams | { asyncParams: () => Promise<DelegateParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC20.delegates

Calls the "delegates" function on the contract.

### Example

```ts
import { delegates } from "thirdweb/extensions/erc20";
 
const result = await delegates({
 contract,
 account: ...,
});
```

```ts
function delegates(
  options: BaseTransactionOptions<DelegatesParams>,
): Promise<string>;
```

### Parameters

The options for the delegates function.

#### Type

```ts
let options: BaseTransactionOptions<DelegatesParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC20.deposit

Calls the "deposit" function on the contract (useful to wrap ETH).

### Example

```ts
import { deposit } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = deposit({ contract, amount: "0.1" });
 
await sendTransaction({ transaction, account });
```

```ts
function deposit(
  options: BaseTransactionOptions<DepositParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "deposit" function.

#### Type

```ts
let options: BaseTransactionOptions<DepositParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC20.generateMintSignature

Generates the payload and signature for minting an ERC20 token.

### Example

```ts
import {
  mintWithSignature,
  generateMintSignature,
} from "thirdweb/extensions/erc20";
 
const { payload, signature } = await generateMintSignature({
  account,
  contract,
  mintRequest: {
    to: "0x...",
    quantity: "10",
  },
});
 
const transaction = mintWithSignature({
  contract,
  payload,
  signature,
});
await sendTransaction({ transaction, account });
```

```ts
function generateMintSignature(
  options: GenerateMintSignatureOptions,
): Promise<{
  payload: {
    currency: string;
    price: bigint;
    primarySaleRecipient: string;
    quantity: bigint;
    to: string;
    uid: `0x${string}`;
    validityEndTimestamp: bigint;
    validityStartTimestamp: bigint;
  };
  signature: `0x${string}`;
}>;
```

### Parameters

The options for the minting process.

#### Type

```ts
let options: {
  account: Account;
  contract: ThirdwebContract;
  contractType?: "TokenERC1155" | "SignatureMintERC1155";
  mintRequest: GeneratePayloadInput;
};
```

### Returns

```ts
let returnType: Promise<{
  payload: {
    currency: string;
    price: bigint;
    primarySaleRecipient: string;
    quantity: bigint;
    to: string;
    uid: `0x${string}`;
    validityEndTimestamp: bigint;
    validityStartTimestamp: bigint;
  };
  signature: `0x${string}`;
}>;
```

A promise that resolves to the payload and signature.
---

###### Connect SDK

## ERC20.getActiveClaimCondition

Retrieves the active claim condition. This method is only available on the `DropERC20` contract.

### Example

```ts
import { getActiveClaimCondition } from "thirdweb/extensions/erc20";
const activeClaimCondition = await getActiveClaimCondition({
  contract,
});
```

```ts
function getActiveClaimCondition(
  options: BaseTransactionOptions,
): Promise<ClaimCondition>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<ClaimCondition>;
```

A promise that resolves to the active claim condition.
---

###### Connect SDK

## ERC20.getActiveClaimConditionId

Calls the "getActiveClaimConditionId" function on the contract.

### Example

```ts
import { getActiveClaimConditionId } from "thirdweb/extensions/erc20";
 
const result = await getActiveClaimConditionId({
  contract,
});
```

```ts
function getActiveClaimConditionId(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getActiveClaimConditionId function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC20.getBalance

Retrieves the balance of an ERC20 token for a specific address.

### Example

```ts
import { getBalance } from "thirdweb/extensions/erc20";
 
const balance = await getBalance({ contract, address: "0x..." });
```

```ts
function getBalance(
  options: BaseTransactionOptions<GetBalanceParams>,
): Promise<GetBalanceResult>;
```

### Parameters

The transaction options including the address.

#### Type

```ts
let options: BaseTransactionOptions<GetBalanceParams>;
```

### Returns

```ts
let returnType: {
  chainId: number;
  decimals: number;
  displayValue: string;
  name: string;
  symbol: string;
  tokenAddress: string;
  value: bigint;
};
```

An object containing the balance value, display value, and symbol.
---

###### Connect SDK

## ERC20.getClaimConditionById

Calls the "getClaimConditionById" function on the contract.

### Example

```ts
import { getClaimConditionById } from "thirdweb/extensions/erc20";
 
const result = await getClaimConditionById({
 contract,
 conditionId: ...,
});
```

```ts
function getClaimConditionById(
  options: BaseTransactionOptions<GetClaimConditionByIdParams>,
): Promise<{
  currency: string;
  maxClaimableSupply: bigint;
  merkleRoot: `0x${string}`;
  metadata: string;
  pricePerToken: bigint;
  quantityLimitPerWallet: bigint;
  startTimestamp: bigint;
  supplyClaimed: bigint;
}>;
```

### Parameters

The options for the getClaimConditionById function.

#### Type

```ts
let options: BaseTransactionOptions<GetClaimConditionByIdParams>;
```

### Returns

```ts
let returnType: Promise<{
  currency: string;
  maxClaimableSupply: bigint;
  merkleRoot: `0x${string}`;
  metadata: string;
  pricePerToken: bigint;
  quantityLimitPerWallet: bigint;
  startTimestamp: bigint;
  supplyClaimed: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC20.getClaimConditions

Retrieves all claim conditions. This method is only available on the `DropERC20` contract.

### Example

```ts
import { getClaimConditions } from "thirdweb/extensions/erc20";
const conditions = await getClaimConditions({ contract });
```

```ts
function getClaimConditions(
  options: BaseTransactionOptions,
): Promise<Array<ClaimCondition>>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<Array<ClaimCondition>>;
```

A promise that resolves to all claim conditions.
---

###### Connect SDK

## ERC20.getCurrencyMetadata

Retrieves the metadata of a currency.

### Example

```ts
import { getCurrencyMetadata } from "thirdweb/extensions/erc20";
 
const currencyMetadata = await getCurrencyMetadata({ contract });
```

```ts
function getCurrencyMetadata(
  options: BaseTransactionOptions,
): Promise<GetCurrencyMetadataResult>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: { decimals: number; name: string; symbol: string };
```

A promise that resolves to an object containing the currency metadata.
---

###### Connect SDK

## ERC20.isClaimToSupported

Checks if the `claimTo` method is supported by the given contract.

### Example

```ts
import { isClaimToSupported } from "thirdweb/extensions/erc20";
 
const supported = isClaimToSupported(["0x..."]);
```

```ts
function isClaimToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `claimTo` method is supported.
---

###### Connect SDK

## ERC20.isERC20

Check if a contract is an ERC20 token.

### Example

```ts
import { isERC20 } from "thirdweb/extensions/erc20";
import { resolveContractAbi } from "thirdweb/contract";
 
const abi = await resolveContractAbi(contract);
const selectors = abi
  .filter((f) => f.type === "function")
  .map((f) => toFunctionSelector(f));
 
const result = await isERC20(selectors);
```

```ts
function isERC20(availableSelectors: Array<string>): boolean;
```

### Parameters

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating whether the contract is an ERC20 token.
---

###### Connect SDK

## ERC20.isGetActiveClaimConditionIdSupported

Checks if the `getActiveClaimConditionId` method is supported by the given contract.

### Example

```ts
import { isGetActiveClaimConditionIdSupported } from "thirdweb/extensions/erc20";
const supported = isGetActiveClaimConditionIdSupported(["0x..."]);
```

```ts
function isGetActiveClaimConditionIdSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getActiveClaimConditionId` method is supported.
---

###### Connect SDK

## ERC20.isGetActiveClaimConditionSupported

Checks if the `getActiveClaimCondition` method is supported by the given contract.

### Example

```ts
import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc20";
 
const supported = isGetActiveClaimConditionSupported(["0x..."]);
```

```ts
function isGetActiveClaimConditionSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getActiveClaimCondition` method is supported.
---

###### Connect SDK

## ERC20.isGetClaimConditionByIdSupported

Checks if the `getClaimConditionById` method is supported by the given contract.

### Example

```ts
import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc20";
const supported = isGetClaimConditionByIdSupported(["0x..."]);
```

```ts
function isGetClaimConditionByIdSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getClaimConditionById` method is supported.
---

###### Connect SDK

## ERC20.isMintToSupported

Checks if the `mintTo` method is supported by the given contract.

### Example

```ts
import { isMintToSupported } from "thirdweb/extensions/erc20";
 
const supported = isMintToSupported(["0x..."]);
```

```ts
function isMintToSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `mintTo` method is supported.
---

###### Connect SDK

## ERC20.isResetClaimEligibilitySupported

Checks if the `resetClaimEligibility` method is supported by the given contract.

### Example

```ts
import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc20";
 
const supported = isResetClaimEligibilitySupported(["0x..."]);
```

```ts
function isResetClaimEligibilitySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `resetClaimEligibility` method is supported.
---

###### Connect SDK

## ERC20.isSetClaimConditionsSupported

Checks if the `setClaimConditions` method is supported by the given contract.

### Example

```ts
import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc20";
 
const supported = isSetClaimConditionsSupported(["0x..."]);
```

```ts
function isSetClaimConditionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `setClaimConditions` method is supported.
---

###### Connect SDK

## ERC20.mintTo

Mints a specified amount of tokens to a given address. This method is only available on the `TokenERC20` contract.

### Example

```ts
import { mintTo } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = mintTo({
  contract,
  to: "0x...",
  amount: 100,
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintTo(
  options: BaseTransactionOptions<MintToParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<MintToParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC20.mintWithSignature

Mints a new ERC20 token with the given minter signature This method is only available on the `TokenERC20` contract.

### Example

```ts
import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const { payload, signature } = await generateMintSignature(...)
 
const transaction = mintWithSignature({
  contract,
  payload,
  signature,
});
 
await sendTransaction({ transaction, account });
```

```ts
function mintWithSignature(
  options: BaseTransactionOptions<MintWithSignatureParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: BaseTransactionOptions<MintWithSignatureParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## ERC20.resetClaimEligibility

Reset the claim eligibility for all users. This method is only available on the `DropERC20` contract.

### Example

```ts
import { resetClaimEligibility } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = resetClaimEligibility({
  contract,
});
 
await sendTransaction({ transaction, account });
```

```ts
function resetClaimEligibility(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC20.setClaimConditions

Set the claim conditions for a ERC20 drop This method is only available on the `DropERC20` contract.

### Example

```ts
import { setClaimConditions } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = setClaimConditions({
  contract,
  phases: [
    {
      maxClaimableSupply: 100n,
      maxClaimablePerWallet: 1n,
      currencyAddress: "0x...",
      price: 0.1,
      startTime: new Date(),
    },
  ],
});
 
await sendTransaction({ transaction, account });
```

```ts
function setClaimConditions(
  options: BaseTransactionOptions<SetClaimConditionsParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<SetClaimConditionsParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

the prepared transaction
---

###### Connect SDK

## ERC20.tokensClaimedEvent

Creates an event object for the TokensClaimed event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensClaimedEvent } from "thirdweb/extensions/erc20";
 
const events = await getContractEvents({
contract,
events: [
 tokensClaimedEvent({
 claimConditionIndex: ...,
 claimer: ...,
 receiver: ...,
})
],
});
```

```ts
function tokensClaimedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "claimConditionIndex";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "claimer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    { readonly name: "quantityClaimed"; readonly type: "uint256" },
  ];
  readonly name: "TokensClaimed";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "claimConditionIndex";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "claimer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    { readonly name: "quantityClaimed"; readonly type: "uint256" },
  ];
  readonly name: "TokensClaimed";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC20.tokensMintedEvent

Creates an event object for the TokensMinted event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensMintedEvent } from "thirdweb/extensions/erc20";
 
const events = await getContractEvents({
contract,
events: [
 tokensMintedEvent({
 mintedTo: ...,
})
],
});
```

```ts
function tokensMintedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    { readonly name: "quantityMinted"; readonly type: "uint256" },
  ];
  readonly name: "TokensMinted";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    { readonly name: "quantityMinted"; readonly type: "uint256" },
  ];
  readonly name: "TokensMinted";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC20.tokensMintedWithSignatureEvent

Creates an event object for the TokensMintedWithSignature event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc20";
 
const events = await getContractEvents({
contract,
events: [
 tokensMintedWithSignatureEvent({
 signer: ...,
 mintedTo: ...,
})
],
});
```

```ts
function tokensMintedWithSignatureEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "to"; readonly type: "address" },
        {
          readonly name: "primarySaleRecipient";
          readonly type: "address";
        },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "price"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        {
          readonly name: "validityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "validityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "mintRequest";
      readonly type: "tuple";
    },
  ];
  readonly name: "TokensMintedWithSignature";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "mintedTo";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "to"; readonly type: "address" },
        {
          readonly name: "primarySaleRecipient";
          readonly type: "address";
        },
        { readonly name: "quantity"; readonly type: "uint256" },
        { readonly name: "price"; readonly type: "uint256" },
        { readonly name: "currency"; readonly type: "address" },
        {
          readonly name: "validityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "validityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "mintRequest";
      readonly type: "tuple";
    },
  ];
  readonly name: "TokensMintedWithSignature";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC20.totalSupply

Calls the "totalSupply" function on the contract.

### Example

```ts
import { totalSupply } from "thirdweb/extensions/erc20";
 
const result = await totalSupply({
  contract,
});
```

```ts
function totalSupply(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalSupply function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC20.transfer

Transfers ERC20 tokens from the sender's address to the specified recipient address.

### Example

```ts
import { transfer } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = transfer({
  contract,
  to: "0x...",
  amount: 100,
});
 
await sendTransaction({ transaction, account });
```

```ts
function transfer(
  options: BaseTransactionOptions<TransferParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transfer transaction.

#### Type

```ts
let options: BaseTransactionOptions<TransferParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the prepared transaction.
---

###### Connect SDK

## ERC20.transferBatch

Transfers a batch of ERC20 tokens from the sender's address to the specified recipient address.

### Example

```ts
import { transferBatch } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = transferBatch({
 contract,
 batch: [
   {
     to: "0x...",
     amount: 100,
   },
   {
     to: "0x...",
     amount: "0.1",
   },
]);
 
await sendTransaction({ transaction, account });
```

```ts
function transferBatch(
  options: BaseTransactionOptions<{
    batch: Array<
      { to: string } & (
        | { amount: string | number }
        | { amountWei: bigint }
      )
    >;
  }>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the batch transfer transaction.

#### Type

```ts
let options: BaseTransactionOptions<{
  batch: Array<
    { to: string } & (
      | { amount: string | number }
      | { amountWei: bigint }
    )
  >;
}>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the prepared transaction.
---

###### Connect SDK

## ERC20.transferEvent

Creates an event object for the Transfer event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { transferEvent } from "thirdweb/extensions/erc20";
 
const events = await getContractEvents({
contract,
events: [
 transferEvent({
 from: ...,
 to: ...,
})
],
});
```

```ts
function transferEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    { readonly name: "value"; readonly type: "uint256" },
  ];
  readonly name: "Transfer";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    { readonly name: "value"; readonly type: "uint256" },
  ];
  readonly name: "Transfer";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC20.transferFrom

Transfers a specified amount of tokens from one address to another address on the ERC20 contract.

### Example

```ts
import { transferFrom } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
 
const transaction = transferFrom({
  contract: USDC_CONTRACT,
  from: "0x1234...",
  to: "0x5678...",
  amount: 100,
});
 
await sendTransaction({ transaction, account });
```

```ts
function transferFrom(
  options: BaseTransactionOptions<TransferFromParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The transaction options including from, to, amount, and gas price.

#### Type

```ts
let options: BaseTransactionOptions<TransferFromParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A promise that resolves to the prepared transaction object.
---

###### Connect SDK

## ERC20.withdraw

Prepares a transaction to call the "withdraw" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { withdraw } from "thirdweb/extensions/erc20";
 
const transaction = withdraw({
 contract,
 amount: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function withdraw(
  options: BaseTransactionOptions<
    WithdrawParams | { asyncParams: () => Promise<WithdrawParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "withdraw" function.

#### Type

```ts
let options: BaseTransactionOptions<
  WithdrawParams | { asyncParams: () => Promise<WithdrawParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## ERC4337
---

###### Connect SDK

## ERC4337.accountDeployedEvent

Creates an event object for the AccountDeployed event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { accountDeployedEvent } from "thirdweb/extensions/erc4337";
 
const events = await getContractEvents({
contract,
events: [
 accountDeployedEvent({
 userOpHash: ...,
 sender: ...,
})
],
});
```

```ts
function accountDeployedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "userOpHash";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
    { readonly name: "factory"; readonly type: "address" },
    { readonly name: "paymaster"; readonly type: "address" },
  ];
  readonly name: "AccountDeployed";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "userOpHash";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
    { readonly name: "factory"; readonly type: "address" },
    { readonly name: "paymaster"; readonly type: "address" },
  ];
  readonly name: "AccountDeployed";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC4337.addAdmin

Adds admin permissions for a specified address.

### Example

```ts
import { addAdmin } from "thirdweb/extensions/erc4337";
import { sendTransaction } from "thirdweb";
 
const transaction = addAdmin({
  contract,
  account,
  adminAddress: "0x...",
});
 
await sendTransaction({ transaction, account });
```

```ts
function addAdmin(
  options: BaseTransactionOptions<AddAdminOptions>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the addAdmin function.

#### Type

```ts
let options: BaseTransactionOptions<AddAdminOptions>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction object to be sent.
---

###### Connect SDK

## ERC4337.addSessionKey

Adds session key permissions for a specified address.

### Example

```ts
import { addSessionKey } from "thirdweb/extensions/erc4337";
import { sendTransaction } from "thirdweb";
 
const transaction = addSessionKey({
  contract,
  account,
  sessionKeyAddress,
  permissions: {
    approvedTargets: ["0x..."],
    nativeTokenLimitPerTransaction: 0.1, // in ETH
    permissionStartTimestamp: new Date(),
    permissionEndTimestamp: new Date(
      Date.now() + 1000 * 60 * 60 * 24 * 365,
    ), // 1 year from now
  },
});
 
await sendTransaction({ transaction, account });
```

```ts
function addSessionKey(
  options: BaseTransactionOptions<AddSessionKeyOptions>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the removeSessionKey function.

#### Type

```ts
let options: BaseTransactionOptions<AddSessionKeyOptions>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction object to be sent.
---

###### Connect SDK

## ERC4337.adminUpdatedEvent

Creates an event object for the AdminUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { adminUpdatedEvent } from "thirdweb/extensions/erc4337";
 
const events = await getContractEvents({
contract,
events: [
 adminUpdatedEvent({
 signer: ...,
})
],
});
```

```ts
function adminUpdatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    { readonly name: "isAdmin"; readonly type: "bool" },
  ];
  readonly name: "AdminUpdated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "signer";
      readonly type: "address";
    },
    { readonly name: "isAdmin"; readonly type: "bool" },
  ];
  readonly name: "AdminUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC4337.createAccount

Prepares a transaction to call the "createAccount" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { createAccount } from "thirdweb/extensions/erc4337";
 
const transaction = createAccount({
 contract,
 admin: ...,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function createAccount(
  options: BaseTransactionOptions<
    | CreateAccountParams
    | { asyncParams: () => Promise<CreateAccountParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "createAccount" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CreateAccountParams
  | { asyncParams: () => Promise<CreateAccountParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC4337.getAccounts

Calls the "getAccounts" function on the contract.

### Example

```ts
import { getAccounts } from "thirdweb/extensions/erc4337";
 
const result = await getAccounts({
 contract,
 start: ...,
 end: ...,
});
```

```ts
function getAccounts(options: BaseTransactionOptions<GetAccountsParams>) : Promise<readonly Array<string>>
```

### Parameters

The options for the getAccounts function.

#### Type

```ts
let options: BaseTransactionOptions<GetAccountsParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<string>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getAccountsOfSigner

Calls the "getAccountsOfSigner" function on the contract.

### Example

```ts
import { getAccountsOfSigner } from "thirdweb/extensions/erc4337";
 
const result = await getAccountsOfSigner({
 contract,
 signer: ...,
});
```

```ts
function getAccountsOfSigner(options: BaseTransactionOptions<GetAccountsOfSignerParams>) : Promise<readonly Array<string>>
```

### Parameters

The options for the getAccountsOfSigner function.

#### Type

```ts
let options: BaseTransactionOptions<GetAccountsOfSignerParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<string>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getAllAccounts

Calls the "getAllAccounts" function on the contract.

### Example

```ts
import { getAllAccounts } from "thirdweb/extensions/erc4337";
 
const result = await getAllAccounts({
  contract,
});
```

```ts
function getAllAccounts(options: BaseTransactionOptions) : Promise<readonly Array<string>>
```

### Parameters

The options for the getAllAccounts function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<string>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getAllActiveSigners

Calls the "getAllActiveSigners" function on the contract.

### Example

```ts
import { getAllActiveSigners } from "thirdweb/extensions/erc4337";
 
const result = await getAllActiveSigners({
  contract,
});
```

```ts
function getAllActiveSigners(options: BaseTransactionOptions) : Promise<readonly Array<{ approvedTargets: readonly Array<string>; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>>
```

### Parameters

The options for the getAllActiveSigners function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ approvedTargets: readonly Array<string>; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getAllAdmins

Calls the "getAllAdmins" function on the contract.

### Example

```ts
import { getAllAdmins } from "thirdweb/extensions/erc4337";
 
const result = await getAllAdmins({
  contract,
});
```

```ts
function getAllAdmins(options: BaseTransactionOptions) : Promise<readonly Array<string>>
```

### Parameters

The options for the getAllAdmins function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<string>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getAllSigners

Calls the "getAllSigners" function on the contract.

### Example

```ts
import { getAllSigners } from "thirdweb/extensions/erc4337";
 
const result = await getAllSigners({
  contract,
});
```

```ts
function getAllSigners(options: BaseTransactionOptions) : Promise<readonly Array<{ approvedTargets: readonly Array<string>; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>>
```

### Parameters

The options for the getAllSigners function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ approvedTargets: readonly Array<string>; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getPermissionsForSigner

Calls the "getPermissionsForSigner" function on the contract.

### Example

```ts
import { getPermissionsForSigner } from "thirdweb/extensions/erc4337";
 
const result = await getPermissionsForSigner({
 contract,
 signer: ...,
});
```

```ts
function getPermissionsForSigner(options: BaseTransactionOptions<GetPermissionsForSignerParams>) : Promise<{ approvedTargets: readonly Array<string>; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>
```

### Parameters

The options for the getPermissionsForSigner function.

#### Type

```ts
let options: BaseTransactionOptions<GetPermissionsForSignerParams>;
```

### Returns

```ts
let returnType: Promise<{ approvedTargets: readonly Array<string>; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.getUserOpHash

Calls the "getUserOpHash" function on the contract.

### Example

```ts
import { getUserOpHash } from "thirdweb/extensions/erc4337";
 
const result = await getUserOpHash({
 contract,
 userOp: ...,
});
```

```ts
function getUserOpHash(
  options: BaseTransactionOptions<GetUserOpHashParams>,
): Promise<`0x${string}`>;
```

### Parameters

The options for the getUserOpHash function.

#### Type

```ts
let options: BaseTransactionOptions<GetUserOpHashParams>;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.isAccountDeployed

Adds admin permissions for a specified address.

### Example

```ts
import { isAccountDeployed } from "thirdweb/extensions/erc4337";
 
const isDeployed = await isAccountDeployed({
  contract,
  account,
  adminSigner: "0x...",
});
 
await isAccountDeployed({ contract, adminSigner });
```

```ts
function isAccountDeployed(
  options: BaseTransactionOptions<GetAddressParams>,
): Promise<boolean>;
```

### Parameters

The options for the addAdmin function.

#### Type

```ts
let options: BaseTransactionOptions<GetAddressParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The transaction object to be sent.
---

###### Connect SDK

## ERC4337.isActiveSigner

Calls the "isActiveSigner" function on the contract.

### Example

```ts
import { isActiveSigner } from "thirdweb/extensions/erc4337";
 
const result = await isActiveSigner({
 contract,
 signer: ...,
});
```

```ts
function isActiveSigner(
  options: BaseTransactionOptions<IsActiveSignerParams>,
): Promise<boolean>;
```

### Parameters

The options for the isActiveSigner function.

#### Type

```ts
let options: BaseTransactionOptions<IsActiveSignerParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.isAddAdminSupported

Checks if the `isAddAdminSupported` method is supported by the given contract.

### Example

```ts
import { isAddAdminSupported } from "thirdweb/extensions/erc4337";
 
const supported = isAddAdminSupported(["0x..."]);
```

```ts
function isAddAdminSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isAddAdminSupported` method is supported.
---

###### Connect SDK

## ERC4337.isAddSessionKeySupported

Checks if the `isAddSessionKeySupported` method is supported by the given contract.

### Example

```ts
import { isAddSessionKeySupported } from "thirdweb/extensions/erc4337";
 
const supported = isAddSessionKeySupported(["0x..."]);
```

```ts
function isAddSessionKeySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isAddSessionKeySupported` method is supported.
---

###### Connect SDK

## ERC4337.isAdmin

Calls the "isAdmin" function on the contract.

### Example

```ts
import { isAdmin } from "thirdweb/extensions/erc4337";
 
const result = await isAdmin({
 contract,
 signer: ...,
});
```

```ts
function isAdmin(
  options: BaseTransactionOptions<IsAdminParams>,
): Promise<boolean>;
```

### Parameters

The options for the isAdmin function.

#### Type

```ts
let options: BaseTransactionOptions<IsAdminParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.isCreateAccountSupported

Checks if the `createAccount` method is supported by the given contract.

### Example

```ts
import { isCreateAccountSupported } from "thirdweb/extensions/erc4337";
 
const supported = isCreateAccountSupported(["0x..."]);
```

```ts
function isCreateAccountSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `createAccount` method is supported.
---

###### Connect SDK

## ERC4337.isGetAccountsOfSignerSupported

Checks if the `getAccountsOfSigner` method is supported by the given contract.

### Example

```ts
import { isGetAccountsOfSignerSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAccountsOfSignerSupported(["0x..."]);
```

```ts
function isGetAccountsOfSignerSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAccountsOfSigner` method is supported.
---

###### Connect SDK

## ERC4337.isGetAccountsSupported

Checks if the `getAccounts` method is supported by the given contract.

### Example

```ts
import { isGetAccountsSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAccountsSupported(["0x..."]);
```

```ts
function isGetAccountsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAccounts` method is supported.
---

###### Connect SDK

## ERC4337.isGetAllAccountsSupported

Checks if the `getAllAccounts` method is supported by the given contract.

### Example

```ts
import { isGetAllAccountsSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAllAccountsSupported(["0x..."]);
```

```ts
function isGetAllAccountsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAllAccounts` method is supported.
---

###### Connect SDK

## ERC4337.isGetAllActiveSignersSupported

Checks if the `getAllActiveSigners` method is supported by the given contract.

### Example

```ts
import { isGetAllActiveSignersSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAllActiveSignersSupported(["0x..."]);
```

```ts
function isGetAllActiveSignersSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAllActiveSigners` method is supported.
---

###### Connect SDK

## ERC4337.isGetAllAdminsSupported

Checks if the `getAllAdmins` method is supported by the given contract.

### Example

```ts
import { isGetAllAdminsSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAllAdminsSupported(["0x..."]);
```

```ts
function isGetAllAdminsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAllAdmins` method is supported.
---

###### Connect SDK

## ERC4337.isGetAllSignersSupported

Checks if the `getAllSigners` method is supported by the given contract.

### Example

```ts
import { isGetAllSignersSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAllSignersSupported(["0x..."]);
```

```ts
function isGetAllSignersSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAllSigners` method is supported.
---

###### Connect SDK

## ERC4337.isIsActiveSignerSupported

Checks if the `isActiveSigner` method is supported by the given contract.

### Example

```ts
import { isIsActiveSignerSupported } from "thirdweb/extensions/erc4337";
const supported = isIsActiveSignerSupported(["0x..."]);
```

```ts
function isIsActiveSignerSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isActiveSigner` method is supported.
---

###### Connect SDK

## ERC4337.isIsAdminSupported

Checks if the `isAdmin` method is supported by the given contract.

### Example

```ts
import { isIsAdminSupported } from "thirdweb/extensions/erc4337";
const supported = isIsAdminSupported(["0x..."]);
```

```ts
function isIsAdminSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isAdmin` method is supported.
---

###### Connect SDK

## ERC4337.isPredictAccountAddressSupported

Checks if the `getAddress` method is supported by the given contract.

### Example

```ts
import { isGetAddressSupported } from "thirdweb/extensions/erc4337";
const supported = isGetAddressSupported(["0x..."]);
```

```ts
function isPredictAccountAddressSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAddress` method is supported.
---

###### Connect SDK

## ERC4337.isRegistered

Calls the "isRegistered" function on the contract.

### Example

```ts
import { isRegistered } from "thirdweb/extensions/erc4337";
 
const result = await isRegistered({
 contract,
 account: ...,
});
```

```ts
function isRegistered(
  options: BaseTransactionOptions<IsRegisteredParams>,
): Promise<boolean>;
```

### Parameters

The options for the isRegistered function.

#### Type

```ts
let options: BaseTransactionOptions<IsRegisteredParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.isRemoveAdminSupported

Checks if the `isRemoveAdminSupported` method is supported by the given contract.

### Example

```ts
import { isRemoveAdminSupported } from "thirdweb/extensions/erc4337";
 
const supported = isRemoveAdminSupported(["0x..."]);
```

```ts
function isRemoveAdminSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isRemoveAdminSupported` method is supported.
---

###### Connect SDK

## ERC4337.isRemoveSessionKeySupported

Checks if the `isRemoveSessionKeySupported` method is supported by the given contract.

### Example

```ts
import { isRemoveSessionKeySupported } from "thirdweb/extensions/erc4337";
 
const supported = isRemoveSessionKeySupported(["0x..."]);
```

```ts
function isRemoveSessionKeySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isRemoveSessionKeySupported` method is supported.
---

###### Connect SDK

## ERC4337.isTotalAccountsSupported

Checks if the `totalAccounts` method is supported by the given contract.

### Example

```ts
import { isTotalAccountsSupported } from "thirdweb/extensions/erc4337";
const supported = isTotalAccountsSupported(["0x..."]);
```

```ts
function isTotalAccountsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `totalAccounts` method is supported.
---

###### Connect SDK

## ERC4337.isValidateUserOpSupported

Checks if the `validateUserOp` method is supported by the given contract.

### Example

```ts
import { isValidateUserOpSupported } from "thirdweb/extensions/erc4337";
 
const supported = isValidateUserOpSupported(["0x..."]);
```

```ts
function isValidateUserOpSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `validateUserOp` method is supported.
---

###### Connect SDK

## ERC4337.predictAccountAddress

Calls the "getAddress" function on the contract.

### Example

```ts
import { getAddress } from "thirdweb/extensions/erc4337";
 
const result = await getAddress({
 contract,
 adminSigner: ...,
 data: ...,
});
```

```ts
function predictAccountAddress(
  options: BaseTransactionOptions<GetAddressParams>,
): Promise<string>;
```

### Parameters

The options for the getAddress function.

#### Type

```ts
let options: BaseTransactionOptions<GetAddressParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.removeAdmin

Removes admin permissions for a specified address.

### Example

```ts
import { removeAdmin } from "thirdweb/extensions/erc4337";
import { sendTransaction } from "thirdweb";
 
const transaction = removeAdmin({
  contract,
  account,
  adminAddress: "0x...",
});
 
await sendTransaction({ transaction, account });
```

```ts
function removeAdmin(
  options: BaseTransactionOptions<RemoveAdminOptions>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the removeAdmin function.

#### Type

```ts
let options: BaseTransactionOptions<RemoveAdminOptions>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction object to be sent.
---

###### Connect SDK

## ERC4337.removeSessionKey

Removes session key permissions for a specified address.

### Example

```ts
import { removeSessionKey } from "thirdweb/extensions/erc4337";
import { sendTransaction } from "thirdweb";
 
const transaction = removeSessionKey({
  contract,
  account,
  sessionKeyAddress,
});
 
await sendTransaction({ transaction, account });
```

```ts
function removeSessionKey(
  options: BaseTransactionOptions<RemoveSessionKeyOptions>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the removeSessionKey function.

#### Type

```ts
let options: BaseTransactionOptions<RemoveSessionKeyOptions>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction object to be sent.
---

###### Connect SDK

## ERC4337.shouldUpdateSessionKey

Checks if the session key should be updated.

### Example

```ts
import { shouldUpdateSessionKey } from "thirdweb/extensions/erc4337";
 
const shouldUpdate = await shouldUpdateSessionKey({
  accountContract,
  sessionKeyAddress,
  newPermissions,
});
```

```ts
function shouldUpdateSessionKey(args: {
  accountContract: Readonly;
  newPermissions: AccountPermissions;
  sessionKeyAddress: string;
}): Promise<boolean>;
```

### Parameters

#### Type

```ts
let args: {
  accountContract: Readonly;
  newPermissions: AccountPermissions;
  sessionKeyAddress: string;
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean indicating if the session key should be updated.
---

###### Connect SDK

## ERC4337.signerPermissionsUpdatedEvent

Creates an event object for the SignerPermissionsUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { signerPermissionsUpdatedEvent } from "thirdweb/extensions/erc4337";
 
const events = await getContractEvents({
contract,
events: [
 signerPermissionsUpdatedEvent({
 authorizingSigner: ...,
 targetSigner: ...,
})
],
});
```

```ts
function signerPermissionsUpdatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "authorizingSigner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "targetSigner";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "signer"; readonly type: "address" },
        { readonly name: "isAdmin"; readonly type: "uint8" },
        {
          readonly name: "approvedTargets";
          readonly type: "address[]";
        },
        {
          readonly name: "nativeTokenLimitPerTransaction";
          readonly type: "uint256";
        },
        {
          readonly name: "permissionStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "permissionEndTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "reqValidityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "reqValidityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "permissions";
      readonly type: "tuple";
    },
  ];
  readonly name: "SignerPermissionsUpdated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "authorizingSigner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "targetSigner";
      readonly type: "address";
    },
    {
      readonly components: readonly [
        { readonly name: "signer"; readonly type: "address" },
        { readonly name: "isAdmin"; readonly type: "uint8" },
        {
          readonly name: "approvedTargets";
          readonly type: "address[]";
        },
        {
          readonly name: "nativeTokenLimitPerTransaction";
          readonly type: "uint256";
        },
        {
          readonly name: "permissionStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "permissionEndTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "reqValidityStartTimestamp";
          readonly type: "uint128";
        },
        {
          readonly name: "reqValidityEndTimestamp";
          readonly type: "uint128";
        },
        { readonly name: "uid"; readonly type: "bytes32" },
      ];
      readonly name: "permissions";
      readonly type: "tuple";
    },
  ];
  readonly name: "SignerPermissionsUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC4337.simulateHandleOp

Prepares a transaction to call the "simulateHandleOp" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { simulateHandleOp } from "thirdweb/extensions/erc4337";
 
const transaction = simulateHandleOp({
 contract,
 op: ...,
 target: ...,
 targetCallData: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function simulateHandleOp(
  options: BaseTransactionOptions<
    | SimulateHandleOpParams
    | { asyncParams: () => Promise<SimulateHandleOpParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "simulateHandleOp" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SimulateHandleOpParams
  | { asyncParams: () => Promise<SimulateHandleOpParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC4337.totalAccounts

Calls the "totalAccounts" function on the contract.

### Example

```ts
import { totalAccounts } from "thirdweb/extensions/erc4337";
 
const result = await totalAccounts({
  contract,
});
```

```ts
function totalAccounts(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalAccounts function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4337.userOperationEventEvent

Creates an event object for the UserOperationEvent event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { userOperationEventEvent } from "thirdweb/extensions/erc4337";
 
const events = await getContractEvents({
contract,
events: [
 userOperationEventEvent({
 userOpHash: ...,
 sender: ...,
 paymaster: ...,
})
],
});
```

```ts
function userOperationEventEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "userOpHash";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "paymaster";
      readonly type: "address";
    },
    { readonly name: "nonce"; readonly type: "uint256" },
    { readonly name: "success"; readonly type: "bool" },
    { readonly name: "actualGasCost"; readonly type: "uint256" },
    { readonly name: "actualGasUsed"; readonly type: "uint256" },
  ];
  readonly name: "UserOperationEvent";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "userOpHash";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "paymaster";
      readonly type: "address";
    },
    { readonly name: "nonce"; readonly type: "uint256" },
    { readonly name: "success"; readonly type: "bool" },
    { readonly name: "actualGasCost"; readonly type: "uint256" },
    { readonly name: "actualGasUsed"; readonly type: "uint256" },
  ];
  readonly name: "UserOperationEvent";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC4337.userOperationRevertReasonEvent

Creates an event object for the UserOperationRevertReason event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { userOperationRevertReasonEvent } from "thirdweb/extensions/erc4337";
 
const events = await getContractEvents({
contract,
events: [
 userOperationRevertReasonEvent({
 userOpHash: ...,
 sender: ...,
})
],
});
```

```ts
function userOperationRevertReasonEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "userOpHash";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
    { readonly name: "nonce"; readonly type: "uint256" },
    { readonly name: "revertReason"; readonly type: "bytes" },
  ];
  readonly name: "UserOperationRevertReason";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "userOpHash";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
    { readonly name: "nonce"; readonly type: "uint256" },
    { readonly name: "revertReason"; readonly type: "bytes" },
  ];
  readonly name: "UserOperationRevertReason";
  readonly type: "event";
}>;
```

The prepared event object.
---
## ERC4626
---

###### Connect SDK

## ERC4626.asset

Calls the "asset" function on the contract.

### Example

```ts
import { asset } from "thirdweb/extensions/erc4626";
 
const result = await asset({
  contract,
});
```

```ts
function asset(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the asset function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.convertToAssets

Calls the "convertToAssets" function on the contract.

### Example

```ts
import { convertToAssets } from "thirdweb/extensions/erc4626";
 
const result = await convertToAssets({
 contract,
 shares: ...,
});
```

```ts
function convertToAssets(
  options: BaseTransactionOptions<ConvertToAssetsParams>,
): Promise<bigint>;
```

### Parameters

The options for the convertToAssets function.

#### Type

```ts
let options: BaseTransactionOptions<ConvertToAssetsParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.convertToShares

Calls the "convertToShares" function on the contract.

### Example

```ts
import { convertToShares } from "thirdweb/extensions/erc4626";
 
const result = await convertToShares({
 contract,
 assets: ...,
});
```

```ts
function convertToShares(
  options: BaseTransactionOptions<ConvertToSharesParams>,
): Promise<bigint>;
```

### Parameters

The options for the convertToShares function.

#### Type

```ts
let options: BaseTransactionOptions<ConvertToSharesParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.deposit

Prepares a transaction to call the "deposit" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { deposit } from "thirdweb/extensions/erc4626";
 
const transaction = deposit({
 contract,
 assets: ...,
 receiver: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function deposit(
  options: BaseTransactionOptions<
    DepositParams | { asyncParams: () => Promise<DepositParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "deposit" function.

#### Type

```ts
let options: BaseTransactionOptions<
  DepositParams | { asyncParams: () => Promise<DepositParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC4626.depositEvent

Creates an event object for the Deposit event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { depositEvent } from "thirdweb/extensions/erc4626";
 
const events = await getContractEvents({
contract,
events: [
 depositEvent({
 caller: ...,
 owner: ...,
})
],
});
```

```ts
function depositEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "caller";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    { readonly name: "assets"; readonly type: "uint256" },
    { readonly name: "shares"; readonly type: "uint256" },
  ];
  readonly name: "Deposit";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "caller";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    { readonly name: "assets"; readonly type: "uint256" },
    { readonly name: "shares"; readonly type: "uint256" },
  ];
  readonly name: "Deposit";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## ERC4626.maxDeposit

Calls the "maxDeposit" function on the contract.

### Example

```ts
import { maxDeposit } from "thirdweb/extensions/erc4626";
 
const result = await maxDeposit({
 contract,
 receiver: ...,
});
```

```ts
function maxDeposit(
  options: BaseTransactionOptions<MaxDepositParams>,
): Promise<bigint>;
```

### Parameters

The options for the maxDeposit function.

#### Type

```ts
let options: BaseTransactionOptions<MaxDepositParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.maxMint

Calls the "maxMint" function on the contract.

### Example

```ts
import { maxMint } from "thirdweb/extensions/erc4626";
 
const result = await maxMint({
 contract,
 receiver: ...,
});
```

```ts
function maxMint(
  options: BaseTransactionOptions<MaxMintParams>,
): Promise<bigint>;
```

### Parameters

The options for the maxMint function.

#### Type

```ts
let options: BaseTransactionOptions<MaxMintParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.maxRedeem

Calls the "maxRedeem" function on the contract.

### Example

```ts
import { maxRedeem } from "thirdweb/extensions/erc4626";
 
const result = await maxRedeem({
 contract,
 owner: ...,
});
```

```ts
function maxRedeem(
  options: BaseTransactionOptions<MaxRedeemParams>,
): Promise<bigint>;
```

### Parameters

The options for the maxRedeem function.

#### Type

```ts
let options: BaseTransactionOptions<MaxRedeemParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.maxWithdraw

Calls the "maxWithdraw" function on the contract.

### Example

```ts
import { maxWithdraw } from "thirdweb/extensions/erc4626";
 
const result = await maxWithdraw({
 contract,
 owner: ...,
});
```

```ts
function maxWithdraw(
  options: BaseTransactionOptions<MaxWithdrawParams>,
): Promise<bigint>;
```

### Parameters

The options for the maxWithdraw function.

#### Type

```ts
let options: BaseTransactionOptions<MaxWithdrawParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.mint

Prepares a transaction to call the "mint" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { mint } from "thirdweb/extensions/erc4626";
 
const transaction = mint({
 contract,
 shares: ...,
 receiver: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mint(
  options: BaseTransactionOptions<
    MintParams | { asyncParams: () => Promise<MintParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "mint" function.

#### Type

```ts
let options: BaseTransactionOptions<
  MintParams | { asyncParams: () => Promise<MintParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC4626.previewDeposit

Calls the "previewDeposit" function on the contract.

### Example

```ts
import { previewDeposit } from "thirdweb/extensions/erc4626";
 
const result = await previewDeposit({
 contract,
 assets: ...,
});
```

```ts
function previewDeposit(
  options: BaseTransactionOptions<PreviewDepositParams>,
): Promise<bigint>;
```

### Parameters

The options for the previewDeposit function.

#### Type

```ts
let options: BaseTransactionOptions<PreviewDepositParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.previewMint

Calls the "previewMint" function on the contract.

### Example

```ts
import { previewMint } from "thirdweb/extensions/erc4626";
 
const result = await previewMint({
 contract,
 shares: ...,
});
```

```ts
function previewMint(
  options: BaseTransactionOptions<PreviewMintParams>,
): Promise<bigint>;
```

### Parameters

The options for the previewMint function.

#### Type

```ts
let options: BaseTransactionOptions<PreviewMintParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.previewRedeem

Calls the "previewRedeem" function on the contract.

### Example

```ts
import { previewRedeem } from "thirdweb/extensions/erc4626";
 
const result = await previewRedeem({
 contract,
 shares: ...,
});
```

```ts
function previewRedeem(
  options: BaseTransactionOptions<PreviewRedeemParams>,
): Promise<bigint>;
```

### Parameters

The options for the previewRedeem function.

#### Type

```ts
let options: BaseTransactionOptions<PreviewRedeemParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.previewWithdraw

Calls the "previewWithdraw" function on the contract.

### Example

```ts
import { previewWithdraw } from "thirdweb/extensions/erc4626";
 
const result = await previewWithdraw({
 contract,
 assets: ...,
});
```

```ts
function previewWithdraw(
  options: BaseTransactionOptions<PreviewWithdrawParams>,
): Promise<bigint>;
```

### Parameters

The options for the previewWithdraw function.

#### Type

```ts
let options: BaseTransactionOptions<PreviewWithdrawParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.redeem

Prepares a transaction to call the "redeem" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { redeem } from "thirdweb/extensions/erc4626";
 
const transaction = redeem({
 contract,
 shares: ...,
 receiver: ...,
 owner: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function redeem(
  options: BaseTransactionOptions<
    RedeemParams | { asyncParams: () => Promise<RedeemParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "redeem" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RedeemParams | { asyncParams: () => Promise<RedeemParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC4626.totalAssets

Calls the "totalAssets" function on the contract.

### Example

```ts
import { totalAssets } from "thirdweb/extensions/erc4626";
 
const result = await totalAssets({
  contract,
});
```

```ts
function totalAssets(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalAssets function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## ERC4626.withdraw

Prepares a transaction to call the "withdraw" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { withdraw } from "thirdweb/extensions/erc4626";
 
const transaction = withdraw({
 contract,
 assets: ...,
 receiver: ...,
 owner: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function withdraw(
  options: BaseTransactionOptions<
    WithdrawParams | { asyncParams: () => Promise<WithdrawParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "withdraw" function.

#### Type

```ts
let options: BaseTransactionOptions<
  WithdrawParams | { asyncParams: () => Promise<WithdrawParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## ERC4626.withdrawEvent

Creates an event object for the Withdraw event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { withdrawEvent } from "thirdweb/extensions/erc4626";
 
const events = await getContractEvents({
contract,
events: [
 withdrawEvent({
 caller: ...,
 receiver: ...,
 owner: ...,
})
],
});
```

```ts
function withdrawEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "caller";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    { readonly name: "assets"; readonly type: "uint256" },
    { readonly name: "shares"; readonly type: "uint256" },
  ];
  readonly name: "Withdraw";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "caller";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "receiver";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "owner";
      readonly type: "address";
    },
    { readonly name: "assets"; readonly type: "uint256" },
    { readonly name: "shares"; readonly type: "uint256" },
  ];
  readonly name: "Withdraw";
  readonly type: "event";
}>;
```

The prepared event object.
---
## FARCASTER
---

###### Connect SDK

## FARCASTER.addSigner

Adds farcaster signer for the given account.

### Example

```ts
import { addSigner } from "thirdweb/extensions/farcaster";
import { sendTransaction } from "thirdweb";
 
const transaction = addSigner({
  client,
  appAccount,
  signerPublicKey,
});
 
await sendTransaction({ transaction, account });
```

```ts
function addSigner(
  options: AddSignerParams,
): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for adding the signer.

#### Type

```ts
let options: Prettify<
  {
    chain?: Chain;
    client: ThirdwebClient;
    disableCache?: boolean;
    signerPublicKey: Hex;
  } & (
    | { appAccount: Account }
    | {
        appAccountAddress: Address;
        deadline: bigint;
        signedKeyRequestMetadata: Hex;
      }
  )
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object to add the signer to the account.
---

###### Connect SDK

## FARCASTER.addSignerFor

Adds farcaster signer for a given user. Helpful if you want to cover the gas fee for a user.

### Example

```ts
import { addSignerFor } from "thirdweb/extensions/farcaster";
import { sendTransaction } from "thirdweb";
 
const transaction = addSignerFor({
  client,
  appAccount,
  userAccount,
  signerPublicKey,
});
 
await sendTransaction({ transaction, account });
```

```ts
function addSignerFor(
  options: AddSignerForParams,
): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for adding the signer.

#### Type

```ts
let options: Prettify<
  {
    chain?: Chain;
    client: ThirdwebClient;
    disableCache?: boolean;
    signerPublicKey: Hex;
  } & (
    | { appAccount: Account }
    | {
        appAccountAddress: Address;
        deadline: bigint;
        signedKeyRequestMetadata: Hex;
      }
  ) &
    (
      | { userAccount: Account }
      | { addSignature: Hex; deadline: bigint; userAddress: Address }
    )
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object to add the signer to the account.
---

###### Connect SDK

## FARCASTER.createEd25519Keypair

Generates an Ed25519 keypair to be used as an account signer.

### Example

```ts
createSigner();
```

```ts
function createEd25519Keypair(): Promise<Ed25519Keypair>;
```

### Returns

```ts
let returnType: { privateKey: Hex; publicKey: Hex };
```

A promise resolving to the generated keypair.
---

###### Connect SDK

## FARCASTER.encodeSignedKeyRequestMetadata

Encodes the signed key request metadata into a hexadecimal string. This function takes in the request signer's address, the key request signature, the request Fid, and the deadline, and returns the encoded ABI parameters as a hexadecimal string. It's used to prepare the metadata for transactions involving signed key requests.

### Example

```ts
const encodedMetadata = encodeSignedKeyRequestMetadata({
  requestSigner: "0x123...",
  keyRequestSignature: "0xabcd...",
  requestFid: 123456789n,
  deadline: 1657758061n,
});
```

```ts
function encodeSignedKeyRequestMetadata(options: {
  deadline: bigint;
  keyRequestSignature: `0x${string}`;
  requestFid: bigint;
  requestSigner: string;
}): `0x${string}`;
```

### Parameters

The options for encoding the signed key request metadata.

#### Type

```ts
let options: {
  deadline: bigint;
  keyRequestSignature: `0x${string}`;
  requestFid: bigint;
  requestSigner: string;
};
```

### Returns

```ts
let returnType: `0x${string}`;
```

The encoded ABI parameters as a hexadecimal string.
---

###### Connect SDK

## FARCASTER.getAddData

Prepares the data required for signing an Add message according to EIP-712.

### Example

```typescript
const message: AddMessage = {
  owner: "0xYourAddress",
  keyType: 1,
  key: "0xYourPublicKey",
  metadataType: 1,
  metadata: "0xYourMetadata",
  nonce: BigInt("YourNonce"),
  deadline: BigInt("YourDeadline"),
};
 
const data = getAddData(message);
```

```ts
function getAddData(message: AddMessage): {
  domain: {
    readonly chainId: 10;
    readonly name: "Farcaster KeyGateway";
    readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B";
    readonly version: "1";
  };
  message: AddMessage;
  primaryType: "Add";
  types: {
    readonly Add: readonly [
      { readonly name: "owner"; readonly type: "address" },
      { readonly name: "keyType"; readonly type: "uint32" },
      { readonly name: "key"; readonly type: "bytes" },
      { readonly name: "metadataType"; readonly type: "uint8" },
      { readonly name: "metadata"; readonly type: "bytes" },
      { readonly name: "nonce"; readonly type: "uint256" },
      { readonly name: "deadline"; readonly type: "uint256" },
    ];
  };
};
```

### Parameters

The AddMessage object containing the message to be signed.

#### Type

```ts
let message: {
  deadline: bigint;
  key: Hex;
  keyType: number;
  metadata: Hex;
  metadataType: number;
  nonce: bigint;
  owner: Address;
};
```

### Returns

```ts
let returnType: {
  domain: {
    readonly chainId: 10;
    readonly name: "Farcaster KeyGateway";
    readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B";
    readonly version: "1";
  };
  message: AddMessage;
  primaryType: "Add";
  types: {
    readonly Add: readonly [
      { readonly name: "owner"; readonly type: "address" },
      { readonly name: "keyType"; readonly type: "uint32" },
      { readonly name: "key"; readonly type: "bytes" },
      { readonly name: "metadataType"; readonly type: "uint8" },
      { readonly name: "metadata"; readonly type: "bytes" },
      { readonly name: "nonce"; readonly type: "uint256" },
      { readonly name: "deadline"; readonly type: "uint256" },
    ];
  };
};
```

The data object structured according to EIP-712, ready for signing.
---

###### Connect SDK

## FARCASTER.getBundler

Retrieves the Bundler contract.

### Example

```ts
import { getBundler } from "thirdweb/extensions/farcaster";
 
const bundler = await getBundler({
  client,
});
```

```ts
function getBundler(options: FarcasterContractOptions): Readonly;
```

### Parameters

The thirdweb client and an optional custom chain.

#### Type

```ts
let options: { chain?: Chain; client: ThirdwebClient };
```

### Returns

```ts
let returnType: Readonly;
```

The Bundler contract instance.
---

###### Connect SDK

## FARCASTER.getFid

Retrieves the current fid for an account.

### Example

```ts
import { getFid } from "thirdweb/extensions/farcaster";
 
const price = await getFid({
  client,
  address,
});
```

```ts
function getFid(options: GetFidParams): Promise<bigint>;
```

### Parameters

Parameters to pass to the function.

#### Type

```ts
let options: {
  address: Address;
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
};
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the account's fid, if one exists, otherwise 0.
---

###### Connect SDK

## FARCASTER.getIdGateway

Retrieves the IdGateway contract.

### Example

```ts
import { getIdGatway } from "thirdweb/extensions/farcaster";
 
const idGateway = await getIdGateway({
  client,
});
```

```ts
function getIdGateway(options: FarcasterContractOptions): Readonly;
```

### Parameters

The thirdweb client and an optional custom chain.

#### Type

```ts
let options: { chain?: Chain; client: ThirdwebClient };
```

### Returns

```ts
let returnType: Readonly;
```

The IdGateway contract instance.
---

###### Connect SDK

## FARCASTER.getIdRegistry

Retrieves the IdRegistry contract.

### Example

```ts
import { getIdRegistry } from "thirdweb/extensions/farcaster";
 
const idRegistry = await getIdRegistry({
  client,
});
```

```ts
function getIdRegistry(options: FarcasterContractOptions): Readonly;
```

### Parameters

The thirdweb client and an optional custom chain.

#### Type

```ts
let options: { chain?: Chain; client: ThirdwebClient };
```

### Returns

```ts
let returnType: Readonly;
```

The IdRegistry contract instance.
---

###### Connect SDK

## FARCASTER.getKeyGateway

Retrieves the KeyGateway contract.

### Example

```ts
import { getKeyGateway } from "thirdweb/extensions/farcaster";
 
const keyGateway = await getKeyGateway({
  client,
});
```

```ts
function getKeyGateway(options: FarcasterContractOptions): Readonly;
```

### Parameters

The thirdweb client and an optional custom chain.

#### Type

```ts
let options: { chain?: Chain; client: ThirdwebClient };
```

### Returns

```ts
let returnType: Readonly;
```

The KeyGateway contract instance.
---

###### Connect SDK

## FARCASTER.getKeyRequestData

Prepares the data required for signing a key request using EIP-712 typed data signing. This includes the domain, types, primary type, and the message to be signed.

### Example

```ts
const message = {
  requestFid: 123456789n,
  key: "0x04bfc...",
  deadline: 1657758061n,
};
const eip712Data = getKeyRequestData(message);
```

```ts
function getKeyRequestData(message: SignedKeyRequestMessage): {
  domain: {
    readonly chainId: 10;
    readonly name: "Farcaster SignedKeyRequestValidator";
    readonly verifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553";
    readonly version: "1";
  };
  message: SignedKeyRequestMessage;
  primaryType: "SignedKeyRequest";
  types: {
    readonly SignedKeyRequest: Array<{ name: string; type: string }>;
  };
};
```

### Parameters

The message to be signed, containing the request FID, key, and deadline.

#### Type

```ts
let message: { deadline: bigint; key: Hex; requestFid: bigint };
```

### Returns

```ts
let returnType: {
  domain: {
    readonly chainId: 10;
    readonly name: "Farcaster SignedKeyRequestValidator";
    readonly verifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553";
    readonly version: "1";
  };
  message: SignedKeyRequestMessage;
  primaryType: "SignedKeyRequest";
  types: {
    readonly SignedKeyRequest: Array<{ name: string; type: string }>;
  };
};
```

An object containing the domain, types, primary type, and the message for EIP-712 signing.
---

###### Connect SDK

## FARCASTER.getNonce

Retrieves the current key gateway nonce for an account.

### Example

```ts
import { getNonce } from "thirdweb/extensions/farcaster";
 
const nonce = await getNonce({
  client,
  address,
});
```

```ts
function getNonce(options: GetNonceParams): Promise<bigint>;
```

### Parameters

Parameters to pass to the function.

#### Type

```ts
let options: {
  address: Address;
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
};
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the current nonce.
---

###### Connect SDK

## FARCASTER.getRegisterData

Constructs the data required for signing a register message in the Farcaster ID Gateway. This includes the EIP-712 domain, types, and the message to be signed.

### Example

```ts
import { getRegisterData } from "thirdweb/extensions/farcaster";
 
const data = getRegisterData(message);
```

```ts
function getRegisterData(message: RegisterMessage): {
  domain: {
    readonly chainId: 10;
    readonly name: "Farcaster IdGateway";
    readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69";
    readonly version: "1";
  };
  message: RegisterMessage;
  primaryType: "Register";
  types: {
    readonly Register: readonly [
      { readonly name: "to"; readonly type: "address" },
      { readonly name: "recovery"; readonly type: "address" },
      { readonly name: "nonce"; readonly type: "uint256" },
      { readonly name: "deadline"; readonly type: "uint256" },
    ];
  };
};
```

### Parameters

The register message containing the necessary information for the signature.

#### Type

```ts
let message: {
  deadline: bigint;
  nonce: bigint;
  recovery: Address;
  to: Address;
};
```

### Returns

```ts
let returnType: {
  domain: {
    readonly chainId: 10;
    readonly name: "Farcaster IdGateway";
    readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69";
    readonly version: "1";
  };
  message: RegisterMessage;
  primaryType: "Register";
  types: {
    readonly Register: readonly [
      { readonly name: "to"; readonly type: "address" },
      { readonly name: "recovery"; readonly type: "address" },
      { readonly name: "nonce"; readonly type: "uint256" },
      { readonly name: "deadline"; readonly type: "uint256" },
    ];
  };
};
```

An object containing the EIP-712 domain, types, and the message, ready to be signed.
---

###### Connect SDK

## FARCASTER.getRegistrationPrice

Retrieves the current cost to register a Farcaster fid in wei.

### Example

```ts
import { getRegistrationPrice } from "thirdweb/extensions/farcaster";
 
const price = await getRegistrationPrice({
  client,
});
```

```ts
function getRegistrationPrice(
  options: GetRegistrationPriceParams,
): Promise<bigint>;
```

### Parameters

An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price.

#### Type

```ts
let options: {
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
  extraStorage?: bigint | number | string;
};
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the current cost of a Farcaster fid in wei.
---

###### Connect SDK

## FARCASTER.getSignedKeyRequestMetadata

Generates the signed key request metadata to add a signer to an account. This function can either sign a new key request using an account object or use an existing key request signature. It prepares the metadata necessary for transactions involving signed key requests.

### Example

```ts
import { getSignedKeyRequestMetadata } from "thirdweb/extensions/farcaster";
 
// Using an existing signature
const signedMetadata = await getSignedKeyRequestMetadata({
  keyRequestSignature: "0xabcd...",
  accountAddress: "0x123...",
  message: {
    requestFid: 123456789n,
    deadline: 1657758061n,
  },
});
 
// Signing a new key request
const signedMetadata = await getSignedKeyRequestMetadata({
  account,
  message: {
    requestFid: 123456789n,
    deadline: 1657758061n,
  },
});
```

```ts
function getSignedKeyRequestMetadata(
  options: SignedKeyRequestMetadataOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for signing the key request or using an existing signature.

#### Type

```ts
let options: Prettify<
  { message: SignedKeyRequestMessage } & (
    | { account: Account }
    | { accountAddress: Address; keyRequestSignature: Hex }
  )
>;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the hexadecimal string of the encoded ABI parameters.
---

###### Connect SDK

## FARCASTER.getStoragePrice

Retrieves the current cost to register a Farcaster fid in wei.

### Example

```ts
import { getStoragePrice } from "thirdweb/extensions/farcaster";
 
const price = await getStoragePrice({
  client,
});
```

```ts
function getStoragePrice(
  options: GetStoragePriceParams,
): Promise<bigint>;
```

### Parameters

An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price.

#### Type

```ts
let options: {
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
  units?: bigint | number | string;
};
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the current cost of a Farcaster fid in USD.
---

###### Connect SDK

## FARCASTER.getStorageRegistry

Retrieves the StorageRegistry contract.

### Example

```ts
import { getStorageRegistry } from "thirdweb/extensions/farcaster";
 
const storageRegistry = await getStorageRegistry({
  client,
});
```

```ts
function getStorageRegistry(
  options: FarcasterContractOptions,
): Readonly;
```

### Parameters

The thirdweb client and an optional custom chain.

#### Type

```ts
let options: { chain?: Chain; client: ThirdwebClient };
```

### Returns

```ts
let returnType: Readonly;
```

The StorageRegistry contract instance.
---

###### Connect SDK

## FARCASTER.getUsdRegistrationPrice

Retrieves the current cost to register a Farcaster fid in USD.

### Example

```ts
import { getUsdRegistrationPrice } from "thirdweb/extensions/farcaster";
 
const price = await getUsdRegistrationPrice({
  client,
});
```

```ts
function getUsdRegistrationPrice(
  options: GetUsdRegistrationPriceParams,
): Promise<number>;
```

### Parameters

An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price.

#### Type

```ts
let options: {
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
  extraStorage?: bigint | number | string;
};
```

### Returns

```ts
let returnType: Promise<number>;
```

A promise that resolves to the current cost of a Farcaster fid in USD.
---

###### Connect SDK

## FARCASTER.getUsdStoragePrice

Retrieves the current cost to register a Farcaster fid in USD.

### Example

```ts
import { getUsdStoragePrice } from "thirdweb/extensions/farcaster";
 
const price = await getUsdStoragePrice({
  client,
});
```

```ts
function getUsdStoragePrice(
  options: GetUsdStoragePriceParams,
): Promise<number>;
```

### Parameters

An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price.

#### Type

```ts
let options: {
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
  units?: bigint | number | string;
};
```

### Returns

```ts
let returnType: Promise<number>;
```

A promise that resolves to the current cost of a Farcaster fid in USD.
---

###### Connect SDK

## FARCASTER.registerFid

Registers a Farcaster fid for the given wallet.

### Example

```ts
import { registerFid } from "thirdweb/extensions/farcaster";
import { sendTransaction } from "thirdweb";
 
const transaction = registerFid({
  client,
  recoveryAddress,
});
 
await sendTransaction({ transaction, account });
```

```ts
function registerFid(
  options: RegisterFidParams,
): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for registering an account.

#### Type

```ts
let options: {
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
  extraStorage?: bigint | string | number;
  recoveryAddress: Address;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object to register the account.
---

###### Connect SDK

## FARCASTER.registerFidAndSigner

Registers a Farcaster fid and signer for the given wallet using the provided app account.

### Example

```ts
import { registerFidAndSigner } from "thirdweb/extensions/farcaster";
import { sendTransaction } from "thirdweb";
 
const transaction = registerFidAndSigner({
  client,
  userAccount,
  appAccount,
  recoveryAddress,
  signerPublicKey,
});
 
await sendTransaction({ transaction, account });
```

```ts
function registerFidAndSigner(
  options: RegisterFidAndSignerParams,
): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for registering an account.

#### Type

```ts
let options: Prettify<
  {
    chain?: Chain;
    client: ThirdwebClient;
    disableCache?: boolean;
    extraStorage?: bigint | number;
    recoveryAddress: Address;
    signerPublicKey: Hex;
  } & (
    | { userAccount: Account }
    | {
        addSignature: Hex;
        deadline: bigint;
        registerSignature: Hex;
        userAddress: Address;
      }
  ) &
    (
      | { appAccount: Account }
      | {
          appAccountAddress: Address;
          deadline: bigint;
          signedKeyRequestMetadata: Hex;
        }
    )
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object to register the account.
---

###### Connect SDK

## FARCASTER.rentStorage

Rent storage for the provided farcaster fid.

### Example

```ts
import { rentStorage } from "thirdweb/extensions/farcaster";
import { sendTransaction } from "thirdweb";
 
const transaction = rentStorage({
  client,
  fid,
  units,
});
 
await sendTransaction({ transaction, account });
```

```ts
function rentStorage(
  options: RentStorageParams,
): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for calling the `rentStorage` function.

#### Type

```ts
let options: {
  chain?: Chain;
  client: ThirdwebClient;
  disableCache?: boolean;
  fid: bigint | number | string;
  units?: bigint | number | string;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  [],
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object to rent the storage.
---

###### Connect SDK

## FARCASTER.signAdd

Signs an Add message using the account's signTypedData method.

### Example

```typescript
const signedMessage = await signAdd({
  account: yourAccount,
  message: yourAddMessage,
});
```

```ts
function signAdd(options: SignAddOptions): Promise<`0x${string}`>;
```

### Parameters

The options for signing the Add message.

#### Type

```ts
let options: { account: Account; message: AddMessage };
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the signature of the Add message.
---

###### Connect SDK

## FARCASTER.signKeyRequest

Signs a key request message using EIP-712 typed data signing. This function prepares the data for signing, signs it with the provided account, and returns the signature.

### Example

```ts
const message = {
  requestFid: 123456789n,
  key: "0x04bfc...",
  deadline: 1657758061n,
};
 
const signature = signKeyRequest({ account: signerAccount, message });
```

```ts
function signKeyRequest(
  options: SignKeyRequestOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for signing the key request, including the account and the message.

#### Type

```ts
let options: { account: Account; message: SignedKeyRequestMessage };
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the signature of the key request.
---

###### Connect SDK

## FARCASTER.signRegister

Signs the register message for Farcaster ID Gateway.

### Example

```ts
const signature = await signRegister({ account, message });
```

```ts
function signRegister(
  options: SignRegisterOptions,
): Promise<`0x${string}`>;
```

### Parameters

The signing options.

#### Type

```ts
let options: { account: Account; message: RegisterMessage };
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the signature.
---

###### Connect SDK

## FARCASTER.idGateway

Calls the "idGateway" function on the contract.

### Example

```ts
import { idGateway } from "thirdweb/extensions/farcaster";
 
const result = await idGateway({
  contract,
});
```

```ts
function idGateway(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the idGateway function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.keyGateway

Calls the "keyGateway" function on the contract.

### Example

```ts
import { keyGateway } from "thirdweb/extensions/farcaster";
 
const result = await keyGateway({
  contract,
});
```

```ts
function keyGateway(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the keyGateway function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.price

Calls the "price" function on the contract.

### Example

```ts
import { price } from "thirdweb/extensions/farcaster";
 
const result = await price({
 contract,
 extraStorage: ...,
});
```

```ts
function price(
  options: BaseTransactionOptions<PriceParams>,
): Promise<bigint>;
```

### Parameters

The options for the price function.

#### Type

```ts
let options: BaseTransactionOptions<PriceParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.register

Prepares a transaction to call the "register" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { register } from "thirdweb/extensions/farcaster";
 
const transaction = register({
 contract,
 recovery: ...,
 extraStorage: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function register(
  options: BaseTransactionOptions<
    RegisterParams | { asyncParams: () => Promise<RegisterParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "register" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RegisterParams | { asyncParams: () => Promise<RegisterParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.idRegistry

Calls the "idRegistry" function on the contract.

### Example

```ts
import { idRegistry } from "thirdweb/extensions/farcaster";
 
const result = await idRegistry({
  contract,
});
```

```ts
function idRegistry(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the idRegistry function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.price

Calls the "price" function on the contract.

### Example

```ts
import { price } from "thirdweb/extensions/farcaster";
 
const result = await price({
 contract,
 extraStorage: ...,
});
```

```ts
function price(
  options: BaseTransactionOptions<PriceParams>,
): Promise<bigint>;
```

### Parameters

The options for the price function.

#### Type

```ts
let options: BaseTransactionOptions<PriceParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.register

Prepares a transaction to call the "register" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { register } from "thirdweb/extensions/farcaster";
 
const transaction = register({
 contract,
 recovery: ...,
 extraStorage: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function register(
  options: BaseTransactionOptions<
    RegisterParams | { asyncParams: () => Promise<RegisterParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "register" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RegisterParams | { asyncParams: () => Promise<RegisterParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.REGISTER\_TYPEHASH

Calls the "REGISTER\_TYPEHASH" function on the contract.

### Example

```ts
import { REGISTER_TYPEHASH } from "thirdweb/extensions/farcaster";
 
const result = await REGISTER_TYPEHASH({
  contract,
});
```

```ts
function REGISTER_TYPEHASH(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the REGISTER\_TYPEHASH function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.registerFor

Prepares a transaction to call the "registerFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { registerFor } from "thirdweb/extensions/farcaster";
 
const transaction = registerFor({
 contract,
 to: ...,
 recovery: ...,
 deadline: ...,
 sig: ...,
 extraStorage: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function registerFor(
  options: BaseTransactionOptions<
    | RegisterForParams
    | { asyncParams: () => Promise<RegisterForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "registerFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | RegisterForParams
  | { asyncParams: () => Promise<RegisterForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.setStorageRegistryEvent

Creates an event object for the SetStorageRegistry event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setStorageRegistryEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setStorageRegistryEvent()],
});
```

```ts
function setStorageRegistryEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldStorageRegistry"; readonly type: "address" },
    { readonly name: "newStorageRegistry"; readonly type: "address" },
  ];
  readonly name: "SetStorageRegistry";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldStorageRegistry"; readonly type: "address" },
    { readonly name: "newStorageRegistry"; readonly type: "address" },
  ];
  readonly name: "SetStorageRegistry";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.storageRegistry

Calls the "storageRegistry" function on the contract.

### Example

```ts
import { storageRegistry } from "thirdweb/extensions/farcaster";
 
const result = await storageRegistry({
  contract,
});
```

```ts
function storageRegistry(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the storageRegistry function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.adminResetEvent

Creates an event object for the AdminReset event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { adminResetEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 adminResetEvent({
 fid: ...,
 key: ...,
})
],
});
```

```ts
function adminResetEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
  ];
  readonly name: "AdminReset";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
  ];
  readonly name: "AdminReset";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH

Calls the "CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH" function on the contract.

### Example

```ts
import { CHANGE_RECOVERY_ADDRESS_TYPEHASH } from "thirdweb/extensions/farcaster";
 
const result = await CHANGE_RECOVERY_ADDRESS_TYPEHASH({
  contract,
});
```

```ts
function CHANGE_RECOVERY_ADDRESS_TYPEHASH(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.changeRecoveryAddress

Prepares a transaction to call the "changeRecoveryAddress" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { changeRecoveryAddress } from "thirdweb/extensions/farcaster";
 
const transaction = changeRecoveryAddress({
 contract,
 recovery: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function changeRecoveryAddress(
  options: BaseTransactionOptions<
    | ChangeRecoveryAddressParams
    | { asyncParams: () => Promise<ChangeRecoveryAddressParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "changeRecoveryAddress" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | ChangeRecoveryAddressParams
  | { asyncParams: () => Promise<ChangeRecoveryAddressParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.changeRecoveryAddressEvent

Creates an event object for the ChangeRecoveryAddress event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { changeRecoveryAddressEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 changeRecoveryAddressEvent({
 id: ...,
 recovery: ...,
})
],
});
```

```ts
function changeRecoveryAddressEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "id";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "recovery";
      readonly type: "address";
    },
  ];
  readonly name: "ChangeRecoveryAddress";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "id";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "recovery";
      readonly type: "address";
    },
  ];
  readonly name: "ChangeRecoveryAddress";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.custodyOf

Calls the "custodyOf" function on the contract.

### Example

```ts
import { custodyOf } from "thirdweb/extensions/farcaster";
 
const result = await custodyOf({
 contract,
 fid: ...,
});
```

```ts
function custodyOf(
  options: BaseTransactionOptions<CustodyOfParams>,
): Promise<string>;
```

### Parameters

The options for the custodyOf function.

#### Type

```ts
let options: BaseTransactionOptions<CustodyOfParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.freezeIdGatewayEvent

Creates an event object for the FreezeIdGateway event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { freezeIdGatewayEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [freezeIdGatewayEvent()],
});
```

```ts
function freezeIdGatewayEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "idGateway"; readonly type: "address" },
  ];
  readonly name: "FreezeIdGateway";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "idGateway"; readonly type: "address" },
  ];
  readonly name: "FreezeIdGateway";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.gatewayFrozen

Calls the "gatewayFrozen" function on the contract.

### Example

```ts
import { gatewayFrozen } from "thirdweb/extensions/farcaster";
 
const result = await gatewayFrozen({
  contract,
});
```

```ts
function gatewayFrozen(
  options: BaseTransactionOptions,
): Promise<boolean>;
```

### Parameters

The options for the gatewayFrozen function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.idCounter

Calls the "idCounter" function on the contract.

### Example

```ts
import { idCounter } from "thirdweb/extensions/farcaster";
 
const result = await idCounter({
  contract,
});
```

```ts
function idCounter(options: BaseTransactionOptions): Promise<bigint>;
```

### Parameters

The options for the idCounter function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.idGateway

Calls the "idGateway" function on the contract.

### Example

```ts
import { idGateway } from "thirdweb/extensions/farcaster";
 
const result = await idGateway({
  contract,
});
```

```ts
function idGateway(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the idGateway function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.idOf

Calls the "idOf" function on the contract.

### Example

```ts
import { idOf } from "thirdweb/extensions/farcaster";
 
const result = await idOf({
 contract,
 owner: ...,
});
```

```ts
function idOf(
  options: BaseTransactionOptions<IdOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the idOf function.

#### Type

```ts
let options: BaseTransactionOptions<IdOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.recover

Prepares a transaction to call the "recover" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { recover } from "thirdweb/extensions/farcaster";
 
const transaction = recover({
 contract,
 from: ...,
 to: ...,
 deadline: ...,
 sig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function recover(
  options: BaseTransactionOptions<
    RecoverParams | { asyncParams: () => Promise<RecoverParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "recover" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RecoverParams | { asyncParams: () => Promise<RecoverParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.recoverEvent

Creates an event object for the Recover event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { recoverEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 recoverEvent({
 from: ...,
 to: ...,
 id: ...,
})
],
});
```

```ts
function recoverEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "id";
      readonly type: "uint256";
    },
  ];
  readonly name: "Recover";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "id";
      readonly type: "uint256";
    },
  ];
  readonly name: "Recover";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.recoverFor

Prepares a transaction to call the "recoverFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { recoverFor } from "thirdweb/extensions/farcaster";
 
const transaction = recoverFor({
 contract,
 from: ...,
 to: ...,
 recoveryDeadline: ...,
 recoverySig: ...,
 toDeadline: ...,
 toSig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function recoverFor(
  options: BaseTransactionOptions<
    | RecoverForParams
    | { asyncParams: () => Promise<RecoverForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "recoverFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RecoverForParams | { asyncParams: () => Promise<RecoverForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.recoveryOf

Calls the "recoveryOf" function on the contract.

### Example

```ts
import { recoveryOf } from "thirdweb/extensions/farcaster";
 
const result = await recoveryOf({
 contract,
 fid: ...,
});
```

```ts
function recoveryOf(
  options: BaseTransactionOptions<RecoveryOfParams>,
): Promise<string>;
```

### Parameters

The options for the recoveryOf function.

#### Type

```ts
let options: BaseTransactionOptions<RecoveryOfParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.registerEvent

Creates an event object for the Register event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { registerEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 registerEvent({
 to: ...,
 id: ...,
})
],
});
```

```ts
function registerEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "id";
      readonly type: "uint256";
    },
    { readonly name: "recovery"; readonly type: "address" },
  ];
  readonly name: "Register";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "id";
      readonly type: "uint256";
    },
    { readonly name: "recovery"; readonly type: "address" },
  ];
  readonly name: "Register";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.setIdCounterEvent

Creates an event object for the SetIdCounter event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setIdCounterEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setIdCounterEvent()],
});
```

```ts
function setIdCounterEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldCounter"; readonly type: "uint256" },
    { readonly name: "newCounter"; readonly type: "uint256" },
  ];
  readonly name: "SetIdCounter";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldCounter"; readonly type: "uint256" },
    { readonly name: "newCounter"; readonly type: "uint256" },
  ];
  readonly name: "SetIdCounter";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.setIdGatewayEvent

Creates an event object for the SetIdGateway event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setIdGatewayEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setIdGatewayEvent()],
});
```

```ts
function setIdGatewayEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldIdGateway"; readonly type: "address" },
    { readonly name: "newIdGateway"; readonly type: "address" },
  ];
  readonly name: "SetIdGateway";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldIdGateway"; readonly type: "address" },
    { readonly name: "newIdGateway"; readonly type: "address" },
  ];
  readonly name: "SetIdGateway";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.transfer

Prepares a transaction to call the "transfer" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { transfer } from "thirdweb/extensions/farcaster";
 
const transaction = transfer({
 contract,
 to: ...,
 deadline: ...,
 sig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function transfer(
  options: BaseTransactionOptions<
    TransferParams | { asyncParams: () => Promise<TransferParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "transfer" function.

#### Type

```ts
let options: BaseTransactionOptions<
  TransferParams | { asyncParams: () => Promise<TransferParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH

Calls the "TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH" function on the contract.

### Example

```ts
import { TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH } from "thirdweb/extensions/farcaster";
 
const result = await TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH({
  contract,
});
```

```ts
function TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.TRANSFER\_TYPEHASH

Calls the "TRANSFER\_TYPEHASH" function on the contract.

### Example

```ts
import { TRANSFER_TYPEHASH } from "thirdweb/extensions/farcaster";
 
const result = await TRANSFER_TYPEHASH({
  contract,
});
```

```ts
function TRANSFER_TYPEHASH(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the TRANSFER\_TYPEHASH function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.transferAndChangeRecovery

Prepares a transaction to call the "transferAndChangeRecovery" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { transferAndChangeRecovery } from "thirdweb/extensions/farcaster";
 
const transaction = transferAndChangeRecovery({
 contract,
 to: ...,
 recovery: ...,
 deadline: ...,
 sig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function transferAndChangeRecovery(
  options: BaseTransactionOptions<
    | TransferAndChangeRecoveryParams
    | { asyncParams: () => Promise<TransferAndChangeRecoveryParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "transferAndChangeRecovery" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | TransferAndChangeRecoveryParams
  | { asyncParams: () => Promise<TransferAndChangeRecoveryParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.transferEvent

Creates an event object for the Transfer event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { transferEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 transferEvent({
 from: ...,
 to: ...,
})
],
});
```

```ts
function transferEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    { readonly name: "id"; readonly type: "uint256" },
  ];
  readonly name: "Transfer";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "from";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "to";
      readonly type: "address";
    },
    { readonly name: "id"; readonly type: "uint256" },
  ];
  readonly name: "Transfer";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.transferFor

Prepares a transaction to call the "transferFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { transferFor } from "thirdweb/extensions/farcaster";
 
const transaction = transferFor({
 contract,
 from: ...,
 to: ...,
 fromDeadline: ...,
 fromSig: ...,
 toDeadline: ...,
 toSig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function transferFor(
  options: BaseTransactionOptions<
    | TransferForParams
    | { asyncParams: () => Promise<TransferForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "transferFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | TransferForParams
  | { asyncParams: () => Promise<TransferForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.verifyFidSignature

Calls the "verifyFidSignature" function on the contract.

### Example

```ts
import { verifyFidSignature } from "thirdweb/extensions/farcaster";
 
const result = await verifyFidSignature({
 contract,
 custodyAddress: ...,
 fid: ...,
 digest: ...,
 sig: ...,
});
```

```ts
function verifyFidSignature(
  options: BaseTransactionOptions<VerifyFidSignatureParams>,
): Promise<boolean>;
```

### Parameters

The options for the verifyFidSignature function.

#### Type

```ts
let options: BaseTransactionOptions<VerifyFidSignatureParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.add

Prepares a transaction to call the "add" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { add } from "thirdweb/extensions/farcaster";
 
const transaction = add({
 contract,
 keyType: ...,
 key: ...,
 metadataType: ...,
 metadata: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function add(
  options: BaseTransactionOptions<
    AddParams | { asyncParams: () => Promise<AddParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "add" function.

#### Type

```ts
let options: BaseTransactionOptions<
  AddParams | { asyncParams: () => Promise<AddParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.ADD\_TYPEHASH

Calls the "ADD\_TYPEHASH" function on the contract.

### Example

```ts
import { ADD_TYPEHASH } from "thirdweb/extensions/farcaster";
 
const result = await ADD_TYPEHASH({
  contract,
});
```

```ts
function ADD_TYPEHASH(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the ADD\_TYPEHASH function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.addFor

Prepares a transaction to call the "addFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { addFor } from "thirdweb/extensions/farcaster";
 
const transaction = addFor({
 contract,
 fidOwner: ...,
 keyType: ...,
 key: ...,
 metadataType: ...,
 metadata: ...,
 deadline: ...,
 sig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function addFor(
  options: BaseTransactionOptions<
    AddForParams | { asyncParams: () => Promise<AddForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "addFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  AddForParams | { asyncParams: () => Promise<AddForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.keyRegistry

Calls the "keyRegistry" function on the contract.

### Example

```ts
import { keyRegistry } from "thirdweb/extensions/farcaster";
 
const result = await keyRegistry({
  contract,
});
```

```ts
function keyRegistry(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the keyRegistry function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.nonces

Calls the "nonces" function on the contract.

### Example

```ts
import { nonces } from "thirdweb/extensions/farcaster";
 
const result = await nonces({
 contract,
 account: ...,
});
```

```ts
function nonces(
  options: BaseTransactionOptions<NoncesParams>,
): Promise<bigint>;
```

### Parameters

The options for the nonces function.

#### Type

```ts
let options: BaseTransactionOptions<NoncesParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.addEvent

Creates an event object for the Add event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { addEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 addEvent({
 fid: ...,
 keyType: ...,
 key: ...,
})
],
});
```

```ts
function addEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "keyType";
      readonly type: "uint32";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
    { readonly name: "metadataType"; readonly type: "uint8" },
    { readonly name: "metadata"; readonly type: "bytes" },
  ];
  readonly name: "Add";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "keyType";
      readonly type: "uint32";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
    { readonly name: "metadataType"; readonly type: "uint8" },
    { readonly name: "metadata"; readonly type: "bytes" },
  ];
  readonly name: "Add";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.adminResetEvent

Creates an event object for the AdminReset event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { adminResetEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 adminResetEvent({
 fid: ...,
 key: ...,
})
],
});
```

```ts
function adminResetEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
  ];
  readonly name: "AdminReset";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
  ];
  readonly name: "AdminReset";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.freezeKeyGatewayEvent

Creates an event object for the FreezeKeyGateway event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { freezeKeyGatewayEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [freezeKeyGatewayEvent()],
});
```

```ts
function freezeKeyGatewayEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "keyGateway"; readonly type: "address" },
  ];
  readonly name: "FreezeKeyGateway";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "keyGateway"; readonly type: "address" },
  ];
  readonly name: "FreezeKeyGateway";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.gatewayFrozen

Calls the "gatewayFrozen" function on the contract.

### Example

```ts
import { gatewayFrozen } from "thirdweb/extensions/farcaster";
 
const result = await gatewayFrozen({
  contract,
});
```

```ts
function gatewayFrozen(
  options: BaseTransactionOptions,
): Promise<boolean>;
```

### Parameters

The options for the gatewayFrozen function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.idRegistry

Calls the "idRegistry" function on the contract.

### Example

```ts
import { idRegistry } from "thirdweb/extensions/farcaster";
 
const result = await idRegistry({
  contract,
});
```

```ts
function idRegistry(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the idRegistry function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.keyAt

Calls the "keyAt" function on the contract.

### Example

```ts
import { keyAt } from "thirdweb/extensions/farcaster";
 
const result = await keyAt({
 contract,
 fid: ...,
 state: ...,
 index: ...,
});
```

```ts
function keyAt(
  options: BaseTransactionOptions<KeyAtParams>,
): Promise<`0x${string}`>;
```

### Parameters

The options for the keyAt function.

#### Type

```ts
let options: BaseTransactionOptions<KeyAtParams>;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.keyDataOf

Calls the "keyDataOf" function on the contract.

### Example

```ts
import { keyDataOf } from "thirdweb/extensions/farcaster";
 
const result = await keyDataOf({
 contract,
 fid: ...,
 key: ...,
});
```

```ts
function keyDataOf(
  options: BaseTransactionOptions<KeyDataOfParams>,
): Promise<string>;
```

### Parameters

The options for the keyDataOf function.

#### Type

```ts
let options: BaseTransactionOptions<KeyDataOfParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.keyGateway

Calls the "keyGateway" function on the contract.

### Example

```ts
import { keyGateway } from "thirdweb/extensions/farcaster";
 
const result = await keyGateway({
  contract,
});
```

```ts
function keyGateway(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the keyGateway function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.keysOf

Calls the "keysOf" function on the contract.

### Example

```ts
import { keysOf } from "thirdweb/extensions/farcaster";
 
const result = await keysOf({
 contract,
 fid: ...,
 state: ...,
});
```

```ts
function keysOf(options: BaseTransactionOptions<KeysOfParams>) : Promise<readonly Array<`0x${string}`>>
```

### Parameters

The options for the keysOf function.

#### Type

```ts
let options: BaseTransactionOptions<KeysOfParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<`0x${string}`>>
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.maxKeysPerFid

Calls the "maxKeysPerFid" function on the contract.

### Example

```ts
import { maxKeysPerFid } from "thirdweb/extensions/farcaster";
 
const result = await maxKeysPerFid({
  contract,
});
```

```ts
function maxKeysPerFid(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the maxKeysPerFid function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.remove

Prepares a transaction to call the "remove" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { remove } from "thirdweb/extensions/farcaster";
 
const transaction = remove({
 contract,
 key: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function remove(
  options: BaseTransactionOptions<
    RemoveParams | { asyncParams: () => Promise<RemoveParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "remove" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RemoveParams | { asyncParams: () => Promise<RemoveParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.REMOVE\_TYPEHASH

Calls the "REMOVE\_TYPEHASH" function on the contract.

### Example

```ts
import { REMOVE_TYPEHASH } from "thirdweb/extensions/farcaster";
 
const result = await REMOVE_TYPEHASH({
  contract,
});
```

```ts
function REMOVE_TYPEHASH(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the REMOVE\_TYPEHASH function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.removeEvent

Creates an event object for the Remove event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { removeEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
contract,
events: [
 removeEvent({
 fid: ...,
 key: ...,
})
],
});
```

```ts
function removeEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
  ];
  readonly name: "Remove";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "fid";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "key";
      readonly type: "bytes";
    },
    { readonly name: "keyBytes"; readonly type: "bytes" },
  ];
  readonly name: "Remove";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.removeFor

Prepares a transaction to call the "removeFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { removeFor } from "thirdweb/extensions/farcaster";
 
const transaction = removeFor({
 contract,
 fidOwner: ...,
 key: ...,
 deadline: ...,
 sig: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function removeFor(
  options: BaseTransactionOptions<
    RemoveForParams | { asyncParams: () => Promise<RemoveForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "removeFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RemoveForParams | { asyncParams: () => Promise<RemoveForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.setIdRegistryEvent

Creates an event object for the SetIdRegistry event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setIdRegistryEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setIdRegistryEvent()],
});
```

```ts
function setIdRegistryEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldIdRegistry"; readonly type: "address" },
    { readonly name: "newIdRegistry"; readonly type: "address" },
  ];
  readonly name: "SetIdRegistry";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldIdRegistry"; readonly type: "address" },
    { readonly name: "newIdRegistry"; readonly type: "address" },
  ];
  readonly name: "SetIdRegistry";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.setKeyGatewayEvent

Creates an event object for the SetKeyGateway event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setKeyGatewayEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setKeyGatewayEvent()],
});
```

```ts
function setKeyGatewayEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldKeyGateway"; readonly type: "address" },
    { readonly name: "newKeyGateway"; readonly type: "address" },
  ];
  readonly name: "SetKeyGateway";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldKeyGateway"; readonly type: "address" },
    { readonly name: "newKeyGateway"; readonly type: "address" },
  ];
  readonly name: "SetKeyGateway";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.setMaxKeysPerFidEvent

Creates an event object for the SetMaxKeysPerFid event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setMaxKeysPerFidEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setMaxKeysPerFidEvent()],
});
```

```ts
function setMaxKeysPerFidEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldMax"; readonly type: "uint256" },
    { readonly name: "newMax"; readonly type: "uint256" },
  ];
  readonly name: "SetMaxKeysPerFid";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "oldMax"; readonly type: "uint256" },
    { readonly name: "newMax"; readonly type: "uint256" },
  ];
  readonly name: "SetMaxKeysPerFid";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.setValidatorEvent

Creates an event object for the SetValidator event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { setValidatorEvent } from "thirdweb/extensions/farcaster";
 
const events = await getContractEvents({
  contract,
  events: [setValidatorEvent()],
});
```

```ts
function setValidatorEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "keyType"; readonly type: "uint32" },
    { readonly name: "metadataType"; readonly type: "uint8" },
    { readonly name: "oldValidator"; readonly type: "address" },
    { readonly name: "newValidator"; readonly type: "address" },
  ];
  readonly name: "SetValidator";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "keyType"; readonly type: "uint32" },
    { readonly name: "metadataType"; readonly type: "uint8" },
    { readonly name: "oldValidator"; readonly type: "address" },
    { readonly name: "newValidator"; readonly type: "address" },
  ];
  readonly name: "SetValidator";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## FARCASTER.totalKeys

Calls the "totalKeys" function on the contract.

### Example

```ts
import { totalKeys } from "thirdweb/extensions/farcaster";
 
const result = await totalKeys({
 contract,
 fid: ...,
 state: ...,
});
```

```ts
function totalKeys(
  options: BaseTransactionOptions<TotalKeysParams>,
): Promise<bigint>;
```

### Parameters

The options for the totalKeys function.

#### Type

```ts
let options: BaseTransactionOptions<TotalKeysParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.batchRent

Prepares a transaction to call the "batchRent" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { batchRent } from "thirdweb/extensions/farcaster";
 
const transaction = batchRent({
 contract,
 fids: ...,
 units: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function batchRent(
  options: BaseTransactionOptions<
    BatchRentParams | { asyncParams: () => Promise<BatchRentParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "batchRent" function.

#### Type

```ts
let options: BaseTransactionOptions<
  BatchRentParams | { asyncParams: () => Promise<BatchRentParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.deprecationTimestamp

Calls the "deprecationTimestamp" function on the contract.

### Example

```ts
import { deprecationTimestamp } from "thirdweb/extensions/farcaster";
 
const result = await deprecationTimestamp({
  contract,
});
```

```ts
function deprecationTimestamp(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the deprecationTimestamp function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.maxUnits

Calls the "maxUnits" function on the contract.

### Example

```ts
import { maxUnits } from "thirdweb/extensions/farcaster";
 
const result = await maxUnits({
  contract,
});
```

```ts
function maxUnits(options: BaseTransactionOptions): Promise<bigint>;
```

### Parameters

The options for the maxUnits function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.price

Calls the "price" function on the contract.

### Example

```ts
import { price } from "thirdweb/extensions/farcaster";
 
const result = await price({
 contract,
 units: ...,
});
```

```ts
function price(
  options: BaseTransactionOptions<PriceParams>,
): Promise<bigint>;
```

### Parameters

The options for the price function.

#### Type

```ts
let options: BaseTransactionOptions<PriceParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.rent

Prepares a transaction to call the "rent" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { rent } from "thirdweb/extensions/farcaster";
 
const transaction = rent({
 contract,
 fid: ...,
 units: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function rent(
  options: BaseTransactionOptions<
    RentParams | { asyncParams: () => Promise<RentParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "rent" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RentParams | { asyncParams: () => Promise<RentParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## FARCASTER.rentedUnits

Calls the "rentedUnits" function on the contract.

### Example

```ts
import { rentedUnits } from "thirdweb/extensions/farcaster";
 
const result = await rentedUnits({
  contract,
});
```

```ts
function rentedUnits(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the rentedUnits function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.unitPrice

Calls the "unitPrice" function on the contract.

### Example

```ts
import { unitPrice } from "thirdweb/extensions/farcaster";
 
const result = await unitPrice({
  contract,
});
```

```ts
function unitPrice(options: BaseTransactionOptions): Promise<bigint>;
```

### Parameters

The options for the unitPrice function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## FARCASTER.usdUnitPrice

Calls the "usdUnitPrice" function on the contract.

### Example

```ts
import { usdUnitPrice } from "thirdweb/extensions/farcaster";
 
const result = await usdUnitPrice({
  contract,
});
```

```ts
function usdUnitPrice(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the usdUnitPrice function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---
## LENS
---

###### Connect SDK

## LENS.exists

Calls the "exists" function on the contract.

### Example

```ts
import { exists } from "thirdweb/extensions/lens";
 
const result = await exists({
 contract,
 tokenId: ...,
});
```

```ts
function exists(
  options: BaseTransactionOptions<ExistsParams>,
): Promise<boolean>;
```

### Parameters

The options for the exists function.

#### Type

```ts
let options: BaseTransactionOptions<ExistsParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getContentURI

Calls the "getContentURI" function on the contract.

### Example

```ts
import { getContentURI } from "thirdweb/extensions/lens";
 
const result = await getContentURI({
 contract,
 profileId: ...,
 pubId: ...,
});
```

```ts
function getContentURI(
  options: BaseTransactionOptions<GetContentURIParams>,
): Promise<string>;
```

### Parameters

The options for the getContentURI function.

#### Type

```ts
let options: BaseTransactionOptions<GetContentURIParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getDefaultHandle

Calls the "getDefaultHandle" function on the contract.

### Example

```ts
import { getDefaultHandle } from "thirdweb/extensions/lens";
 
const result = await getDefaultHandle({
 contract,
 profileId: ...,
});
```

```ts
function getDefaultHandle(
  options: BaseTransactionOptions<GetDefaultHandleParams>,
): Promise<bigint>;
```

### Parameters

The options for the getDefaultHandle function.

#### Type

```ts
let options: BaseTransactionOptions<GetDefaultHandleParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getFollowData

Calls the "getFollowData" function on the contract.

### Example

```ts
import { getFollowData } from "thirdweb/extensions/lens";
 
const result = await getFollowData({
 contract,
 followTokenId: ...,
});
```

```ts
function getFollowData(
  options: BaseTransactionOptions<GetFollowDataParams>,
): Promise<{
  followerProfileId: bigint;
  followTimestamp: number;
  originalFollowTimestamp: number;
  profileIdAllowedToRecover: bigint;
}>;
```

### Parameters

The options for the getFollowData function.

#### Type

```ts
let options: BaseTransactionOptions<GetFollowDataParams>;
```

### Returns

```ts
let returnType: Promise<{
  followerProfileId: bigint;
  followTimestamp: number;
  originalFollowTimestamp: number;
  profileIdAllowedToRecover: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getFollowerCount

Calls the "getFollowerCount" function on the contract.

### Example

```ts
import { getFollowerCount } from "thirdweb/extensions/lens";
 
const result = await getFollowerCount({
  contract,
});
```

```ts
function getFollowerCount(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getFollowerCount function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getFollowerProfileId

Calls the "getFollowerProfileId" function on the contract.

### Example

```ts
import { getFollowerProfileId } from "thirdweb/extensions/lens";
 
const result = await getFollowerProfileId({
 contract,
 followTokenId: ...,
});
```

```ts
function getFollowerProfileId(
  options: BaseTransactionOptions<GetFollowerProfileIdParams>,
): Promise<bigint>;
```

### Parameters

The options for the getFollowerProfileId function.

#### Type

```ts
let options: BaseTransactionOptions<GetFollowerProfileIdParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getFollowTokenId

Calls the "getFollowTokenId" function on the contract.

### Example

```ts
import { getFollowTokenId } from "thirdweb/extensions/lens";
 
const result = await getFollowTokenId({
 contract,
 followerProfileId: ...,
});
```

```ts
function getFollowTokenId(
  options: BaseTransactionOptions<GetFollowTokenIdParams>,
): Promise<bigint>;
```

### Parameters

The options for the getFollowTokenId function.

#### Type

```ts
let options: BaseTransactionOptions<GetFollowTokenIdParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getFullProfile

Return the profile data _with Lens handle_ and optional join date

In Lens Protocol, each profile is associated with an ERC721 token, thus, the tokenId represent profileId and the 2 terms can be used interchangeably

### Example

```ts
import { getFullProfile } from "thirdweb/extension/lens";
 
const profileId = 10000n; // profileId is the tokenId of the NFT
const lensProfile = await getFullProfile({ profileId, client });
```

```ts
function getFullProfile(
  options: GetFullProfileParams,
): Promise<FullProfileResponse>;
```

### Parameters

#### Type

```ts
let options: {
  client: ThirdwebClient;
  includeJoinDate?: boolean;
  overrides?: {
    chain?: Chain;
    lensHandleAddress?: string;
    lensHubAddress?: string;
    tokenHandleRegistryAddress?: string;
  };
  profileId: bigint;
};
```

### Returns

```ts
let returnType: {
  handle: string;
  joinDate: bigint | null;
  profileData: LensProfileSchema | null;
} | null;
```
---

###### Connect SDK

## LENS.getHandle

Calls the "getHandle" function on the contract.

### Example

```ts
import { getHandle } from "thirdweb/extensions/lens";
 
const result = await getHandle({
 contract,
 tokenId: ...,
});
```

```ts
function getHandle(
  options: BaseTransactionOptions<GetHandleParams>,
): Promise<string>;
```

### Parameters

The options for the getHandle function.

#### Type

```ts
let options: BaseTransactionOptions<GetHandleParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getHandleFromProfileId

Return the Lens handle of a profile in the format: lens/@`<name-of-user>`

### Example

```ts
import { getHandleFromProfileId } from "thirdweb/extensions/lens";
 
const profileId = 461662n;
const handle = await getHandleFromProfileId({ profileId, client }); // "lens/@captain_jack"
```

```ts
function getHandleFromProfileId(
  options: GetHandleFromProfileIdParams,
): Promise<null | string>;
```

### Parameters

#### Type

```ts
let options: {
  client: ThirdwebClient;
  overrides?: {
    chain?: Chain;
    lensHandleAddress?: string;
    tokenHandleRegistryAddress?: string;
  };
  profileId: bigint;
};
```

### Returns

```ts
let returnType: Promise<null | string>;
```
---

###### Connect SDK

## LENS.getHandleTokenURIContract

Calls the "getHandleTokenURIContract" function on the contract.

### Example

```ts
import { getHandleTokenURIContract } from "thirdweb/extensions/lens";
 
const result = await getHandleTokenURIContract({
  contract,
});
```

```ts
function getHandleTokenURIContract(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getHandleTokenURIContract function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getLocalName

Calls the "getLocalName" function on the contract.

### Example

```ts
import { getLocalName } from "thirdweb/extensions/lens";
 
const result = await getLocalName({
 contract,
 tokenId: ...,
});
```

```ts
function getLocalName(
  options: BaseTransactionOptions<GetLocalNameParams>,
): Promise<string>;
```

### Parameters

The options for the getLocalName function.

#### Type

```ts
let options: BaseTransactionOptions<GetLocalNameParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getModuleTypes

Calls the "getModuleTypes" function on the contract.

### Example

```ts
import { getModuleTypes } from "thirdweb/extensions/lens";
 
const result = await getModuleTypes({
 contract,
 moduleAddress: ...,
});
```

```ts
function getModuleTypes(
  options: BaseTransactionOptions<GetModuleTypesParams>,
): Promise<bigint>;
```

### Parameters

The options for the getModuleTypes function.

#### Type

```ts
let options: BaseTransactionOptions<GetModuleTypesParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getOriginalFollowTimestamp

Calls the "getOriginalFollowTimestamp" function on the contract.

### Example

```ts
import { getOriginalFollowTimestamp } from "thirdweb/extensions/lens";
 
const result = await getOriginalFollowTimestamp({
 contract,
 followTokenId: ...,
});
```

```ts
function getOriginalFollowTimestamp(
  options: BaseTransactionOptions<GetOriginalFollowTimestampParams>,
): Promise<bigint>;
```

### Parameters

The options for the getOriginalFollowTimestamp function.

#### Type

```ts
let options: BaseTransactionOptions<GetOriginalFollowTimestampParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getProfile

Calls the "getProfile" function on the contract.

### Example

```ts
import { getProfile } from "thirdweb/extensions/lens";
 
const result = await getProfile({
 contract,
 profileId: ...,
});
```

```ts
function getProfile(
  options: BaseTransactionOptions<GetProfileParams>,
): Promise<{
  __DEPRECATED__followNFTURI: string;
  __DEPRECATED__handle: string;
  __DEPRECATED__imageURI: string;
  followModule: string;
  followNFT: string;
  metadataURI: string;
  pubCount: bigint;
}>;
```

### Parameters

The options for the getProfile function.

#### Type

```ts
let options: BaseTransactionOptions<GetProfileParams>;
```

### Returns

```ts
let returnType: Promise<{
  __DEPRECATED__followNFTURI: string;
  __DEPRECATED__handle: string;
  __DEPRECATED__imageURI: string;
  followModule: string;
  followNFT: string;
  metadataURI: string;
  pubCount: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getProfileIdAllowedToRecover

Calls the "getProfileIdAllowedToRecover" function on the contract.

### Example

```ts
import { getProfileIdAllowedToRecover } from "thirdweb/extensions/lens";
 
const result = await getProfileIdAllowedToRecover({
 contract,
 followTokenId: ...,
});
```

```ts
function getProfileIdAllowedToRecover(
  options: BaseTransactionOptions<GetProfileIdAllowedToRecoverParams>,
): Promise<bigint>;
```

### Parameters

The options for the getProfileIdAllowedToRecover function.

#### Type

```ts
let options: BaseTransactionOptions<GetProfileIdAllowedToRecoverParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getProfileIdByHandleHash

Calls the "getProfileIdByHandleHash" function on the contract.

### Example

```ts
import { getProfileIdByHandleHash } from "thirdweb/extensions/lens";
 
const result = await getProfileIdByHandleHash({
 contract,
 handleHash: ...,
});
```

```ts
function getProfileIdByHandleHash(
  options: BaseTransactionOptions<GetProfileIdByHandleHashParams>,
): Promise<bigint>;
```

### Parameters

The options for the getProfileIdByHandleHash function.

#### Type

```ts
let options: BaseTransactionOptions<GetProfileIdByHandleHashParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getProfileMetadata

Download user lens profile from Arweave This method does NOT give you the user handle & join-time - consider using `getFullProfileData` instead It is useful & cost efficient if you only want to get user's name, bio, picture, coverPicture etc.

### Example

```ts
import { getProfileMetadata } from "thirdweb/extensions/lens";
 
const profileData = await getProfileMetadata({ profileId, client });
 
if (profileData) {
  console.log("Display name: ", profileData.lens.name);
  console.log("Bio: ", profileData.lens.bio);
}
```

```ts
function getProfileMetadata(
  options: GetProfileMetadataParams,
): Promise<null | LensProfileSchema>;
```

### Parameters

#### Type

```ts
let options: {
  client: ThirdwebClient;
  overrides?: { chain?: Chain; lensHubAddress?: string };
  profileId: bigint;
};
```

### Returns

```ts
let returnType: {
  lens: {
    appId?: string;
    attributes: Array<MetadataAttribute>;
    bio: string;
    coverPicture: string;
    id: string;
    name: string;
    picture: string;
  };
  signature: string;
};
```

LensProfileSchema | null
---

###### Connect SDK

## LENS.getPublication

Calls the "getPublication" function on the contract.

### Example

```ts
import { getPublication } from "thirdweb/extensions/lens";
 
const result = await getPublication({
 contract,
 profileId: ...,
 pubId: ...,
});
```

```ts
function getPublication(
  options: BaseTransactionOptions<GetPublicationParams>,
): Promise<{
  __DEPRECATED__collectModule: string;
  __DEPRECATED__collectNFT: string;
  contentURI: string;
  pointedProfileId: bigint;
  pointedPubId: bigint;
  pubType: number;
  referenceModule: string;
  rootProfileId: bigint;
  rootPubId: bigint;
}>;
```

### Parameters

The options for the getPublication function.

#### Type

```ts
let options: BaseTransactionOptions<GetPublicationParams>;
```

### Returns

```ts
let returnType: Promise<{
  __DEPRECATED__collectModule: string;
  __DEPRECATED__collectNFT: string;
  contentURI: string;
  pointedProfileId: bigint;
  pointedPubId: bigint;
  pubType: number;
  referenceModule: string;
  rootProfileId: bigint;
  rootPubId: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.getTokenId

Calls the "getTokenId" function on the contract.

### Example

```ts
import { getTokenId } from "thirdweb/extensions/lens";
 
const result = await getTokenId({
 contract,
 localName: ...,
});
```

```ts
function getTokenId(
  options: BaseTransactionOptions<GetTokenIdParams>,
): Promise<bigint>;
```

### Parameters

The options for the getTokenId function.

#### Type

```ts
let options: BaseTransactionOptions<GetTokenIdParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.isErc20CurrencyRegistered

Calls the "isErc20CurrencyRegistered" function on the contract.

### Example

```ts
import { isErc20CurrencyRegistered } from "thirdweb/extensions/lens";
 
const result = await isErc20CurrencyRegistered({
 contract,
 currencyAddress: ...,
});
```

```ts
function isErc20CurrencyRegistered(
  options: BaseTransactionOptions<IsErc20CurrencyRegisteredParams>,
): Promise<boolean>;
```

### Parameters

The options for the isErc20CurrencyRegistered function.

#### Type

```ts
let options: BaseTransactionOptions<IsErc20CurrencyRegisteredParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.isFollowing

Calls the "isFollowing" function on the contract.

### Example

```ts
import { isFollowing } from "thirdweb/extensions/lens";
 
const result = await isFollowing({
 contract,
 followerProfileId: ...,
});
```

```ts
function isFollowing(
  options: BaseTransactionOptions<IsFollowingParams>,
): Promise<boolean>;
```

### Parameters

The options for the isFollowing function.

#### Type

```ts
let options: BaseTransactionOptions<IsFollowingParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.isModuleRegistered

Calls the "isModuleRegistered" function on the contract.

### Example

```ts
import { isModuleRegistered } from "thirdweb/extensions/lens";
 
const result = await isModuleRegistered({
 contract,
 moduleAddress: ...,
});
```

```ts
function isModuleRegistered(
  options: BaseTransactionOptions<IsModuleRegisteredParams>,
): Promise<boolean>;
```

### Parameters

The options for the isModuleRegistered function.

#### Type

```ts
let options: BaseTransactionOptions<IsModuleRegisteredParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.isModuleRegisteredAs

Calls the "isModuleRegisteredAs" function on the contract.

### Example

```ts
import { isModuleRegisteredAs } from "thirdweb/extensions/lens";
 
const result = await isModuleRegisteredAs({
 contract,
 moduleAddress: ...,
 moduleType: ...,
});
```

```ts
function isModuleRegisteredAs(
  options: BaseTransactionOptions<IsModuleRegisteredAsParams>,
): Promise<boolean>;
```

### Parameters

The options for the isModuleRegisteredAs function.

#### Type

```ts
let options: BaseTransactionOptions<IsModuleRegisteredAsParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.mintTimestampOf

Calls the "mintTimestampOf" function on the contract.

### Example

```ts
import { mintTimestampOf } from "thirdweb/extensions/lens";
 
const result = await mintTimestampOf({
 contract,
 tokenId: ...,
});
```

```ts
function mintTimestampOf(
  options: BaseTransactionOptions<MintTimestampOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the mintTimestampOf function.

#### Type

```ts
let options: BaseTransactionOptions<MintTimestampOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.mintTimestampOfFollowNFT

Calls the "mintTimestampOf" function on the contract.

### Example

```ts
import { mintTimestampOf } from "thirdweb/extensions/lens";
 
const result = await mintTimestampOf({
 contract,
 tokenId: ...,
});
```

```ts
function mintTimestampOfFollowNFT(
  options: BaseTransactionOptions<MintTimestampOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the mintTimestampOf function.

#### Type

```ts
let options: BaseTransactionOptions<MintTimestampOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.nonces

Calls the "nonces" function on the contract.

### Example

```ts
import { nonces } from "thirdweb/extensions/lens";
 
const result = await nonces({
 contract,
 signer: ...,
});
```

```ts
function nonces(
  options: BaseTransactionOptions<NoncesParams>,
): Promise<bigint>;
```

### Parameters

The options for the nonces function.

#### Type

```ts
let options: BaseTransactionOptions<NoncesParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.resolve

Calls the "resolve" function on the contract.

### Example

```ts
import { resolve } from "thirdweb/extensions/lens";
 
const result = await resolve({
 contract,
 handleId: ...,
});
```

```ts
function resolve(
  options: BaseTransactionOptions<ResolveParams>,
): Promise<bigint>;
```

### Parameters

The options for the resolve function.

#### Type

```ts
let options: BaseTransactionOptions<ResolveParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## LENS.resolveAddress

Take in a Lens handle or local-name and return the wallet address behind that handle/local-name. For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name

### Example

```ts
import { resolveAddress } from "thirdweb/extensions/lens";
 
const walletAddress = await resolveAddress({
  name: "vitalik",
  client,
});
```

```ts
function resolveAddress(
  options: ResolveLensAddressParams,
): Promise<string>;
```

### Parameters

#### Type

```ts
let options: {
  client: ThirdwebClient;
  name: string;
  overrides?: { chain?: Chain; lensHandleContractAddress?: string };
};
```

### Returns

```ts
let returnType: Promise<string>;
```
---

###### Connect SDK

## LENS.tokenDataOf

Calls the "tokenDataOf" function on the contract.

### Example

```ts
import { tokenDataOf } from "thirdweb/extensions/lens";
 
const result = await tokenDataOf({
 contract,
 tokenId: ...,
});
```

```ts
function tokenDataOf(
  options: BaseTransactionOptions<TokenDataOfParams>,
): Promise<{ mintTimestamp: bigint; owner: string }>;
```

### Parameters

The options for the tokenDataOf function.

#### Type

```ts
let options: BaseTransactionOptions<TokenDataOfParams>;
```

### Returns

```ts
let returnType: Promise<{ mintTimestamp: bigint; owner: string }>;
```

The parsed result of the function call.
---
## MULTICALL3
---

###### Connect SDK

## MULTICALL3.aggregate

Prepares a transaction to call the "aggregate" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { aggregate } from "thirdweb/extensions/multicall3";
 
const transaction = aggregate({
 contract,
 calls: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function aggregate(
  options: BaseTransactionOptions<
    AggregateParams | { asyncParams: () => Promise<AggregateParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "aggregate" function.

#### Type

```ts
let options: BaseTransactionOptions<
  AggregateParams | { asyncParams: () => Promise<AggregateParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MULTICALL3.aggregate3

Prepares a transaction to call the "aggregate3" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { aggregate3 } from "thirdweb/extensions/multicall3";
 
const transaction = aggregate3({
 contract,
 calls: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function aggregate3(
  options: BaseTransactionOptions<
    | Aggregate3Params
    | { asyncParams: () => Promise<Aggregate3Params> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "aggregate3" function.

#### Type

```ts
let options: BaseTransactionOptions<
  Aggregate3Params | { asyncParams: () => Promise<Aggregate3Params> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MULTICALL3.aggregate3Value

Prepares a transaction to call the "aggregate3Value" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { aggregate3Value } from "thirdweb/extensions/multicall3";
 
const transaction = aggregate3Value({
 contract,
 calls: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function aggregate3Value(
  options: BaseTransactionOptions<
    | Aggregate3ValueParams
    | { asyncParams: () => Promise<Aggregate3ValueParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "aggregate3Value" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | Aggregate3ValueParams
  | { asyncParams: () => Promise<Aggregate3ValueParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MULTICALL3.blockAndAggregate

Prepares a transaction to call the "blockAndAggregate" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { blockAndAggregate } from "thirdweb/extensions/multicall3";
 
const transaction = blockAndAggregate({
 contract,
 calls: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function blockAndAggregate(
  options: BaseTransactionOptions<
    | BlockAndAggregateParams
    | { asyncParams: () => Promise<BlockAndAggregateParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "blockAndAggregate" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | BlockAndAggregateParams
  | { asyncParams: () => Promise<BlockAndAggregateParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MULTICALL3.getBasefee

Calls the "getBasefee" function on the contract.

### Example

```ts
import { getBasefee } from "thirdweb/extensions/multicall3";
 
const result = await getBasefee({
  contract,
});
```

```ts
function getBasefee(options: BaseTransactionOptions): Promise<bigint>;
```

### Parameters

The options for the getBasefee function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getBlockHash

Calls the "getBlockHash" function on the contract.

### Example

```ts
import { getBlockHash } from "thirdweb/extensions/multicall3";
 
const result = await getBlockHash({
 contract,
 blockNumber: ...,
});
```

```ts
function getBlockHash(
  options: BaseTransactionOptions<GetBlockHashParams>,
): Promise<`0x${string}`>;
```

### Parameters

The options for the getBlockHash function.

#### Type

```ts
let options: BaseTransactionOptions<GetBlockHashParams>;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getBlockNumber

Calls the "getBlockNumber" function on the contract.

### Example

```ts
import { getBlockNumber } from "thirdweb/extensions/multicall3";
 
const result = await getBlockNumber({
  contract,
});
```

```ts
function getBlockNumber(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getBlockNumber function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getChainId

Calls the "getChainId" function on the contract.

### Example

```ts
import { getChainId } from "thirdweb/extensions/multicall3";
 
const result = await getChainId({
  contract,
});
```

```ts
function getChainId(options: BaseTransactionOptions): Promise<bigint>;
```

### Parameters

The options for the getChainId function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getCurrentBlockCoinbase

Calls the "getCurrentBlockCoinbase" function on the contract.

### Example

```ts
import { getCurrentBlockCoinbase } from "thirdweb/extensions/multicall3";
 
const result = await getCurrentBlockCoinbase({
  contract,
});
```

```ts
function getCurrentBlockCoinbase(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getCurrentBlockCoinbase function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getCurrentBlockDifficulty

Calls the "getCurrentBlockDifficulty" function on the contract.

### Example

```ts
import { getCurrentBlockDifficulty } from "thirdweb/extensions/multicall3";
 
const result = await getCurrentBlockDifficulty({
  contract,
});
```

```ts
function getCurrentBlockDifficulty(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getCurrentBlockDifficulty function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getCurrentBlockGasLimit

Calls the "getCurrentBlockGasLimit" function on the contract.

### Example

```ts
import { getCurrentBlockGasLimit } from "thirdweb/extensions/multicall3";
 
const result = await getCurrentBlockGasLimit({
  contract,
});
```

```ts
function getCurrentBlockGasLimit(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getCurrentBlockGasLimit function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getCurrentBlockTimestamp

Calls the "getCurrentBlockTimestamp" function on the contract.

### Example

```ts
import { getCurrentBlockTimestamp } from "thirdweb/extensions/multicall3";
 
const result = await getCurrentBlockTimestamp({
  contract,
});
```

```ts
function getCurrentBlockTimestamp(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the getCurrentBlockTimestamp function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getEthBalance

Calls the "getEthBalance" function on the contract.

### Example

```ts
import { getEthBalance } from "thirdweb/extensions/multicall3";
 
const result = await getEthBalance({
 contract,
 addr: ...,
});
```

```ts
function getEthBalance(
  options: BaseTransactionOptions<GetEthBalanceParams>,
): Promise<bigint>;
```

### Parameters

The options for the getEthBalance function.

#### Type

```ts
let options: BaseTransactionOptions<GetEthBalanceParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.getLastBlockHash

Calls the "getLastBlockHash" function on the contract.

### Example

```ts
import { getLastBlockHash } from "thirdweb/extensions/multicall3";
 
const result = await getLastBlockHash({
  contract,
});
```

```ts
function getLastBlockHash(
  options: BaseTransactionOptions,
): Promise<`0x${string}`>;
```

### Parameters

The options for the getLastBlockHash function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The parsed result of the function call.
---

###### Connect SDK

## MULTICALL3.tryAggregate

Prepares a transaction to call the "tryAggregate" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { tryAggregate } from "thirdweb/extensions/multicall3";
 
const transaction = tryAggregate({
 contract,
 requireSuccess: ...,
 calls: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function tryAggregate(
  options: BaseTransactionOptions<
    | TryAggregateParams
    | { asyncParams: () => Promise<TryAggregateParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "tryAggregate" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | TryAggregateParams
  | { asyncParams: () => Promise<TryAggregateParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MULTICALL3.tryBlockAndAggregate

Prepares a transaction to call the "tryBlockAndAggregate" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { tryBlockAndAggregate } from "thirdweb/extensions/multicall3";
 
const transaction = tryBlockAndAggregate({
 contract,
 requireSuccess: ...,
 calls: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function tryBlockAndAggregate(
  options: BaseTransactionOptions<
    | TryBlockAndAggregateParams
    | { asyncParams: () => Promise<TryBlockAndAggregateParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "tryBlockAndAggregate" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | TryBlockAndAggregateParams
  | { asyncParams: () => Promise<TryBlockAndAggregateParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## PACK
---

###### Connect SDK

## PACK.createNewPack

Deprecated

\[Pack contract is incompatible with Pectra update. Support for this contract is being removed in next release.\]

### Example

```ts
import { createNewPack } from "thirdweb/extensions/pack";
 
const transaction = createNewPack({
  contract: packContract,
  client,
  recipient: "0x...",
  tokenOwner: "0x...",
  packMetadata: {
    name: "Pack #1",
    image: "image-of-pack-1",
  },
  openStartTimestamp: new Date(),
  erc20Rewards: [
    {
      contractAddress: "0x...",
      quantityPerReward: 1,
      totalRewards: 1,
    },
  ],
  erc721Rewards: [
    {
      contractAddress: "0x...",
      tokenId: 0n,
    },
  ],
  erc1155Rewards: [
    {
      contractAddress: "0x...",
      tokenId: 0n,
      quantityPerReward: 1,
      totalRewards: 1,
    },
  ],
});
```

```ts
function createNewPack(
  options: WithOverrides<BaseTransactionOptions<CreateNewPackParams>>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: WithOverrides<
  BaseTransactionOptions<CreateNewPackParams>
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```
---

###### Connect SDK

## PACK.createPack

Prepares a transaction to call the "createPack" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { createPack } from "thirdweb/extensions/pack";
 
const transaction = createPack({
 contract,
 contents: ...,
 numOfRewardUnits: ...,
 packUri: ...,
 openStartTimestamp: ...,
 amountDistributedPerOpen: ...,
 recipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function createPack(
  options: BaseTransactionOptions<
    | CreatePackParams
    | { asyncParams: () => Promise<CreatePackParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "createPack" function.

#### Type

```ts
let options: BaseTransactionOptions<
  CreatePackParams | { asyncParams: () => Promise<CreatePackParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## PACK.getPackContents

Calls the "getPackContents" function on the contract.

### Example

```ts
import { getPackContents } from "thirdweb/extensions/pack";
 
const result = await getPackContents({
 contract,
 packId: ...,
});
```

```ts
function getPackContents(options: BaseTransactionOptions<GetPackContentsParams>) : Promise<readonly [readonly Array<{ assetContract: string; tokenId: bigint; tokenType: number; totalAmount: bigint }>, readonly Array<bigint>]>
```

### Parameters

The options for the getPackContents function.

#### Type

```ts
let options: BaseTransactionOptions<GetPackContentsParams>;
```

### Returns

```ts
let returnType: Promise<readonly [readonly Array<{ assetContract: string; tokenId: bigint; tokenType: number; totalAmount: bigint }>, readonly Array<bigint>]>
```

The parsed result of the function call.
---

###### Connect SDK

## PACK.getTokenCountOfBundle

Calls the "getTokenCountOfBundle" function on the contract.

### Example

```ts
import { getTokenCountOfBundle } from "thirdweb/extensions/pack";
 
const result = await getTokenCountOfBundle({
 contract,
 bundleId: ...,
});
```

```ts
function getTokenCountOfBundle(
  options: BaseTransactionOptions<GetTokenCountOfBundleParams>,
): Promise<bigint>;
```

### Parameters

The options for the getTokenCountOfBundle function.

#### Type

```ts
let options: BaseTransactionOptions<GetTokenCountOfBundleParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## PACK.openPack

Prepares a transaction to call the "openPack" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { openPack } from "thirdweb/extensions/pack";
 
const transaction = openPack({
 contract,
 packId: ...,
 amountToOpen: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function openPack(
  options: BaseTransactionOptions<
    OpenPackParams | { asyncParams: () => Promise<OpenPackParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "openPack" function.

#### Type

```ts
let options: BaseTransactionOptions<
  OpenPackParams | { asyncParams: () => Promise<OpenPackParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## PACK.packCreatedEvent

Creates an event object for the PackCreated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { packCreatedEvent } from "thirdweb/extensions/pack";
 
const events = await getContractEvents({
contract,
events: [
 packCreatedEvent({
 packId: ...,
})
],
});
```

```ts
function packCreatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackCreated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackCreated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## PACK.packOpenedEvent

Creates an event object for the PackOpened event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { packOpenedEvent } from "thirdweb/extensions/pack";
 
const events = await getContractEvents({
contract,
events: [
 packOpenedEvent({
 packId: ...,
 opener: ...,
})
],
});
```

```ts
function packOpenedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "opener";
      readonly type: "address";
    },
    { readonly name: "numOfPacksOpened"; readonly type: "uint256" },
    {
      readonly components: readonly [
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "totalAmount"; readonly type: "uint256" },
      ];
      readonly name: "rewardUnitsDistributed";
      readonly type: "tuple[]";
    },
  ];
  readonly name: "PackOpened";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    {
      readonly indexed: true;
      readonly name: "opener";
      readonly type: "address";
    },
    { readonly name: "numOfPacksOpened"; readonly type: "uint256" },
    {
      readonly components: readonly [
        { readonly name: "assetContract"; readonly type: "address" },
        { readonly name: "tokenType"; readonly type: "uint8" },
        { readonly name: "tokenId"; readonly type: "uint256" },
        { readonly name: "totalAmount"; readonly type: "uint256" },
      ];
      readonly name: "rewardUnitsDistributed";
      readonly type: "tuple[]";
    },
  ];
  readonly name: "PackOpened";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## PACK.packUpdatedEvent

Creates an event object for the PackUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { packUpdatedEvent } from "thirdweb/extensions/pack";
 
const events = await getContractEvents({
contract,
events: [
 packUpdatedEvent({
 packId: ...,
})
],
});
```

```ts
function packUpdatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackUpdated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "packId";
      readonly type: "uint256";
    },
    { readonly name: "recipient"; readonly type: "address" },
    { readonly name: "totalPacksCreated"; readonly type: "uint256" },
  ];
  readonly name: "PackUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---
## PERMISSIONS
---

###### Connect SDK

## PERMISSIONS.getAllRoleMembers

Retrieves all members of a specific role.

### Example

```ts
import { getAllRoleMembers } from "thirdweb/extensions/permissions";
 
const result = await getAllRoleMembers({
  contract,
  role: "admin",
});
```

```ts
function getAllRoleMembers(
  options: BaseTransactionOptions<GetAllRoleMembersParams>,
): Promise<Array<string>>;
```

### Parameters

The options for retrieving role members.

#### Type

```ts
let options: BaseTransactionOptions<GetAllRoleMembersParams>;
```

### Returns

```ts
let returnType: Promise<Array<string>>;
```

A promise that resolves to an array of strings representing the role members.
---

###### Connect SDK

## PERMISSIONS.getRoleAdmin

Gets the admin of a role.

### Example

```ts
import { getRoleAdmin } from "thirdweb/extensions/permissions";
 
const result = await getRoleAdmin({
  contract,
  role: "admin",
});
```

```ts
function getRoleAdmin(
  options: BaseTransactionOptions<GetRoleAdminParams>,
): Promise<string>;
```

### Parameters

The options for getting the role's admin.

#### Type

```ts
let options: BaseTransactionOptions<GetRoleAdminParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The address of the role's admin.
---

###### Connect SDK

## PERMISSIONS.getRoleHash

Get a hex value of a smart contract role You need the hex value to interact with the smart contracts.

### Example

```ts
const adminRoleHash = getRoleHash("admin"); // 0x0000000...000000
```

```ts
function getRoleHash(role: RoleInput): `0x${string}`;
```

### Parameters

string

#### Type

```ts
let role: RoleInput;
```

### Returns

```ts
let returnType: `0x${string}`;
```

hex value of the contract role
---

###### Connect SDK

## PERMISSIONS.getRoleMember

Retrieves a specific member of a specific role.

### Example

```ts
import { getRoleMember } from "thirdweb/extensions/permissions";
 
const address = await getRoleMember({
  contract,
  role: "admin",
  index: 0n,
});
```

```ts
function getRoleMember(
  options: BaseTransactionOptions<GetRoleMemberParams>,
): Promise<string>;
```

### Parameters

The options for retrieving the role member.

#### Type

```ts
let options: BaseTransactionOptions<GetRoleMemberParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

A promise that resolves to the address of the role member.
---

###### Connect SDK

## PERMISSIONS.getRoleMemberCount

Retrieves the number of members of a specific role.

### Example

```ts
import { getRoleMemberCount } from "thirdweb/extensions/permissions";
 
const result = await getRoleMemberCount({
  contract,
  role: "admin",
});
```

```ts
function getRoleMemberCount(
  options: BaseTransactionOptions<GetRoleMemberCountParams>,
): Promise<bigint>;
```

### Parameters

The options for retrieving role member count.

#### Type

```ts
let options: BaseTransactionOptions<GetRoleMemberCountParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the number of members of the role.
---

###### Connect SDK

## PERMISSIONS.grantRole

Grants a role to a target account.

### Example

```ts
import { grantRole } from "thirdweb/extensions/permissions";
import { sendTransaction } from "thirdweb";
 
const transaction = grantRole({
  contract,
  role: "admin",
  targetAccountAddress: "0x1234567890123456789012345678901234567890",
});
 
await sendTransaction({ transaction, account });
```

```ts
function grantRole(
  options: BaseTransactionOptions<GrantRoleParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for granting the role.

#### Type

```ts
let options: BaseTransactionOptions<GrantRoleParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that grants the role when sent.
---

###### Connect SDK

## PERMISSIONS.hasRole

Checks if the target account has the role.

### Example

```ts
import { hasRole } from "thirdweb/extensions/permissions";
 
const result = await hasRole({
  contract,
  role: "admin",
  targetAccountAddress: "0x1234567890123456789012345678901234567890",
});
```

```ts
function hasRole(
  options: BaseTransactionOptions<HasRoleParams>,
): Promise<boolean>;
```

### Parameters

The options for checking the role.

#### Type

```ts
let options: BaseTransactionOptions<HasRoleParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean that is true if the target account has the role.
---

###### Connect SDK

## PERMISSIONS.isGetAllRoleMembersSupported

Checks if the `getAllRoleMembers` method is supported by the given contract.

### Example

```ts
import { isGetAllRoleMembersSupported } from "thirdweb/extensions/permissions";
 
const supported = isGetAllRoleMembersSupported(["0x..."]);
```

```ts
function isGetAllRoleMembersSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getAllRoleMembers` method is supported.
---

###### Connect SDK

## PERMISSIONS.isGetRoleAdminSupported

Checks if the `getRoleAdmin` method is supported by the given contract.

### Example

```ts
import { isGetRoleAdminSupported } from "thirdweb/extensions/permissions";
const supported = isGetRoleAdminSupported(["0x..."]);
```

```ts
function isGetRoleAdminSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getRoleAdmin` method is supported.
---

###### Connect SDK

## PERMISSIONS.isGetRoleMemberCountSupported

Checks if the `getRoleMemberCount` method is supported by the given contract.

### Example

```ts
import { isGetRoleMemberCountSupported } from "thirdweb/extensions/permissions";
const supported = isGetRoleMemberCountSupported(["0x..."]);
```

```ts
function isGetRoleMemberCountSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getRoleMemberCount` method is supported.
---

###### Connect SDK

## PERMISSIONS.isGetRoleMemberSupported

Checks if the `getRoleMember` method is supported by the given contract.

### Example

```ts
import { isGetRoleMemberSupported } from "thirdweb/extensions/permissions";
const supported = isGetRoleMemberSupported(["0x..."]);
```

```ts
function isGetRoleMemberSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getRoleMember` method is supported.
---

###### Connect SDK

## PERMISSIONS.isGrantRoleSupported

Checks if the `grantRole` method is supported by the given contract.

### Example

```ts
import { isGrantRoleSupported } from "thirdweb/extensions/permissions";
 
const supported = isGrantRoleSupported(["0x..."]);
```

```ts
function isGrantRoleSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `grantRole` method is supported.
---

###### Connect SDK

## PERMISSIONS.isHasRoleSupported

Checks if the `hasRole` method is supported by the given contract.

### Example

```ts
import { isHasRoleSupported } from "thirdweb/extensions/permissions";
const supported = isHasRoleSupported(["0x..."]);
```

```ts
function isHasRoleSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `hasRole` method is supported.
---

###### Connect SDK

## PERMISSIONS.isRenounceRoleSupported

Checks if the `renounceRole` method is supported by the given contract.

### Example

```ts
import { isRenounceRoleSupported } from "thirdweb/extensions/permissions";
 
const supported = isRenounceRoleSupported(["0x..."]);
```

```ts
function isRenounceRoleSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `renounceRole` method is supported.
---

###### Connect SDK

## PERMISSIONS.isRevokeRoleSupported

Checks if the `revokeRole` method is supported by the given contract.

### Example

```ts
import { isRevokeRoleSupported } from "thirdweb/extensions/permissions";
 
const supported = isRevokeRoleSupported(["0x..."]);
```

```ts
function isRevokeRoleSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `revokeRole` method is supported.
---

###### Connect SDK

## PERMISSIONS.renounceRole

Lets the target account renounce the role. (The target account must be the sender of the transaction.)

### Example

```ts
import { renounceRole } from "thirdweb/extensions/permissions";
import { sendTransaction } from "thirdweb";
 
const transaction = renounceRole({
  contract,
  role: "admin",
  targetAccountAddress: "0x1234567890123456789012345678901234567890",
});
await sendTransaction({ transaction, account });
```

```ts
function renounceRole(
  options: BaseTransactionOptions<RenounceRoleParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for renouncing the role.

#### Type

```ts
let options: BaseTransactionOptions<RenounceRoleParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that revokes the role when sent.
---

###### Connect SDK

## PERMISSIONS.revokeRole

Revokes a role from a target account.

### Example

```ts
import { revokeRole } from "thirdweb/extensions/permissions";
import { sendTransaction } from "thirdweb";
 
const transaction = revokeRole({
  contract,
  role: "admin",
  targetAccountAddress: "0x1234567890123456789012345678901234567890",
});
 
await sendTransaction({ transaction, account });
```

```ts
function revokeRole(
  options: BaseTransactionOptions<RevokeRoleParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for revoking the role.

#### Type

```ts
let options: BaseTransactionOptions<RevokeRoleParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction that revokes the role when sent.
---

###### Connect SDK

## PERMISSIONS.roleAdminChangedEvent

Creates an event object for the RoleAdminChanged event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { roleAdminChangedEvent } from "thirdweb/extensions/permissions";
 
const events = await getContractEvents({
contract,
events: [
 roleAdminChangedEvent({
 role: ...,
 previousAdminRole: ...,
 newAdminRole: ...,
})
],
});
```

```ts
function roleAdminChangedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "role";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "previousAdminRole";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "newAdminRole";
      readonly type: "bytes32";
    },
  ];
  readonly name: "RoleAdminChanged";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "role";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "previousAdminRole";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "newAdminRole";
      readonly type: "bytes32";
    },
  ];
  readonly name: "RoleAdminChanged";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## PERMISSIONS.roleGrantedEvent

Creates an event object for the RoleGranted event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { roleGrantedEvent } from "thirdweb/extensions/permissions";
 
const events = await getContractEvents({
contract,
events: [
 roleGrantedEvent({
 role: ...,
 account: ...,
 sender: ...,
})
],
});
```

```ts
function roleGrantedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "role";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "account";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
  ];
  readonly name: "RoleGranted";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "role";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "account";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
  ];
  readonly name: "RoleGranted";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## PERMISSIONS.roleRevokedEvent

Creates an event object for the RoleRevoked event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { roleRevokedEvent } from "thirdweb/extensions/permissions";
 
const events = await getContractEvents({
contract,
events: [
 roleRevokedEvent({
 role: ...,
 account: ...,
 sender: ...,
})
],
});
```

```ts
function roleRevokedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "role";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "account";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
  ];
  readonly name: "RoleRevoked";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "role";
      readonly type: "bytes32";
    },
    {
      readonly indexed: true;
      readonly name: "account";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
  ];
  readonly name: "RoleRevoked";
  readonly type: "event";
}>;
```

The prepared event object.
---
## SPLIT
---

###### Connect SDK

## SPLIT.distribute

Prepares a transaction to call the "distribute" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { distribute } from "thirdweb/extensions/split";
 
const transaction = distribute();
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function distribute(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "distribute" function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## SPLIT.distributeByToken

This extension is similar to the `distribute` extension, however it require you to specify the token (address) that you want to distribute

### Example

```ts
import { distributeByToken } from "thirdweb/extensions/split";
 
const transaction = distributeByToken();
 
// Send the transaction
...
```

```ts
function distributeByToken(
  options: BaseTransactionOptions<{ tokenAddress: string }>,
): PreparedTransaction<
  any,
  {
    readonly inputs: readonly [
      { readonly name: "token"; readonly type: "address" },
    ];
    readonly name: "distribute";
    readonly outputs: readonly [];
    readonly stateMutability: "nonpayable";
    readonly type: "function";
  },
  PrepareTransactionOptions
>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<{ tokenAddress: string }>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  {
    readonly inputs: readonly [
      { readonly name: "token"; readonly type: "address" },
    ];
    readonly name: "distribute";
    readonly outputs: readonly [];
    readonly stateMutability: "nonpayable";
    readonly type: "function";
  },
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## SPLIT.getAllRecipientsAddresses

Get the addresses of all recipients of a [thirdweb Split contract](https://thirdweb.com/thirdweb.eth/Split)

### Example

```ts
import { getAllRecipientsAddresses } from "thirdweb/extensions/split";
 
const addresses = await getAllRecipientsAddresses({ contract });
```

```ts
function getAllRecipientsAddresses(
  options: BaseTransactionOptions,
): Promise<Array<string>>;
```

### Parameters

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<Array<string>>;
```

an array of wallet addresses
---

###### Connect SDK

## SPLIT.getAllRecipientsPercentages

Get all the recipients of a Split contracts

### Example

```ts
import { getAllRecipientsPercentages } from "thirdweb/extensions/split";
 
const allRecipients = await getAllRecipientsPercentages({ contract });
// Example result:
[
  {
    address: "0x1...",
    splitPercentage: 25, // 25%
  },
  {
    address: "0x2...",
    splitPercentage: 75, // 75%
  },
];
```

```ts
function getAllRecipientsPercentages(
  options: BaseTransactionOptions,
): Promise<Array<SplitRecipient>>;
```

### Parameters

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: { address: string; splitPercentage: number };
```

an array of recipients' addresses and split percentage of each
---

###### Connect SDK

## SPLIT.getRecipientSplitPercentage

Get the split percentage of a recipient

### Example

```ts
import { getRecipientSplitPercentage } from "thirdweb/extensions/split";
 
const percentage = await getRecipientSplitPercentage({
  recipientAddress: "0x...",
});
```

```ts
function getRecipientSplitPercentage(
  options: BaseTransactionOptions<{ recipientAddress: string }>,
): Promise<SplitRecipient>;
```

### Parameters

The options for the transaction

#### Type

```ts
let options: BaseTransactionOptions<{ recipientAddress: string }>;
```

### Returns

```ts
let returnType: { address: string; splitPercentage: number };
```

The split percentage of the recipient
---

###### Connect SDK

## SPLIT.payee

Calls the "payee" function on the contract.

### Example

```ts
import { payee } from "thirdweb/extensions/split";
 
const result = await payee({
 contract,
 index: ...,
});
```

```ts
function payee(
  options: BaseTransactionOptions<PayeeParams>,
): Promise<string>;
```

### Parameters

The options for the payee function.

#### Type

```ts
let options: BaseTransactionOptions<PayeeParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.payeeCount

Calls the "payeeCount" function on the contract.

### Example

```ts
import { payeeCount } from "thirdweb/extensions/split";
 
const result = await payeeCount({
  contract,
});
```

```ts
function payeeCount(options: BaseTransactionOptions): Promise<bigint>;
```

### Parameters

The options for the payeeCount function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.releasable

Calls the "releasable" function on the contract.

### Example

```ts
import { releasable } from "thirdweb/extensions/split";
 
const result = await releasable({
 contract,
 account: ...,
});
```

```ts
function releasable(
  options: BaseTransactionOptions<ReleasableParams>,
): Promise<bigint>;
```

### Parameters

The options for the releasable function.

#### Type

```ts
let options: BaseTransactionOptions<ReleasableParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.releasableByToken

Calls the "releasable" function on the contract.

### Example

```ts
import { releasableByToken } from "thirdweb/extensions/split";
 
const result = await releasableByToken({
 contract,
 account: ...,
});
```

```ts
function releasableByToken(
  options: BaseTransactionOptions<ReleasableByTokenParams>,
): Promise<bigint>;
```

### Parameters

The options for the releasable function.

#### Type

```ts
let options: BaseTransactionOptions<ReleasableByTokenParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.release

Prepares a transaction to call the "release" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { release } from "thirdweb/extensions/split";
 
const transaction = release({
 contract,
 account: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function release(
  options: BaseTransactionOptions<
    ReleaseParams | { asyncParams: () => Promise<ReleaseParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "release" function.

#### Type

```ts
let options: BaseTransactionOptions<
  ReleaseParams | { asyncParams: () => Promise<ReleaseParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## SPLIT.releaseByToken

Similar to the `release` extension, however this one requires you to specify a tokenAddress to release

### Example

```ts
import { releaseByToken } from "thirdweb/extensions/split";
 
const transaction = releaseByToken({
 contract,
 account: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
...
```

```ts
function releaseByToken(
  options: BaseTransactionOptions<ReleaseByTokenParams>,
): PreparedTransaction<
  any,
  {
    readonly inputs: readonly [
      { readonly name: "token"; readonly type: "address" },
      { readonly name: "account"; readonly type: "address" },
    ];
    readonly name: "release";
    readonly outputs: readonly [];
    readonly stateMutability: "nonpayable";
    readonly type: "function";
  },
  PrepareTransactionOptions
>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<ReleaseByTokenParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  {
    readonly inputs: readonly [
      { readonly name: "token"; readonly type: "address" },
      { readonly name: "account"; readonly type: "address" },
    ];
    readonly name: "release";
    readonly outputs: readonly [];
    readonly stateMutability: "nonpayable";
    readonly type: "function";
  },
  PrepareTransactionOptions
>;
```
---

###### Connect SDK

## SPLIT.released

Calls the "released" function on the contract.

### Example

```ts
import { released } from "thirdweb/extensions/split";
 
const result = await released({
 contract,
 account: ...,
});
```

```ts
function released(
  options: BaseTransactionOptions<ReleasedParams>,
): Promise<bigint>;
```

### Parameters

The options for the released function.

#### Type

```ts
let options: BaseTransactionOptions<ReleasedParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.releasedByToken

Calls the "released" function on the contract. Similar to the `released` extension, however this one requires you to specify a tokenAddress

### Example

```ts
import { releasedByToken } from "thirdweb/extensions/split";
 
const result = await releasedByToken({
  contract,
  account: "0x...",
  tokenAddress: "0x...",
});
```

```ts
function releasedByToken(
  options: BaseTransactionOptions<
    ReleasedParams & { tokenAddress: string }
  >,
): Promise<bigint>;
```

### Parameters

The options for the released function.

#### Type

```ts
let options: BaseTransactionOptions<
  ReleasedParams & { tokenAddress: string }
>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.shares

Calls the "shares" function on the contract.

### Example

```ts
import { shares } from "thirdweb/extensions/split";
 
const result = await shares({
 contract,
 account: ...,
});
```

```ts
function shares(
  options: BaseTransactionOptions<SharesParams>,
): Promise<bigint>;
```

### Parameters

The options for the shares function.

#### Type

```ts
let options: BaseTransactionOptions<SharesParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.totalReleased

Calls the "totalReleased" function on the contract.

### Example

```ts
import { totalReleased } from "thirdweb/extensions/split";
 
const result = await totalReleased({
  contract,
});
```

```ts
function totalReleased(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the totalReleased function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## SPLIT.totalReleasedByToken

Calls the "totalReleased" function on the contract. Similar to the `release` extension, however this one requires you to specify a tokenAddress

### Example

```ts
import { totalReleasedByToken } from "thirdweb/extensions/split";
 
const result = await totalReleasedByToken({
  contract,
  tokenAddress: "0x...",
});
```

```ts
function totalReleasedByToken(
  options: BaseTransactionOptions<{ tokenAddress: string }>,
): Promise<bigint>;
```

### Parameters

The options for the totalReleased function.

#### Type

```ts
let options: BaseTransactionOptions<{ tokenAddress: string }>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---
## THIRDWEB
---

###### Connect SDK

## THIRDWEB.add

Prepares a transaction to call the "add" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { add } from "thirdweb/extensions/thirdweb";
 
const transaction = add({
 contract,
 deployer: ...,
 deployment: ...,
 chainId: ...,
 metadataUri: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function add(
  options: BaseTransactionOptions<
    AddParams | { asyncParams: () => Promise<AddParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "add" function.

#### Type

```ts
let options: BaseTransactionOptions<
  AddParams | { asyncParams: () => Promise<AddParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## THIRDWEB.contractType

Calls the "contractType" function on the contract.

### Example

```ts
import { contractType } from "thirdweb/extensions/thirdweb";
 
const result = await contractType({
  contract,
});
```

```ts
function contractType(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the contractType function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.count

Calls the "count" function on the contract.

### Example

```ts
import { count } from "thirdweb/extensions/thirdweb";
 
const result = await count({
 contract,
 deployer: ...,
});
```

```ts
function count(
  options: BaseTransactionOptions<CountParams>,
): Promise<bigint>;
```

### Parameters

The options for the count function.

#### Type

```ts
let options: BaseTransactionOptions<CountParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.deployProxyByImplementation

Prepares a transaction to call the "deployProxyByImplementation" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { deployProxyByImplementation } from "thirdweb/extensions/thirdweb";
 
const transaction = deployProxyByImplementation({
 contract,
 implementation: ...,
 data: ...,
 salt: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function deployProxyByImplementation(
  options: BaseTransactionOptions<
    | DeployProxyByImplementationParams
    | {
        asyncParams: () => Promise<DeployProxyByImplementationParams>;
      }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "deployProxyByImplementation" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | DeployProxyByImplementationParams
  | { asyncParams: () => Promise<DeployProxyByImplementationParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## THIRDWEB.getAll

Calls the "getAll" function on the contract.

### Example

```ts
import { getAll } from "thirdweb/extensions/thirdweb";
 
const result = await getAll({
 contract,
 deployer: ...,
});
```

```ts
function getAll(options: BaseTransactionOptions<GetAllParams>) : Promise<readonly Array<{ chainId: bigint; deploymentAddress: string; metadataURI: string }>>
```

### Parameters

The options for the getAll function.

#### Type

```ts
let options: BaseTransactionOptions<GetAllParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ chainId: bigint; deploymentAddress: string; metadataURI: string }>>
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.getAllPublishedContracts

Calls the "getAllPublishedContracts" function on the contract.

### Example

```ts
import { getAllPublishedContracts } from "thirdweb/extensions/thirdweb";
 
const result = await getAllPublishedContracts({
 contract,
 publisher: ...,
});
```

```ts
function getAllPublishedContracts(options: BaseTransactionOptions<GetAllPublishedContractsParams>) : Promise<readonly Array<{ bytecodeHash: `0x${string}`; contractId: string; implementation: string; publishMetadataUri: string; publishTimestamp: bigint }>>
```

### Parameters

The options for the getAllPublishedContracts function.

#### Type

```ts
let options: BaseTransactionOptions<GetAllPublishedContractsParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ bytecodeHash: `0x${string}`; contractId: string; implementation: string; publishMetadataUri: string; publishTimestamp: bigint }>>
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.getMetadataUri

Calls the "getMetadataUri" function on the contract.

### Example

```ts
import { getMetadataUri } from "thirdweb/extensions/thirdweb";
 
const result = await getMetadataUri({
 contract,
 chainId: ...,
 deployment: ...,
});
```

```ts
function getMetadataUri(
  options: BaseTransactionOptions<GetMetadataUriParams>,
): Promise<string>;
```

### Parameters

The options for the getMetadataUri function.

#### Type

```ts
let options: BaseTransactionOptions<GetMetadataUriParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.getPublishedContract

Calls the "getPublishedContract" function on the contract.

### Example

```ts
import { getPublishedContract } from "thirdweb/extensions/thirdweb";
 
const result = await getPublishedContract({
 contract,
 publisher: ...,
 contractId: ...,
});
```

```ts
function getPublishedContract(
  options: BaseTransactionOptions<GetPublishedContractParams>,
): Promise<{
  bytecodeHash: `0x${string}`;
  contractId: string;
  implementation: string;
  publishMetadataUri: string;
  publishTimestamp: bigint;
}>;
```

### Parameters

The options for the getPublishedContract function.

#### Type

```ts
let options: BaseTransactionOptions<GetPublishedContractParams>;
```

### Returns

```ts
let returnType: Promise<{
  bytecodeHash: `0x${string}`;
  contractId: string;
  implementation: string;
  publishMetadataUri: string;
  publishTimestamp: bigint;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.getPublishedContractVersions

Calls the "getPublishedContractVersions" function on the contract.

### Example

```ts
import { getPublishedContractVersions } from "thirdweb/extensions/thirdweb";
 
const result = await getPublishedContractVersions({
 contract,
 publisher: ...,
 contractId: ...,
});
```

```ts
function getPublishedContractVersions(options: BaseTransactionOptions<GetPublishedContractVersionsParams>) : Promise<readonly Array<{ bytecodeHash: `0x${string}`; contractId: string; implementation: string; publishMetadataUri: string; publishTimestamp: bigint }>>
```

### Parameters

The options for the getPublishedContractVersions function.

#### Type

```ts
let options: BaseTransactionOptions<GetPublishedContractVersionsParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ bytecodeHash: `0x${string}`; contractId: string; implementation: string; publishMetadataUri: string; publishTimestamp: bigint }>>
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.getPublishedUriFromCompilerUri

Calls the "getPublishedUriFromCompilerUri" function on the contract.

### Example

```ts
import { getPublishedUriFromCompilerUri } from "thirdweb/extensions/thirdweb";
 
const result = await getPublishedUriFromCompilerUri({
 contract,
 compilerMetadataUri: ...,
});
```

```ts
function getPublishedUriFromCompilerUri(options: BaseTransactionOptions<GetPublishedUriFromCompilerUriParams>) : Promise<readonly Array<string>>
```

### Parameters

The options for the getPublishedUriFromCompilerUri function.

#### Type

```ts
let options: BaseTransactionOptions<GetPublishedUriFromCompilerUriParams>;
```

### Returns

```ts
let returnType: Promise<readonly Array<string>>
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.getPublisherProfileUri

Calls the "getPublisherProfileUri" function on the contract.

### Example

```ts
import { getPublisherProfileUri } from "thirdweb/extensions/thirdweb";
 
const result = await getPublisherProfileUri({
 contract,
 publisher: ...,
});
```

```ts
function getPublisherProfileUri(
  options: BaseTransactionOptions<GetPublisherProfileUriParams>,
): Promise<string>;
```

### Parameters

The options for the getPublisherProfileUri function.

#### Type

```ts
let options: BaseTransactionOptions<GetPublisherProfileUriParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## THIRDWEB.isContractTypeSupported

Checks if the `contractType` method is supported by the given contract.

### Example

```ts
import { isContractTypeSupported } from "thirdweb/extensions/thirdweb";
 
const supported = isContractTypeSupported(["0x..."]);
```

```ts
function isContractTypeSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `contractType` method is supported.
---

###### Connect SDK

## THIRDWEB.publishContract

Publish a contract to the contract publisher.

### Example

```ts
const tx = publishContract({
  contract,
  account,
  metadata,
});
```

```ts
function publishContract(
  options: BaseTransactionOptions<PublishContractParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for publishing the contract.

#### Type

```ts
let options: BaseTransactionOptions<PublishContractParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction to publish the contract.
---

###### Connect SDK

## THIRDWEB.remove

Prepares a transaction to call the "remove" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { remove } from "thirdweb/extensions/thirdweb";
 
const transaction = remove({
 contract,
 deployer: ...,
 deployment: ...,
 chainId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function remove(
  options: BaseTransactionOptions<
    RemoveParams | { asyncParams: () => Promise<RemoveParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "remove" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RemoveParams | { asyncParams: () => Promise<RemoveParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## THIRDWEB.setPublisherProfileUri

Prepares a transaction to call the "setPublisherProfileUri" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setPublisherProfileUri } from "thirdweb/extensions/thirdweb";
 
const transaction = setPublisherProfileUri({
 contract,
 publisher: ...,
 uri: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setPublisherProfileUri(
  options: BaseTransactionOptions<
    | SetPublisherProfileUriParams
    | { asyncParams: () => Promise<SetPublisherProfileUriParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setPublisherProfileUri" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetPublisherProfileUriParams
  | { asyncParams: () => Promise<SetPublisherProfileUriParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## THIRDWEB.unpublishContract

Prepares a transaction to call the "unpublishContract" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { unpublishContract } from "thirdweb/extensions/thirdweb";
 
const transaction = unpublishContract({
 contract,
 publisher: ...,
 contractId: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function unpublishContract(
  options: BaseTransactionOptions<
    | UnpublishContractParams
    | { asyncParams: () => Promise<UnpublishContractParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "unpublishContract" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | UnpublishContractParams
  | { asyncParams: () => Promise<UnpublishContractParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## UNISWAP
---

###### Connect SDK

## UNISWAP.createPool

Prepares a transaction to call the "createPool" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { createPool } from "thirdweb/extensions/uniswap";
 
const transaction = createPool({
 contract,
 tokenA: ...,
 tokenB: ...,
 fee: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function createPool(
  options: BaseTransactionOptions<
    | CreatePoolParams
    | { asyncParams: () => Promise<CreatePoolParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "createPool" function.

#### Type

```ts
let options: BaseTransactionOptions<
  CreatePoolParams | { asyncParams: () => Promise<CreatePoolParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.enableFeeAmount

Prepares a transaction to call the "enableFeeAmount" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { enableFeeAmount } from "thirdweb/extensions/uniswap";
 
const transaction = enableFeeAmount({
 contract,
 fee: ...,
 tickSpacing: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function enableFeeAmount(
  options: BaseTransactionOptions<
    | EnableFeeAmountParams
    | { asyncParams: () => Promise<EnableFeeAmountParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "enableFeeAmount" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | EnableFeeAmountParams
  | { asyncParams: () => Promise<EnableFeeAmountParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.exactInput

Prepares a transaction to call the "exactInput" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { exactInput } from "thirdweb/extensions/uniswap";
 
const transaction = exactInput({
 contract,
 params: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function exactInput(
  options: BaseTransactionOptions<
    | ExactInputParams
    | { asyncParams: () => Promise<ExactInputParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "exactInput" function.

#### Type

```ts
let options: BaseTransactionOptions<
  ExactInputParams | { asyncParams: () => Promise<ExactInputParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.exactInputSingle

Prepares a transaction to call the "exactInputSingle" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { exactInputSingle } from "thirdweb/extensions/uniswap";
 
const transaction = exactInputSingle({
 contract,
 params: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function exactInputSingle(
  options: BaseTransactionOptions<
    | ExactInputSingleParams
    | { asyncParams: () => Promise<ExactInputSingleParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "exactInputSingle" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | ExactInputSingleParams
  | { asyncParams: () => Promise<ExactInputSingleParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.exactOutput

Prepares a transaction to call the "exactOutput" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { exactOutput } from "thirdweb/extensions/uniswap";
 
const transaction = exactOutput({
 contract,
 params: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function exactOutput(
  options: BaseTransactionOptions<
    | ExactOutputParams
    | { asyncParams: () => Promise<ExactOutputParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "exactOutput" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | ExactOutputParams
  | { asyncParams: () => Promise<ExactOutputParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.exactOutputSingle

Prepares a transaction to call the "exactOutputSingle" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { exactOutputSingle } from "thirdweb/extensions/uniswap";
 
const transaction = exactOutputSingle({
 contract,
 params: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function exactOutputSingle(
  options: BaseTransactionOptions<
    | ExactOutputSingleParams
    | { asyncParams: () => Promise<ExactOutputSingleParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "exactOutputSingle" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | ExactOutputSingleParams
  | { asyncParams: () => Promise<ExactOutputSingleParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.feeAmountEnabledEvent

Creates an event object for the FeeAmountEnabled event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { feeAmountEnabledEvent } from "thirdweb/extensions/uniswap";
 
const events = await getContractEvents({
  contract,
  events: [feeAmountEnabledEvent()],
});
```

```ts
function feeAmountEnabledEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "fee"; readonly type: "uint24" },
    { readonly name: "tickSpacing"; readonly type: "int24" },
  ];
  readonly name: "FeeAmountEnabled";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "fee"; readonly type: "uint24" },
    { readonly name: "tickSpacing"; readonly type: "int24" },
  ];
  readonly name: "FeeAmountEnabled";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## UNISWAP.feeAmountTickSpacing

Calls the "feeAmountTickSpacing" function on the contract.

### Example

```ts
import { feeAmountTickSpacing } from "thirdweb/extensions/uniswap";
 
const result = await feeAmountTickSpacing({
 contract,
 fee: ...,
});
```

```ts
function feeAmountTickSpacing(
  options: BaseTransactionOptions<FeeAmountTickSpacingParams>,
): Promise<number>;
```

### Parameters

The options for the feeAmountTickSpacing function.

#### Type

```ts
let options: BaseTransactionOptions<FeeAmountTickSpacingParams>;
```

### Returns

```ts
let returnType: Promise<number>;
```

The parsed result of the function call.
---

###### Connect SDK

## UNISWAP.getPool

Calls the "getPool" function on the contract.

### Example

```ts
import { getPool } from "thirdweb/extensions/uniswap";
 
const result = await getPool({
 contract,
 tokenA: ...,
 tokenB: ...,
 fee: ...,
});
```

```ts
function getPool(
  options: BaseTransactionOptions<GetPoolParams>,
): Promise<string>;
```

### Parameters

The options for the getPool function.

#### Type

```ts
let options: BaseTransactionOptions<GetPoolParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## UNISWAP.getUniswapV3Pool

Finds the Uniswap V3 pools for the two tokens.

### Example

```ts
import { getUniswapV3Pool } from "thirdweb/extensions/uniswap";
const pools = await getUniswapV3Pool({
  tokenA: "0x...",
  tokenB: "0x...",
  contract: factoryContract,
});
```

```ts
function getUniswapV3Pool(
  options: BaseTransactionOptions<GetUniswapV3PoolParams>,
): Promise<Array<GetUniswapV3PoolResult>>;
```

### Parameters

The token pair to find any pools for any Uniswap contract that implements getPool.

#### Type

```ts
let options: BaseTransactionOptions<GetUniswapV3PoolParams>;
```

### Returns

```ts
let returnType: {
  poolAddress: Address;
  poolFee: (typeof UniswapFee)[keyof typeof UniswapFee];
};
```

The pools' addresses and fees.
---

###### Connect SDK

## UNISWAP.owner

Calls the "owner" function on the contract.

### Example

```ts
import { owner } from "thirdweb/extensions/uniswap";
 
const result = await owner({
  contract,
});
```

```ts
function owner(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the owner function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## UNISWAP.ownerChangedEvent

Creates an event object for the OwnerChanged event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { ownerChangedEvent } from "thirdweb/extensions/uniswap";
 
const events = await getContractEvents({
contract,
events: [
 ownerChangedEvent({
 oldOwner: ...,
 newOwner: ...,
})
],
});
```

```ts
function ownerChangedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "oldOwner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "newOwner";
      readonly type: "address";
    },
  ];
  readonly name: "OwnerChanged";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "oldOwner";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "newOwner";
      readonly type: "address";
    },
  ];
  readonly name: "OwnerChanged";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## UNISWAP.poolCreatedEvent

Creates an event object for the PoolCreated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { poolCreatedEvent } from "thirdweb/extensions/uniswap";
 
const events = await getContractEvents({
contract,
events: [
 poolCreatedEvent({
 token0: ...,
 token1: ...,
 sender: ...,
})
],
});
```

```ts
function poolCreatedEvent(
  filters: Partial,
): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "token0";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "token1";
      readonly type: "address";
    },
    { readonly name: "fee"; readonly type: "uint24" },
    { readonly name: "tickLower"; readonly type: "int24" },
    { readonly name: "tickUpper"; readonly type: "int24" },
    { readonly name: "liquidity"; readonly type: "uint128" },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
  ];
  readonly name: "PoolCreated";
  readonly type: "event";
}>;
```

### Parameters

Optional filters to apply to the event.

#### Type

```ts
let filters: Partial;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly indexed: true;
      readonly name: "token0";
      readonly type: "address";
    },
    {
      readonly indexed: true;
      readonly name: "token1";
      readonly type: "address";
    },
    { readonly name: "fee"; readonly type: "uint24" },
    { readonly name: "tickLower"; readonly type: "int24" },
    { readonly name: "tickUpper"; readonly type: "int24" },
    { readonly name: "liquidity"; readonly type: "uint128" },
    {
      readonly indexed: true;
      readonly name: "sender";
      readonly type: "address";
    },
  ];
  readonly name: "PoolCreated";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## UNISWAP.quoteExactInput

Prepares a transaction to call the "quoteExactInput" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { quoteExactInput } from "thirdweb/extensions/uniswap";
 
const transaction = quoteExactInput({
 contract,
 path: ...,
 amountIn: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function quoteExactInput(
  options: BaseTransactionOptions<
    | QuoteExactInputParams
    | { asyncParams: () => Promise<QuoteExactInputParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "quoteExactInput" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | QuoteExactInputParams
  | { asyncParams: () => Promise<QuoteExactInputParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.quoteExactInputSingle

Prepares a transaction to call the "quoteExactInputSingle" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { quoteExactInputSingle } from "thirdweb/extensions/uniswap";
 
const transaction = quoteExactInputSingle({
 contract,
 tokenIn: ...,
 tokenOut: ...,
 fee: ...,
 amountIn: ...,
 sqrtPriceLimitX96: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function quoteExactInputSingle(
  options: BaseTransactionOptions<
    | QuoteExactInputSingleParams
    | { asyncParams: () => Promise<QuoteExactInputSingleParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "quoteExactInputSingle" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | QuoteExactInputSingleParams
  | { asyncParams: () => Promise<QuoteExactInputSingleParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.quoteExactOutput

Prepares a transaction to call the "quoteExactOutput" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { quoteExactOutput } from "thirdweb/extensions/uniswap";
 
const transaction = quoteExactOutput({
 contract,
 path: ...,
 amountOut: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function quoteExactOutput(
  options: BaseTransactionOptions<
    | QuoteExactOutputParams
    | { asyncParams: () => Promise<QuoteExactOutputParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "quoteExactOutput" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | QuoteExactOutputParams
  | { asyncParams: () => Promise<QuoteExactOutputParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.quoteExactOutputSingle

Prepares a transaction to call the "quoteExactOutputSingle" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { quoteExactOutputSingle } from "thirdweb/extensions/uniswap";
 
const transaction = quoteExactOutputSingle({
 contract,
 tokenIn: ...,
 tokenOut: ...,
 fee: ...,
 amountOut: ...,
 sqrtPriceLimitX96: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function quoteExactOutputSingle(
  options: BaseTransactionOptions<
    | QuoteExactOutputSingleParams
    | { asyncParams: () => Promise<QuoteExactOutputSingleParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "quoteExactOutputSingle" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | QuoteExactOutputSingleParams
  | { asyncParams: () => Promise<QuoteExactOutputSingleParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## UNISWAP.setOwner

Prepares a transaction to call the "setOwner" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setOwner } from "thirdweb/extensions/uniswap";
 
const transaction = setOwner({
 contract,
 newOwner: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setOwner(
  options: BaseTransactionOptions<
    SetOwnerParams | { asyncParams: () => Promise<SetOwnerParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setOwner" function.

#### Type

```ts
let options: BaseTransactionOptions<
  SetOwnerParams | { asyncParams: () => Promise<SetOwnerParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## UNSTOPPABLE-DOMAINS
---

###### Connect SDK

## UNSTOPPABLE-DOMAINS.namehash

Calls the "namehash" function on the contract.

### Example

```ts
import { namehash } from "thirdweb/extensions/unstoppable-domains";
 
const result = await namehash({
 contract,
 labels: ...,
});
```

```ts
function namehash(
  options: BaseTransactionOptions<NamehashParams>,
): Promise<bigint>;
```

### Parameters

The options for the namehash function.

#### Type

```ts
let options: BaseTransactionOptions<NamehashParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## UNSTOPPABLE-DOMAINS.resolveAddress

Resolve an Unstoppable-Domain domain to an Ethereum address

### Example

#### Basic usage

```ts
import { resolveAddress } from "thirdweb/extension/unstoppable-domains";
 
const address = await resolveAddress({
  client,
  name: "thirdweb.crypto",
});
```

#### Custom resolver

By default this extension will try to resolve the name on Polygon mainnet, you can decide to customize the resolver contract by specifying `resolverAddress` and `resolverChain`

```ts
import { ethereum } from "thirdweb/chains";
 
const address = await resolveAddress({
  client,
  name: "thirdweb.crypto",
  resolverAddress: "0x...",
  resolverChain: ethereum,
});
```

```ts
function resolveAddress(
  options: ResolveAddressOptions,
): Promise<string>;
```

### Parameters

The options for resolving an UD domain

#### Type

```ts
let options: {
  client: ThirdwebClient;
  name: string;
  resolverAddress?: string;
  resolverChain?: Chain;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The Ethereum address associated with the domain name. [Learn more](https://docs.unstoppabledomains.com/reverse-resolution/)
---

###### Connect SDK

## UNSTOPPABLE-DOMAINS.resolveName

Resolves the primary Untoppable-Domains name for a specified address.

### Example

#### Basic usage

```ts
import { resolveName } from "thirdweb/extension/unstoppable-domains";
 
const name = await resolveName({
  client,
  address: "0x...",
});
```

#### Custom resolver

By default this extension will try to resolve the address on Polygon mainnet, you can decide to customize the resolver contract by specifying `resolverAddress` and `resolverChain`

```ts
import { ethereum } from "thirdweb/chains";
 
const address = await resolveName({
  client,
  address: "0x...",
  resolverAddress: "0x...",
  resolverChain: ethereum,
});
```

```ts
function resolveName(options: ResolveUDNameOptions): Promise<string>;
```

### Parameters

The options for resolving an UD domain

#### Type

```ts
let options: {
  address: string;
  client: ThirdwebClient;
  resolverAddress?: string;
  resolverChain?: Chain;
};
```

### Returns

```ts
let returnType: Promise<string>;
```
---

###### Connect SDK

## UNSTOPPABLE-DOMAINS.reverseNameOf

Calls the "reverseNameOf" function on the contract.

### Example

```ts
import { reverseNameOf } from "thirdweb/extensions/unstoppable-domains";
 
const result = await reverseNameOf({
 contract,
 addr: ...,
});
```

```ts
function reverseNameOf(
  options: BaseTransactionOptions<ReverseNameOfParams>,
): Promise<string>;
```

### Parameters

The options for the reverseNameOf function.

#### Type

```ts
let options: BaseTransactionOptions<ReverseNameOfParams>;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---
## VOTE
---

###### Connect SDK

## VOTE.canExecute

Simulate the `execute` method of the Vote contract, to check if you can execute a proposal

### Example

```ts
import { canExecute } from "thirdweb/extensions/vote";
 
const executable = await canExecute({ contract, proposalId });
```

```ts
function canExecute(
  options: BaseTransactionOptions<{ proposalId: bigint }>,
): Promise<boolean>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<{ proposalId: bigint }>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

boolean - `true` if the proposal is executable, else `false`
---

###### Connect SDK

## VOTE.castVote

Prepares a transaction to call the "castVote" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { castVote } from "thirdweb/extensions/vote";
 
const transaction = castVote({
 contract,
 proposalId: ...,
 support: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function castVote(
  options: BaseTransactionOptions<
    CastVoteParams | { asyncParams: () => Promise<CastVoteParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "castVote" function.

#### Type

```ts
let options: BaseTransactionOptions<
  CastVoteParams | { asyncParams: () => Promise<CastVoteParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.castVoteBySig

Prepares a transaction to call the "castVoteBySig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { castVoteBySig } from "thirdweb/extensions/vote";
 
const transaction = castVoteBySig({
 contract,
 proposalId: ...,
 support: ...,
 v: ...,
 r: ...,
 s: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function castVoteBySig(
  options: BaseTransactionOptions<
    | CastVoteBySigParams
    | { asyncParams: () => Promise<CastVoteBySigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "castVoteBySig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CastVoteBySigParams
  | { asyncParams: () => Promise<CastVoteBySigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.castVoteWithReason

Prepares a transaction to call the "castVoteWithReason" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { castVoteWithReason } from "thirdweb/extensions/vote";
 
const transaction = castVoteWithReason({
 contract,
 proposalId: ...,
 support: ...,
 reason: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function castVoteWithReason(
  options: BaseTransactionOptions<
    | CastVoteWithReasonParams
    | { asyncParams: () => Promise<CastVoteWithReasonParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "castVoteWithReason" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CastVoteWithReasonParams
  | { asyncParams: () => Promise<CastVoteWithReasonParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.castVoteWithReasonAndParams

Prepares a transaction to call the "castVoteWithReasonAndParams" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { castVoteWithReasonAndParams } from "thirdweb/extensions/vote";
 
const transaction = castVoteWithReasonAndParams({
 contract,
 proposalId: ...,
 support: ...,
 reason: ...,
 params: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function castVoteWithReasonAndParams(
  options: BaseTransactionOptions<
    | CastVoteWithReasonAndParamsParams
    | {
        asyncParams: () => Promise<CastVoteWithReasonAndParamsParams>;
      }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "castVoteWithReasonAndParams" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CastVoteWithReasonAndParamsParams
  | { asyncParams: () => Promise<CastVoteWithReasonAndParamsParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.castVoteWithReasonAndParamsBySig

Prepares a transaction to call the "castVoteWithReasonAndParamsBySig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { castVoteWithReasonAndParamsBySig } from "thirdweb/extensions/vote";
 
const transaction = castVoteWithReasonAndParamsBySig({
 contract,
 proposalId: ...,
 support: ...,
 reason: ...,
 params: ...,
 v: ...,
 r: ...,
 s: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function castVoteWithReasonAndParamsBySig(
  options: BaseTransactionOptions<
    | CastVoteWithReasonAndParamsBySigParams
    | {
        asyncParams: () => Promise<CastVoteWithReasonAndParamsBySigParams>;
      }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "castVoteWithReasonAndParamsBySig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CastVoteWithReasonAndParamsBySigParams
  | {
      asyncParams: () => Promise<CastVoteWithReasonAndParamsBySigParams>;
    }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.execute

Prepares a transaction to call the "execute" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { execute } from "thirdweb/extensions/vote";
 
const transaction = execute({
 contract,
 targets: ...,
 values: ...,
 calldatas: ...,
 descriptionHash: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function execute(
  options: BaseTransactionOptions<
    ExecuteParams | { asyncParams: () => Promise<ExecuteParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "execute" function.

#### Type

```ts
let options: BaseTransactionOptions<
  ExecuteParams | { asyncParams: () => Promise<ExecuteParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.executeProposal

Execute a Proposal

### Example

```ts
import { executeProposal } from "thirdweb/extensions/vote";
 
const transaction = executeProposal({ contract, proposalId });
const tx = await sendTransaction({ transaction, account });
```

```ts
function executeProposal(
  options: BaseTransactionOptions<{ proposalId: bigint }>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<{ proposalId: bigint }>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

a prepared transaction for the `execute` method
---

###### Connect SDK

## VOTE.getAll

Get all proposals from a Vote contract with some extra info attached for each proposal (current state and votes)

### Example

```ts
import { getAll } from "thirdweb/extension/getAll";
 
const allProposals = await getAll({ contract });
```

```ts
function getAll(
  options: BaseTransactionOptions,
): Promise<Array<ProposalItem>>;
```

### Parameters

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: {
  description: string;
  endBlock: bigint;
  executions: Array<{
    nativeTokenValue: bigint | undefined;
    toAddress: string | undefined;
    transactionData: Hex | undefined;
  }>;
  proposalId: bigint;
  proposer: string;
  startBlock: bigint;
  state: number;
  stateLabel: string | undefined;
  votes: ProposalVoteInfo;
};
```

An array containing proposals data
---

###### Connect SDK

## VOTE.getAllProposals

Calls the "getAllProposals" function on the contract.

### Example

```ts
import { getAllProposals } from "thirdweb/extensions/vote";
 
const result = await getAllProposals({
  contract,
});
```

```ts
function getAllProposals(options: BaseTransactionOptions) : Promise<readonly Array<{ calldatas: readonly Array<`0x${string}`>; description: string; endBlock: bigint; proposalId: bigint; proposer: string; signatures: readonly Array<string>; startBlock: bigint; targets: readonly Array<string>; values: readonly Array<bigint> }>>
```

### Parameters

The options for the getAllProposals function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ calldatas: readonly Array<`0x${string}`>; description: string; endBlock: bigint; proposalId: bigint; proposer: string; signatures: readonly Array<string>; startBlock: bigint; targets: readonly Array<string>; values: readonly Array<bigint> }>>
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.getProposalVoteCounts

Get the info about Against, For and Abstain votes of a proposal

### Example

```ts
import { getProposalVoteCounts } from "thirdweb/extensions/vote";
 
const data = await getProposalVoteCounts({ contract, proposalId });
 
// Example result
{
  for: 12000000000000000000n, // 12 tokens (with a decimals of 18) were used to vote "for"
  against: 7000000000000000000n, // 7 tokens (with a decimals of 18) were used to vote "against"
  abstain: 0n, // no user has voted abstain on this proposal
}
```

```ts
function getProposalVoteCounts(
  options: BaseTransactionOptions<ProposalVotesParams>,
): Promise<ProposalVoteInfo>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<ProposalVotesParams>;
```

### Returns

```ts
let returnType: Promise<ProposalVoteInfo>;
```

the object containing the info about Against, For and Abstain votes of a proposal Note: the count is displayed in "wei"
---

###### Connect SDK

## VOTE.getVotes

Calls the "getVotes" function on the contract.

### Example

```ts
import { getVotes } from "thirdweb/extensions/vote";
 
const result = await getVotes({
 contract,
 account: ...,
 blockNumber: ...,
});
```

```ts
function getVotes(
  options: BaseTransactionOptions<GetVotesParams>,
): Promise<bigint>;
```

### Parameters

The options for the getVotes function.

#### Type

```ts
let options: BaseTransactionOptions<GetVotesParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.getVotesWithParams

Calls the "getVotesWithParams" function on the contract.

### Example

```ts
import { getVotesWithParams } from "thirdweb/extensions/vote";
 
const result = await getVotesWithParams({
 contract,
 account: ...,
 blockNumber: ...,
 params: ...,
});
```

```ts
function getVotesWithParams(
  options: BaseTransactionOptions<GetVotesWithParamsParams>,
): Promise<bigint>;
```

### Parameters

The options for the getVotesWithParams function.

#### Type

```ts
let options: BaseTransactionOptions<GetVotesWithParamsParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.hashProposal

Calls the "hashProposal" function on the contract.

### Example

```ts
import { hashProposal } from "thirdweb/extensions/vote";
 
const result = await hashProposal({
 contract,
 targets: ...,
 values: ...,
 calldatas: ...,
 descriptionHash: ...,
});
```

```ts
function hashProposal(
  options: BaseTransactionOptions<HashProposalParams>,
): Promise<bigint>;
```

### Parameters

The options for the hashProposal function.

#### Type

```ts
let options: BaseTransactionOptions<HashProposalParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.hasVoted

Calls the "hasVoted" function on the contract.

### Example

```ts
import { hasVoted } from "thirdweb/extensions/vote";
 
const result = await hasVoted({
 contract,
 proposalId: ...,
 account: ...,
});
```

```ts
function hasVoted(
  options: BaseTransactionOptions<HasVotedParams>,
): Promise<boolean>;
```

### Parameters

The options for the hasVoted function.

#### Type

```ts
let options: BaseTransactionOptions<HasVotedParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.proposalDeadline

Calls the "proposalDeadline" function on the contract.

### Example

```ts
import { proposalDeadline } from "thirdweb/extensions/vote";
 
const result = await proposalDeadline({
 contract,
 proposalId: ...,
});
```

```ts
function proposalDeadline(
  options: BaseTransactionOptions<ProposalDeadlineParams>,
): Promise<bigint>;
```

### Parameters

The options for the proposalDeadline function.

#### Type

```ts
let options: BaseTransactionOptions<ProposalDeadlineParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.proposalExists

Check if a proposal exists based on a given proposalId

### Example

```ts
import { proposalExists } from "thirdweb/extensions/vote";
 
// Check if the proposal with proposalId `4` exists
const exists = await proposalExists({ contract, proposalId: 4n }); // either `true` or `false`
```

```ts
function proposalExists(
  options: BaseTransactionOptions<StateParams>,
): Promise<boolean>;
```

### Parameters

#### Type

```ts
let options: BaseTransactionOptions<StateParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

`true` if the proposal exists, else `false`
---

###### Connect SDK

## VOTE.proposalIndex

Calls the "proposalIndex" function on the contract.

### Example

```ts
import { proposalIndex } from "thirdweb/extensions/vote";
 
const result = await proposalIndex({
  contract,
});
```

```ts
function proposalIndex(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the proposalIndex function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.proposals

Calls the "proposals" function on the contract.

### Example

```ts
import { proposals } from "thirdweb/extensions/vote";
 
const result = await proposals({
 contract,
 key: ...,
});
```

```ts
function proposals(
  options: BaseTransactionOptions<ProposalsParams>,
): Promise<readonly [bigint, string, bigint, bigint, string]>;
```

### Parameters

The options for the proposals function.

#### Type

```ts
let options: BaseTransactionOptions<ProposalsParams>;
```

### Returns

```ts
let returnType: Promise<
  readonly [bigint, string, bigint, bigint, string]
>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.proposalSnapshot

Calls the "proposalSnapshot" function on the contract.

### Example

```ts
import { proposalSnapshot } from "thirdweb/extensions/vote";
 
const result = await proposalSnapshot({
 contract,
 proposalId: ...,
});
```

```ts
function proposalSnapshot(
  options: BaseTransactionOptions<ProposalSnapshotParams>,
): Promise<bigint>;
```

### Parameters

The options for the proposalSnapshot function.

#### Type

```ts
let options: BaseTransactionOptions<ProposalSnapshotParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.proposalThreshold

Calls the "proposalThreshold" function on the contract.

### Example

```ts
import { proposalThreshold } from "thirdweb/extensions/vote";
 
const result = await proposalThreshold({
  contract,
});
```

```ts
function proposalThreshold(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the proposalThreshold function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.proposalVotes

Calls the "proposalVotes" function on the contract.

### Example

```ts
import { proposalVotes } from "thirdweb/extensions/vote";
 
const result = await proposalVotes({
 contract,
 proposalId: ...,
});
```

```ts
function proposalVotes(
  options: BaseTransactionOptions<ProposalVotesParams>,
): Promise<readonly [bigint, bigint, bigint]>;
```

### Parameters

The options for the proposalVotes function.

#### Type

```ts
let options: BaseTransactionOptions<ProposalVotesParams>;
```

### Returns

```ts
let returnType: Promise<readonly [bigint, bigint, bigint]>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.propose

Prepares a transaction to call the "propose" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { propose } from "thirdweb/extensions/vote";
 
const transaction = propose({
 contract,
 targets: ...,
 values: ...,
 calldatas: ...,
 description: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function propose(
  options: BaseTransactionOptions<
    ProposeParams | { asyncParams: () => Promise<ProposeParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "propose" function.

#### Type

```ts
let options: BaseTransactionOptions<
  ProposeParams | { asyncParams: () => Promise<ProposeParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.quorum

Calls the "quorum" function on the contract.

### Example

```ts
import { quorum } from "thirdweb/extensions/vote";
 
const result = await quorum({
 contract,
 blockNumber: ...,
});
```

```ts
function quorum(
  options: BaseTransactionOptions<QuorumParams>,
): Promise<bigint>;
```

### Parameters

The options for the quorum function.

#### Type

```ts
let options: BaseTransactionOptions<QuorumParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.quorumDenominator

Calls the "quorumDenominator" function on the contract.

### Example

```ts
import { quorumDenominator } from "thirdweb/extensions/vote";
 
const result = await quorumDenominator({
  contract,
});
```

```ts
function quorumDenominator(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the quorumDenominator function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.quorumNumeratorByBlockNumber

Calls the "quorumDenominator" function on the contract with an extra param called `blockNumber`. This extension is similar to the `quorumDenominator` extension, except that it takes in a bigint (blockNumber)

### Example

```ts
import { quorumNumeratorByBlockNumber } from "thirdweb/extensions/vote";
 
const result = await quorumNumeratorByBlockNumber({
  contract,
  blockNumber: 13232234232n,
});
```

```ts
function quorumNumeratorByBlockNumber(
  options: BaseTransactionOptions<{ blockNumber: bigint }>,
): Promise<bigint>;
```

### Parameters

The options for the quorumDenominator function.

#### Type

```ts
let options: BaseTransactionOptions<{ blockNumber: bigint }>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.relay

Prepares a transaction to call the "relay" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { relay } from "thirdweb/extensions/vote";
 
const transaction = relay({
 contract,
 target: ...,
 value: ...,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function relay(
  options: BaseTransactionOptions<
    RelayParams | { asyncParams: () => Promise<RelayParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "relay" function.

#### Type

```ts
let options: BaseTransactionOptions<
  RelayParams | { asyncParams: () => Promise<RelayParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.setProposalThreshold

Prepares a transaction to call the "setProposalThreshold" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setProposalThreshold } from "thirdweb/extensions/vote";
 
const transaction = setProposalThreshold({
 contract,
 newProposalThreshold: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setProposalThreshold(
  options: BaseTransactionOptions<
    | SetProposalThresholdParams
    | { asyncParams: () => Promise<SetProposalThresholdParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setProposalThreshold" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetProposalThresholdParams
  | { asyncParams: () => Promise<SetProposalThresholdParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.setVotingDelay

Prepares a transaction to call the "setVotingDelay" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setVotingDelay } from "thirdweb/extensions/vote";
 
const transaction = setVotingDelay({
 contract,
 newVotingDelay: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setVotingDelay(
  options: BaseTransactionOptions<
    | SetVotingDelayParams
    | { asyncParams: () => Promise<SetVotingDelayParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setVotingDelay" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetVotingDelayParams
  | { asyncParams: () => Promise<SetVotingDelayParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.setVotingPeriod

Prepares a transaction to call the "setVotingPeriod" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { setVotingPeriod } from "thirdweb/extensions/vote";
 
const transaction = setVotingPeriod({
 contract,
 newVotingPeriod: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setVotingPeriod(
  options: BaseTransactionOptions<
    | SetVotingPeriodParams
    | { asyncParams: () => Promise<SetVotingPeriodParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setVotingPeriod" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetVotingPeriodParams
  | { asyncParams: () => Promise<SetVotingPeriodParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.state

Calls the "state" function on the contract.

### Example

```ts
import { state } from "thirdweb/extensions/vote";
 
const result = await state({
 contract,
 proposalId: ...,
});
```

```ts
function state(
  options: BaseTransactionOptions<StateParams>,
): Promise<number>;
```

### Parameters

The options for the state function.

#### Type

```ts
let options: BaseTransactionOptions<StateParams>;
```

### Returns

```ts
let returnType: Promise<number>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.token

Calls the "token" function on the contract.

### Example

```ts
import { token } from "thirdweb/extensions/vote";
 
const result = await token({
  contract,
});
```

```ts
function token(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the token function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.updateQuorumNumerator

Prepares a transaction to call the "updateQuorumNumerator" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { updateQuorumNumerator } from "thirdweb/extensions/vote";
 
const transaction = updateQuorumNumerator({
 contract,
 newQuorumNumerator: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function updateQuorumNumerator(
  options: BaseTransactionOptions<
    | UpdateQuorumNumeratorParams
    | { asyncParams: () => Promise<UpdateQuorumNumeratorParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "updateQuorumNumerator" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | UpdateQuorumNumeratorParams
  | { asyncParams: () => Promise<UpdateQuorumNumeratorParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## VOTE.votingDelay

Calls the "votingDelay" function on the contract.

### Example

```ts
import { votingDelay } from "thirdweb/extensions/vote";
 
const result = await votingDelay({
  contract,
});
```

```ts
function votingDelay(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the votingDelay function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## VOTE.votingPeriod

Calls the "votingPeriod" function on the contract.

### Example

```ts
import { votingPeriod } from "thirdweb/extensions/vote";
 
const result = await votingPeriod({
  contract,
});
```

```ts
function votingPeriod(
  options: BaseTransactionOptions,
): Promise<bigint>;
```

### Parameters

The options for the votingPeriod function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---
## MODULES
---

###### Connect SDK

## MODULES.cancelOwnershipHandover

Prepares a transaction to call the "cancelOwnershipHandover" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { cancelOwnershipHandover } from "thirdweb/extensions/modules";
 
const transaction = cancelOwnershipHandover();
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function cancelOwnershipHandover(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "cancelOwnershipHandover" function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.completeOwnershipHandover

Prepares a transaction to call the "completeOwnershipHandover" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { completeOwnershipHandover } from "thirdweb/extensions/modules";
 
const transaction = completeOwnershipHandover({
 contract,
 pendingOwner: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function completeOwnershipHandover(
  options: BaseTransactionOptions<
    | CompleteOwnershipHandoverParams
    | { asyncParams: () => Promise<CompleteOwnershipHandoverParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "completeOwnershipHandover" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | CompleteOwnershipHandoverParams
  | { asyncParams: () => Promise<CompleteOwnershipHandoverParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.getInstalledModules

Calls the "getInstalledModules" function on the contract.

### Example

```ts
import { getInstalledModules } from "thirdweb/extensions/modules";
 
const result = await getInstalledModules({
  contract,
});
```

```ts
function getInstalledModules(options: BaseTransactionOptions) : Promise<readonly Array<{ config: { callbackFunctions: readonly Array<{ selector: `0x${string}` }>; fallbackFunctions: readonly Array<{ permissionBits: bigint; selector: `0x${string}` }>; registerInstallationCallback: boolean; requiredInterfaces: readonly Array<`0x${string}`>; supportedInterfaces: readonly Array<`0x${string}`> }; implementation: string }>>
```

### Parameters

The options for the getInstalledModules function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ config: { callbackFunctions: readonly Array<{ selector: `0x${string}` }>; fallbackFunctions: readonly Array<{ permissionBits: bigint; selector: `0x${string}` }>; registerInstallationCallback: boolean; requiredInterfaces: readonly Array<`0x${string}`>; supportedInterfaces: readonly Array<`0x${string}`> }; implementation: string }>>
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.getModuleConfig

Calls the "getModuleConfig" function on the contract.

### Example

```ts
import { getModuleConfig } from "thirdweb/extensions/modules";
 
const result = await getModuleConfig({
  contract,
});
```

```ts
function getModuleConfig(options: BaseTransactionOptions) : Promise<{ callbackFunctions: readonly Array<{ selector: `0x${string}` }>; fallbackFunctions: readonly Array<{ permissionBits: bigint; selector: `0x${string}` }>; registerInstallationCallback: boolean; requiredInterfaces: readonly Array<`0x${string}`>; supportedInterfaces: readonly Array<`0x${string}`> }>
```

### Parameters

The options for the getModuleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<{ callbackFunctions: readonly Array<{ selector: `0x${string}` }>; fallbackFunctions: readonly Array<{ permissionBits: bigint; selector: `0x${string}` }>; registerInstallationCallback: boolean; requiredInterfaces: readonly Array<`0x${string}`>; supportedInterfaces: readonly Array<`0x${string}`> }>
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.getSupportedCallbackFunctions

Calls the "getSupportedCallbackFunctions" function on the contract.

### Example

```ts
import { getSupportedCallbackFunctions } from "thirdweb/extensions/modules";
 
const result = await getSupportedCallbackFunctions({
  contract,
});
```

```ts
function getSupportedCallbackFunctions(options: BaseTransactionOptions) : Promise<readonly Array<{ mode: number; selector: `0x${string}` }>>
```

### Parameters

The options for the getSupportedCallbackFunctions function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly Array<{ mode: number; selector: `0x${string}` }>>
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.grantRoles

Prepares a transaction to call the "grantRoles" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { grantRoles } from "thirdweb/extensions/modules";
 
const transaction = grantRoles({
 contract,
 user: ...,
 roles: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function grantRoles(
  options: BaseTransactionOptions<
    | GrantRolesParams
    | { asyncParams: () => Promise<GrantRolesParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "grantRoles" function.

#### Type

```ts
let options: BaseTransactionOptions<
  GrantRolesParams | { asyncParams: () => Promise<GrantRolesParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.hasAllRoles

Calls the "hasAllRoles" function on the contract.

### Example

```ts
import { hasAllRoles } from "thirdweb/extensions/modules";
 
const result = await hasAllRoles({
 contract,
 user: ...,
 roles: ...,
});
```

```ts
function hasAllRoles(
  options: BaseTransactionOptions<HasAllRolesParams>,
): Promise<boolean>;
```

### Parameters

The options for the hasAllRoles function.

#### Type

```ts
let options: BaseTransactionOptions<HasAllRolesParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.hasAnyRole

Calls the "hasAnyRole" function on the contract.

### Example

```ts
import { hasAnyRole } from "thirdweb/extensions/modules";
 
const result = await hasAnyRole({
 contract,
 user: ...,
 roles: ...,
});
```

```ts
function hasAnyRole(
  options: BaseTransactionOptions<HasAnyRoleParams>,
): Promise<boolean>;
```

### Parameters

The options for the hasAnyRole function.

#### Type

```ts
let options: BaseTransactionOptions<HasAnyRoleParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.installModule

Prepares a transaction to call the "installModule" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { installModule } from "thirdweb/extensions/modules";
 
const transaction = installModule({
 contract,
 moduleContract: ...,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function installModule(
  options: BaseTransactionOptions<
    | InstallModuleParams
    | { asyncParams: () => Promise<InstallModuleParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "installModule" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | InstallModuleParams
  | { asyncParams: () => Promise<InstallModuleParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.isGetInstalledModulesSupported

Checks if the `getInstalledModules` method is supported by the given contract.

### Example

```ts
import { isGetInstalledModulesSupported } from "thirdweb/extensions/modules";
const supported = isGetInstalledModulesSupported(["0x..."]);
```

```ts
function isGetInstalledModulesSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getInstalledModules` method is supported.
---

###### Connect SDK

## MODULES.isGetModuleConfigSupported

Checks if the `getModuleConfig` method is supported by the given contract.

### Example

```ts
import { isGetModuleConfigSupported } from "thirdweb/extensions/modules";
const supported = isGetModuleConfigSupported(["0x..."]);
```

```ts
function isGetModuleConfigSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getModuleConfig` method is supported.
---

###### Connect SDK

## MODULES.isGetSupportedCallbackFunctionsSupported

Checks if the `getSupportedCallbackFunctions` method is supported by the given contract.

### Example

```ts
import { isGetSupportedCallbackFunctionsSupported } from "thirdweb/extensions/modules";
const supported = isGetSupportedCallbackFunctionsSupported(["0x..."]);
```

```ts
function isGetSupportedCallbackFunctionsSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `getSupportedCallbackFunctions` method is supported.
---

###### Connect SDK

## MODULES.isInstallModuleSupported

Checks if the `installModule` method is supported by the given contract.

### Example

```ts
import { isInstallModuleSupported } from "thirdweb/extensions/modules";
 
const supported = isInstallModuleSupported(["0x..."]);
```

```ts
function isInstallModuleSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `installModule` method is supported.
---

###### Connect SDK

## MODULES.isUninstallModuleSupported

Checks if the `uninstallModule` method is supported by the given contract.

### Example

```ts
import { isUninstallModuleSupported } from "thirdweb/extensions/modules";
 
const supported = isUninstallModuleSupported(["0x..."]);
```

```ts
function isUninstallModuleSupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `uninstallModule` method is supported.
---

###### Connect SDK

## MODULES.moduleInstalledEvent

Creates an event object for the ModuleInstalled event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { moduleInstalledEvent } from "thirdweb/extensions/modules";
 
const events = await getContractEvents({
  contract,
  events: [moduleInstalledEvent()],
});
```

```ts
function moduleInstalledEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "caller"; readonly type: "address" },
    { readonly name: "implementation"; readonly type: "address" },
    { readonly name: "installedModule"; readonly type: "address" },
  ];
  readonly name: "ModuleInstalled";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "caller"; readonly type: "address" },
    { readonly name: "implementation"; readonly type: "address" },
    { readonly name: "installedModule"; readonly type: "address" },
  ];
  readonly name: "ModuleInstalled";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## MODULES.owner

Calls the "owner" function on the contract.

### Example

```ts
import { owner } from "thirdweb/extensions/modules";
 
const result = await owner({
  contract,
});
```

```ts
function owner(options: BaseTransactionOptions): Promise<string>;
```

### Parameters

The options for the owner function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.ownershipHandoverExpiresAt

Calls the "ownershipHandoverExpiresAt" function on the contract.

### Example

```ts
import { ownershipHandoverExpiresAt } from "thirdweb/extensions/modules";
 
const result = await ownershipHandoverExpiresAt({
 contract,
 pendingOwner: ...,
});
```

```ts
function ownershipHandoverExpiresAt(
  options: BaseTransactionOptions<OwnershipHandoverExpiresAtParams>,
): Promise<bigint>;
```

### Parameters

The options for the ownershipHandoverExpiresAt function.

#### Type

```ts
let options: BaseTransactionOptions<OwnershipHandoverExpiresAtParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.renounceOwnership

Prepares a transaction to call the "renounceOwnership" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { renounceOwnership } from "thirdweb/extensions/modules";
 
const transaction = renounceOwnership();
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function renounceOwnership(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "renounceOwnership" function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.renounceRoles

Prepares a transaction to call the "renounceRoles" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { renounceRoles } from "thirdweb/extensions/modules";
 
const transaction = renounceRoles({
 contract,
 roles: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function renounceRoles(
  options: BaseTransactionOptions<
    | RenounceRolesParams
    | { asyncParams: () => Promise<RenounceRolesParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "renounceRoles" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | RenounceRolesParams
  | { asyncParams: () => Promise<RenounceRolesParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.requestOwnershipHandover

Prepares a transaction to call the "requestOwnershipHandover" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { requestOwnershipHandover } from "thirdweb/extensions/modules";
 
const transaction = requestOwnershipHandover();
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function requestOwnershipHandover(
  options: BaseTransactionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "requestOwnershipHandover" function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.revokeRoles

Prepares a transaction to call the "revokeRoles" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { revokeRoles } from "thirdweb/extensions/modules";
 
const transaction = revokeRoles({
 contract,
 user: ...,
 roles: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function revokeRoles(
  options: BaseTransactionOptions<
    | RevokeRolesParams
    | { asyncParams: () => Promise<RevokeRolesParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "revokeRoles" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | RevokeRolesParams
  | { asyncParams: () => Promise<RevokeRolesParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.rolesOf

Calls the "rolesOf" function on the contract.

### Example

```ts
import { rolesOf } from "thirdweb/extensions/modules";
 
const result = await rolesOf({
 contract,
 user: ...,
});
```

```ts
function rolesOf(
  options: BaseTransactionOptions<RolesOfParams>,
): Promise<bigint>;
```

### Parameters

The options for the rolesOf function.

#### Type

```ts
let options: BaseTransactionOptions<RolesOfParams>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

The parsed result of the function call.
---

###### Connect SDK

## MODULES.transferOwnership

Prepares a transaction to call the "transferOwnership" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { transferOwnership } from "thirdweb/extensions/modules";
 
const transaction = transferOwnership({
 contract,
 newOwner: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function transferOwnership(
  options: BaseTransactionOptions<
    | TransferOwnershipParams
    | { asyncParams: () => Promise<TransferOwnershipParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "transferOwnership" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | TransferOwnershipParams
  | { asyncParams: () => Promise<TransferOwnershipParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.uninstallModule

Prepares a transaction to call the "uninstallModule" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { uninstallModule } from "thirdweb/extensions/modules";
 
const transaction = uninstallModule({
 contract,
 moduleContract: ...,
 data: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function uninstallModule(
  options: BaseTransactionOptions<
    | UninstallModuleParams
    | { asyncParams: () => Promise<UninstallModuleParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "uninstallModule" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | UninstallModuleParams
  | { asyncParams: () => Promise<UninstallModuleParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## MODULES.encodeMintParams

Encodes the parameters for the "encodeBytesBeforeMintERC20" function.

### Example

```ts
import { encodeEncodeBytesBeforeMintERC20Params } "thirdweb/extensions/modules";
const result = encodeEncodeBytesBeforeMintERC20Params({
 params: ...,
});
```

```ts
function encodeMintParams(
  options: EncodeBytesBeforeMintERC20Params,
): `0x${string}`;
```

### Parameters

The options for the encodeBytesBeforeMintERC20 function.

#### Type

```ts
let options: EncodeBytesBeforeMintERC20Params;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The encoded ABI parameters.
---

###### Connect SDK

## MODULES.encodeMintParams

Encodes the parameters for the "encodeBytesBeforeMintERC20" function.

### Example

```ts
import { encodeEncodeBytesBeforeMintERC20Params } "thirdweb/extensions/modules";
const result = encodeEncodeBytesBeforeMintERC20Params({
 params: ...,
});
```

```ts
function encodeMintParams(
  options: EncodeBytesBeforeMintERC20Params,
): `0x${string}`;
```

### Parameters

The options for the encodeBytesBeforeMintERC20 function.

#### Type

```ts
let options: EncodeBytesBeforeMintERC20Params;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The encoded ABI parameters.
---

###### Connect SDK

## MODULES.encodeMintParams

Encodes the parameters for the "encodeBytesBeforeMintERC721" function.

### Example

```ts
import { encodeEncodeBytesBeforeMintERC721Params } "thirdweb/extensions/modules";
const result = encodeEncodeBytesBeforeMintERC721Params({
 params: ...,
});
```

```ts
function encodeMintParams(
  options: EncodeBytesBeforeMintERC721Params,
): `0x${string}`;
```

### Parameters

The options for the encodeBytesBeforeMintERC721 function.

#### Type

```ts
let options: EncodeBytesBeforeMintERC721Params;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The encoded ABI parameters.
---
## EIP5792
---

###### Connect SDK

## EIP5792.getCallsStatus

Get the status of an [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle.

This function is dependent on the wallet's support for EIP-5792 and could fail.

### Example

```ts
import { createThirdwebClient } from "thirdweb";
 import { sendCalls, getCallsStatus } from "thirdweb/wallets/eip5792";
 
 const client = createThirdwebClient({ clientId: ... });
 
 const result = await sendCalls({ wallet, client, calls });
 
 let result;
 while (result.status !== "success") {
   result = await getCallsStatus(result);
 }
```

```ts
function getCallsStatus(
  options: GetCallsStatusOptions,
): Promise<{
  atomic: boolean;
  chainId: number;
  id: string;
  receipts?: Array<WalletCallReceipt<bigint, "success" | "reverted">>;
  status: undefined | "pending" | "success" | "failure";
  statusCode: number;
  version: string;
}>;
```

### Parameters

#### Type

```ts
let options: {
  client: ThirdwebClient;
  id: WalletSendCallsId;
  wallet: Wallet;
};
```

### Returns

```ts
let returnType: {
  blockHash: Hex;
  blockNumber: quantity;
  gasUsed: quantity;
  logs: Array<{ address: string; data: Hex; topics: Array<Hex> }>;
  status: status;
  transactionHash: Hex;
};
```

* A promise that resolves to the bundle's status and receipts (if available). GetCallsStatusResponse
---

###### Connect SDK

## EIP5792.getCapabilities

Get the capabilities of a wallet based on the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) specification.

This function is dependent on the wallet's support for EIP-5792, but will not throw._The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792._

### Example

```ts
import { getCapabilities } from "thirdweb/wallets/eip5792";
 
const wallet = createWallet("com.coinbase.wallet");
const capabilities = await getCapabilities({ wallet });
```

```ts
function getCapabilities(
  options: GetCapabilitiesOptions<ID>,
): Promise<{ message?: string }>;
```

### Parameters

#### Type

```ts
let options: GetCapabilitiesOptions<ID>;
```

### Returns

```ts
let returnType: Promise<{ message?: string }>;
```

* A promise that resolves to the capabilities of the wallet based on the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) spec.
---

###### Connect SDK

## EIP5792.sendAndConfirmCalls

Send and confirm calls in a single transaction.

This is a convenience function that sends the calls with `sendCalls` and then waits for the receipts with `waitForCallsReceipt`.

### Example

```ts
const call1 = approve({
  contract: USDT_CONTRACT,
  amount: 100,
  spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
});
const call2 = transfer({
  contract: USDT_CONTRACT,
  to: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
  amount: 100,
});
const result = await sendAndConfirmCalls({
  calls: [call1, call2],
  wallet: wallet,
});
console.log("Transaction receipts:", result.receipts);
```

```ts
function sendAndConfirmCalls(
  options: {
    atomicRequired?: boolean;
    calls: Array<PreparedSendCall<[], AbiFunction>>;
    capabilities?: WalletCapabilities;
    chain?: Readonly<ChainOptions & { rpc: string }>;
    version?: string;
    wallet: Wallet<ID>;
  } & { maxBlocksWaitTime?: number },
): Promise<{
  atomic: boolean;
  chainId: number;
  id: string;
  receipts?: Array<WalletCallReceipt<bigint, "success" | "reverted">>;
  status: undefined | "pending" | "success" | "failure";
  statusCode: number;
  version: string;
}>;
```

### Parameters

The options for sending and confirming calls.

#### Type

```ts
let options: {
  atomicRequired?: boolean;
  calls: Array<PreparedSendCall<[], AbiFunction>>;
  capabilities?: WalletCapabilities;
  chain?: Readonly<ChainOptions & { rpc: string }>;
  version?: string;
  wallet: Wallet<ID>;
} & { maxBlocksWaitTime?: number };
```

### Returns

```ts
let returnType: {
  blockHash: Hex;
  blockNumber: quantity;
  gasUsed: quantity;
  logs: Array<{ address: string; data: Hex; topics: Array<Hex> }>;
  status: status;
  transactionHash: Hex;
};
```

The receipts of the calls.
---

###### Connect SDK

## EIP5792.sendCalls

Send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This function works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions.

This function is dependent on the wallet's support for EIP-5792 and could fail.

* getCallsStatus for how to retrieve the status of the bundle.
* getCapabilities for how to retrieve the capabilities of the wallet.

### Example

```ts
import { createThirdwebClient } from "thirdweb";
import { sendCalls } from "thirdweb/wallets/eip5792";
 
const client = createThirdwebClient({ clientId: ... });
const wallet = createWallet("com.coinbase.wallet");
await wallet.connect({ client });
 
const sendTx1 = approve({
     contract: USDT_CONTRACT,
     amount: 100,
     spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6",
   });
const sendTx2 = approve({
     contract: USDT_CONTRACT,
     amount: 100,
     spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
   });
const bundleId = await sendCalls({
  wallet,
  client,
  calls: [sendTx1, sendTx2],
});
```

Sponsor transactions with a paymaster:

```ts
const bundleId = await sendCalls({
  wallet,
  client,
  calls: [send1, send2],
  capabilities: {
    paymasterService: {
      url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`,
    },
  },
});
```

We recommend proxying any paymaster calls via an API route you setup and control.

```ts
function sendCalls(options: {
  atomicRequired?: boolean;
  calls: Array<PreparedSendCall<[], AbiFunction>>;
  capabilities?: WalletCapabilities;
  chain?: Readonly<ChainOptions & { rpc: string }>;
  version?: string;
  wallet: Wallet<ID>;
}): Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  id: string;
  wallet: Wallet;
}>;
```

### Parameters

#### Type

```ts
let options: {
  atomicRequired?: boolean;
  calls: Array<PreparedSendCall<[], AbiFunction>>;
  capabilities?: WalletCapabilities;
  chain?: Readonly<ChainOptions & { rpc: string }>;
  version?: string;
  wallet: Wallet<ID>;
};
```

### Returns

```ts
let returnType: Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  id: string;
  wallet: Wallet;
}>;
```

The ID of the bundle of the calls.
---

###### Connect SDK

## EIP5792.waitForCallsReceipt

Waits for the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle to be confirmed.

This function is dependent on the wallet's support for EIP-5792 and could fail.

### Example

```ts
import { waitForCallsReceipt } from "thirdweb/wallets/eip5792";
const result = await waitForCallsReceipt({
  client,
  chain,
  wallet,
  id: "0x123...",
});
```

Example with useSendCalls:

```ts
const sendResult = await sendCalls({
  client,
  chain,
  wallet,
  calls: [...],
});
const confirmResult = await waitForCallsReceipt(sendResult);
console.log("Transaction confirmed: ", confirmResult.receipts?.[0].transactionHash);
```

```ts
function waitForCallsReceipt(options: {
  chain: Readonly;
  client: ThirdwebClient;
  id: string;
  maxBlocksWaitTime?: number;
  wallet: Wallet;
}): Promise<{
  atomic: boolean;
  chainId: number;
  id: string;
  receipts?: Array<WalletCallReceipt<bigint, "success" | "reverted">>;
  status: undefined | "pending" | "success" | "failure";
  statusCode: number;
  version: string;
}>;
```

### Parameters

The options for waiting for the bundle. By default, the max wait time is 100 blocks.

#### Type

```ts
let options: {
  chain: Readonly;
  client: ThirdwebClient;
  id: string;
  maxBlocksWaitTime?: number;
  wallet: Wallet;
};
```

### Returns

```ts
let returnType: {
  blockHash: Hex;
  blockNumber: quantity;
  gasUsed: quantity;
  logs: Array<{ address: string; data: Hex; topics: Array<Hex> }>;
  status: status;
  transactionHash: Hex;
};
```

A promise that resolves with the final getCallsStatus result.
---
## ERC7702
---

###### Connect SDK

## ERC7702.createSessionKey

Creates session key permissions for a specified address.

### Example

```ts
import { createSessionKey } from "thirdweb/wallets/in-app";
import { sendTransaction } from "thirdweb";
 
const transaction = createSessionKey({
  account: account,
  contract: accountContract,
  sessionKeyAddress: TEST_ACCOUNT_A.address,
  durationInSeconds: 86400, // 1 day
  grantFullPermissions: true,
});
 
await sendTransaction({ transaction, account });
```

```ts
function createSessionKey(
  options: BaseTransactionOptions<CreateSessionKeyOptions>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the createSessionKey function.

#### Type

```ts
let options: BaseTransactionOptions<CreateSessionKeyOptions>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction object to be sent.
---

###### Connect SDK

## ERC7702.isCreateSessionKeySupported

Checks if the `isCreateSessionKeySupported` method is supported by the given contract.

### Example

```ts
import { isCreateSessionKeySupported } from "thirdweb/extensions/erc7702";
 
const supported = isCreateSessionKeySupported(["0x..."]);
```

```ts
function isCreateSessionKeySupported(
  availableSelectors: Array<string>,
): boolean;
```

### Parameters

An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.

#### Type

```ts
let availableSelectors: Array<string>;
```

### Returns

```ts
let returnType: boolean;
```

A boolean indicating if the `isAddSessionKeySupported` method is supported.
---
# Modules
---
## BatchMetadataERC1155
---

###### Connect SDK

## BatchMetadataERC1155.batchMetadataUpdateEvent

Creates an event object for the BatchMetadataUpdate event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { BatchMetadataERC1155 } from "thirdweb/modules";
 
const events = await getContractEvents({
  contract,
  events: [BatchMetadataERC1155.batchMetadataUpdateEvent()],
});
```

```ts
function batchMetadataUpdateEvent(): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly name: "startTokenIdIncluside";
      readonly type: "uint256";
    },
    {
      readonly name: "endTokenIdInclusive";
      readonly type: "uint256";
    },
    { readonly name: "baseURI"; readonly type: "string" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly name: "startTokenIdIncluside";
      readonly type: "uint256";
    },
    {
      readonly name: "endTokenIdInclusive";
      readonly type: "uint256";
    },
    { readonly name: "baseURI"; readonly type: "string" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## BatchMetadataERC1155.encodeInstall

Encodes the install data for the BatchMetadataERC1155 module.

```ts
function encodeInstall(): string;
```

### Returns

```ts
let returnType: string;
```

* The encoded data.
---

###### Connect SDK

## BatchMetadataERC1155.install

Installs the BatchMetadataERC1155 module on a core contract.

### Example

```ts
import { BatchMetadataERC1155 } from "thirdweb/modules";
 
const transaction = BatchMetadataERC1155.install({
  contract: coreContract,
  account: account,
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## BatchMetadataERC1155.module

Convenience function to add the BatchMetadataERC1155 module as a default module on a core contract.

### Example

```ts
import {
  BatchMetadataERC1155,
  deployModularContract,
} from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC1155",
  params: {
    name: "My Modular Contract",
  },
  modules: [BatchMetadataERC1155.module()],
});
```

```ts
function module(params?: {
  publisher?: string;
}): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## BatchMetadataERC1155.uploadMetadata

Uploads metadata for a batch of NFTs.

### Example

```ts
import { BatchMetadataERC1155 } from "thirdweb/modules";
 
const transaction = BatchMetadataERC1155.uploadMetadata({
  contract,
  metadatas: [{ name: "My NFT", description: "This is my NFT" }],
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function uploadMetadata(
  options: BaseTransactionOptions<UploadMetadataParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: BaseTransactionOptions<UploadMetadataParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction to upload the metadata.
---
## BatchMetadataERC721
---

###### Connect SDK

## BatchMetadataERC721.batchMetadataUpdateEvent

Creates an event object for the BatchMetadataUpdate event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { BatchMetadataERC721 } from "thirdweb/modules";
 
const events = await getContractEvents({
  contract,
  events: [BatchMetadataERC721.batchMetadataUpdateEvent()],
});
```

```ts
function batchMetadataUpdateEvent(): PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly name: "startTokenIdIncluside";
      readonly type: "uint256";
    },
    {
      readonly name: "endTokenIdInclusive";
      readonly type: "uint256";
    },
    { readonly name: "baseURI"; readonly type: "string" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    {
      readonly name: "startTokenIdIncluside";
      readonly type: "uint256";
    },
    {
      readonly name: "endTokenIdInclusive";
      readonly type: "uint256";
    },
    { readonly name: "baseURI"; readonly type: "string" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## BatchMetadataERC721.encodeInstall

Encodes the install data for the BatchMetadataERC721 module.

```ts
function encodeInstall(): string;
```

### Returns

```ts
let returnType: string;
```

* The encoded data.
---

###### Connect SDK

## BatchMetadataERC721.install

Installs the BatchMetadataERC721 module on a core contract.

### Example

```ts
import { BatchMetadataERC721 } from "thirdweb/modules";
 
const transaction = BatchMetadataERC721.install({
  contract: coreContract,
  account: account,
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## BatchMetadataERC721.module

Convenience function to add the BatchMetadataERC721 module as a default module on a core contract.

### Example

```ts
import {
  BatchMetadataERC721,
  deployModularContract,
} from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC721",
  params: {
    name: "My Modular Contract",
  },
  modules: [BatchMetadataERC721.module()],
});
```

```ts
function module(params?: {
  publisher?: string;
}): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## BatchMetadataERC721.uploadMetadata

Uploads metadata for a batch of NFTs.

### Example

```ts
import { BatchMetadataERC721 } from "thirdweb/modules";
 
const transaction = BatchMetadataERC721.uploadMetadata({
  contract,
  metadatas: [{ name: "My NFT", description: "This is my NFT" }],
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function uploadMetadata(
  options: BaseTransactionOptions<UploadMetadataParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the transaction.

#### Type

```ts
let options: BaseTransactionOptions<UploadMetadataParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

The transaction to upload the metadata.
---
## ClaimableERC1155
---

###### Connect SDK

## ClaimableERC1155.encodeInstall

Encodes the install data for the ClaimableERC1155 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## ClaimableERC1155.getClaimCondition

Calls the "getClaimConditionByTokenId" function on the contract.

### Example

```ts
import { ClaimableERC1155 } from "thirdweb/modules";
 
const result = await ClaimableERC1155.getClaimConditionByTokenId({
 contract,
 tokenId: ...,
});
```

```ts
function getClaimCondition(
  options: BaseTransactionOptions<GetClaimConditionByTokenIdParams>,
): Promise<{
  allowlistMerkleRoot: `0x${string}`;
  auxData: string;
  availableSupply: bigint;
  currency: string;
  endTimestamp: number;
  maxMintPerWallet: bigint;
  pricePerUnit: bigint;
  startTimestamp: number;
}>;
```

### Parameters

The options for the getClaimConditionByTokenId function.

#### Type

```ts
let options: BaseTransactionOptions<GetClaimConditionByTokenIdParams>;
```

### Returns

```ts
let returnType: Promise<{
  allowlistMerkleRoot: `0x${string}`;
  auxData: string;
  availableSupply: bigint;
  currency: string;
  endTimestamp: number;
  maxMintPerWallet: bigint;
  pricePerUnit: bigint;
  startTimestamp: number;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## ClaimableERC1155.getSaleConfig

Calls the "getSaleConfig" function on the contract.

### Example

```ts
import { ClaimableERC1155 } from "thirdweb/modules";
 
const result = await ClaimableERC1155.getSaleConfig({
  contract,
});
```

```ts
function getSaleConfig(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getSaleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ClaimableERC1155.install

Installs the ClaimableERC1155 module on a core contract.

### Example

```ts
import { ClaimableERC1155 } from "thirdweb/modules";
 
const transaction  = ClaimableERC1155.install({
 contract: coreContract,
 account: account,
 params: {
    primarySaleRecipient: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## ClaimableERC1155.mint

Mints ERC1155 tokens to a specified address via a ClaimableERC1155 module.

### Example

```typescript
import { ClaimableERC1155 } from "thirdweb/modules";
 
const transaction = ClaimableERC1155.mint({
  contract,
  to: "0x...", // Address to mint tokens to
  quantity: 2, // Amount of tokens to mint
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mint(
  options: BaseTransactionOptions<MintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<MintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## ClaimableERC1155.module

Convenience function to add the ClaimableERC1155 module as a default module on a core contract.

### Example

```ts
import { ClaimableERC1155, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC1155",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    ClaimableERC1155.module({
       primarySaleRecipient: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## ClaimableERC1155.setClaimCondition

Sets the claim conditions for a given token ID.

### Example

```ts
import { ClaimableERC1155 } from "thirdweb/modules";
 
const transaction = ClaimableERC1155.setClaimCondition({
  contract: contract,
  tokenId: 0n,
  pricePerToken: "1", // in ETH
  maxClaimableSupply: "1000000",
  maxClaimablePerWallet: "1",
});
 
await sendTransaction({ transaction, account });
```

```ts
function setClaimCondition(
  options: BaseTransactionOptions<
    ClaimConditionInput & { tokenId: bigint }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for setting the claim conditions.

#### Type

```ts
let options: BaseTransactionOptions<
  ClaimConditionInput & { tokenId: bigint }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to set the claim conditions.
---

###### Connect SDK

## ClaimableERC1155.setSaleConfig

Prepares a transaction to call the "setSaleConfig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { ClaimableERC1155 } from "thirdweb/modules";
 
const transaction = ClaimableERC1155.setSaleConfig({
 contract,
 primarySaleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSaleConfig(
  options: BaseTransactionOptions<
    | SetSaleConfigParams
    | { asyncParams: () => Promise<SetSaleConfigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSaleConfig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSaleConfigParams
  | { asyncParams: () => Promise<SetSaleConfigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## ClaimableERC20
---

###### Connect SDK

## ClaimableERC20.encodeInstall

Encodes the install data for the ClaimableERC20 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## ClaimableERC20.getClaimCondition

Calls the "getClaimCondition" function on the contract.

### Example

```ts
import { ClaimableERC20 } from "thirdweb/modules";
 
const result = await ClaimableERC20.getClaimCondition({
  contract,
});
```

```ts
function getClaimCondition(
  options: BaseTransactionOptions,
): Promise<{
  allowlistMerkleRoot: `0x${string}`;
  auxData: string;
  availableSupply: bigint;
  currency: string;
  endTimestamp: number;
  maxMintPerWallet: bigint;
  pricePerUnit: bigint;
  startTimestamp: number;
}>;
```

### Parameters

The options for the getClaimCondition function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<{
  allowlistMerkleRoot: `0x${string}`;
  auxData: string;
  availableSupply: bigint;
  currency: string;
  endTimestamp: number;
  maxMintPerWallet: bigint;
  pricePerUnit: bigint;
  startTimestamp: number;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## ClaimableERC20.getSaleConfig

Calls the "getSaleConfig" function on the contract.

### Example

```ts
import { ClaimableERC20 } from "thirdweb/modules";
 
const result = await ClaimableERC20.getSaleConfig({
  contract,
});
```

```ts
function getSaleConfig(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getSaleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ClaimableERC20.install

Installs the ClaimableERC20 module on a core contract.

### Example

```ts
import { ClaimableERC20 } from "thirdweb/modules";
 
const transaction  = ClaimableERC20.install({
 contract: coreContract,
 account: account,
 params: {
    primarySaleRecipient: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## ClaimableERC20.mint

Mints tokens to a specified address via a ClaimableERC20 module.

### Example

```typescript
import { ClaimableERC20 } from "thirdweb/modules";
 
const transaction = ClaimableERC20.mint({
  contract,
  to: "0x...", // Address to mint tokens to
  quantity: "0.1", // Amount of tokens to mint (in decimals)
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mint(
  options: BaseTransactionOptions<MintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<MintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## ClaimableERC20.module

Convenience function to add the ClaimableERC20 module as a default module on a core contract.

### Example

```ts
import { ClaimableERC20, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC20",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    ClaimableERC20.module({
       primarySaleRecipient: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## ClaimableERC20.setClaimCondition

Sets the claim conditions for a given token ID.

### Example

```ts
import { ClaimableERC20 } from "thirdweb/modules";
 
const transaction = ClaimableERC20.setClaimCondition({
  contract: contract,
  pricePerToken: "1", // in ETH
  maxClaimableSupply: "1000000",
  maxClaimablePerWallet: "1",
});
 
await sendTransaction({ transaction, account });
```

```ts
function setClaimCondition(
  options: BaseTransactionOptions<ClaimConditionInput>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for setting the claim conditions.

#### Type

```ts
let options: BaseTransactionOptions<ClaimConditionInput>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to set the claim conditions.
---

###### Connect SDK

## ClaimableERC20.setSaleConfig

Prepares a transaction to call the "setSaleConfig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { ClaimableERC20 } from "thirdweb/modules";
 
const transaction = ClaimableERC20.setSaleConfig({
 contract,
 primarySaleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSaleConfig(
  options: BaseTransactionOptions<
    | SetSaleConfigParams
    | { asyncParams: () => Promise<SetSaleConfigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSaleConfig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSaleConfigParams
  | { asyncParams: () => Promise<SetSaleConfigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## ClaimableERC721
---

###### Connect SDK

## ClaimableERC721.encodeInstall

Encodes the install data for the ClaimableERC721 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## ClaimableERC721.getClaimCondition

Calls the "getClaimCondition" function on the contract.

### Example

```ts
import { ClaimableERC721 } from "thirdweb/modules";
 
const result = await ClaimableERC721.getClaimCondition({
  contract,
});
```

```ts
function getClaimCondition(
  options: BaseTransactionOptions,
): Promise<{
  allowlistMerkleRoot: `0x${string}`;
  auxData: string;
  availableSupply: bigint;
  currency: string;
  endTimestamp: number;
  maxMintPerWallet: bigint;
  pricePerUnit: bigint;
  startTimestamp: number;
}>;
```

### Parameters

The options for the getClaimCondition function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<{
  allowlistMerkleRoot: `0x${string}`;
  auxData: string;
  availableSupply: bigint;
  currency: string;
  endTimestamp: number;
  maxMintPerWallet: bigint;
  pricePerUnit: bigint;
  startTimestamp: number;
}>;
```

The parsed result of the function call.
---

###### Connect SDK

## ClaimableERC721.getSaleConfig

Calls the "getSaleConfig" function on the contract.

### Example

```ts
import { ClaimableERC721 } from "thirdweb/modules";
 
const result = await ClaimableERC721.getSaleConfig({
  contract,
});
```

```ts
function getSaleConfig(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getSaleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## ClaimableERC721.install

Installs the ClaimableERC721 module on a core contract.

### Example

```ts
import { ClaimableERC721 } from "thirdweb/modules";
 
const transaction  = ClaimableERC721.install({
 contract: coreContract,
 account: account,
 params: {
    primarySaleRecipient: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## ClaimableERC721.mint

Mints ERC721 tokens to a specified address via a ClaimableERC721 module.

### Example

```typescript
import { ClaimableERC721 } from "thirdweb/modules";
 
const transaction = ClaimableERC721.mint({
  contract,
  to: "0x...", // Address to mint tokens to
  quantity: 2, // Amount of tokens to mint
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mint(
  options: BaseTransactionOptions<MintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<MintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## ClaimableERC721.module

Convenience function to add the ClaimableERC721 module as a default module on a core contract.

### Example

```ts
import { ClaimableERC721, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC721",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    ClaimableERC721.module({
       primarySaleRecipient: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## ClaimableERC721.setClaimCondition

Sets the claim conditions for a given token ID.

### Example

```ts
import { ClaimableERC721 } from "thirdweb/modules";
 
const transaction = ClaimableERC721.setClaimCondition({
  contract: contract,
  pricePerToken: "1", // in ETH
  maxClaimableSupply: "1000000",
  maxClaimablePerWallet: "1",
});
 
await sendTransaction({ transaction, account });
```

```ts
function setClaimCondition(
  options: BaseTransactionOptions<ClaimConditionInput>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for setting the claim conditions.

#### Type

```ts
let options: BaseTransactionOptions<ClaimConditionInput>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to set the claim conditions.
---

###### Connect SDK

## ClaimableERC721.setSaleConfig

Prepares a transaction to call the "setSaleConfig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { ClaimableERC721 } from "thirdweb/modules";
 
const transaction = ClaimableERC721.setSaleConfig({
 contract,
 primarySaleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSaleConfig(
  options: BaseTransactionOptions<
    | SetSaleConfigParams
    | { asyncParams: () => Promise<SetSaleConfigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSaleConfig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSaleConfigParams
  | { asyncParams: () => Promise<SetSaleConfigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## MintableERC1155
---

###### Connect SDK

## MintableERC1155.encodeInstall

Encodes the install data for the MintableERC1155 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## MintableERC1155.generateMintSignature

Generates a payload and signature for minting ERC1155 tokens with a signature.

### Example

```typescript
import { MintableERC1155 } from "thirdweb/modules";
 
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
  await MintableERC1155.generateMintSignature({
    account,
    contract,
    nft: {
      name: "My NFT",
      description: "This is my NFT",
      image: "ipfs://...",
    },
    mintRequest: {
      recipient: "0x...",
      quantity: "10",
    },
  });
 
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC1155.mintWithSignature({
  contract,
  payload,
  signature,
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function generateMintSignature(
  options: GenerateMintSignatureOptions,
): Promise<{
  payload: {
    amount: bigint;
    baseURI: string;
    data: `0x${string}`;
    to: `0x${string}`;
    tokenId: bigint;
  };
  signature: `0x${string}`;
}>;
```

### Parameters

The options for generating the payload and signature.

#### Type

```ts
let options: {
  account: Account;
  contract: ThirdwebContract;
  contractType?: "TokenERC1155" | "SignatureMintERC1155";
  mintRequest: GeneratePayloadInput;
};
```

### Returns

```ts
let returnType: Promise<{
  payload: {
    amount: bigint;
    baseURI: string;
    data: `0x${string}`;
    to: `0x${string}`;
    tokenId: bigint;
  };
  signature: `0x${string}`;
}>;
```

The payload and signature.
---

###### Connect SDK

## MintableERC1155.getSaleConfig

Calls the "getSaleConfig" function on the contract.

### Example

```ts
import { MintableERC1155 } from "thirdweb/modules";
 
const result = await MintableERC1155.getSaleConfig({
  contract,
});
```

```ts
function getSaleConfig(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getSaleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## MintableERC1155.install

Installs the MintableERC1155 module on a core contract.

### Example

```ts
import { MintableERC1155 } from "thirdweb/modules";
 
const transaction  = MintableERC1155.install({
 contract: coreContract,
 account: account,
 params: {
    primarySaleRecipient: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## MintableERC1155.mintWithRole

Mints ERC1155 tokens to a specified address via a MintableERC1155 module.

### Example

```typescript
import { MintableERC1155 } from "thirdweb/modules";
 
const transaction = MintableERC1155.mintWithRole({
  contract,
  to: "0x...", // Address to mint tokens to
  amount: 2, // Amount of tokens to mint
  nft: {
    name: "My NFT",
    description: "This is my NFT",
    image: "ipfs://...",
  },
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mintWithRole(
  options: BaseTransactionOptions<EditionMintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<EditionMintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC1155.mintWithSignature

Mints ERC1155 tokens to a specified address with a signature via a MintableERC1155 module.

### Example

```typescript
import { MintableERC1155 } from "thirdweb/modules";
 
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
  await MintableERC1155.generateMintSignature({
    account,
    contract,
    nft: {
      name: "My NFT",
      description: "This is my NFT",
      image: "ipfs://...",
    },
    mintRequest: {
      recipient: "0x...",
      quantity: "10",
    },
  });
 
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC1155.mintWithSignature({
  contract,
  payload,
  signature,
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mintWithSignature(
  options: BaseTransactionOptions<{
    payload: {
      amount: bigint;
      baseURI: string;
      data: `0x${string}`;
      to: `0x${string}`;
      tokenId: bigint;
    };
    signature: `0x${string}`;
  }>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<{
  payload: {
    amount: bigint;
    baseURI: string;
    data: `0x${string}`;
    to: `0x${string}`;
    tokenId: bigint;
  };
  signature: `0x${string}`;
}>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC1155.module

Convenience function to add the MintableERC1155 module as a default module on a core contract.

### Example

```ts
import { MintableERC1155, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC1155",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    MintableERC1155.module({
       primarySaleRecipient: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## MintableERC1155.setSaleConfig

Prepares a transaction to call the "setSaleConfig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { MintableERC1155 } from "thirdweb/modules";
 
const transaction = MintableERC1155.setSaleConfig({
 contract,
 primarySaleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSaleConfig(
  options: BaseTransactionOptions<
    | SetSaleConfigParams
    | { asyncParams: () => Promise<SetSaleConfigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSaleConfig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSaleConfigParams
  | { asyncParams: () => Promise<SetSaleConfigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## MintableERC20
---

###### Connect SDK

## MintableERC20.encodeInstall

Encodes the install data for the MintableERC20 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## MintableERC20.generateMintSignature

Generates a mint signature for a given mint request to be used with a MintableERC20 module.

### Example

```typescript
import { MintableERC20 } from "thirdweb/modules";
 
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
  await MintableERC20.generateMintSignature({
    account,
    contract,
    mintRequest: {
      recipient: "0x...",
      quantity: "10",
    },
  });
 
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC20.mintWithSignature({
  contract,
  payload,
  signature,
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function generateMintSignature(
  options: GenerateMintSignatureOptions,
): Promise<{
  payload: { amount: bigint; data: `0x${string}`; to: `0x${string}` };
  signature: `0x${string}`;
}>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: {
  account: Account;
  contract: ThirdwebContract;
  contractType?: "TokenERC1155" | "SignatureMintERC1155";
  mintRequest: GeneratePayloadInput;
};
```

### Returns

```ts
let returnType: Promise<{
  payload: { amount: bigint; data: `0x${string}`; to: `0x${string}` };
  signature: `0x${string}`;
}>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC20.getSaleConfig

Calls the "getSaleConfig" function on the contract.

### Example

```ts
import { MintableERC20 } from "thirdweb/modules";
 
const result = await MintableERC20.getSaleConfig({
  contract,
});
```

```ts
function getSaleConfig(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getSaleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## MintableERC20.install

Installs the MintableERC20 module on a core contract.

### Example

```ts
import { MintableERC20 } from "thirdweb/modules";
 
const transaction  = MintableERC20.install({
 contract: coreContract,
 account: account,
 params: {
    primarySaleRecipient: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## MintableERC20.mintWithRole

Mints ERC20 tokens to a specified address via a MintableERC20 module.

### Example

```typescript
import { MintableERC20 } from "thirdweb/modules";
 
const transaction = MintableERC20.mintWithRole({
  contract,
  to: "0x...", // Address to mint tokens to
  quantity: 2, // Amount of tokens to mint (in decimals)
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mintWithRole(
  options: BaseTransactionOptions<TokenMintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<TokenMintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC20.mintWithSignature

Mints ERC20 tokens to a specified address with a signature via a MintableERC20 module.

### Example

```typescript
import { MintableERC20 } from "thirdweb/modules";
 
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
  await MintableERC20.generateMintSignature({
    account,
    contract,
    mintRequest: {
      recipient: "0x...",
      quantity: "10",
    },
  });
 
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC20.mintWithSignature({
  contract,
  payload,
  signature,
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mintWithSignature(
  options: BaseTransactionOptions<{
    payload: {
      amount: bigint;
      data: `0x${string}`;
      to: `0x${string}`;
    };
    signature: `0x${string}`;
  }>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<{
  payload: { amount: bigint; data: `0x${string}`; to: `0x${string}` };
  signature: `0x${string}`;
}>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC20.module

Convenience function to add the MintableERC20 module as a default module on a core contract.

### Example

```ts
import { MintableERC20, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC20",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    MintableERC20.module({
       primarySaleRecipient: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## MintableERC20.setSaleConfig

Prepares a transaction to call the "setSaleConfig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { MintableERC20 } from "thirdweb/modules";
 
const transaction = MintableERC20.setSaleConfig({
 contract,
 primarySaleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSaleConfig(
  options: BaseTransactionOptions<
    | SetSaleConfigParams
    | { asyncParams: () => Promise<SetSaleConfigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSaleConfig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSaleConfigParams
  | { asyncParams: () => Promise<SetSaleConfigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## MintableERC721
---

###### Connect SDK

## MintableERC721.encodeInstall

Encodes the install data for the MintableERC721 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## MintableERC721.generateMintSignature

Generates a payload and signature for minting ERC721 tokens via a MintableERC721 module.

### Example

```typescript
import { MintableERC20 } from "thirdweb/modules";
 
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
  await MintableERC721.generateMintSignature({
    account,
    contract,
    nfts: [
      {
        name: "My NFT",
        description: "My NFT",
        image: "https://example.com/image.png",
      },
    ],
    mintRequest: {
      recipient: "0x...",
    },
  });
 
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC20.mintWithSignature({
  contract,
  payload,
  signature,
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function generateMintSignature(
  options: GenerateMintSignatureOptions,
): Promise<{
  payload: {
    amount: bigint;
    baseURI: string;
    data: `0x${string}`;
    to: `0x${string}`;
  };
  signature: `0x${string}`;
}>;
```

### Parameters

The options for generating the payload and signature.

#### Type

```ts
let options: {
  account: Account;
  contract: ThirdwebContract;
  contractType?: "TokenERC1155" | "SignatureMintERC1155";
  mintRequest: GeneratePayloadInput;
};
```

### Returns

```ts
let returnType: Promise<{
  payload: {
    amount: bigint;
    baseURI: string;
    data: `0x${string}`;
    to: `0x${string}`;
  };
  signature: `0x${string}`;
}>;
```

The payload and signature.
---

###### Connect SDK

## MintableERC721.getSaleConfig

Calls the "getSaleConfig" function on the contract.

### Example

```ts
import { MintableERC721 } from "thirdweb/modules";
 
const result = await MintableERC721.getSaleConfig({
  contract,
});
```

```ts
function getSaleConfig(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getSaleConfig function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## MintableERC721.install

Installs the MintableERC721 module on a core contract.

### Example

```ts
import { MintableERC721 } from "thirdweb/modules";
 
const transaction  = MintableERC721.install({
 contract: coreContract,
 account: account,
 params: {
    primarySaleRecipient: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## MintableERC721.mintWithRole

Mints ERC721 tokens to a specified address via a MintableERC721 module.

### Example

```typescript
import { MintableERC721 } from "thirdweb/modules";
 
const transaction = MintableERC721.mintWithRole({
  contract,
  to: "0x...", // Address to mint tokens to
  nfts: [
    {
      name: "My NFT",
      description: "This is my NFT",
      image: "ipfs://...",
    },
  ],
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mintWithRole(
  options: BaseTransactionOptions<NFTMintParams>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<NFTMintParams>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC721.mintWithSignature

Mints ERC721 tokens to a specified address with a signature via a MintableERC721 module.

### Example

```typescript
import { MintableERC721 } from "thirdweb/modules";
 
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
  await MintableERC721.generateMintSignature({
    account,
    contract,
    nfts: [
      {
        name: "My NFT",
        description: "My NFT",
        image: "https://example.com/image.png",
      },
    ],
    mintRequest: {
      recipient: "0x...",
    },
  });
 
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC721.mintWithSignature({
  contract,
  payload,
  signature,
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function mintWithSignature(
  options: BaseTransactionOptions<{
    payload: {
      amount: bigint;
      baseURI: string;
      data: `0x${string}`;
      to: `0x${string}`;
    };
    signature: `0x${string}`;
  }>,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for minting tokens.

#### Type

```ts
let options: BaseTransactionOptions<{
  payload: {
    amount: bigint;
    baseURI: string;
    data: `0x${string}`;
    to: `0x${string}`;
  };
  signature: `0x${string}`;
}>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A transaction to mint tokens.
---

###### Connect SDK

## MintableERC721.module

Convenience function to add the MintableERC721 module as a default module on a core contract.

### Example

```ts
import { MintableERC721, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC721",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    MintableERC721.module({
       primarySaleRecipient: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## MintableERC721.setSaleConfig

Prepares a transaction to call the "setSaleConfig" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { MintableERC721 } from "thirdweb/modules";
 
const transaction = MintableERC721.setSaleConfig({
 contract,
 primarySaleRecipient: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSaleConfig(
  options: BaseTransactionOptions<
    | SetSaleConfigParams
    | { asyncParams: () => Promise<SetSaleConfigParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSaleConfig" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSaleConfigParams
  | { asyncParams: () => Promise<SetSaleConfigParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## OpenEditionMetadataERC721
---

###### Connect SDK

## OpenEditionMetadataERC721.batchMetadataUpdateEvent

Creates an event object for the BatchMetadataUpdate event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { OpenEditionMetadataERC721 } from "thirdweb/modules";
 
const events = await getContractEvents({
  contract,
  events: [OpenEditionMetadataERC721.batchMetadataUpdateEvent()],
});
```

```ts
function batchMetadataUpdateEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "_fromTokenId"; readonly type: "uint256" },
    { readonly name: "_toTokenId"; readonly type: "uint256" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "_fromTokenId"; readonly type: "uint256" },
    { readonly name: "_toTokenId"; readonly type: "uint256" },
  ];
  readonly name: "BatchMetadataUpdate";
  readonly type: "event";
}>;
```

The prepared event object.
---

###### Connect SDK

## OpenEditionMetadataERC721.encodeInstall

Encodes the install data for the OpenEditionMetadataERC721 module.

```ts
function encodeInstall(): string;
```

### Returns

```ts
let returnType: string;
```

* The encoded data.
---

###### Connect SDK

## OpenEditionMetadataERC721.install

Installs the OpenEditionMetadataERC721 module on a core contract.

### Example

```ts
import { OpenEditionMetadataERC721 } from "thirdweb/modules";
 
const transaction = OpenEditionMetadataERC721.install({
  contract: coreContract,
  account: account,
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## OpenEditionMetadataERC721.module

Convenience function to add the OpenEditionMetadataERC721 module as a default module on a core contract.

### Example

```ts
import {
  OpenEditionMetadataERC721,
  deployModularContract,
} from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC721",
  params: {
    name: "My Modular Contract",
  },
  modules: [OpenEditionMetadataERC721.module()],
});
```

```ts
function module(params?: {
  publisher?: string;
}): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## OpenEditionMetadataERC721.setSharedMetadata

Prepares a transaction to call the "setSharedMetadata" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { OpenEditionMetadataERC721 } from "thirdweb/modules";
 
const transaction = OpenEditionMetadataERC721.setSharedMetadata({
 contract,
 metadata: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setSharedMetadata(
  options: BaseTransactionOptions<
    | SetSharedMetadataParams
    | { asyncParams: () => Promise<SetSharedMetadataParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setSharedMetadata" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetSharedMetadataParams
  | { asyncParams: () => Promise<SetSharedMetadataParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## OpenEditionMetadataERC721.sharedMetadataUpdatedEvent

Creates an event object for the SharedMetadataUpdated event.

### Example

```ts
import { getContractEvents } from "thirdweb";
import { OpenEditionMetadataERC721 } from "thirdweb/modules";
 
const events = await getContractEvents({
  contract,
  events: [OpenEditionMetadataERC721.sharedMetadataUpdatedEvent()],
});
```

```ts
function sharedMetadataUpdatedEvent(): PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "name"; readonly type: "string" },
    { readonly name: "description"; readonly type: "string" },
    { readonly name: "imageURI"; readonly type: "string" },
    { readonly name: "animationURI"; readonly type: "string" },
  ];
  readonly name: "SharedMetadataUpdated";
  readonly type: "event";
}>;
```

### Returns

```ts
let returnType: PreparedEvent<{
  readonly inputs: readonly [
    { readonly name: "name"; readonly type: "string" },
    { readonly name: "description"; readonly type: "string" },
    { readonly name: "imageURI"; readonly type: "string" },
    { readonly name: "animationURI"; readonly type: "string" },
  ];
  readonly name: "SharedMetadataUpdated";
  readonly type: "event";
}>;
```

The prepared event object.
---
## RoyaltyERC1155
---

###### Connect SDK

## RoyaltyERC1155.encodeInstall

Encodes the install data for the RoyaltyERC1155 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## RoyaltyERC1155.getDefaultRoyaltyInfo

Calls the "getDefaultRoyaltyInfo" function on the contract.

### Example

```ts
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const result = await RoyaltyERC1155.getDefaultRoyaltyInfo({
  contract,
});
```

```ts
function getDefaultRoyaltyInfo(
  options: BaseTransactionOptions,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getDefaultRoyaltyInfo function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC1155.getRoyaltyInfoForToken

Calls the "getRoyaltyInfoForToken" function on the contract.

### Example

```ts
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const result = await RoyaltyERC1155.getRoyaltyInfoForToken({
 contract,
 tokenId: ...,
});
```

```ts
function getRoyaltyInfoForToken(
  options: BaseTransactionOptions<GetRoyaltyInfoForTokenParams>,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getRoyaltyInfoForToken function.

#### Type

```ts
let options: BaseTransactionOptions<GetRoyaltyInfoForTokenParams>;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC1155.getTransferValidationFunction

Calls the "getTransferValidationFunction" function on the contract.

### Example

```ts
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const result = await RoyaltyERC1155.getTransferValidationFunction({
  contract,
});
```

```ts
function getTransferValidationFunction(
  options: BaseTransactionOptions,
): Promise<readonly [`0x${string}`, boolean]>;
```

### Parameters

The options for the getTransferValidationFunction function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [`0x${string}`, boolean]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC1155.getTransferValidator

Calls the "getTransferValidator" function on the contract.

### Example

```ts
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const result = await RoyaltyERC1155.getTransferValidator({
  contract,
});
```

```ts
function getTransferValidator(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getTransferValidator function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC1155.install

Installs the RoyaltyERC1155 module on a core contract.

### Example

```ts
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const transaction  = RoyaltyERC1155.install({
 contract: coreContract,
 account: account,
 params: {
    royaltyRecipient: ...,
    royaltyBps: ...,
    transferValidator: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## RoyaltyERC1155.module

Convenience function to add the RoyaltyERC1155 module as a default module on a core contract.

### Example

```ts
import { RoyaltyERC1155, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC1155",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    RoyaltyERC1155.module({
       royaltyRecipient: ...,
       royaltyBps: ...,
       transferValidator: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## RoyaltyERC1155.royaltyInfo

Calls the "royaltyInfo" function on the contract.

### Example

```ts
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const result = await RoyaltyERC1155.royaltyInfo({
 contract,
 tokenId: ...,
 salePrice: ...,
});
```

```ts
function royaltyInfo(
  options: BaseTransactionOptions<RoyaltyInfoParams>,
): Promise<readonly [string, bigint]>;
```

### Parameters

The options for the royaltyInfo function.

#### Type

```ts
let options: BaseTransactionOptions<RoyaltyInfoParams>;
```

### Returns

```ts
let returnType: Promise<readonly [string, bigint]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC1155.setDefaultRoyaltyInfo

Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const transaction = RoyaltyERC1155.setDefaultRoyaltyInfo({
 contract,
 royaltyRecipient: ...,
 royaltyBps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setDefaultRoyaltyInfo(
  options: BaseTransactionOptions<
    | SetDefaultRoyaltyInfoParams
    | { asyncParams: () => Promise<SetDefaultRoyaltyInfoParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setDefaultRoyaltyInfo" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetDefaultRoyaltyInfoParams
  | { asyncParams: () => Promise<SetDefaultRoyaltyInfoParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## RoyaltyERC1155.setRoyaltyInfoForToken

Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const transaction = RoyaltyERC1155.setRoyaltyInfoForToken({
 contract,
 tokenId: ...,
 recipient: ...,
 bps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setRoyaltyInfoForToken(
  options: BaseTransactionOptions<
    | SetRoyaltyInfoForTokenParams
    | { asyncParams: () => Promise<SetRoyaltyInfoForTokenParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setRoyaltyInfoForToken" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetRoyaltyInfoForTokenParams
  | { asyncParams: () => Promise<SetRoyaltyInfoForTokenParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## RoyaltyERC1155.setTransferValidator

Prepares a transaction to call the "setTransferValidator" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { RoyaltyERC1155 } from "thirdweb/modules";
 
const transaction = RoyaltyERC1155.setTransferValidator({
 contract,
 validator: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferValidator(
  options: BaseTransactionOptions<
    | SetTransferValidatorParams
    | { asyncParams: () => Promise<SetTransferValidatorParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferValidator" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferValidatorParams
  | { asyncParams: () => Promise<SetTransferValidatorParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## RoyaltyERC721
---

###### Connect SDK

## RoyaltyERC721.encodeInstall

Encodes the install data for the RoyaltyERC721 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## RoyaltyERC721.getDefaultRoyaltyInfo

Calls the "getDefaultRoyaltyInfo" function on the contract.

### Example

```ts
import { RoyaltyERC721 } from "thirdweb/modules";
 
const result = await RoyaltyERC721.getDefaultRoyaltyInfo({
  contract,
});
```

```ts
function getDefaultRoyaltyInfo(
  options: BaseTransactionOptions,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getDefaultRoyaltyInfo function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC721.getRoyaltyInfoForToken

Calls the "getRoyaltyInfoForToken" function on the contract.

### Example

```ts
import { RoyaltyERC721 } from "thirdweb/modules";
 
const result = await RoyaltyERC721.getRoyaltyInfoForToken({
 contract,
 tokenId: ...,
});
```

```ts
function getRoyaltyInfoForToken(
  options: BaseTransactionOptions<GetRoyaltyInfoForTokenParams>,
): Promise<readonly [string, number]>;
```

### Parameters

The options for the getRoyaltyInfoForToken function.

#### Type

```ts
let options: BaseTransactionOptions<GetRoyaltyInfoForTokenParams>;
```

### Returns

```ts
let returnType: Promise<readonly [string, number]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC721.getTransferValidationFunction

Calls the "getTransferValidationFunction" function on the contract.

### Example

```ts
import { RoyaltyERC721 } from "thirdweb/modules";
 
const result = await RoyaltyERC721.getTransferValidationFunction({
  contract,
});
```

```ts
function getTransferValidationFunction(
  options: BaseTransactionOptions,
): Promise<readonly [`0x${string}`, boolean]>;
```

### Parameters

The options for the getTransferValidationFunction function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<readonly [`0x${string}`, boolean]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC721.getTransferValidator

Calls the "getTransferValidator" function on the contract.

### Example

```ts
import { RoyaltyERC721 } from "thirdweb/modules";
 
const result = await RoyaltyERC721.getTransferValidator({
  contract,
});
```

```ts
function getTransferValidator(
  options: BaseTransactionOptions,
): Promise<string>;
```

### Parameters

The options for the getTransferValidator function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<string>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC721.install

Installs the RoyaltyERC721 module on a core contract.

### Example

```ts
import { RoyaltyERC721 } from "thirdweb/modules";
 
const transaction  = RoyaltyERC721.install({
 contract: coreContract,
 account: account,
 params: {
    royaltyRecipient: ...,
    royaltyBps: ...,
    transferValidator: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## RoyaltyERC721.module

Convenience function to add the RoyaltyERC721 module as a default module on a core contract.

### Example

```ts
import { RoyaltyERC721, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC721",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    RoyaltyERC721.module({
       royaltyRecipient: ...,
       royaltyBps: ...,
       transferValidator: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## RoyaltyERC721.royaltyInfo

Calls the "royaltyInfo" function on the contract.

### Example

```ts
import { RoyaltyERC721 } from "thirdweb/modules";
 
const result = await RoyaltyERC721.royaltyInfo({
 contract,
 tokenId: ...,
 salePrice: ...,
});
```

```ts
function royaltyInfo(
  options: BaseTransactionOptions<RoyaltyInfoParams>,
): Promise<readonly [string, bigint]>;
```

### Parameters

The options for the royaltyInfo function.

#### Type

```ts
let options: BaseTransactionOptions<RoyaltyInfoParams>;
```

### Returns

```ts
let returnType: Promise<readonly [string, bigint]>;
```

The parsed result of the function call.
---

###### Connect SDK

## RoyaltyERC721.setDefaultRoyaltyInfo

Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { RoyaltyERC721 } from "thirdweb/modules";
 
const transaction = RoyaltyERC721.setDefaultRoyaltyInfo({
 contract,
 royaltyRecipient: ...,
 royaltyBps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setDefaultRoyaltyInfo(
  options: BaseTransactionOptions<
    | SetDefaultRoyaltyInfoParams
    | { asyncParams: () => Promise<SetDefaultRoyaltyInfoParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setDefaultRoyaltyInfo" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetDefaultRoyaltyInfoParams
  | { asyncParams: () => Promise<SetDefaultRoyaltyInfoParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## RoyaltyERC721.setRoyaltyInfoForToken

Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { RoyaltyERC721 } from "thirdweb/modules";
 
const transaction = RoyaltyERC721.setRoyaltyInfoForToken({
 contract,
 tokenId: ...,
 recipient: ...,
 bps: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setRoyaltyInfoForToken(
  options: BaseTransactionOptions<
    | SetRoyaltyInfoForTokenParams
    | { asyncParams: () => Promise<SetRoyaltyInfoForTokenParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setRoyaltyInfoForToken" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetRoyaltyInfoForTokenParams
  | { asyncParams: () => Promise<SetRoyaltyInfoForTokenParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## RoyaltyERC721.setTransferValidator

Prepares a transaction to call the "setTransferValidator" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { RoyaltyERC721 } from "thirdweb/modules";
 
const transaction = RoyaltyERC721.setTransferValidator({
 contract,
 validator: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferValidator(
  options: BaseTransactionOptions<
    | SetTransferValidatorParams
    | { asyncParams: () => Promise<SetTransferValidatorParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferValidator" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferValidatorParams
  | { asyncParams: () => Promise<SetTransferValidatorParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## SequentialTokenIdERC1155
---

###### Connect SDK

## SequentialTokenIdERC1155.encodeInstall

Encodes the install data for the SequentialTokenIdERC1155 module.

```ts
function encodeInstall(
  params: EncodeBytesOnInstallParams,
): `0x${string}`;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams;
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded data.
---

###### Connect SDK

## SequentialTokenIdERC1155.install

Installs the SequentialTokenIdERC1155 module on a core contract.

### Example

```ts
import { SequentialTokenIdERC1155 } from "thirdweb/modules";
 
const transaction  = SequentialTokenIdERC1155.install({
 contract: coreContract,
 account: account,
 params: {
    startTokenId: ...,
 },
});
 
await sendTransaction({
 transaction,
 account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params: EncodeBytesOnInstallParams & { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## SequentialTokenIdERC1155.module

Convenience function to add the SequentialTokenIdERC1155 module as a default module on a core contract.

### Example

```ts
import { SequentialTokenIdERC1155, deployModularContract } from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC1155",
  params: {
    name: "My Modular Contract",
  },
  modules: [
    SequentialTokenIdERC1155.module({
       startTokenId: ...,
    }),
  ],
});
```

```ts
function module(
  params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: EncodeBytesOnInstallParams & { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
```

* The module function.
---
## TransferableERC1155
---

###### Connect SDK

## TransferableERC1155.encodeInstall

Encodes the install data for the TransferableERC1155 module.

```ts
function encodeInstall(): string;
```

### Returns

```ts
let returnType: string;
```

* The encoded data.
---

###### Connect SDK

## TransferableERC1155.install

Installs the TransferableERC1155 module on a core contract.

### Example

```ts
import { TransferableERC1155 } from "thirdweb/modules";
 
const transaction = TransferableERC1155.install({
  contract: coreContract,
  account: account,
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## TransferableERC1155.isTransferEnabled

Calls the "isTransferEnabled" function on the contract.

### Example

```ts
import { TransferableERC1155 } from "thirdweb/modules";
 
const result = await TransferableERC1155.isTransferEnabled({
  contract,
});
```

```ts
function isTransferEnabled(
  options: BaseTransactionOptions,
): Promise<boolean>;
```

### Parameters

The options for the isTransferEnabled function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## TransferableERC1155.isTransferEnabledFor

Calls the "isTransferEnabledFor" function on the contract.

### Example

```ts
import { TransferableERC1155 } from "thirdweb/modules";
 
const result = await TransferableERC1155.isTransferEnabledFor({
 contract,
 target: ...,
});
```

```ts
function isTransferEnabledFor(
  options: BaseTransactionOptions<IsTransferEnabledForParams>,
): Promise<boolean>;
```

### Parameters

The options for the isTransferEnabledFor function.

#### Type

```ts
let options: BaseTransactionOptions<IsTransferEnabledForParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## TransferableERC1155.module

Convenience function to add the TransferableERC1155 module as a default module on a core contract.

### Example

```ts
import {
  TransferableERC1155,
  deployModularContract,
} from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC1155",
  params: {
    name: "My Modular Contract",
  },
  modules: [TransferableERC1155.module()],
});
```

```ts
function module(params?: {
  publisher?: string;
}): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## TransferableERC1155.setTransferable

Prepares a transaction to call the "setTransferable" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { TransferableERC1155 } from "thirdweb/modules";
 
const transaction = TransferableERC1155.setTransferable({
 contract,
 enableTransfer: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferable(
  options: BaseTransactionOptions<
    | SetTransferableParams
    | { asyncParams: () => Promise<SetTransferableParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferable" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferableParams
  | { asyncParams: () => Promise<SetTransferableParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## TransferableERC1155.setTransferableFor

Prepares a transaction to call the "setTransferableFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { TransferableERC1155 } from "thirdweb/modules";
 
const transaction = TransferableERC1155.setTransferableFor({
 contract,
 target: ...,
 enableTransfer: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferableFor(
  options: BaseTransactionOptions<
    | SetTransferableForParams
    | { asyncParams: () => Promise<SetTransferableForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferableFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferableForParams
  | { asyncParams: () => Promise<SetTransferableForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## TransferableERC20
---

###### Connect SDK

## TransferableERC20.encodeInstall

Encodes the install data for the TransferableERC20 module.

```ts
function encodeInstall(): string;
```

### Returns

```ts
let returnType: string;
```

* The encoded data.
---

###### Connect SDK

## TransferableERC20.install

Installs the TransferableERC20 module on a core contract.

### Example

```ts
import { TransferableERC20 } from "thirdweb/modules";
 
const transaction = TransferableERC20.install({
  contract: coreContract,
  account: account,
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## TransferableERC20.isTransferEnabled

Calls the "isTransferEnabled" function on the contract.

### Example

```ts
import { TransferableERC20 } from "thirdweb/modules";
 
const result = await TransferableERC20.isTransferEnabled({
  contract,
});
```

```ts
function isTransferEnabled(
  options: BaseTransactionOptions,
): Promise<boolean>;
```

### Parameters

The options for the isTransferEnabled function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## TransferableERC20.isTransferEnabledFor

Calls the "isTransferEnabledFor" function on the contract.

### Example

```ts
import { TransferableERC20 } from "thirdweb/modules";
 
const result = await TransferableERC20.isTransferEnabledFor({
 contract,
 target: ...,
});
```

```ts
function isTransferEnabledFor(
  options: BaseTransactionOptions<IsTransferEnabledForParams>,
): Promise<boolean>;
```

### Parameters

The options for the isTransferEnabledFor function.

#### Type

```ts
let options: BaseTransactionOptions<IsTransferEnabledForParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## TransferableERC20.module

Convenience function to add the TransferableERC20 module as a default module on a core contract.

### Example

```ts
import {
  TransferableERC20,
  deployModularContract,
} from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC20",
  params: {
    name: "My Modular Contract",
  },
  modules: [TransferableERC20.module()],
});
```

```ts
function module(params?: {
  publisher?: string;
}): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## TransferableERC20.setTransferable

Prepares a transaction to call the "setTransferable" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { TransferableERC20 } from "thirdweb/modules";
 
const transaction = TransferableERC20.setTransferable({
 contract,
 enableTransfer: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferable(
  options: BaseTransactionOptions<
    | SetTransferableParams
    | { asyncParams: () => Promise<SetTransferableParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferable" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferableParams
  | { asyncParams: () => Promise<SetTransferableParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## TransferableERC20.setTransferableFor

Prepares a transaction to call the "setTransferableFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { TransferableERC20 } from "thirdweb/modules";
 
const transaction = TransferableERC20.setTransferableFor({
 contract,
 target: ...,
 enableTransfer: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferableFor(
  options: BaseTransactionOptions<
    | SetTransferableForParams
    | { asyncParams: () => Promise<SetTransferableForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferableFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferableForParams
  | { asyncParams: () => Promise<SetTransferableForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
## TransferableERC721
---

###### Connect SDK

## TransferableERC721.encodeInstall

Encodes the install data for the TransferableERC721 module.

```ts
function encodeInstall(): string;
```

### Returns

```ts
let returnType: string;
```

* The encoded data.
---

###### Connect SDK

## TransferableERC721.install

Installs the TransferableERC721 module on a core contract.

### Example

```ts
import { TransferableERC721 } from "thirdweb/modules";
 
const transaction = TransferableERC721.install({
  contract: coreContract,
  account: account,
});
 
await sendTransaction({
  transaction,
  account,
});
```

```ts
function install(options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
}): PreparedTransaction;
```

### Parameters

#### Type

```ts
let options: {
  account: Account;
  contract: Readonly;
  params?: { publisher?: string };
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

the transaction to install the module
---

###### Connect SDK

## TransferableERC721.isTransferEnabled

Calls the "isTransferEnabled" function on the contract.

### Example

```ts
import { TransferableERC721 } from "thirdweb/modules";
 
const result = await TransferableERC721.isTransferEnabled({
  contract,
});
```

```ts
function isTransferEnabled(
  options: BaseTransactionOptions,
): Promise<boolean>;
```

### Parameters

The options for the isTransferEnabled function.

#### Type

```ts
let options: { contract: ThirdwebContract<abi> } & T;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## TransferableERC721.isTransferEnabledFor

Calls the "isTransferEnabledFor" function on the contract.

### Example

```ts
import { TransferableERC721 } from "thirdweb/modules";
 
const result = await TransferableERC721.isTransferEnabledFor({
 contract,
 target: ...,
});
```

```ts
function isTransferEnabledFor(
  options: BaseTransactionOptions<IsTransferEnabledForParams>,
): Promise<boolean>;
```

### Parameters

The options for the isTransferEnabledFor function.

#### Type

```ts
let options: BaseTransactionOptions<IsTransferEnabledForParams>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

The parsed result of the function call.
---

###### Connect SDK

## TransferableERC721.module

Convenience function to add the TransferableERC721 module as a default module on a core contract.

### Example

```ts
import {
  TransferableERC721,
  deployModularContract,
} from "thirdweb/modules";
 
const deployed = deployModularContract({
  client,
  chain,
  account,
  core: "ERC721",
  params: {
    name: "My Modular Contract",
  },
  modules: [TransferableERC721.module()],
});
```

```ts
function module(params?: {
  publisher?: string;
}): (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

### Parameters

The parameters for the module.

#### Type

```ts
let params: { publisher?: string };
```

### Returns

```ts
let returnType: (args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
}) => Promise<{ data: "0x"; module: `0x${string}` }>;
```

* The module function.
---

###### Connect SDK

## TransferableERC721.setTransferable

Prepares a transaction to call the "setTransferable" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { TransferableERC721 } from "thirdweb/modules";
 
const transaction = TransferableERC721.setTransferable({
 contract,
 enableTransfer: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferable(
  options: BaseTransactionOptions<
    | SetTransferableParams
    | { asyncParams: () => Promise<SetTransferableParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferable" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferableParams
  | { asyncParams: () => Promise<SetTransferableParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---

###### Connect SDK

## TransferableERC721.setTransferableFor

Prepares a transaction to call the "setTransferableFor" function on the contract.

### Example

```ts
import { sendTransaction } from "thirdweb";
import { TransferableERC721 } from "thirdweb/modules";
 
const transaction = TransferableERC721.setTransferableFor({
 contract,
 target: ...,
 enableTransfer: ...,
 overrides: {
   ...
 }
});
 
// Send the transaction
await sendTransaction({ transaction, account });
```

```ts
function setTransferableFor(
  options: BaseTransactionOptions<
    | SetTransferableForParams
    | { asyncParams: () => Promise<SetTransferableForParams> }
  >,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for the "setTransferableFor" function.

#### Type

```ts
let options: BaseTransactionOptions<
  | SetTransferableForParams
  | { asyncParams: () => Promise<SetTransferableForParams> }
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction object.
---
# Payments
---
## Buy
---

###### Connect SDK

## Buy.prepare

Prepares a _finalized_ Universal Bridge quote for the provided buy request with transaction data. This function will return everything `quote` does, with the addition of a series of prepared transactions and the associated expiration timestamp.

### Example

```typescript
import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
 
const quote = await Bridge.Buy.prepare({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  sender: "0x...",
  receiver: "0x...",
  client: thirdwebClient,
});
```

This will return a quote that might look like:

```typescript
{
  originAmount: 2000030000n,
  destinationAmount: 1000000000000000000n,
  blockNumber: 22026509n,
  timestamp: 1741730936680,
  estimatedExecutionTimeMs: 1000
  steps: [
    {
      originToken: {
        chainId: 1,
        address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        symbol: "USDC",
        name: "USDC",
        decimals: 6,
        priceUsd: 1,
        iconUri: "https://..."
      },
      destinationToken: {
        chainId: 10,
        address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        symbol: "ETH",
        name: "Ethereum",
        decimals: 18,
        priceUsd: 2000,
        iconUri: "https://..."
      },
      originAmount: 2000030000n,
      destinationAmount: 1000000000000000000n,
      estimatedExecutionTimeMs: 1000
      transactions: [
        {
          action: "approval",
          id: "0x",
          to: "0x...",
          data: "0x...",
          chainId: 10,
          type: "eip1559"
        },
        {
          action: "buy",
          to: "0x...",
          value: 10000026098875381n,
          data: "0x...",
          chainId: 10,
          type: "eip1559"
        }
      ]
    }
  ],
  expiration: 1741730936680,
  intent: {
    originChainId: 1,
    originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    destinationChainId: 10,
    destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    amount: 1000000000000000000n
  }
}
```

### Sending the transactions

The `transactions` array is a series of transactions ready to be executed (with `sendTransaction`) one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:

* Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
* All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address.
* If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.

NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full bridge completion on the destination chain.

You can access this functions input and output types with `Buy.prepare.Options` and `Buy.prepare.Result`, respectively.

You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option.

```ts
const quote = await Bridge.Buy.prepare({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  sender: "0x...",
  receiver: "0x...",
  purchaseData: {
    size: "large",
    shippingAddress: "123 Main St, New York, NY 10001",
  },
  client: thirdwebClient,
});
```

To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option.

```ts
const quote = await Bridge.Buy.prepare({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  sender: "0x...",
  receiver: "0x...",
  maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps
  client: thirdwebClient,
});
```

```ts
function prepare(options: Options): Promise<Result>;
```

### Parameters

The options for the quote.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: Promise<Result>;
```

A promise that resolves to a finalized quote and transactions for the requested buy.
---

###### Connect SDK

## Buy.quote

Retrieves a Universal Bridge quote for the provided buy intent. The quote will specify the necessary `originAmount` to receive the desired `destinationAmount`, which is specified with the `buyAmountWei` option.

### Example

```typescript
import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
 
const quote = await Bridge.Buy.quote({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  client: thirdwebClient,
});
```

This will return a quote that might look like:

```typescript
{
  originAmount: 10000026098875381n,
  destinationAmount: 1000000000000000000n,
  blockNumber: 22026509n,
  timestamp: 1741730936680,
  estimatedExecutionTimeMs: 1000
  steps: [
    {
      originToken: {
        chainId: 1,
        address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        symbol: "ETH",
        name: "Ethereum",
        decimals: 18,
        priceUsd: 0.0025,
        iconUri: "https://..."
      },
      destinationToken: {
        chainId: 10,
        address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        symbol: "ETH",
        name: "Ethereum",
        decimals: 18,
        priceUsd: 0.0025,
        iconUri: "https://..."
      },
      originAmount: 10000026098875381n,
      destinationAmount: 1000000000000000000n,
      estimatedExecutionTimeMs: 1000
    }
  ],
  intent: {
    originChainId: 1,
    originTokenAddress: NATIVE_TOKEN_ADDRESS,
    destinationChainId: 10,
    destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
    amount: 1000000000000000000n
  }
}
```

The quote is an _estimate_ for how much you would expect to pay for a specific buy. This quote is not guaranteed and you should use `Buy.prepare` to get a finalized quote with transaction data ready for execution. So why use `quote`? The quote function is sometimes slightly faster than `prepare`, and can be used before the user connects their wallet.

You can access this functions input and output types with `Buy.quote.Options` and `Buy.quote.Result`, respectively.

To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option.

```ts
const quote = await Bridge.Buy.quote({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps
  client: thirdwebClient,
});
```

```ts
function quote(options: Options): Promise<Result>;
```

### Parameters

The options for the quote.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: Promise<Result>;
```

A promise that resolves to a non-finalized quote for the requested buy.
---
## Onramp
---

###### Connect SDK

## Onramp.prepare

Prepares an onramp transaction, returning a link from the specified provider to onramp to the specified token.

### Example

```typescript
import { Bridge } from "thirdweb";
import { ethereum } from "thirdweb/chains";
import { NATIVE_TOKEN_ADDRESS, toWei } from "thirdweb/utils";
 
const preparedOnramp = await Bridge.Onramp.prepare({
  client: thirdwebClient,
  onramp: "stripe",
  chainId: ethereum.id,
  tokenAddress: NATIVE_TOKEN_ADDRESS,
  receiver: "0x...", // receiver's address
  amount: toWei("10"), // 10 of the destination token
  // Optional params:
  // sender: "0x...", // sender's address
  // onrampTokenAddress: NATIVE_TOKEN_ADDRESS, // token to initially onramp to
  // onrampChainId: 1, // chain to initially onramp to
  // currency: "USD",
  // maxSteps: 2,
  // purchaseData: { customId: "123" }
});
 
console.log(preparedOnramp.link); // URL to redirect the user to
console.log(preparedOnramp.currencyAmount); // Amount in fiat the user will pay
```

This function returns a quote that might look like:

```typescript
{
  id: "123e4567-e89b-12d3-a456-426614174000",
  link: "https://onramp.example.com/session?id=...",
  currency: "USD",
  currencyAmount: 10.52,
  destinationAmount: 10000000000000000000n, // 10 ETH if decimals 18
  timestamp: 1689812800,
  expiration: 1689842800,
  steps: [
    // ... further steps if any post-onramp swaps are needed
  ],
  intent: {
    onramp: "stripe",
    chainId: 1,
    tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    receiver: "0x...",
    amount: "10000000000000000000"
  }
}
```

#### Global Support

For the best user experience, specify the user's `country` code in your request. This will return an error if the user's country is not supported by the provider.

```typescript
const preparedOnramp = await Bridge.Onramp.prepare({
  client: thirdwebClient,
  onramp: "stripe",
  chainId: ethereum.id,
  tokenAddress: NATIVE_TOKEN_ADDRESS,
  receiver: "0x...", // receiver's address
  amount: toWei("10"), // 10 of the destination token
  country: "AU", // User's country code
});
```

```ts
function prepare(
  options: Options,
): Promise<OnrampPrepareQuoteResponseData>;
```

### Parameters

The options for preparing the onramp.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: Promise<OnrampPrepareQuoteResponseData>;
```

A promise that resolves to the prepared onramp details, including the link and quote.
---

###### Connect SDK

## Onramp.status

Retrieves the status of an Onramp session created via Bridge.Onramp.prepare. The status will include any on-chain transactions that have occurred as a result of the onramp as well as any arbitrary `purchaseData` that was supplied when the onramp was prepared.

### Example

```typescript
import { Bridge } from "thirdweb";
 
const onrampStatus = await Bridge.Onramp.status({
  id: "022218cc-96af-4291-b90c-dadcb47571ec",
  client: thirdwebClient,
});
 
// Possible results:
// {
//   status: "CREATED",
//   transactions: [],
//   purchaseData: {
//     orderId: "abc-123",
//   },
// }
//
// or
// {
//   status: "PENDING",
//   transactions: [],
//   purchaseData: {
//     orderId: "abc-123",
//   },
// }
//
// or
// {
//   status: "COMPLETED",
//   transactions: [
//     {
//       chainId: 1,
//       transactionHash:
//         "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
//     },
//   ],
//   purchaseData: {
//     orderId: "abc-123",
//   },
// }
```

```ts
function status(options: Options): Promise<Result>;
```

### Parameters

The options for fetching the onramp status.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: Promise<Result>;
```

A promise that resolves to the status of the onramp session.
---
## Sell
---

###### Connect SDK

## Sell.prepare

Prepares a _finalized_ Universal Bridge quote for the provided sell request with transaction data. This function will return everything `quote` does, with the addition of a series of prepared transactions and the associated expiration timestamp.

### Example

```typescript
import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
 
const quote = await Bridge.Sell.prepare({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  client: thirdwebClient,
});
```

This will return a quote that might look like:

```typescript
{
  originAmount: 2000000000n,
  destinationAmount:  9980000000000000000n,
  blockNumber: 22026509n,
  timestamp: 1741730936680,
  estimatedExecutionTimeMs: 1000
  steps: [
    {
      originToken: {
        chainId: 1,
        address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        symbol: "USDC",
        name: "USDC",
        decimals: 6,
        priceUsd: 1,
        iconUri: "https://..."
      },
      destinationToken: {
        chainId: 10,
        address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        symbol: "ETH",
        name: "Ethereum",
        decimals: 18,
        priceUsd: 2000,
        iconUri: "https://..."
      },
      originAmount: 2000000000n,
      destinationAmount:  9980000000000000000n,
      estimatedExecutionTimeMs: 1000
    }
    transactions: [
      {
        id: "0x...",
        action: "approval",
        to: "0x...",
        data: "0x...",
        chainId: 10,
        type: "eip1559"
      },
      {
        id: "0x...",
        action: "sell",
        to: "0x...",
        data: "0x...",
        chainId: 10,
        type: "eip1559"
      }
    ],
  ],
  expiration: 1741730936680,
  intent: {
    originChainId: 1,
    originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    destinationChainId: 10,
    destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    amount: 2000000000n
  }
}
```

### Sending the transactions

The `transactions` array is a series of transactions ready to be executed (with `sendTransaction`) must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:

* Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
* All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address.
* If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.

NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full bridge completion on the destination chain.

You can access this functions input and output types with `Sell.prepare.Options` and `Sell.prepare.Result`, respectively.

You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option.

```ts
const quote = await Bridge.Sell.prepare({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  purchaseData: {
    size: "large",
    shippingAddress: "123 Main St, New York, NY 10001",
  },
  client: thirdwebClient,
});
```

To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option.

```ts
const quote = await Bridge.Sell.prepare({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps
  client: thirdwebClient,
});
```

```ts
function prepare(options: Options): Promise<Result>;
```

### Parameters

The options for the quote.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: Promise<Result>;
```

A promise that resolves to a finalized quote and transactions for the requested sell.
---

###### Connect SDK

## Sell.quote

Retrieves a Universal Bridge quote for the provided sell intent. The quote will specify the expected `destinationAmount` that will be received in exchange for the specified `originAmount`, which is specified with the `sellAmountWei` option.

### Example

```typescript
import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
 
const quote = await Bridge.Sell.quote({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  client: thirdwebClient,
});
```

This will return a quote that might look like:

```typescript
{
  originAmount: 1000000000000000000n,
  destinationAmount: 9999979011973735n,
  blockNumber: 22026509n,
  timestamp: 1741730936680,
  estimatedExecutionTimeMs: 1000
  steps: [
    {
      originToken: {
        chainId: 1,
        address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        symbol: "ETH",
        name: "Ethereum",
        decimals: 18,
        priceUsd: 2000,
        iconUri: "https://..."
      },
      destinationToken: {
        chainId: 10,
        address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        symbol: "ETH",
        name: "Ethereum",
        decimals: 18,
        priceUsd: 2000,
        iconUri: "https://..."
      },
      originAmount: 1000000000000000000n,
      destinationAmount:  99999979011973735n,
      estimatedExecutionTimeMs: 1000
    }
  ],
  intent: {
    originChainId: 1,
    originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    destinationChainId: 10,
    destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    amount: 1000000000000000000n
  }
}
```

The quote is an _estimate_ for how much you would expect to receive for a specific sell. This quote is not guaranteed and you should use `Sell.prepare` to get a finalized quote with transaction data ready for execution. So why use `quote`? The quote function is sometimes slightly faster than `prepare`, and can be used before the user connects their wallet.

You can access this functions input and output types with `Sell.quote.Options` and `Sell.quote.Result`, respectively.

To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option.

```ts
const quote = await Bridge.Sell.quote({
  originChainId: 1,
  originTokenAddress: NATIVE_TOKEN_ADDRESS,
  destinationChainId: 10,
  destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
  amount: toWei("0.01"),
  maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps
  client: thirdwebClient,
});
```

```ts
function quote(options: Options): Promise<Result>;
```

### Parameters

The options for the quote.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: Promise<Result>;
```

A promise that resolves to a non-finalized quote for the requested sell.
---
# Client
---

###### Connect SDK

## createThirdwebClient

Creates a Thirdweb client using the provided client ID (client-side) or secret key (server-side).

Get your client ID and secret key from the Thirdweb dashboard [here](https://thirdweb.com/create-api-key). \*\*Never share your secret key with anyone.

A client is necessary for most functions in the thirdweb SDK. It provides access to thirdweb APIs including built-in RPC, storage, and more.

### Example

Create a client on the client side (client ID):

```ts
import { createThirdwebClient } from "thirdweb";
 
const client = createThirdwebClient({ clientId: "..." });
```

Create a client on the server (secret key):

```ts
import { createThirdwebClient } from "thirdweb";
 
const client = createThirdwebClient({ secretKey: "..." });
```

```ts
function createThirdwebClient(
  options: CreateThirdwebClientOptions,
): ThirdwebClient;
```

### Parameters

The options for creating the client.

#### Type

```ts
let options: Prettify<
  (
    | { clientId: string; secretKey?: string }
    | { clientId?: string; secretKey: string }
  ) &
    ClientOptions
>;
```

### Returns

```ts
let returnType: {
  readonly clientId: string;
  readonly secretKey: string | undefined;
} & Readonly<ClientOptions>;
```

The created Thirdweb client.
---
# Wallets
---

###### Connect SDK

## AccountAvatar

The component for showing the avatar of the account. If fetches all the social profiles linked to your wallet, including: Farcaster, ENS, Lens (more to be added) You can choose which social profile you want to display. Defaults to the first item in the list.

### Example

#### Basic usage

```tsx
import { AccountProvider, AccountAvatar } from "thirdweb/react";
 
<AccountProvider address="0x...">
  <AccountAvatar />
</AccountProvider>;
```

Result: An `<img />` component, if the avatar is resolved successfully

```html
<img alt="" src="resolved-url-for-the-avatar" />
```

#### Show a loading sign when the avatar is being resolved

```tsx
import { AccountProvider, AccountAvatar } from "thirdweb/react";
 
<AccountProvider address="0x...">
  <AccountAvatar loadingComponent={<YourLoadingComponent />} />
</AccountProvider>;
```

#### Fallback to something when the avatar fails to resolve

```tsx
import { AccountProvider, AccountAvatar } from "thirdweb/react";
 
<AccountProvider address="0x...">
  <AccountAvatar fallbackComponent={<DummyImage />} />
</AccountProvider>;
```

#### Select a social profile to display

If you wallet associates with more than one social profiles (Lens, Farcaster, ENS, etc.) You can specify which service you want to prioritize using the `socialType` props

```tsx
import { AccountProvider, AccountAvatar } from "thirdweb/react";
 
<AccountProvider address="0x...">
  <AccountAvatar
    // Choose between: "farcaster" | "lens" | "ens"
    socialType={"ens"}
  />
</AccountProvider>;
```

#### Custom ENS resolver chain

This component shares the same props with the ENS extension `resolveAvatar`

```tsx
import { AccountProvider, AccountAvatar } from "thirdweb/react";
import { base } from "thirdweb/chains";
 
<AccountProvider address="0x...">
  <AccountAvatar resolverAddress={"0x..."} resolverChain={base} />
</AccountProvider>;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<AccountAvatar
  queryOptions={{
    enabled: isEnabled,
    retry: 3,
  }}
/>;
```

```ts
function AccountAvatar(
  __namedParameters: AccountAvatarProps,
): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,alt : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,children : ReactNode,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,crossOrigin : CrossOrigin,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,decoding : "auto" | "async" | "sync",defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,fetchPriority : "auto" | "high" | "low",height : string | number,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLImageElement>,onAbortCapture : ReactEventHandler<HTMLImageElement>,onAnimationEnd : AnimationEventHandler<HTMLImageElement>,onAnimationEndCapture : AnimationEventHandler<HTMLImageElement>,onAnimationIteration : AnimationEventHandler<HTMLImageElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLImageElement>,onAnimationStart : AnimationEventHandler<HTMLImageElement>,onAnimationStartCapture : AnimationEventHandler<HTMLImageElement>,onAuxClick : MouseEventHandler<HTMLImageElement>,onAuxClickCapture : MouseEventHandler<HTMLImageElement>,onBeforeInput : InputEventHandler<HTMLImageElement>,onBeforeInputCapture : FormEventHandler<HTMLImageElement>,onBeforeToggle : ToggleEventHandler<HTMLImageElement>,onBlur : FocusEventHandler<HTMLImageElement>,onBlurCapture : FocusEventHandler<HTMLImageElement>,onCanPlay : ReactEventHandler<HTMLImageElement>,onCanPlayCapture : ReactEventHandler<HTMLImageElement>,onCanPlayThrough : ReactEventHandler<HTMLImageElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLImageElement>,onChange : FormEventHandler<HTMLImageElement>,onChangeCapture : FormEventHandler<HTMLImageElement>,onClick : MouseEventHandler<HTMLImageElement>,onClickCapture : MouseEventHandler<HTMLImageElement>,onCompositionEnd : CompositionEventHandler<HTMLImageElement>,onCompositionEndCapture : CompositionEventHandler<HTMLImageElement>,onCompositionStart : CompositionEventHandler<HTMLImageElement>,onCompositionStartCapture : CompositionEventHandler<HTMLImageElement>,onCompositionUpdate : CompositionEventHandler<HTMLImageElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLImageElement>,onContextMenu : MouseEventHandler<HTMLImageElement>,onContextMenuCapture : MouseEventHandler<HTMLImageElement>,onCopy : ClipboardEventHandler<HTMLImageElement>,onCopyCapture : ClipboardEventHandler<HTMLImageElement>,onCut : ClipboardEventHandler<HTMLImageElement>,onCutCapture : ClipboardEventHandler<HTMLImageElement>,onDoubleClick : MouseEventHandler<HTMLImageElement>,onDoubleClickCapture : MouseEventHandler<HTMLImageElement>,onDrag : DragEventHandler<HTMLImageElement>,onDragCapture : DragEventHandler<HTMLImageElement>,onDragEnd : DragEventHandler<HTMLImageElement>,onDragEndCapture : DragEventHandler<HTMLImageElement>,onDragEnter : DragEventHandler<HTMLImageElement>,onDragEnterCapture : DragEventHandler<HTMLImageElement>,onDragExit : DragEventHandler<HTMLImageElement>,onDragExitCapture : DragEventHandler<HTMLImageElement>,onDragLeave : DragEventHandler<HTMLImageElement>,onDragLeaveCapture : DragEventHandler<HTMLImageElement>,onDragOver : DragEventHandler<HTMLImageElement>,onDragOverCapture : DragEventHandler<HTMLImageElement>,onDragStart : DragEventHandler<HTMLImageElement>,onDragStartCapture : DragEventHandler<HTMLImageElement>,onDrop : DragEventHandler<HTMLImageElement>,onDropCapture : DragEventHandler<HTMLImageElement>,onDurationChange : ReactEventHandler<HTMLImageElement>,onDurationChangeCapture : ReactEventHandler<HTMLImageElement>,onEmptied : ReactEventHandler<HTMLImageElement>,onEmptiedCapture : ReactEventHandler<HTMLImageElement>,onEncrypted : ReactEventHandler<HTMLImageElement>,onEncryptedCapture : ReactEventHandler<HTMLImageElement>,onEnded : ReactEventHandler<HTMLImageElement>,onEndedCapture : ReactEventHandler<HTMLImageElement>,onError : ReactEventHandler<HTMLImageElement>,onErrorCapture : ReactEventHandler<HTMLImageElement>,onFocus : FocusEventHandler<HTMLImageElement>,onFocusCapture : FocusEventHandler<HTMLImageElement>,onGotPointerCapture : PointerEventHandler<HTMLImageElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onInput : FormEventHandler<HTMLImageElement>,onInputCapture : FormEventHandler<HTMLImageElement>,onInvalid : FormEventHandler<HTMLImageElement>,onInvalidCapture : FormEventHandler<HTMLImageElement>,onKeyDown : KeyboardEventHandler<HTMLImageElement>,onKeyDownCapture : KeyboardEventHandler<HTMLImageElement>,onKeyPress : KeyboardEventHandler<HTMLImageElement>,onKeyPressCapture : KeyboardEventHandler<HTMLImageElement>,onKeyUp : KeyboardEventHandler<HTMLImageElement>,onKeyUpCapture : KeyboardEventHandler<HTMLImageElement>,onLoad : ReactEventHandler<HTMLImageElement>,onLoadCapture : ReactEventHandler<HTMLImageElement>,onLoadedData : ReactEventHandler<HTMLImageElement>,onLoadedDataCapture : ReactEventHandler<HTMLImageElement>,onLoadedMetadata : ReactEventHandler<HTMLImageElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLImageElement>,onLoadStart : ReactEventHandler<HTMLImageElement>,onLoadStartCapture : ReactEventHandler<HTMLImageElement>,onLostPointerCapture : PointerEventHandler<HTMLImageElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onMouseDown : MouseEventHandler<HTMLImageElement>,onMouseDownCapture : MouseEventHandler<HTMLImageElement>,onMouseEnter : MouseEventHandler<HTMLImageElement>,onMouseLeave : MouseEventHandler<HTMLImageElement>,onMouseMove : MouseEventHandler<HTMLImageElement>,onMouseMoveCapture : MouseEventHandler<HTMLImageElement>,onMouseOut : MouseEventHandler<HTMLImageElement>,onMouseOutCapture : MouseEventHandler<HTMLImageElement>,onMouseOver : MouseEventHandler<HTMLImageElement>,onMouseOverCapture : MouseEventHandler<HTMLImageElement>,onMouseUp : MouseEventHandler<HTMLImageElement>,onMouseUpCapture : MouseEventHandler<HTMLImageElement>,onPaste : ClipboardEventHandler<HTMLImageElement>,onPasteCapture : ClipboardEventHandler<HTMLImageElement>,onPause : ReactEventHandler<HTMLImageElement>,onPauseCapture : ReactEventHandler<HTMLImageElement>,onPlay : ReactEventHandler<HTMLImageElement>,onPlayCapture : ReactEventHandler<HTMLImageElement>,onPlaying : ReactEventHandler<HTMLImageElement>,onPlayingCapture : ReactEventHandler<HTMLImageElement>,onPointerCancel : PointerEventHandler<HTMLImageElement>,onPointerCancelCapture : PointerEventHandler<HTMLImageElement>,onPointerDown : PointerEventHandler<HTMLImageElement>,onPointerDownCapture : PointerEventHandler<HTMLImageElement>,onPointerEnter : PointerEventHandler<HTMLImageElement>,onPointerLeave : PointerEventHandler<HTMLImageElement>,onPointerMove : PointerEventHandler<HTMLImageElement>,onPointerMoveCapture : PointerEventHandler<HTMLImageElement>,onPointerOut : PointerEventHandler<HTMLImageElement>,onPointerOutCapture : PointerEventHandler<HTMLImageElement>,onPointerOver : PointerEventHandler<HTMLImageElement>,onPointerOverCapture : PointerEventHandler<HTMLImageElement>,onPointerUp : PointerEventHandler<HTMLImageElement>,onPointerUpCapture : PointerEventHandler<HTMLImageElement>,onProgress : ReactEventHandler<HTMLImageElement>,onProgressCapture : ReactEventHandler<HTMLImageElement>,onRateChange : ReactEventHandler<HTMLImageElement>,onRateChangeCapture : ReactEventHandler<HTMLImageElement>,onReset : FormEventHandler<HTMLImageElement>,onResetCapture : FormEventHandler<HTMLImageElement>,onScroll : UIEventHandler<HTMLImageElement>,onScrollCapture : UIEventHandler<HTMLImageElement>,onScrollEnd : UIEventHandler<HTMLImageElement>,onScrollEndCapture : UIEventHandler<HTMLImageElement>,onSeeked : ReactEventHandler<HTMLImageElement>,onSeekedCapture : ReactEventHandler<HTMLImageElement>,onSeeking : ReactEventHandler<HTMLImageElement>,onSeekingCapture : ReactEventHandler<HTMLImageElement>,onSelect : ReactEventHandler<HTMLImageElement>,onSelectCapture : ReactEventHandler<HTMLImageElement>,onStalled : ReactEventHandler<HTMLImageElement>,onStalledCapture : ReactEventHandler<HTMLImageElement>,onSubmit : FormEventHandler<HTMLImageElement>,onSubmitCapture : FormEventHandler<HTMLImageElement>,onSuspend : ReactEventHandler<HTMLImageElement>,onSuspendCapture : ReactEventHandler<HTMLImageElement>,onTimeUpdate : ReactEventHandler<HTMLImageElement>,onTimeUpdateCapture : ReactEventHandler<HTMLImageElement>,onToggle : ToggleEventHandler<HTMLImageElement>,onTouchCancel : TouchEventHandler<HTMLImageElement>,onTouchCancelCapture : TouchEventHandler<HTMLImageElement>,onTouchEnd : TouchEventHandler<HTMLImageElement>,onTouchEndCapture : TouchEventHandler<HTMLImageElement>,onTouchMove : TouchEventHandler<HTMLImageElement>,onTouchMoveCapture : TouchEventHandler<HTMLImageElement>,onTouchStart : TouchEventHandler<HTMLImageElement>,onTouchStartCapture : TouchEventHandler<HTMLImageElement>,onTransitionCancel : TransitionEventHandler<HTMLImageElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLImageElement>,onTransitionEnd : TransitionEventHandler<HTMLImageElement>,onTransitionEndCapture : TransitionEventHandler<HTMLImageElement>,onTransitionRun : TransitionEventHandler<HTMLImageElement>,onTransitionRunCapture : TransitionEventHandler<HTMLImageElement>,onTransitionStart : TransitionEventHandler<HTMLImageElement>,onTransitionStartCapture : TransitionEventHandler<HTMLImageElement>,onVolumeChange : ReactEventHandler<HTMLImageElement>,onVolumeChangeCapture : ReactEventHandler<HTMLImageElement>,onWaiting : ReactEventHandler<HTMLImageElement>,onWaitingCapture : ReactEventHandler<HTMLImageElement>,onWheel : WheelEventHandler<HTMLImageElement>,onWheelCapture : WheelEventHandler<HTMLImageElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,referrerPolicy : HTMLAttributeReferrerPolicy,rel : string,resolverAddress : string,resolverChain : Readonly<(ChainOptions) & ({ rpc: string })>,resource : string,results : number,rev : string,role : AriaRole,security : string,sizes : string,slot : string,socialType : "farcaster" | "ens" | "lens",spellCheck : Booleanish,srcSet : string,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",useMap : string,vocab : string,width : string | number}
```

### Returns

```ts
let returnType: null | Element;
```

An `<img />` if the avatar is resolved successfully
---

###### Connect SDK

## AccountBalance

This component fetches and shows the balance of the wallet address on a given chain. It inherits all the attributes of a HTML `<span>` component, hence you can style it just like how you would style a normal `<span>`

### Example

#### Basic usage

```tsx
import { AccountProvider, AccountBalance } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<AccountProvider address="0x...">
  <AccountBalance chain={ethereum} />
</AccountProvider>;
```

Result:

```html
<span>1.091435 ETH</span>
```

#### Format the balance (round up, shorten etc.)

The AccountBalance component accepts a `formatFn` which takes in an object of type `AccountBalanceInfo` and outputs a string The function is used to modify the display value of the wallet balance (either in crypto or fiat)

```tsx
import type { AccountBalanceInfo } from "thirdweb/react";
import { formatNumber } from "thirdweb/utils";
 
const format = (props: AccountInfoBalance):string => `${formatNumber(props.balance, 1)} ${props.symbol.toLowerCase()}`
 
<AccountBalance formatFn={format} />
```

Result:

```html
<span>1.1 eth</span> // the balance is rounded up to 1 decimal and the symbol is lowercased
```

#### Show a loading sign when the balance is being fetched

```tsx
import { AccountProvider, AccountBalance } from "thirdweb/react";
 
<AccountProvider address="0x...">
  <AccountBalance chain={ethereum} loadingComponent={<Spinner />} />
</AccountProvider>;
```

#### Fallback to something when the balance fails to resolve

```tsx
<AccountProvider address="0x...">
  <AccountBalance
    chain={nonExistentChain}
    fallbackComponent={"Failed to load"}
  />
</AccountProvider>;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<AccountBalance
  queryOptions={{
    enabled: isEnabled,
    retry: 4,
  }}
/>;
```

```ts
function AccountBalance(
  __namedParameters: AccountBalanceProps,
): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,chain : Readonly<(ChainOptions) & ({ rpc: string })>,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,formatFn : (props: AccountBalanceInfo) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<AccountBalanceInfo, Error, AccountBalanceInfo, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,showBalanceInFiat : SupportedFiatCurrency,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,tokenAddress : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```
---

###### Connect SDK

## AccountName

This component is used to display the name of the account. A "name" in this context is the username, or account of the social profiles that the wallet may have. In case a name is not found or failed to resolve, you can always fallback to displaying the wallet address instead by using the `fallbackComponent` prop.

This component inherits all attribute of a native HTML `<span>` element, so you can style it just like how you would style a `<span>`.

### Example

#### Basic usage

```tsx
import { AccountProvider, AccountName } from "thirdweb/react";
 
<AccountProvider address="0x1234...3f3f" client={client}>
  <AccountName />
</AccountProvider>;
```

#### Show wallet address while social name is being loaded

```tsx
<AccountName loadingComponent={<AccountAddress />} />;
```

#### Fallback to showing wallet address if fail to resolve social name

```tsx
<AccountName fallbackComponent={<AccountAddress />} />;
```

#### Transform the account name using `formatFn` prop

```tsx
import { isAddress, shortenAddress } from "thirdweb/utils";
import { AccountProvider, AccountName } from "thirdweb/react";
 
// Let's say we want the name to be capitalized without using CSS
const formatName = (name: string) => name.toUpperCase();
 
return <AccountName formatFn={formatName} />;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<AccountName
  queryOptions={{
    enabled: isEnabled,
    retry: 3,
  }}
/>;
```

```ts
function AccountName(props: AccountNameProps): null | Element;
```

### Parameters

#### Type

```ts
let props: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,formatFn : (str: string) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resolverAddress : string,resolverChain : Readonly<(ChainOptions) & ({ rpc: string })>,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,socialType : "farcaster" | "ens" | "lens",spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```

A `<span>` containing the name of the account

```html
<span>{name}</span>
```
---

###### Connect SDK

## WalletIcon

This component tries to resolve the icon of a given wallet, then return an image.

### Example

#### Basic usage

```tsx
import { WalletProvider, WalletIcon } from "thirdweb/react";
 
<WalletProvider id="io.metamask">
  <WalletIcon />
</WalletProvider>;
```

Result: An `<img />` component with the src of the icon

```html
<img src="metamask-icon.png" />
```

#### Show a loading sign while the icon is being loaded

```tsx
<WalletIcon loadingComponent={<Spinner />} />;
```

#### Fallback to a dummy image if the wallet icon fails to resolve

```tsx
<WalletIcon fallbackComponent={<img src="blank-image.png" />} />;
```

#### Usage with queryOptions

WalletIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic

```tsx
<WalletIcon queryOptions={{ enabled: someLogic, retry: 3 }} />;
```

```ts
function WalletIcon(
  __namedParameters: WalletIconProps,
): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,alt : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,children : ReactNode,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,crossOrigin : CrossOrigin,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,decoding : "auto" | "async" | "sync",defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,fetchPriority : "auto" | "high" | "low",height : string | number,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLImageElement>,onAbortCapture : ReactEventHandler<HTMLImageElement>,onAnimationEnd : AnimationEventHandler<HTMLImageElement>,onAnimationEndCapture : AnimationEventHandler<HTMLImageElement>,onAnimationIteration : AnimationEventHandler<HTMLImageElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLImageElement>,onAnimationStart : AnimationEventHandler<HTMLImageElement>,onAnimationStartCapture : AnimationEventHandler<HTMLImageElement>,onAuxClick : MouseEventHandler<HTMLImageElement>,onAuxClickCapture : MouseEventHandler<HTMLImageElement>,onBeforeInput : InputEventHandler<HTMLImageElement>,onBeforeInputCapture : FormEventHandler<HTMLImageElement>,onBeforeToggle : ToggleEventHandler<HTMLImageElement>,onBlur : FocusEventHandler<HTMLImageElement>,onBlurCapture : FocusEventHandler<HTMLImageElement>,onCanPlay : ReactEventHandler<HTMLImageElement>,onCanPlayCapture : ReactEventHandler<HTMLImageElement>,onCanPlayThrough : ReactEventHandler<HTMLImageElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLImageElement>,onChange : FormEventHandler<HTMLImageElement>,onChangeCapture : FormEventHandler<HTMLImageElement>,onClick : MouseEventHandler<HTMLImageElement>,onClickCapture : MouseEventHandler<HTMLImageElement>,onCompositionEnd : CompositionEventHandler<HTMLImageElement>,onCompositionEndCapture : CompositionEventHandler<HTMLImageElement>,onCompositionStart : CompositionEventHandler<HTMLImageElement>,onCompositionStartCapture : CompositionEventHandler<HTMLImageElement>,onCompositionUpdate : CompositionEventHandler<HTMLImageElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLImageElement>,onContextMenu : MouseEventHandler<HTMLImageElement>,onContextMenuCapture : MouseEventHandler<HTMLImageElement>,onCopy : ClipboardEventHandler<HTMLImageElement>,onCopyCapture : ClipboardEventHandler<HTMLImageElement>,onCut : ClipboardEventHandler<HTMLImageElement>,onCutCapture : ClipboardEventHandler<HTMLImageElement>,onDoubleClick : MouseEventHandler<HTMLImageElement>,onDoubleClickCapture : MouseEventHandler<HTMLImageElement>,onDrag : DragEventHandler<HTMLImageElement>,onDragCapture : DragEventHandler<HTMLImageElement>,onDragEnd : DragEventHandler<HTMLImageElement>,onDragEndCapture : DragEventHandler<HTMLImageElement>,onDragEnter : DragEventHandler<HTMLImageElement>,onDragEnterCapture : DragEventHandler<HTMLImageElement>,onDragExit : DragEventHandler<HTMLImageElement>,onDragExitCapture : DragEventHandler<HTMLImageElement>,onDragLeave : DragEventHandler<HTMLImageElement>,onDragLeaveCapture : DragEventHandler<HTMLImageElement>,onDragOver : DragEventHandler<HTMLImageElement>,onDragOverCapture : DragEventHandler<HTMLImageElement>,onDragStart : DragEventHandler<HTMLImageElement>,onDragStartCapture : DragEventHandler<HTMLImageElement>,onDrop : DragEventHandler<HTMLImageElement>,onDropCapture : DragEventHandler<HTMLImageElement>,onDurationChange : ReactEventHandler<HTMLImageElement>,onDurationChangeCapture : ReactEventHandler<HTMLImageElement>,onEmptied : ReactEventHandler<HTMLImageElement>,onEmptiedCapture : ReactEventHandler<HTMLImageElement>,onEncrypted : ReactEventHandler<HTMLImageElement>,onEncryptedCapture : ReactEventHandler<HTMLImageElement>,onEnded : ReactEventHandler<HTMLImageElement>,onEndedCapture : ReactEventHandler<HTMLImageElement>,onError : ReactEventHandler<HTMLImageElement>,onErrorCapture : ReactEventHandler<HTMLImageElement>,onFocus : FocusEventHandler<HTMLImageElement>,onFocusCapture : FocusEventHandler<HTMLImageElement>,onGotPointerCapture : PointerEventHandler<HTMLImageElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onInput : FormEventHandler<HTMLImageElement>,onInputCapture : FormEventHandler<HTMLImageElement>,onInvalid : FormEventHandler<HTMLImageElement>,onInvalidCapture : FormEventHandler<HTMLImageElement>,onKeyDown : KeyboardEventHandler<HTMLImageElement>,onKeyDownCapture : KeyboardEventHandler<HTMLImageElement>,onKeyPress : KeyboardEventHandler<HTMLImageElement>,onKeyPressCapture : KeyboardEventHandler<HTMLImageElement>,onKeyUp : KeyboardEventHandler<HTMLImageElement>,onKeyUpCapture : KeyboardEventHandler<HTMLImageElement>,onLoad : ReactEventHandler<HTMLImageElement>,onLoadCapture : ReactEventHandler<HTMLImageElement>,onLoadedData : ReactEventHandler<HTMLImageElement>,onLoadedDataCapture : ReactEventHandler<HTMLImageElement>,onLoadedMetadata : ReactEventHandler<HTMLImageElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLImageElement>,onLoadStart : ReactEventHandler<HTMLImageElement>,onLoadStartCapture : ReactEventHandler<HTMLImageElement>,onLostPointerCapture : PointerEventHandler<HTMLImageElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onMouseDown : MouseEventHandler<HTMLImageElement>,onMouseDownCapture : MouseEventHandler<HTMLImageElement>,onMouseEnter : MouseEventHandler<HTMLImageElement>,onMouseLeave : MouseEventHandler<HTMLImageElement>,onMouseMove : MouseEventHandler<HTMLImageElement>,onMouseMoveCapture : MouseEventHandler<HTMLImageElement>,onMouseOut : MouseEventHandler<HTMLImageElement>,onMouseOutCapture : MouseEventHandler<HTMLImageElement>,onMouseOver : MouseEventHandler<HTMLImageElement>,onMouseOverCapture : MouseEventHandler<HTMLImageElement>,onMouseUp : MouseEventHandler<HTMLImageElement>,onMouseUpCapture : MouseEventHandler<HTMLImageElement>,onPaste : ClipboardEventHandler<HTMLImageElement>,onPasteCapture : ClipboardEventHandler<HTMLImageElement>,onPause : ReactEventHandler<HTMLImageElement>,onPauseCapture : ReactEventHandler<HTMLImageElement>,onPlay : ReactEventHandler<HTMLImageElement>,onPlayCapture : ReactEventHandler<HTMLImageElement>,onPlaying : ReactEventHandler<HTMLImageElement>,onPlayingCapture : ReactEventHandler<HTMLImageElement>,onPointerCancel : PointerEventHandler<HTMLImageElement>,onPointerCancelCapture : PointerEventHandler<HTMLImageElement>,onPointerDown : PointerEventHandler<HTMLImageElement>,onPointerDownCapture : PointerEventHandler<HTMLImageElement>,onPointerEnter : PointerEventHandler<HTMLImageElement>,onPointerLeave : PointerEventHandler<HTMLImageElement>,onPointerMove : PointerEventHandler<HTMLImageElement>,onPointerMoveCapture : PointerEventHandler<HTMLImageElement>,onPointerOut : PointerEventHandler<HTMLImageElement>,onPointerOutCapture : PointerEventHandler<HTMLImageElement>,onPointerOver : PointerEventHandler<HTMLImageElement>,onPointerOverCapture : PointerEventHandler<HTMLImageElement>,onPointerUp : PointerEventHandler<HTMLImageElement>,onPointerUpCapture : PointerEventHandler<HTMLImageElement>,onProgress : ReactEventHandler<HTMLImageElement>,onProgressCapture : ReactEventHandler<HTMLImageElement>,onRateChange : ReactEventHandler<HTMLImageElement>,onRateChangeCapture : ReactEventHandler<HTMLImageElement>,onReset : FormEventHandler<HTMLImageElement>,onResetCapture : FormEventHandler<HTMLImageElement>,onScroll : UIEventHandler<HTMLImageElement>,onScrollCapture : UIEventHandler<HTMLImageElement>,onScrollEnd : UIEventHandler<HTMLImageElement>,onScrollEndCapture : UIEventHandler<HTMLImageElement>,onSeeked : ReactEventHandler<HTMLImageElement>,onSeekedCapture : ReactEventHandler<HTMLImageElement>,onSeeking : ReactEventHandler<HTMLImageElement>,onSeekingCapture : ReactEventHandler<HTMLImageElement>,onSelect : ReactEventHandler<HTMLImageElement>,onSelectCapture : ReactEventHandler<HTMLImageElement>,onStalled : ReactEventHandler<HTMLImageElement>,onStalledCapture : ReactEventHandler<HTMLImageElement>,onSubmit : FormEventHandler<HTMLImageElement>,onSubmitCapture : FormEventHandler<HTMLImageElement>,onSuspend : ReactEventHandler<HTMLImageElement>,onSuspendCapture : ReactEventHandler<HTMLImageElement>,onTimeUpdate : ReactEventHandler<HTMLImageElement>,onTimeUpdateCapture : ReactEventHandler<HTMLImageElement>,onToggle : ToggleEventHandler<HTMLImageElement>,onTouchCancel : TouchEventHandler<HTMLImageElement>,onTouchCancelCapture : TouchEventHandler<HTMLImageElement>,onTouchEnd : TouchEventHandler<HTMLImageElement>,onTouchEndCapture : TouchEventHandler<HTMLImageElement>,onTouchMove : TouchEventHandler<HTMLImageElement>,onTouchMoveCapture : TouchEventHandler<HTMLImageElement>,onTouchStart : TouchEventHandler<HTMLImageElement>,onTouchStartCapture : TouchEventHandler<HTMLImageElement>,onTransitionCancel : TransitionEventHandler<HTMLImageElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLImageElement>,onTransitionEnd : TransitionEventHandler<HTMLImageElement>,onTransitionEndCapture : TransitionEventHandler<HTMLImageElement>,onTransitionRun : TransitionEventHandler<HTMLImageElement>,onTransitionRunCapture : TransitionEventHandler<HTMLImageElement>,onTransitionStart : TransitionEventHandler<HTMLImageElement>,onTransitionStartCapture : TransitionEventHandler<HTMLImageElement>,onVolumeChange : ReactEventHandler<HTMLImageElement>,onVolumeChangeCapture : ReactEventHandler<HTMLImageElement>,onWaiting : ReactEventHandler<HTMLImageElement>,onWaitingCapture : ReactEventHandler<HTMLImageElement>,onWheel : WheelEventHandler<HTMLImageElement>,onWheelCapture : WheelEventHandler<HTMLImageElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,referrerPolicy : HTMLAttributeReferrerPolicy,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,sizes : string,slot : string,spellCheck : Booleanish,srcSet : string,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",useMap : string,vocab : string,width : string | number}
```

### Returns

```ts
let returnType: null | Element;
```

an `<img />` with the src of the wallet icon
---

###### Connect SDK

## deploySmartAccount

Deployes a smart account via a dummy transaction. If the account is already deployed, this will do nothing.

### Example

```ts
import { deploySmartAccount } from "thirdweb";
 
const account = await deploySmartAccount({
  smartAccount,
  chain,
  client,
  accountContract,
});
```

```ts
function deploySmartAccount(args: {
  accountContract: Readonly;
  chain: Readonly;
  client: ThirdwebClient;
  smartAccount: Account;
}): Promise<
  | undefined
  | {
      chain: Readonly;
      client: ThirdwebClient;
      maxBlocksWaitTime?: number;
      readonly transactionHash: `0x${string}`;
    }
>;
```

### Parameters

Arguments for the deployment.

#### Type

```ts
let args: {
  accountContract: Readonly;
  chain: Readonly;
  client: ThirdwebClient;
  smartAccount: Account;
};
```

### Returns

```ts
let returnType: Promise<
  | undefined
  | {
      chain: Readonly;
      client: ThirdwebClient;
      maxBlocksWaitTime?: number;
      readonly transactionHash: `0x${string}`;
    }
>;
```
---

###### Connect SDK

## getUser

Gets user based on the provided query parameters. This function is only available on the server (a secret key is required in the client).

### Example

```ts
import { getUser } from "thirdweb/wallets";
 
const user = await getUser({
  client,
  walletAddress: "0x123...",
});
```

```ts
function getUser(options: {
  client: ThirdwebClient;
  ecosystem?: Ecosystem;
  email?: string;
  externalWalletAddress?: string;
  id?: string;
  phone?: string;
  walletAddress?: string;
}): Promise<null | GetUserResult>;
```

### Parameters

The options for the get user function.

#### Type

```ts
let options: {
  client: ThirdwebClient;
  ecosystem?: Ecosystem;
  email?: string;
  externalWalletAddress?: string;
  id?: string;
  phone?: string;
  walletAddress?: string;
};
```

### Returns

```ts
let returnType: {
  createdAt: string;
  email?: string;
  phone?: string;
  profiles: Array<Profile>;
  smartAccountAddress?: string;
  userId: string;
  walletAddress: string;
};
```

A user object or null if not found.
---

###### Connect SDK

## authenticate

Authenticates the user based on the provided authentication arguments.

### Example

```ts
import { authenticate } from "thirdweb/wallets/in-app";
 
const result = await authenticate({
  client,
  strategy: "email",
  email: "example@example.org",
  verificationCode: "123456",
});
```

Authenticate to a backend account (only do this on your backend):

```ts
import { authenticate } from "thirdweb/wallets/in-app";
 
const result = await authenticate({
  client,
  strategy: "backend",
  walletSecret: "...", // Provided by your app
});
```

```ts
function authenticate(
  args: AuthArgsType,
): Promise<AuthStoredTokenWithCookieReturnType>;
```

### Parameters

The authentication arguments.

#### Type

```ts
let args: AuthArgsType;
```

### Returns

```ts
let returnType: Promise<AuthStoredTokenWithCookieReturnType>;
```

A promise that resolves to the authentication result.
---

###### Connect SDK

## authenticateWithRedirect

Authenticates the user based on the provided authentication arguments using a redirect.

### Example

```ts
import { authenticateWithRedirect } from "thirdweb/wallets/in-app";
 
const result = await authenticateWithRedirect({
  client,
  strategy: "google",
  mode: "redirect",
  redirectUrl: "https://example.org",
});
```

```ts
function authenticateWithRedirect(
  args: SocialAuthArgsType & {
    client: ThirdwebClient;
    ecosystem?: Ecosystem;
  },
): Promise<void>;
```

### Parameters

The authentication arguments.

#### Type

```ts
let args: SocialAuthArgsType & {
  client: ThirdwebClient;
  ecosystem?: Ecosystem;
};
```

### Returns

```ts
let returnType: Promise<void>;
```

A promise that resolves to the authentication result.
---

###### Connect SDK

## createWallet

Creates a wallet based on the provided ID and arguments.

* Supports 500+ wallets
* Handles both injected browser wallets and WalletConnect sessions

[View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)

### Example

### Connecting the wallet

Once created, you can connect the wallet to your app by calling the `connect` method.

The `connect` method returns a promise that resolves to the connected account.

Each wallet type can have different connect options. [View the different connect options](https://portal.thirdweb.com/references/typescript/v5/WalletConnectionOption)

### Connecting to an injected wallet

```ts
import { createWallet } from "thirdweb/wallets";
 
const metamaskWallet = createWallet("io.metamask");
 
const account = await metamaskWallet.connect({
  client,
});
```

You can check if a wallet is installed by calling the [injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider) method.

### Connecting via WalletConnect modal

```ts
import { createWallet } from "thirdweb/wallets";
 
const metamaskWallet = createWallet("io.metamask");
 
await metamask.connect({
  client,
  walletConnect: {
    projectId: "YOUR_PROJECT_ID",
    showQrModal: true,
    appMetadata: {
      name: "My App",
      url: "https://my-app.com",
      description: "my app description",
      logoUrl: "https://path/to/my-app/logo.svg",
    },
  },
});
```

[View ConnectWallet connection options](https://portal.thirdweb.com/references/typescript/v5/WCConnectOptions)

### Connecting with coinbase wallet

```ts
import { createWallet } from "thirdweb/wallets";
 
const cbWallet = createWallet("com.coinbase.wallet", {
  appMetadata: {
    name: "My App",
    url: "https://my-app.com",
    description: "my app description",
    logoUrl: "https://path/to/my-app/logo.svg",
  },
  walletConfig: {
    // options: 'all' | 'smartWalletOnly' | 'eoaOnly'
    options: "all",
  },
});
 
const account = await cbWallet.connect({
  client,
});
```

[View Coinbase wallet creation options](https://portal.thirdweb.com/references/typescript/v5/CoinbaseWalletCreationOptions)

### Connecting with a smart wallet

```ts
import { createWallet } from "thirdweb/wallets";
 
const wallet = createWallet("smart", {
  chain: sepolia,
  sponsorGas: true,
});
 
const account = await wallet.connect({
  client,
  personalAccount, // pass the admin account
});
```

```ts
function createWallet(...args: CreateWalletArgs<ID>): Wallet<ID>;
```

### Parameters

The arguments for creating the wallet.

#### Type

```ts
let args: CreateWalletArgs<ID>;
```

### Returns

```ts
let returnType: Wallet<ID>;
```

* The created wallet.
---

###### Connect SDK

## createWalletAdapter

Creates a wallet from the given account.

You can use this to:

* convert a third party library wallet (wagmi, viem, ethers) into a thirdweb wallet.
* connect with a private key (for automated tests)

Available wallet adatpers:

* [Viem](https://portal.thirdweb.com/references/typescript/v5/viemAdapter)
* [Ethers 6](https://portal.thirdweb.com/references/typescript/v5/ethers6Adapter)
* [Ethers 5](https://portal.thirdweb.com/references/typescript/v5/ethers5Adapter)

### Example

```ts
import { createWalletAdapter } from "thirdweb";
 
const wallet = createWalletAdapter({
  client,
  adaptedAccount,
  chain,
  onDisconnect: () => {
    // disconnect logic
  },
  switchChain: async (chain) => {
    // switch chain logic
  },
});
```

```ts
function createWalletAdapter(
  options: AdapterWalletOptions,
): Wallet<"adapter">;
```

### Parameters

The options for the adapter wallet.

#### Type

```ts
let options: {
  adaptedAccount: Account;
  chain: Chain;
  client: ThirdwebClient;
  onDisconnect: () => Promise<void> | void;
  switchChain: (chain: Chain) => Promise<void> | void;
};
```

### Returns

```ts
let returnType: Wallet<"adapter">;
```

a wallet instance.
---

###### Connect SDK

## createWalletConnectClient

Creates a new WalletConnect client for interacting with another application.

### Example

```ts
import { createWalletConnectClient } from "thirdweb/wallets";
 
const client = await createWalletConnectClient({
  wallet: wallet,
  client: client,
});
```

Pass custom handlers:

```ts
import { createWalletConnectClient } from "thirdweb/wallets";
 
const client = await createWalletConnectClient({
  wallet: wallet,
  client: client,
  requestHandlers: {
    eth_signTransaction: ({ account, chainId, params }) => {
      // handle transaction signing
    },
  },
});
```

Pass connect and disconnect callbacks:

```ts
import { createWalletConnectClient } from "thirdweb/wallets";
 
const client = await createWalletConnectClient({
  wallet: wallet,
  client: client,
  onConnect: (session) => {
    console.log("Connected to WalletConnect", session);
  },
  onDisconnect: (session) => {
    console.log("Disconnected from WalletConnect", session);
  },
});
```

```ts
function createWalletConnectClient(options: {
  appMetadata?: AppMetadata;
  chains?: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  onConnect?: (session: WalletConnectSession) => void;
  onDisconnect?: (session: WalletConnectSession) => void;
  onError?: (error: Error) => void;
  projectId?: string;
  requestHandlers?: {
    eth_sendRawTransaction?: (_: {
      account: Account;
      chainId: number;
      params: WalletConnectRawTransactionRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_sendTransaction?: (_: {
      account: Account;
      chainId: number;
      params: WalletConnectTransactionRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_sign?: (_: {
      account: Account;
      params: WalletConnectSignRequestPrams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_signTransaction?: (_: {
      account: Account;
      params: WalletConnectTransactionRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_signTypedData?: (_: {
      account: Account;
      params: WalletConnectSignTypedDataRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_signTypedData_v4?: (_: {
      account: Account;
      params: WalletConnectSignTypedDataRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    personal_sign?: (_: {
      account: Account;
      params: WalletConnectSignRequestPrams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    wallet_addEthereumChain?: (_: {
      params: WalletConnectAddEthereumChainRequestParams;
      wallet: Wallet;
    }) => Promise<`0x${string}`>;
    wallet_switchEthereumChain?: (_: {
      params: WalletConnectSwitchEthereumChainRequestParams;
      wallet: Wallet;
    }) => Promise<`0x${string}`>;
  };
  wallet: Wallet;
}): Promise<SignClient>;
```

### Parameters

The options to use to create the WalletConnect client.

#### Type

```ts
let options: {
  appMetadata?: AppMetadata;
  chains?: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  onConnect?: (session: WalletConnectSession) => void;
  onDisconnect?: (session: WalletConnectSession) => void;
  onError?: (error: Error) => void;
  projectId?: string;
  requestHandlers?: {
    eth_sendRawTransaction?: (_: {
      account: Account;
      chainId: number;
      params: WalletConnectRawTransactionRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_sendTransaction?: (_: {
      account: Account;
      chainId: number;
      params: WalletConnectTransactionRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_sign?: (_: {
      account: Account;
      params: WalletConnectSignRequestPrams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_signTransaction?: (_: {
      account: Account;
      params: WalletConnectTransactionRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_signTypedData?: (_: {
      account: Account;
      params: WalletConnectSignTypedDataRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    eth_signTypedData_v4?: (_: {
      account: Account;
      params: WalletConnectSignTypedDataRequestParams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    personal_sign?: (_: {
      account: Account;
      params: WalletConnectSignRequestPrams;
    }) => Promise<`0x${string}` | WalletConnectRequestError>;
    wallet_addEthereumChain?: (_: {
      params: WalletConnectAddEthereumChainRequestParams;
      wallet: Wallet;
    }) => Promise<`0x${string}`>;
    wallet_switchEthereumChain?: (_: {
      params: WalletConnectSwitchEthereumChainRequestParams;
      wallet: Wallet;
    }) => Promise<`0x${string}`>;
  };
  wallet: Wallet;
};
```

### Returns

```ts
let returnType: Promise<SignClient>;
```

The WalletConnect client. Use this client to connect to a WalletConnect URI with createWalletConnectSession.
---

###### Connect SDK

## createWalletConnectSession

Initiates a new WalletConnect session for interacting with another application.

### Example

```ts
import {
  createWalletConnectClient,
  createWalletConnectSession,
} from "thirdweb/wallets";
 
const client = await createWalletConnectClient({
  wallet: wallet,
  client: client,
});
 
const session = createWalletConnectSession({
  walletConnectClient: client,
  uri: "wc:...",
});
```

```ts
function createWalletConnectSession(
  options: CreateWalletConnectSessionOptions,
): void;
```

### Parameters

The options to use to create the WalletConnect session.

#### Type

```ts
let options: CreateWalletConnectSessionOptions;
```

### Returns

```ts
let returnType: void;
```
---

###### Connect SDK

## disconnectWalletConnectSession

Disconnects a WalletConnect session.

### Example

```ts
import { disconnectWalletConnectSession } from "thirdweb/wallets";
 
await disconnectWalletConnectSession({
  session: mySession,
  walletConnectClient: wcClient,
});
```

```ts
function disconnectWalletConnectSession(options: {
  session: WalletConnectSession;
  walletConnectClient: SignClient;
}): Promise<void>;
```

### Parameters

The options to use to disconnect the WalletConnect session.

#### Type

```ts
let options: {
  session: WalletConnectSession;
  walletConnectClient: SignClient;
};
```

### Returns

```ts
let returnType: Promise<void>;
```
---

###### Connect SDK

## ecosystemWallet

Creates an [Ecosystem Wallet](https://portal.thirdweb.com/connect/wallet/overview) based on various authentication methods. Full list of available authentication methods [here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure).

Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods.

Refer to [inAppWallet](https://portal.thirdweb.com/typescript/v5/inAppWallet) for detailed usage examples.

### Example

#### Logging into an ecosystem wallet

Below is the general code snippet needed to connect via a given auth strategy to an ecosystem wallet. For more variants on the various auth strategies, refer to [inAppWallet](https://portal.thirdweb.com/typescript/v5/inAppWallet).

```ts
import { ecosystemWallet } from "thirdweb/wallets";
 
const wallet = ecosystemWallet("ecosystem.hooli");
 
const account = await wallet.connect({
  client,
  chain,
  strategy: "google",
});
```

[View all connection options](https://portal.thirdweb.com/references/typescript/v5/EcosystemWalletConnectionOptions).

#### Connect to a restricted ecosystem wallet with your designated partner ID

The partner ID will be provided to you by the ecosystem with which you're integrating.

```ts
import { ecosystemWallet } from "thirdweb/wallets";
const wallet = ecosystemWallet("ecosystem.hooli", {
  partnerId: "...",
});
```

```ts
function ecosystemWallet(
  id: `ecosystem.${string}`,
  options: EcosystemWalletCreationOptions,
): Wallet<`ecosystem.${string}`>;
```

### Parameters

#### Type

```ts
let id: `ecosystem.${string}`;
```

#### Type

```ts
let options: {
  auth?: {
    allowedSmsCountryCodes?: Array<SupportedSmsCountry>;
    defaultSmsCountryCode?: SupportedSmsCountry;
    mode?: "popup" | "redirect" | "window";
    redirectUrl?: string;
  };
  partnerId?: string;
  storage?: AsyncStorage;
};
```

### Returns

```ts
let returnType: Wallet<`ecosystem.${string}`>;
```

The created ecosystem wallet.
---

###### Connect SDK

## getActiveWalletConnectSessions

Retrieves all active WalletConnect sessions.

### Example

```ts
import { getActiveWalletConnectSessions } from "thirdweb/wallets";
 
const sessions = await getActiveWalletConnectSessions();
```

```ts
function getActiveWalletConnectSessions(): Promise<
  Array<WalletConnectSession>
>;
```

### Returns

```ts
let returnType: { origin?: string; topic: string };
```

All active WalletConnect sessions.
---

###### Connect SDK

## getProfiles

Gets the linked profiles for the connected in-app or ecosystem wallet.

### Example

```ts
import { getProfiles } from "thirdweb/wallets";
 
const profiles = await getProfiles({
  client,
});
 
console.log(profiles[0].type); // will be "email", "phone", "google", "discord", etc
console.log(profiles[0].details.email);
console.log(profiles[0].details.phone);
```

#### Getting profiles for a ecosystem user

```ts
import { getProfiles } from "thirdweb/wallets/in-app";
 
const profiles = await getProfiles({
  client,
  ecosystem: {
    id: "ecosystem.your-ecosystem-id",
  },
});
```

```ts
function getProfiles(
  args: GetAuthenticatedUserParams,
): Promise<Array<Profile>>;
```

### Parameters

#### Type

```ts
let args: { client: ThirdwebClient; ecosystem?: Ecosystem };
```

### Returns

```ts
let returnType: {
  details: {
    address?: Address;
    email?: string;
    id?: string;
    phone?: string;
  };
  type: AuthOption;
};
```

An array of accounts user profiles linked to the connected wallet.
---

###### Connect SDK

## getUserEmail

Retrieves the authenticated user email for the active in-app wallet.

### Example

```ts
import { getUserEmail } from "thirdweb/wallets/in-app";
 
const email = await getUserEmail({ client });
console.log(email);
```

```ts
function getUserEmail(
  options: GetAuthenticatedUserParams,
): Promise<undefined | string>;
```

### Parameters

The arguments for retrieving the authenticated user.

#### Type

```ts
let options: { client: ThirdwebClient; ecosystem?: Ecosystem };
```

### Returns

```ts
let returnType: Promise<undefined | string>;
```

The authenticated user email if logged in and wallet initialized, otherwise undefined.
---

###### Connect SDK

## getUserPhoneNumber

Retrieves the authenticated user phone number for the active embedded wallet.

### Example

```ts
import { getUserPhoneNumber } from "thirdweb/wallets/embedded";
 
const phoneNumber = await getUserPhoneNumber({ client });
console.log(phoneNumber);
```

```ts
function getUserPhoneNumber(
  options: GetAuthenticatedUserParams,
): Promise<undefined | string>;
```

### Parameters

The arguments for retrieving the authenticated user.

#### Type

```ts
let options: { client: ThirdwebClient; ecosystem?: Ecosystem };
```

### Returns

```ts
let returnType: Promise<undefined | string>;
```

The authenticated user phone number if authenticated with phone number, otherwise undefined.
---

###### Connect SDK

## inAppWallet

Creates an app scoped wallet for users based on various authentication methods. Full list of available authentication methods [here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure).

Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods.

### Example

#### Login with socials

```ts
import { inAppWallet } from "thirdweb/wallets";
 
const wallet = inAppWallet();
 
const account = await wallet.connect({
  client,
  chain,
  strategy: "google", // or "apple", "facebook","discord", "github", "twitch", "x", "telegram", "line", "coinbase", etc
});
```

[View all available social auth methods](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure)

#### Enable smart accounts and sponsor gas for your users:

With the `executionMode` option, you can enable smart accounts and sponsor gas for your users.

_Using EIP-7702_ (recommended):

On chains with EIP-7702 enabled, you can upgrade the inapp wallet to a smart account, keeping the same address and performance as the regular EOA.

```ts
import { inAppWallet } from "thirdweb/wallets";
import { sepolia } from "thirdweb/chains";
 
const wallet = inAppWallet({
  executionMode: {
    mode: "EIP7702",
    sponsorGas: true,
  },
});
 
// account will be a smart account with sponsored gas enabled
const account = await wallet.connect({
  client,
  strategy: "google",
});
```

_Using EIP-4337_:

On chains without EIP-7702 enabled, you can still use smart accounts using EIP-4337, this will return a different address (the smart contract address) than the regular EOA.

```ts
import { inAppWallet } from "thirdweb/wallets/in-app";
 
const wallet = inAppWallet({
  executionMode: {
    mode: "EIP4337",
    smartAccount: {
      chain: sepolia, // chain required for EIP-4337
      sponsorGas: true,
    },
  },
});
```

#### Login with email

To login with email, you can use the `preAuthenticate` function to first send a verification code to the user's email, then login with the verification code.

```ts
import {
  inAppWallet,
  preAuthenticate,
} from "thirdweb/wallets/in-app";
 
const wallet = inAppWallet();
 
// sends a verification code to the provided email
await preAuthenticate({
  client,
  strategy: "email",
  email: "example@example.com",
});
 
// login with the verification code
const account = await wallet.connect({
  client,
  chain,
  strategy: "email",
  email: "example@example.com",
  verificationCode: "123456",
});
```

#### Login with phone number

Similar to email, you can login with a phone number by first sending a verification code to the user's phone number, then login with the verification code.

```ts
import {
  inAppWallet,
  preAuthenticate,
} from "thirdweb/wallets/in-app";
 
const wallet = inAppWallet();
 
// sends a verification code to the provided phone number
await preAuthenticate({
  client,
  strategy: "phone",
  phoneNumber: "+1234567890",
});
 
// login with the verification code
const account = await wallet.connect({
  client,
  chain,
  strategy: "phone",
  honeNumber: "+1234567890",
  verificationCode: "123456",
});
```

#### Login with another wallet (SIWE)

You can also login to the in-app wallet with another existing wallet by signing a standard Sign in with Ethereum (SIWE) message.

```ts
import { inAppWallet, createWallet } from "thirdweb/wallets";
 
const rabby = createWallet("io.rabby");
const inAppWallet = inAppWallet();
 
const account = await inAppWallet.connect({
  strategy: "wallet",
  chain: mainnet,
  wallet: rabby,
  client: MY_CLIENT,
});
```

#### Login with passkey

You can also login with a passkey. This mode requires specifying whether it should create a new passkey, or sign in with an existing passkey. We recommend checking if the user has a passkey stored in their browser to automatically login with it.

```ts
import {
  inAppWallet,
  hasStoredPasskey,
} from "thirdweb/wallets/in-app";
 
const wallet = inAppWallet();
 
const wallet = inAppWallet();
const hasPasskey = await hasStoredPasskey(client);
await wallet.connect({
  client,
  strategy: "passkey",
  type: hasPasskey ? "sign-in" : "sign-up",
});
```

#### Connect to a guest account

You can also connect to a guest account, this will create a new account for the user instantly and store it in the browser's local storage.

You can later "upgrade" this account by linking another auth method, like email or phone for example. This will preserve the account's address and history.

```ts
import { inAppWallet } from "thirdweb/wallets";
 
const wallet = inAppWallet();
 
const account = await wallet.connect({
  client,
  strategy: "guest",
});
```

#### Connect to a backend account

For usage in backends, you can create wallets with the `backend` strategy and a stable walletSecret.

Make sure to keep that walletSecret safe as it is the key to access that wallet, never expose it to the client.

```ts
import { inAppWallet } from "thirdweb/wallets";
 
const wallet = inAppWallet();
 
const account = await wallet.connect({
  client,
  strategy: "backend",
  walletSecret: "...", // Your own secret, keep it safe
});
```

#### Connect with custom JWT (any OIDC provider)

You can use any OIDC provider to authenticate your users. Make sure to configure it in your dashboard under in-app wallet settings.

```ts
import { inAppWallet } from "thirdweb/wallets";
 
const wallet = inAppWallet();
 
const account = await wallet.connect({
  client,
  strategy: "jwt",
  jwt: "your_jwt_here",
});
```

#### Connect with custom endpoint

You can also use your own endpoint to authenticate your users. Make sure to configure it in your dashboard under in-app wallet settings.

```ts
import { inAppWallet } from "thirdweb/wallets";
 
const wallet = inAppWallet();
 
const account = await wallet.connect({
  client,
  strategy: "auth_endpoint",
  payload: "your_auth_payload_here",
});
```

#### Specify a logo, icon and name for your login page (Connect UI)

You can specify a logo, icon and name for your login page to customize how in-app wallets are displayed in the Connect UI components (ConnectButton and ConnectEmbed).

```ts
import { inAppWallet } from "thirdweb/wallets";
const wallet = inAppWallet({
  metadata: {
    name: "My App",
    icon: "https://example.com/icon.png",
    image: {
      src: "https://example.com/logo.png",
      alt: "My logo",
      width: 100,
      height: 100,
    },
  },
});
```

#### Hide the ability to export the private key within the Connect Modal UI

By default, the Connect Modal will show a button to export the private key of the wallet. You can hide this button by setting the `hidePrivateKeyExport` option to `true`.

```ts
import { inAppWallet } from "thirdweb/wallets";
const wallet = inAppWallet({
  hidePrivateKeyExport: true,
});
```

#### Open the Oauth window in the same tab

By default, the Oauth window will open in a popup window. You can change this behavior by setting the `auth.mode` option to `"redirect"`.

```ts
import { inAppWallet } from "thirdweb/wallets";
const wallet = inAppWallet({
  auth: {
    mode: "redirect",
  },
});
```

#### Override storage for the wallet state

By default, wallet state is stored in the browser's local storage if in the browser, or in-memory storage if not in the browser. You can override this behavior by providing a custom storage object, useful for server side and CLI integrations.

```ts
import { inAppWallet } from "thirdweb/wallets";
import { AsyncStorage } from "thirdweb/storage";
 
const myStorage: AsyncStorage = {
  getItem: async (key) => {
    return customGet(`CUSTOM_STORAGE_KEY${key}`);
  },
  setItem: async (key, value) => {
    return customSet(`CUSTOM_STORAGE_KEY${key}`, value);
  },
  removeItem: async (key) => {
    return customRemove(`CUSTOM_STORAGE_KEY${key}`);
  },
};
 
const wallet = inAppWallet({
  storage: myStorage,
});
```

```ts
function inAppWallet(
  createOptions?: InAppWalletCreationOptions,
): Wallet<"inApp">;
```

### Parameters

configuration options Refer to [InAppWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/InAppWalletCreationOptions) to see the available options.

#### Type

```ts
let createOptions:
  | {
      auth?: {
        allowedSmsCountryCodes?: Array<SupportedSmsCountry>;
        defaultSmsCountryCode?: SupportedSmsCountry;
        mode?: "popup" | "redirect" | "window";
        options: Array<InAppWalletAuth>;
        passkeyDomain?: string;
        redirectUrl?: string;
      };
      executionMode?: ExecutionModeOptions;
      hidePrivateKeyExport?: boolean;
      metadata?: {
        icon?: string;
        image?: {
          alt?: string;
          height?: number;
          src: string;
          width?: number;
        };
        name?: string;
      };
      partnerId?: string;
      smartAccount?: SmartWalletOptions;
      storage?: AsyncStorage;
    }
  | undefined;
```

### Returns

```ts
let returnType: Wallet<"inApp">;
```

The created in-app wallet.
---

###### Connect SDK

## linkProfile

Connects a new profile (and new authentication method) to the current user.

Requires a connected in-app or ecosystem account.

_When a profile is linked to the account, that profile can then be used to sign into the same account._

### Example

```ts
import { linkProfile } from "thirdweb/wallets";
 
// optionally specify the ecosystem if you're linking an ecosystem wallet
await linkProfile({ client, strategy: "discord" });
```

```ts
function linkProfile(args: AuthArgsType): Promise<Array<Profile>>;
```

### Parameters

#### Type

```ts
let args: AuthArgsType;
```

### Returns

```ts
let returnType: {
  details: {
    address?: Address;
    email?: string;
    id?: string;
    phone?: string;
  };
  type: AuthOption;
};
```

A promise that resolves to the currently linked profiles when the connection is successful.
---

###### Connect SDK

## preAuthenticate

Pre-authenticates the user based on the provided authentication strategy. Use this function to send a verification code to the user's email or phone number.

### Example

```ts
import { preAuthenticate } from "thirdweb/wallets/in-app";
 
const result = await preAuthenticate({
  client,
  strategy: "email",
  email: "example@example.org",
});
```

```ts
function preAuthenticate(args: PreAuthArgsType): Promise<void>;
```

### Parameters

The arguments required for pre-authentication.

#### Type

```ts
let args: PreAuthArgsType;
```

### Returns

```ts
let returnType: Promise<void>;
```

A promise that resolves to the pre-authentication result.
---

###### Connect SDK

## privateKeyToAccount

Get an `Account` object from a private key.

### Example

```ts
import { privateKeyToAccount } from "thirdweb/wallets";
 
const wallet = privateKeyToAccount({
  client,
  privateKey: "...",
});
```

```ts
function privateKeyToAccount(
  options: PrivateKeyToAccountOptions,
): Account;
```

### Parameters

The options for `privateKeyToAccount`Refer to the type [PrivateKeyToAccountOptions](https://portal.thirdweb.com/references/typescript/v5/PrivateKeyToAccountOptions)

#### Type

```ts
let options: { client: ThirdwebClient; privateKey: string };
```

### Returns

```ts
let returnType: {
  address: Address;
  estimateGas?: (tx: PreparedTransaction) => Promise<bigint>;
  onTransactionRequested?: (
    transaction: PreparedTransaction<any>,
  ) => Promise<void>;
  sendBatchTransaction?: (
    txs: Array<SendTransactionOption>,
  ) => Promise<SendTransactionResult>;
  sendRawTransaction?: (
    tx: SendRawTransactionOptions,
  ) => Promise<SendTransactionResult>;
  sendTransaction: (
    tx: SendTransactionOption,
  ) => Promise<SendTransactionResult>;
  signAuthorization?: (
    authorization: AuthorizationRequest,
  ) => Promise<SignedAuthorization>;
  signMessage: ({
    message,
    originalMessage,
    chainId,
  }: {
    chainId?: number;
    message: SignableMessage;
    originalMessage?: string;
  }) => Promise<Hex>;
  signTransaction?: (tx: SerializableTransaction) => Promise<Hex>;
  signTypedData: (
    _typedData: ox__TypedData.Definition<typedData, primaryType>,
  ) => Promise<Hex>;
  watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;
};
```

The `Account` object that represents the private key
---

###### Connect SDK

## smartWallet

Creates a ERC4337 smart wallet based on a admin account.

Smart wallets are smart contract wallets that enable multiple benefits for users:

* Sponsor gas fees for transactions
* Multiple owners
* Session keys
* Batch transactions
* Predictable addresses
* Programmable features

[Learn more about account abstraction](https://portal.thirdweb.com/connect/account-abstraction/how-it-works)

### Example

### Connect to a smart wallet

To connect to a smart wallet, you need to provide an admin account as the `personalAccount` option.

Any wallet can be used as an admin account, including an in-app wallets.

The `sponsorGas` option is used to enable sponsored gas for transactions automatically.

```ts
import { smartWallet, inAppWallet } from "thirdweb/wallets";
import { sepolia } from "thirdweb/chains";
import { sendTransaction } from "thirdweb";
 
const wallet = smartWallet({
  chain: sepolia,
  sponsorGas: true, // enable sponsored transactions
});
 
// any wallet can be used as an admin account
// in this example we use an in-app wallet
const adminWallet = inAppWallet();
const personalAccount = await adminWallet.connect({
  client,
  chain: sepolia,
  strategy: "google",
});
 
const smartAccount = await wallet.connect({
  client,
  personalAccount, // pass the admin account
});
 
// sending sponsored transactions with the smartAccount
await sendTransaction({
  account: smartAccount,
  transaction,
});
```

### Using a custom account factory

You can pass a custom account factory to the `smartWallet` function to use a your own account factory.

```ts
import { smartWallet } from "thirdweb/wallets";
import { sepolia } from "thirdweb/chains";
 
const wallet = smartWallet({
  chain: sepolia,
  sponsorGas: true, // enable sponsored transactions
  factoryAddress: "0x...", // custom factory address
});
```

### Using v0.7 Entrypoint

Both v0.6 (default) and v0.7 ERC4337 Entrypoints are supported. To use the v0.7 Entrypoint, simply pass in a compatible account factory.

You can use the predeployed `DEFAULT_ACCOUNT_FACTORY_V0_7` or deploy your own [AccountFactory v0.7](https://thirdweb.com/thirdweb.eth/AccountFactory%5F0%5F7).

```ts
import {
  smartWallet,
  DEFAULT_ACCOUNT_FACTORY_V0_7,
} from "thirdweb/wallets/smart";
import { sepolia } from "thirdweb/chains";
 
const wallet = smartWallet({
  chain: sepolia,
  sponsorGas: true, // enable sponsored transactions
  factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7, // 0.7 factory address
});
```

### Configuring the smart wallet

You can pass options to the `smartWallet` function to configure the smart wallet.

```ts
import { smartWallet } from "thirdweb/wallets";
import { sepolia } from "thirdweb/chains";
 
const wallet = smartWallet({
 chain: sepolia,
 sponsorGas: true, // enable sponsored transactions
 factoryAddress: "0x...", // custom factory address
 overrides: {
   accountAddress: "0x...", // override account address
   accountSalt: "0x...", // override account salt
   entrypointAddress: "0x...", // override entrypoint address
   tokenPaymaster: TokenPaymaster.BASE_USDC, // enable erc20 paymaster
   bundlerUrl: "https://...", // override bundler url
   paymaster: (userOp) => { ... }, // override paymaster
   ...
 }
});
```

Refer to [SmartWalletOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletOptions) for more details.

```ts
function smartWallet(
  createOptions: SmartWalletOptions,
): Wallet<"smart">;
```

### Parameters

The options for creating the wallet. Refer to [SmartWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletCreationOptions) for more details.

#### Type

```ts
let createOptions: Prettify<
  {
    chain: Chain;
    factoryAddress?: string;
    overrides?: {
      accountAddress?: string;
      accountSalt?: string;
      bundlerUrl?: string;
      createAccount?: (
        factoryContract: ThirdwebContract,
        admin: string,
      ) => PreparedTransaction;
      entrypointAddress?: string;
      execute?: (
        accountContract: ThirdwebContract,
        transaction: SendTransactionOption,
      ) => PreparedTransaction;
      executeBatch?: (
        accountContract: ThirdwebContract,
        transactions: Array<SendTransactionOption>,
      ) => PreparedTransaction;
      getAccountNonce?: (
        accountContract: ThirdwebContract,
      ) => Promise<bigint>;
      paymaster?: (
        userOp: UserOperationV06 | UserOperationV07,
      ) => Promise<PaymasterResult>;
      predictAddress?: (
        factoryContract: ThirdwebContract,
        admin: string,
      ) => Promise<string>;
      signMessage?: (options: {
        accountContract: ThirdwebContract;
        adminAccount: Account;
        factoryContract: ThirdwebContract;
        message: SignableMessage;
      }) => Promise<Hex>;
      signTypedData?: (options: {
        accountContract: ThirdwebContract;
        adminAccount: Account;
        factoryContract: ThirdwebContract;
        typedData: ox__TypedData.Definition<typedData, primaryType>;
      }) => Promise<Hex>;
      tokenPaymaster?: TokenPaymasterConfig;
    };
    sessionKey?: { address: string; permissions: AccountPermissions };
  } & ({ gasless: boolean } | { sponsorGas: boolean })
>;
```

### Returns

```ts
let returnType: Wallet<"smart">;
```

The created smart wallet.
---

###### Connect SDK

## unlinkProfile

Disconnects an existing profile (authentication method) from the current user. Once disconnected, that profile can no longer be used to sign into the account.

### Example

#### Unlinking an authentication method

```ts
import { inAppWallet } from "thirdweb/wallets";
 
const wallet = inAppWallet();
wallet.connect({ strategy: "google" });
 
const profiles = await getProfiles({
  client,
});
 
const updatedProfiles = await unlinkProfile({
  client,
  profileToUnlink: profiles[0],
});
```

#### Unlinking an authentication for ecosystems

```ts
import { unlinkProfile } from "thirdweb/wallets/in-app";
 
const updatedProfiles = await unlinkProfile({
  client,
  ecosystem: {
    id: "ecosystem.your-ecosystem-id",
  },
  profileToUnlink: profiles[0],
});
```

#### Unlinking an authentication method with account deletion

```ts
import { unlinkProfile } from "thirdweb/wallets/in-app";
 
const updatedProfiles = await unlinkProfile({
  client,
  profileToUnlink: profiles[0],
  allowAccountDeletion: true, // This will delete the account if it's the last profile linked to the account
});
```

```ts
function unlinkProfile(args: UnlinkParams): Promise<Array<Profile>>;
```

### Parameters

The object containing the profile that we want to unlink.

#### Type

```ts
let args: UnlinkParams;
```

### Returns

```ts
let returnType: {
  details: {
    address?: Address;
    email?: string;
    id?: string;
    phone?: string;
  };
  type: AuthOption;
};
```

A promise that resolves to the updated linked profiles.
---

###### Connect SDK

## walletConnect

Creates a wallet that allows connecting to any wallet that supports the WalletConnect protocol.

### Example

```ts
import { walletConnect } from "thirdweb/wallets";
 
const wallet = walletConnect();
 
const account = await wallet.connect({
  client,
});
```

```ts
function walletConnect(): Wallet<"walletConnect">;
```

### Returns

```ts
let returnType: Wallet<"walletConnect">;
```

The created smart wallet.
---

###### Connect SDK

## engineAccount

Deprecated

This for v2 dedicated engine instances, for v3 and engine cloud use Engine.serverWallet()

Creates an account that uses your engine backend wallet for sending transactions and signing messages.

### Example

```ts
import { engineAccount } from "thirdweb/wallets/engine";
 
const engineAcc = engineAccount({
  engineUrl: "https://engine.thirdweb.com",
  authToken: "your-auth-token",
  walletAddress: "0x...",
});
 
// then use the account as you would any other account
const transaction = claimTo({
  contract,
  to: "0x...",
  quantity: 1n,
});
const result = await sendTransaction({
  transaction,
  account: engineAcc,
});
console.log("Transaction sent:", result.transactionHash);
```

```ts
function engineAccount(options: EngineAccountOptions): Account;
```

### Parameters

The options for the engine account.

#### Type

```ts
let options: {
  authToken: string;
  chain?: Chain;
  engineUrl: string;
  overrides?: {
    accountAddress?: string;
    accountFactoryAddress?: string;
    accountSalt?: string;
  };
  walletAddress: string;
};
```

### Returns

```ts
let returnType: {
  address: Address;
  estimateGas?: (tx: PreparedTransaction) => Promise<bigint>;
  onTransactionRequested?: (
    transaction: PreparedTransaction<any>,
  ) => Promise<void>;
  sendBatchTransaction?: (
    txs: Array<SendTransactionOption>,
  ) => Promise<SendTransactionResult>;
  sendRawTransaction?: (
    tx: SendRawTransactionOptions,
  ) => Promise<SendTransactionResult>;
  sendTransaction: (
    tx: SendTransactionOption,
  ) => Promise<SendTransactionResult>;
  signAuthorization?: (
    authorization: AuthorizationRequest,
  ) => Promise<SignedAuthorization>;
  signMessage: ({
    message,
    originalMessage,
    chainId,
  }: {
    chainId?: number;
    message: SignableMessage;
    originalMessage?: string;
  }) => Promise<Hex>;
  signTransaction?: (tx: SerializableTransaction) => Promise<Hex>;
  signTypedData: (
    _typedData: ox__TypedData.Definition<typedData, primaryType>,
  ) => Promise<Hex>;
  watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;
};
```

An account that uses your engine backend wallet.
---

###### Connect SDK

## ERC7579.erc7579

Config for a ERC7579 modular smart wallet.

This configuration is in BETA, expect breaking changes.

### Example

```typescript
import { sepolia } from "thirdweb/chains";
import { smartWallet, Config } from "thirdweb/wallets/smart";
 
const modularSmartWallet = smartWallet(
  Config.erc7579({
    chain: sepolia,
    sponsorGas: true,
    factoryAddress: "0x...", // the 7579 factory address
    validatorAddress: "0x...", // the default validator module address
  }),
});
```

```ts
function erc7579(options: ERC7579Config): SmartWalletOptions;
```

### Parameters

Optional overrides for the smart wallet.

#### Type

```ts
let options: SmartWalletOptions & {
  factoryAddress: string;
  validatorAddress: string;
};
```

### Returns

```ts
let returnType: Prettify<
  {
    chain: Chain;
    factoryAddress?: string;
    overrides?: {
      accountAddress?: string;
      accountSalt?: string;
      bundlerUrl?: string;
      createAccount?: (
        factoryContract: ThirdwebContract,
        admin: string,
      ) => PreparedTransaction;
      entrypointAddress?: string;
      execute?: (
        accountContract: ThirdwebContract,
        transaction: SendTransactionOption,
      ) => PreparedTransaction;
      executeBatch?: (
        accountContract: ThirdwebContract,
        transactions: Array<SendTransactionOption>,
      ) => PreparedTransaction;
      getAccountNonce?: (
        accountContract: ThirdwebContract,
      ) => Promise<bigint>;
      paymaster?: (
        userOp: UserOperationV06 | UserOperationV07,
      ) => Promise<PaymasterResult>;
      predictAddress?: (
        factoryContract: ThirdwebContract,
        admin: string,
      ) => Promise<string>;
      signMessage?: (options: {
        accountContract: ThirdwebContract;
        adminAccount: Account;
        factoryContract: ThirdwebContract;
        message: SignableMessage;
      }) => Promise<Hex>;
      signTypedData?: (options: {
        accountContract: ThirdwebContract;
        adminAccount: Account;
        factoryContract: ThirdwebContract;
        typedData: ox__TypedData.Definition<typedData, primaryType>;
      }) => Promise<Hex>;
      tokenPaymaster?: TokenPaymasterConfig;
    };
    sessionKey?: { address: string; permissions: AccountPermissions };
  } & ({ gasless: boolean } | { sponsorGas: boolean })
>;
```

The smart wallet options.
---
# Wallet Connection
---

###### Connect SDK

## AutoConnectProps

```ts
type AutoConnectProps = {
  accountAbstraction?: SmartWalletOptions;
  appMetadata?: AppMetadata;
  chain?: Chain;
  client: ThirdwebClient;
  onConnect?: (wallet: Wallet) => void;
  onTimeout?: () => void;
  siweAuth?: {
    doLogin: () => Promise<void>;
    isLoggedIn: boolean | undefined;
    isLoggingIn: boolean | undefined;
    requiresAuth: boolean;
  };
  timeout?: number;
  wallets?: Array<Wallet>;
};
```

Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options.

If you are connecting to smart wallet using personal wallet - setting this configuration will autoConnect the personal wallet and then connect to the smart wallet.

```tsx
<AutoConnect
  accountAbstraction={{
   factoryAddress: "0x123...",
   chain: sepolia,
   gasless: true;
  }}
/>
```

```ts
type accountAbstraction = SmartWalletOptions;
```

Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.

Some wallets display this information to the user when they connect to your app.

```ts
type appMetadata = AppMetadata;
```

### Example

```ts
{
  name: "My App",
  url: "https://my-app.com",
  description: "some description about your app",
  logoUrl: "https://path/to/my-app/logo.svg",
};
```

Optional chain to autoconnect to

```ts
type chain = Chain;
```

A client is the entry point to the thirdweb SDK. It is required for all other actions. You can create a client using the `createThirdwebClient` function. Refer to the [Creating a Client](https://portal.thirdweb.com/typescript/v5/client) documentation for more information.

You must provide a `clientId` or `secretKey` in order to initialize a client. Pass `clientId` if you want for client-side usage and `secretKey` for server-side usage.

```tsx
import { createThirdwebClient } from "thirdweb";
 
const client = createThirdwebClient({
  clientId: "<your_client_id>",
});
```

```ts
type client = ThirdwebClient;
```

```ts
function onConnect(wallet: Wallet): void;
```

##### Parameters

###### Type

```ts
let wallet: {
  getAdminAccount?: () => Account | undefined;
  getAuthToken?: () => string | null;
  getConfig: () => CreateWalletArgs<TWalletId>[1];
  id: TWalletId;
  onConnectRequested?: () => Promise<void>;
  subscribe: WalletEmitter<TWalletId>["subscribe"];
  autoConnect: (
    options: WalletAutoConnectionOption<TWalletId>,
  ) => Promise<Account>;
  connect: (
    options: WalletConnectionOption<TWalletId>,
  ) => Promise<Account>;
  disconnect: () => Promise<void>;
  getAccount: () => undefined | Account;
  getChain: () =>
    | undefined
    | Readonly<ChainOptions & { rpc: string }>;
  switchChain: (chain: Readonly) => Promise<void>;
};
```

##### Returns

```ts
let returnType: void;
```

```ts
function onTimeout(): void;
```

##### Returns

```ts
let returnType: void;
```

```ts
type siweAuth = {
  doLogin: () => Promise<void>;
  isLoggedIn: boolean | undefined;
  isLoggingIn: boolean | undefined;
  requiresAuth: boolean;
};
```

if the autoConnection does not succeed within given timeout in milliseconds, it will be cancelled.

By default, the timeout is set to 15000ms (15 seconds).

```tsx
<AutoConnect
  client={client}
  autoConnect={{ timeout: 10000 }}
  wallets={wallets}
  appMetadata={appMetadata}
/>;
```

```ts
type timeout = number;
```

Array of wallets that your app uses

```ts
type wallets = Array<Wallet>;
```

### Example

```tsx
import { AutoConnect } from "thirdweb/react";
import { createWallet, inAppWallet } from "thirdweb/wallets";
 
const wallets = [
  inAppWallet(),
  createWallet("io.metamask"),
  createWallet("com.coinbase.wallet"),
  createWallet("me.rainbow"),
];
 
function Example() {
  return <AutoConnect client={client} wallets={wallets} />;
}
```
---

###### Connect SDK

## AutoConnect

AutoConnect last connected wallet on page reload or revisit. Note: If you are using `ConnectButton` or `ConnectEmbed` components, You don't need to use this component as it is already included.

This is useful if you are manually connecting the wallets using the [useConnect](https://portal.thirdweb.com/references/typescript/v5/useConnect) hook and want to auto connect the last connected wallets on page reload or revisit.

You can also use the [useAutoConnect](https://portal.thirdweb.com/references/typescript/v5/useAutoConnect) hook to achieve the same result.

To check if the wallet in in the process of auto connecting, you can use the [useIsAutoConnecting](https://portal.thirdweb.com/references/typescript/v5/useIsAutoConnecting) hook.

### Example

```tsx
import { AutoConnect } from "thirdweb/react";
import { createWallet, inAppWallet } from "thirdweb/wallets";
 
// list of wallets that your app uses
const wallets = [
  inAppWallet(),
  createWallet("io.metamask"),
  createWallet("me.rainbow"),
];
 
function Example() {
  return (
    <AutoConnect
      wallets={wallets}
      client={client}
      appMetadata={appMetadata}
    />
  );
}
```

```ts
function AutoConnect(props: AutoConnectProps): null;
```

### Parameters

Object of type `AutoConnectProps`. Refer to [AutoConnectProps](https://portal.thirdweb.com/references/typescript/v5/AutoConnectProps)

#### Type

```ts
let props: {
  accountAbstraction?: SmartWalletOptions;
  appMetadata?: AppMetadata;
  chain?: Chain;
  client: ThirdwebClient;
  onConnect?: (wallet: Wallet) => void;
  onTimeout?: () => void;
  siweAuth?: {
    doLogin: () => Promise<void>;
    isLoggedIn: boolean | undefined;
    isLoggingIn: boolean | undefined;
    requiresAuth: boolean;
  };
  timeout?: number;
  wallets?: Array<Wallet>;
};
```

### Returns

```ts
let returnType: null;
```
---
# Wallet Utilities
---

###### Connect SDK

## generateAccount

Generates a new account with a random private key.

### Example

```ts
import { generateAccount } from "thirdweb/wallets";
const account = await generateAccount({ client });
```

```ts
function generateAccount(
  options: GenerateAccountOptions,
): Promise<Account>;
```

### Parameters

The options for generating the account.

#### Type

```ts
let options: { client: ThirdwebClient };
```

### Returns

```ts
let returnType: {
  address: Address;
  estimateGas?: (tx: PreparedTransaction) => Promise<bigint>;
  onTransactionRequested?: (
    transaction: PreparedTransaction<any>,
  ) => Promise<void>;
  sendBatchTransaction?: (
    txs: Array<SendTransactionOption>,
  ) => Promise<SendTransactionResult>;
  sendRawTransaction?: (
    tx: SendRawTransactionOptions,
  ) => Promise<SendTransactionResult>;
  sendTransaction: (
    tx: SendTransactionOption,
  ) => Promise<SendTransactionResult>;
  signAuthorization?: (
    authorization: AuthorizationRequest,
  ) => Promise<SignedAuthorization>;
  signMessage: ({
    message,
    originalMessage,
    chainId,
  }: {
    chainId?: number;
    message: SignableMessage;
    originalMessage?: string;
  }) => Promise<Hex>;
  signTransaction?: (tx: SerializableTransaction) => Promise<Hex>;
  signTypedData: (
    _typedData: ox__TypedData.Definition<typedData, primaryType>,
  ) => Promise<Hex>;
  watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;
};
```

A Thirdweb account.
---

###### Connect SDK

## getWalletBalance

Retrieves the balance of a token or native currency for a given wallet.

### Example

```ts
import { getWalletBalance } from "thirdweb/wallets";
const balance = await getWalletBalance({
  address,
  client,
  chain,
  tokenAddress,
});
```

```ts
function getWalletBalance(
  options: GetWalletBalanceOptions,
): Promise<GetBalanceResult>;
```

### Parameters

The options for retrieving the token balance.

#### Type

```ts
let options: {
  address: string;
  chain: Chain;
  client: ThirdwebClient;
  tokenAddress?: string;
};
```

### Returns

```ts
let returnType: {
  chainId: number;
  decimals: number;
  displayValue: string;
  name: string;
  symbol: string;
  tokenAddress: string;
  value: bigint;
};
```

A promise that resolves to the token balance result.
---

###### Connect SDK

## injectedProvider

Get Injected Provider for given wallet by passing a wallet ID (rdns) using [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) Provider Discovery.

### Example

```ts
import { injectedProvider } from "thirdweb/wallets";
 
const metamaskProvider = injectedProvider("io.metamask");
 
if (metamaskProvider) {
  console.log("Metamask is installed");
}
```

```ts
function injectedProvider(walletId: WalletId): undefined | Ethereum;
```

### Parameters

The Wallet Id (rdns) to check.

#### Type

```ts
let walletId:
  | "walletConnect"
  | "inApp"
  | "embedded"
  | "smart"
  | "adapter"
  | EcosystemWalletId
  | WCSupportedWalletIds
  | InjectedSupportedWalletIds;
```

### Returns

```ts
let returnType: undefined | Ethereum;
```

The details of the Injected Provider if it exists. `undefined` otherwise.
---

###### Connect SDK

## getSocialIcon

Gets the icon URI for a given social authentication provider

### Example

```tsx
const googleIcon = getSocialIcon("google");
const appleIcon = getSocialIcon("apple");
```

```ts
function getSocialIcon(
  provider:
    | ({} & string)
    | "google"
    | "apple"
    | "facebook"
    | "discord"
    | "line"
    | "x"
    | "coinbase"
    | "farcaster"
    | "telegram"
    | "github"
    | "twitch"
    | "steam"
    | "guest"
    | "backend"
    | "email"
    | "phone"
    | "passkey"
    | "wallet",
): string;
```

### Parameters

The authentication provider to get the icon for

#### Type

```ts
let provider:
  | ({} & string)
  | "google"
  | "apple"
  | "facebook"
  | "discord"
  | "line"
  | "x"
  | "coinbase"
  | "farcaster"
  | "telegram"
  | "github"
  | "twitch"
  | "steam"
  | "guest"
  | "backend"
  | "email"
  | "phone"
  | "passkey"
  | "wallet";
```

### Returns

```ts
let returnType: string;
```

A data URI containing the SVG icon for the provider, or a generic wallet icon if the provider is not recognized
---

###### Connect SDK

## hasStoredPasskey

Returns whether this device has a stored passkey ready to be used for sign-in

```ts
function hasStoredPasskey(
  client: ThirdwebClient,
  ecosystemId?: `ecosystem.${string}`,
  storage?: AsyncStorage,
): Promise<boolean>;
```

### Parameters

the thirdweb client

#### Type

```ts
let client: {
  readonly clientId: string;
  readonly secretKey: string | undefined;
} & Readonly<ClientOptions>;
```

#### Type

```ts
let ecosystemId: `ecosystem.${string}`;
```

#### Type

```ts
let storage: {
  getItem: (key: string) => Promise<null | string>;
  removeItem: (key: string) => Promise<void>;
  setItem: (key: string, value: string) => Promise<void>;
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```

whether the device has a stored passkey
---

###### Connect SDK

## bundleUserOp

Bundle a user operation.

### Example

```ts
import { bundleUserOp } from "thirdweb/wallets/smart";
 
const userOpHash = await bundleUserOp({
  userOp,
  options,
});
```

```ts
function bundleUserOp(args: {
  options: BundlerOptions;
  userOp: UserOperationV06 | UserOperationV07;
}): Promise<`0x${string}`>;
```

### Parameters

The options for bundling a user operation.

#### Type

```ts
let args: {
  options: BundlerOptions;
  userOp: UserOperationV06 | UserOperationV07;
};
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The bundle hash of the user operation.
---

###### Connect SDK

## createAndSignUserOp

Create and sign a user operation.

### Example

```ts
import { createAndSignUserOp } from "thirdweb/wallets/smart";
 
const userOp = await createAndSignUserOp({
  client,
  adminAccount,
  smartWalletOptions,
  transactions,
});
```

```ts
function createAndSignUserOp(options: {
  adminAccount: Account;
  client: ThirdwebClient;
  isDeployedOverride?: boolean;
  smartWalletOptions: SmartWalletOptions;
  transactions: Array<PreparedTransaction>;
  waitForDeployment?: boolean;
}): Promise<UserOperationV06 | UserOperationV07>;
```

### Parameters

The options for creating and signing the user operation

#### Type

```ts
let options: {
  adminAccount: Account;
  client: ThirdwebClient;
  isDeployedOverride?: boolean;
  smartWalletOptions: SmartWalletOptions;
  transactions: Array<PreparedTransaction>;
  waitForDeployment?: boolean;
};
```

### Returns

```ts
let returnType: Promise<UserOperationV06 | UserOperationV07>;
```

* The signed user operation
---

###### Connect SDK

## createUnsignedUserOp

Creates an unsigned user operation from a prepared transaction.

### Example

```ts
import { createUnsignedUserOp } from "thirdweb/wallets/smart";
 
const transaction = prepareContractCall(...);
 
const userOp = await createUnsignedUserOp({
 transaction,
 factoryContract,
 accountContract,
 adminAddress,
 sponsorGas,
 overrides,
});
```

```ts
function createUnsignedUserOp(args: {
  accountContract: Readonly;
  adminAddress: string;
  factoryContract: Readonly;
  isDeployedOverride?: boolean;
  overrides?: {
    accountAddress?: string;
    accountSalt?: string;
    bundlerUrl?: string;
    createAccount?: (
      factoryContract: Readonly,
      admin: string,
    ) => PreparedTransaction;
    entrypointAddress?: string;
    execute?: (
      accountContract: Readonly,
      transaction: SendTransactionOption,
    ) => PreparedTransaction;
    executeBatch?: (
      accountContract: Readonly,
      transactions: Array<SendTransactionOption>,
    ) => PreparedTransaction;
    getAccountNonce?: (accountContract: Readonly) => Promise<bigint>;
    paymaster?: (
      userOp: UserOperationV06 | UserOperationV07,
    ) => Promise<PaymasterResult>;
    predictAddress?: (
      factoryContract: Readonly,
      admin: string,
    ) => Promise<string>;
    signMessage?: (options: {
      accountContract: Readonly;
      adminAccount: Account;
      factoryContract: Readonly;
      message: SignableMessage;
    }) => Promise<`0x${string}`>;
    signTypedData?: (options: {
      accountContract: Readonly;
      adminAccount: Account;
      factoryContract: Readonly;
      typedData: Definition<typedData, primaryType>;
    }) => Promise<`0x${string}`>;
    tokenPaymaster?: TokenPaymasterConfig;
  };
  sponsorGas: boolean;
  transaction: PreparedTransaction;
  waitForDeployment?: boolean;
}): Promise<UserOperationV06 | UserOperationV07>;
```

### Parameters

The prepared transaction and options

#### Type

```ts
let args: {
  accountContract: Readonly;
  adminAddress: string;
  factoryContract: Readonly;
  isDeployedOverride?: boolean;
  overrides?: {
    accountAddress?: string;
    accountSalt?: string;
    bundlerUrl?: string;
    createAccount?: (
      factoryContract: Readonly,
      admin: string,
    ) => PreparedTransaction;
    entrypointAddress?: string;
    execute?: (
      accountContract: Readonly,
      transaction: SendTransactionOption,
    ) => PreparedTransaction;
    executeBatch?: (
      accountContract: Readonly,
      transactions: Array<SendTransactionOption>,
    ) => PreparedTransaction;
    getAccountNonce?: (accountContract: Readonly) => Promise<bigint>;
    paymaster?: (
      userOp: UserOperationV06 | UserOperationV07,
    ) => Promise<PaymasterResult>;
    predictAddress?: (
      factoryContract: Readonly,
      admin: string,
    ) => Promise<string>;
    signMessage?: (options: {
      accountContract: Readonly;
      adminAccount: Account;
      factoryContract: Readonly;
      message: SignableMessage;
    }) => Promise<`0x${string}`>;
    signTypedData?: (options: {
      accountContract: Readonly;
      adminAccount: Account;
      factoryContract: Readonly;
      typedData: Definition<typedData, primaryType>;
    }) => Promise<`0x${string}`>;
    tokenPaymaster?: TokenPaymasterConfig;
  };
  sponsorGas: boolean;
  transaction: PreparedTransaction;
  waitForDeployment?: boolean;
};
```

### Returns

```ts
let returnType: Promise<UserOperationV06 | UserOperationV07>;
```

* The unsigned user operation
---

###### Connect SDK

## estimateUserOpGas

Estimate the gas cost of a user operation.

### Example

```ts
import { estimateUserOpGas } from "thirdweb/wallets/smart";
 
const gasCost = await estimateUserOpGas({
  userOp,
  options,
});
```

```ts
function estimateUserOpGas(
  args: {
    options: BundlerOptions;
    userOp: UserOperationV06 | UserOperationV07;
  },
  stateOverrides?: {},
): Promise<EstimationResult>;
```

### Parameters

The options for estimating the gas cost of a user operation.

#### Type

```ts
let args: {
  options: BundlerOptions;
  userOp: UserOperationV06 | UserOperationV07;
};
```

### Returns

```ts
let returnType: Promise<EstimationResult>;
```

The estimated gas cost of the user operation.
---

###### Connect SDK

## estimateUserOpGasCost

Estimate the gas cost of a user operation.

### Example

```ts
import { estimateUserOpGasCost } from "thirdweb/wallets/smart";
 
const gasCost = await estimateUserOpGasCost({
  transactions,
  adminAccount,
  client,
  smartWalletOptions,
});
```

```ts
function estimateUserOpGasCost(args: {
  adminAccount: Account;
  client: ThirdwebClient;
  smartWalletOptions: SmartWalletOptions;
  transactions: Array<PreparedTransaction>;
}): Promise<{ ether: string; wei: bigint }>;
```

### Parameters

The options for estimating the gas cost of a user operation.

#### Type

```ts
let args: {
  adminAccount: Account;
  client: ThirdwebClient;
  smartWalletOptions: SmartWalletOptions;
  transactions: Array<PreparedTransaction>;
};
```

### Returns

```ts
let returnType: Promise<{ ether: string; wei: bigint }>;
```

The estimated gas cost of the user operation.
---

###### Connect SDK

## getPaymasterAndData

Get paymaster and data details for a user operation.

### Example

```ts
import { getPaymasterAndData } from "thirdweb/wallets/smart";
 
const userOp = createUnsignedUserOp(...);
 
const paymasterAndData = await getPaymasterAndData({
 userOp,
 client,
 chain,
});
```

```ts
function getPaymasterAndData(args: {
  chain: Readonly;
  client: ThirdwebClient;
  entrypointAddress?: string;
  paymasterOverride?: (
    userOp: UserOperationV06 | UserOperationV07,
  ) => Promise<PaymasterResult>;
  userOp: UserOperationV06 | UserOperationV07;
}): Promise<PaymasterResult>;
```

### Parameters

The userOp and options

#### Type

```ts
let args: {
  chain: Readonly;
  client: ThirdwebClient;
  entrypointAddress?: string;
  paymasterOverride?: (
    userOp: UserOperationV06 | UserOperationV07,
  ) => Promise<PaymasterResult>;
  userOp: UserOperationV06 | UserOperationV07;
};
```

### Returns

```ts
let returnType: {
  callGasLimit?: bigint;
  preVerificationGas?: bigint;
  verificationGasLimit?: bigint;
} & (
  | { paymasterAndData: string }
  | {
      paymaster: string;
      paymasterData: string;
      paymasterPostOpGasLimit?: bigint;
      paymasterVerificationGasLimit?: bigint;
    }
);
```

* The paymaster and data details for the user operation.
---

###### Connect SDK

## getUserOpGasFees

Get the gas fees of a user operation.

### Example

```ts
import { getUserOpGasPrice } from "thirdweb/wallets/smart";
 
const fees = await getUserOpGasPrice({
  options,
});
```

```ts
function getUserOpGasFees(args: {
  options: BundlerOptions;
}): Promise<GasPriceResult>;
```

### Parameters

The options for getting the gas price of a user operation.

#### Type

```ts
let args: { options: BundlerOptions };
```

### Returns

```ts
let returnType: Promise<GasPriceResult>;
```

The gas price of the user operation.
---

###### Connect SDK

## getUserOpHash

Get the hash of a user operation.

### Example

```ts
import { getUserOpHash } from "thirdweb/wallets/smart";
 
const userOp = await createUnsignedUserOp(...);
const userOpHash = await getUserOpHash({
 client,
 userOp,
 chain,
});
```

```ts
function getUserOpHash(args: {
  chain: Readonly;
  client: ThirdwebClient;
  entrypointAddress?: string;
  userOp: UserOperationV06 | UserOperationV07;
}): Promise<`0x${string}`>;
```

### Parameters

The options for getting the user operation hash

#### Type

```ts
let args: {
  chain: Readonly;
  client: ThirdwebClient;
  entrypointAddress?: string;
  userOp: UserOperationV06 | UserOperationV07;
};
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

* The user operation hash
---

###### Connect SDK

## getUserOpReceipt

Get the receipt of a user operation.

### Example

```ts
import { getUserOpReceipt } from "thirdweb/wallets/smart";
 
const receipt = await getUserOpReceipt({
  client,
  chain,
  userOpHash,
});
```

```ts
function getUserOpReceipt(
  args: BundlerOptions & { userOpHash: `0x${string}` },
): Promise<undefined | TransactionReceipt>;
```

### Parameters

The options for getting the receipt of a user operation.

#### Type

```ts
let args: BundlerOptions & { userOpHash: `0x${string}` };
```

### Returns

```ts
let returnType: {
  blobGasPrice?: quantity;
  blobGasUsed?: quantity;
  blockHash: Hash;
  blockNumber: quantity;
  contractAddress: Address | null | undefined;
  cumulativeGasUsed: quantity;
  effectiveGasPrice: quantity;
  from: Address;
  gasUsed: quantity;
  logs: Array<Log<quantity, index, false>>;
  logsBloom: Hex;
  root?: Hash;
  status: status;
  to: Address | null;
  transactionHash: Hash;
  transactionIndex: index;
  type: type;
};
```

The receipt of the user operation.
---

###### Connect SDK

## getUserOpReceiptRaw

Get the receipt of a user operation.

### Example

```ts
import { getUserOpReceiptRaw } from "thirdweb/wallets/smart";
 
const receipt = await getUserOpReceiptRaw({
  client,
  chain,
  userOpHash,
});
```

```ts
function getUserOpReceiptRaw(
  args: BundlerOptions & { userOpHash: `0x${string}` },
): Promise<undefined | UserOperationReceipt>;
```

### Parameters

The options for getting the receipt of a user operation.

#### Type

```ts
let args: BundlerOptions & { userOpHash: `0x${string}` };
```

### Returns

```ts
let returnType: Promise<undefined | UserOperationReceipt>;
```

The raw receipt of the user operation.
---

###### Connect SDK

## predictAddress

Deprecated

Use `predictSmartAccountAddress` instead.

Predict the address of a smart account.

### Example

```ts
import { predictAddress } from "thirdweb/wallets/smart";
 
const predictedAddress = await predictAddress({
  factoryContract,
  adminAddress,
  accountSalt,
});
```

```ts
function predictAddress(args: {
  accountAddress?: string;
  accountSalt?: string;
  adminAddress: string;
  factoryContract: Readonly;
  predictAddressOverride?: (
    factoryContract: Readonly,
    admin: string,
  ) => Promise<string>;
}): Promise<string>;
```

### Parameters

The options for predicting the address of a smart account.

#### Type

```ts
let args: {
  accountAddress?: string;
  accountSalt?: string;
  adminAddress: string;
  factoryContract: Readonly;
  predictAddressOverride?: (
    factoryContract: Readonly,
    admin: string,
  ) => Promise<string>;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The predicted address of the smart account.
---

###### Connect SDK

## predictSmartAccountAddress

Predict the address of a smart account.

### Example

```ts
import { predictSmartAccountAddress } from "thirdweb/wallets/smart";
 
const predictedAddress = await predictSmartAccountAddress({
  client,
  chain,
  adminAddress,
});
```

```ts
function predictSmartAccountAddress(args: {
  accountSalt?: string;
  adminAddress: string;
  chain: Readonly;
  client: ThirdwebClient;
  factoryAddress?: string;
}): Promise<string>;
```

### Parameters

The options for predicting the address of a smart account.

#### Type

```ts
let args: {
  accountSalt?: string;
  adminAddress: string;
  chain: Readonly;
  client: ThirdwebClient;
  factoryAddress?: string;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

The predicted address of the smart account.
---

###### Connect SDK

## prepareUserOp

Prepare a user operation for signing.

### Example

```ts
import { prepareUserOp } from "thirdweb/wallets/smart";
 
const userOp = await prepareUserOp({
  transactions,
  adminAccount,
  client,
  smartWalletOptions,
});
```

You can then sign the user operation with signUserOp(). and send it to the bundler with bundlerUserOp().

```ts
function prepareUserOp(options: {
  adminAccount: Account;
  client: ThirdwebClient;
  isDeployedOverride?: boolean;
  smartWalletOptions: SmartWalletOptions;
  transactions: Array<PreparedTransaction>;
  waitForDeployment?: boolean;
}): Promise<UserOperationV06 | UserOperationV07>;
```

### Parameters

The options for preparing the user operation

#### Type

```ts
let options: {
  adminAccount: Account;
  client: ThirdwebClient;
  isDeployedOverride?: boolean;
  smartWalletOptions: SmartWalletOptions;
  transactions: Array<PreparedTransaction>;
  waitForDeployment?: boolean;
};
```

### Returns

```ts
let returnType: Promise<UserOperationV06 | UserOperationV07>;
```

* The prepared user operation
---

###### Connect SDK

## signUserOp

Sign a user operation.

### Example

```ts
import { signUserOp } from "thirdweb/wallets/smart";
 
const userOp = await createUnsignedUserOp(...);
 
const signedUserOp = await signUserOp({
 client,
 userOp,
 chain,
 adminAccount,
});
```

```ts
function signUserOp(args: {
  adminAccount: Account;
  chain: Readonly;
  client: ThirdwebClient;
  entrypointAddress?: string;
  userOp: UserOperationV06 | UserOperationV07;
}): Promise<UserOperationV06 | UserOperationV07>;
```

### Parameters

#### Type

```ts
let args: {
  adminAccount: Account;
  chain: Readonly;
  client: ThirdwebClient;
  entrypointAddress?: string;
  userOp: UserOperationV06 | UserOperationV07;
};
```

### Returns

```ts
let returnType: Promise<UserOperationV06 | UserOperationV07>;
```

* The user operation with the signature field populated
---

###### Connect SDK

## waitForUserOpReceipt

Wait for the user operation to be mined.

### Example

```ts
import { waitForUserOpReceipt } from "thirdweb/wallets/smart";
 
const receipt = await waitForUserOpReceipt({
  chain,
  client,
  userOpHash,
});
```

```ts
function waitForUserOpReceipt(
  args: BundlerOptions & {
    intervalMs?: number;
    timeoutMs?: number;
    userOpHash: `0x${string}`;
  },
): Promise<TransactionReceipt>;
```

### Parameters

The options and user operation hash

#### Type

```ts
let args: BundlerOptions & {
  intervalMs?: number;
  timeoutMs?: number;
  userOpHash: `0x${string}`;
};
```

### Returns

```ts
let returnType: {
  blobGasPrice?: quantity;
  blobGasUsed?: quantity;
  blockHash: Hash;
  blockNumber: quantity;
  contractAddress: Address | null | undefined;
  cumulativeGasUsed: quantity;
  effectiveGasPrice: quantity;
  from: Address;
  gasUsed: quantity;
  logs: Array<Log<quantity, index, false>>;
  logsBloom: Hex;
  root?: Hash;
  status: status;
  to: Address | null;
  transactionHash: Hash;
  transactionIndex: index;
  type: type;
};
```

* The transaction receipt
---
# Chain
---

###### Connect SDK

## defineChain

Defines a chain with the given options.

### Example

Just pass the chain ID to connect to:

```ts
const chain = defineChain(1);
```

Or pass your own RPC or custom values:

```ts
const chain = defineChain({
  id: 1,
  rpc: "https://my-rpc.com",
  nativeCurrency: {
    name: "Ether",
    symbol: "ETH",
    decimals: 18,
  },
});
```

```ts
function defineChain(
  options: number | Chain | ChainOptions | LegacyChain,
): Readonly;
```

### Parameters

The options for the chain.

#### Type

```ts
let options: number | Chain | ChainOptions | LegacyChain;
```

### Returns

```ts
let returnType: Readonly;
```

The defined chain.
---

###### Connect SDK

## getChainMetadata

Retrieves chain data for a given chain.

### Example

```ts
const chain = defineChain({ id: 1 });
const chainData = await getChainMetadata(chain);
console.log(chainData);
```

```ts
function getChainMetadata(chain: Readonly): Promise<ChainMetadata>;
```

### Parameters

The chain object containing the chain ID.

#### Type

```ts
let chain: Readonly;
```

### Returns

```ts
let returnType: { chain: string; chainId: number; ens?: { registry: string }; explorers?: Readonly<Array<ChainExplorer>>; faucets?: readonly Array<string>; features?: Readonly<Array<{ name: string }>>; icon?: Icon; infoURL?: string; name: string; nativeCurrency: { decimals: number; name: string; symbol: string }; networkId?: number; parent?: { bridges?: Readonly<Array<{ url: string }>>; chain: string; type: string }; redFlags?: readonly Array<string>; rpc: readonly Array<string>; shortName: string; slip44?: number; slug: string; stackType: string; status?: string; testnet: boolean; title?: string }
```

A Promise that resolves to the chain data.
---

###### Connect SDK

## getRpcUrlForChain

Retrieves the RPC URL for the specified chain. If a custom RPC URL is defined in the options, it will be used. Otherwise, a thirdweb RPC URL will be constructed using the chain ID and client ID.

### Example

```ts
import { getRpcUrlForChain } from "thirdweb/chains";
const rpcUrl = getRpcUrlForChain({ chain: 1, client });
console.log(rpcUrl); // "https://1.rpc.thirdweb.com/...
```

```ts
function getRpcUrlForChain(options: GetRpcUrlForChainOptions): string;
```

### Parameters

The options object containing the chain and client information.

#### Type

```ts
let options: GetRpcUrlForChainOptions;
```

### Returns

```ts
let returnType: string;
```

The RPC URL for the specified chain.
---

###### Connect SDK

## ChainIcon

This component tries to resolve the icon of a given chain, then return an image.

### Example

#### Basic usage

```tsx
import { ChainProvider, ChainIcon } from "thirdweb/react";
 
<ChainProvider chain={chain}>
  <ChainIcon />
</ChainProvider>;
```

Result: An `<img />` component with the src of the icon

```html
<img src="chain-icon.png" />
```

#### Override the icon with the `iconResolver` prop

If you already have the icon url, you can skip the network requests and pass it directly to the ChainIcon

```tsx
<ChainIcon iconResolver="/ethereum-icon.png" />;
```

You can also pass in your own custom (async) function that retrieves the icon url

```tsx
const getIcon = async () => {
  const icon = getIconFromCoinMarketCap(chainId, etc);
  return icon;
};
 
<ChainIcon iconResolver={getIcon} />;
```

#### Show a loading sign while the icon is being loaded

```tsx
<ChainIcon loadingComponent={<Spinner />} />;
```

#### Fallback to a dummy image if the chain icon fails to resolve

```tsx
<ChainIcon fallbackComponent={<img src="blank-image.png" />} />;
```

#### Usage with queryOptions

ChainIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic

```tsx
<ChainIcon queryOptions={{ enabled: someLogic, retry: 3 }} />;
```

```ts
function ChainIcon(__namedParameters: ChainIconProps): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,alt : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,children : ReactNode,className : string,client : ThirdwebClient,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,crossOrigin : CrossOrigin,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,decoding : "auto" | "async" | "sync",defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,fetchPriority : "auto" | "high" | "low",height : string | number,hidden : boolean,iconResolver : string | (() => string) | (() => Promise<string>),id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLImageElement>,onAbortCapture : ReactEventHandler<HTMLImageElement>,onAnimationEnd : AnimationEventHandler<HTMLImageElement>,onAnimationEndCapture : AnimationEventHandler<HTMLImageElement>,onAnimationIteration : AnimationEventHandler<HTMLImageElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLImageElement>,onAnimationStart : AnimationEventHandler<HTMLImageElement>,onAnimationStartCapture : AnimationEventHandler<HTMLImageElement>,onAuxClick : MouseEventHandler<HTMLImageElement>,onAuxClickCapture : MouseEventHandler<HTMLImageElement>,onBeforeInput : InputEventHandler<HTMLImageElement>,onBeforeInputCapture : FormEventHandler<HTMLImageElement>,onBeforeToggle : ToggleEventHandler<HTMLImageElement>,onBlur : FocusEventHandler<HTMLImageElement>,onBlurCapture : FocusEventHandler<HTMLImageElement>,onCanPlay : ReactEventHandler<HTMLImageElement>,onCanPlayCapture : ReactEventHandler<HTMLImageElement>,onCanPlayThrough : ReactEventHandler<HTMLImageElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLImageElement>,onChange : FormEventHandler<HTMLImageElement>,onChangeCapture : FormEventHandler<HTMLImageElement>,onClick : MouseEventHandler<HTMLImageElement>,onClickCapture : MouseEventHandler<HTMLImageElement>,onCompositionEnd : CompositionEventHandler<HTMLImageElement>,onCompositionEndCapture : CompositionEventHandler<HTMLImageElement>,onCompositionStart : CompositionEventHandler<HTMLImageElement>,onCompositionStartCapture : CompositionEventHandler<HTMLImageElement>,onCompositionUpdate : CompositionEventHandler<HTMLImageElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLImageElement>,onContextMenu : MouseEventHandler<HTMLImageElement>,onContextMenuCapture : MouseEventHandler<HTMLImageElement>,onCopy : ClipboardEventHandler<HTMLImageElement>,onCopyCapture : ClipboardEventHandler<HTMLImageElement>,onCut : ClipboardEventHandler<HTMLImageElement>,onCutCapture : ClipboardEventHandler<HTMLImageElement>,onDoubleClick : MouseEventHandler<HTMLImageElement>,onDoubleClickCapture : MouseEventHandler<HTMLImageElement>,onDrag : DragEventHandler<HTMLImageElement>,onDragCapture : DragEventHandler<HTMLImageElement>,onDragEnd : DragEventHandler<HTMLImageElement>,onDragEndCapture : DragEventHandler<HTMLImageElement>,onDragEnter : DragEventHandler<HTMLImageElement>,onDragEnterCapture : DragEventHandler<HTMLImageElement>,onDragExit : DragEventHandler<HTMLImageElement>,onDragExitCapture : DragEventHandler<HTMLImageElement>,onDragLeave : DragEventHandler<HTMLImageElement>,onDragLeaveCapture : DragEventHandler<HTMLImageElement>,onDragOver : DragEventHandler<HTMLImageElement>,onDragOverCapture : DragEventHandler<HTMLImageElement>,onDragStart : DragEventHandler<HTMLImageElement>,onDragStartCapture : DragEventHandler<HTMLImageElement>,onDrop : DragEventHandler<HTMLImageElement>,onDropCapture : DragEventHandler<HTMLImageElement>,onDurationChange : ReactEventHandler<HTMLImageElement>,onDurationChangeCapture : ReactEventHandler<HTMLImageElement>,onEmptied : ReactEventHandler<HTMLImageElement>,onEmptiedCapture : ReactEventHandler<HTMLImageElement>,onEncrypted : ReactEventHandler<HTMLImageElement>,onEncryptedCapture : ReactEventHandler<HTMLImageElement>,onEnded : ReactEventHandler<HTMLImageElement>,onEndedCapture : ReactEventHandler<HTMLImageElement>,onError : ReactEventHandler<HTMLImageElement>,onErrorCapture : ReactEventHandler<HTMLImageElement>,onFocus : FocusEventHandler<HTMLImageElement>,onFocusCapture : FocusEventHandler<HTMLImageElement>,onGotPointerCapture : PointerEventHandler<HTMLImageElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onInput : FormEventHandler<HTMLImageElement>,onInputCapture : FormEventHandler<HTMLImageElement>,onInvalid : FormEventHandler<HTMLImageElement>,onInvalidCapture : FormEventHandler<HTMLImageElement>,onKeyDown : KeyboardEventHandler<HTMLImageElement>,onKeyDownCapture : KeyboardEventHandler<HTMLImageElement>,onKeyPress : KeyboardEventHandler<HTMLImageElement>,onKeyPressCapture : KeyboardEventHandler<HTMLImageElement>,onKeyUp : KeyboardEventHandler<HTMLImageElement>,onKeyUpCapture : KeyboardEventHandler<HTMLImageElement>,onLoad : ReactEventHandler<HTMLImageElement>,onLoadCapture : ReactEventHandler<HTMLImageElement>,onLoadedData : ReactEventHandler<HTMLImageElement>,onLoadedDataCapture : ReactEventHandler<HTMLImageElement>,onLoadedMetadata : ReactEventHandler<HTMLImageElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLImageElement>,onLoadStart : ReactEventHandler<HTMLImageElement>,onLoadStartCapture : ReactEventHandler<HTMLImageElement>,onLostPointerCapture : PointerEventHandler<HTMLImageElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onMouseDown : MouseEventHandler<HTMLImageElement>,onMouseDownCapture : MouseEventHandler<HTMLImageElement>,onMouseEnter : MouseEventHandler<HTMLImageElement>,onMouseLeave : MouseEventHandler<HTMLImageElement>,onMouseMove : MouseEventHandler<HTMLImageElement>,onMouseMoveCapture : MouseEventHandler<HTMLImageElement>,onMouseOut : MouseEventHandler<HTMLImageElement>,onMouseOutCapture : MouseEventHandler<HTMLImageElement>,onMouseOver : MouseEventHandler<HTMLImageElement>,onMouseOverCapture : MouseEventHandler<HTMLImageElement>,onMouseUp : MouseEventHandler<HTMLImageElement>,onMouseUpCapture : MouseEventHandler<HTMLImageElement>,onPaste : ClipboardEventHandler<HTMLImageElement>,onPasteCapture : ClipboardEventHandler<HTMLImageElement>,onPause : ReactEventHandler<HTMLImageElement>,onPauseCapture : ReactEventHandler<HTMLImageElement>,onPlay : ReactEventHandler<HTMLImageElement>,onPlayCapture : ReactEventHandler<HTMLImageElement>,onPlaying : ReactEventHandler<HTMLImageElement>,onPlayingCapture : ReactEventHandler<HTMLImageElement>,onPointerCancel : PointerEventHandler<HTMLImageElement>,onPointerCancelCapture : PointerEventHandler<HTMLImageElement>,onPointerDown : PointerEventHandler<HTMLImageElement>,onPointerDownCapture : PointerEventHandler<HTMLImageElement>,onPointerEnter : PointerEventHandler<HTMLImageElement>,onPointerLeave : PointerEventHandler<HTMLImageElement>,onPointerMove : PointerEventHandler<HTMLImageElement>,onPointerMoveCapture : PointerEventHandler<HTMLImageElement>,onPointerOut : PointerEventHandler<HTMLImageElement>,onPointerOutCapture : PointerEventHandler<HTMLImageElement>,onPointerOver : PointerEventHandler<HTMLImageElement>,onPointerOverCapture : PointerEventHandler<HTMLImageElement>,onPointerUp : PointerEventHandler<HTMLImageElement>,onPointerUpCapture : PointerEventHandler<HTMLImageElement>,onProgress : ReactEventHandler<HTMLImageElement>,onProgressCapture : ReactEventHandler<HTMLImageElement>,onRateChange : ReactEventHandler<HTMLImageElement>,onRateChangeCapture : ReactEventHandler<HTMLImageElement>,onReset : FormEventHandler<HTMLImageElement>,onResetCapture : FormEventHandler<HTMLImageElement>,onScroll : UIEventHandler<HTMLImageElement>,onScrollCapture : UIEventHandler<HTMLImageElement>,onScrollEnd : UIEventHandler<HTMLImageElement>,onScrollEndCapture : UIEventHandler<HTMLImageElement>,onSeeked : ReactEventHandler<HTMLImageElement>,onSeekedCapture : ReactEventHandler<HTMLImageElement>,onSeeking : ReactEventHandler<HTMLImageElement>,onSeekingCapture : ReactEventHandler<HTMLImageElement>,onSelect : ReactEventHandler<HTMLImageElement>,onSelectCapture : ReactEventHandler<HTMLImageElement>,onStalled : ReactEventHandler<HTMLImageElement>,onStalledCapture : ReactEventHandler<HTMLImageElement>,onSubmit : FormEventHandler<HTMLImageElement>,onSubmitCapture : FormEventHandler<HTMLImageElement>,onSuspend : ReactEventHandler<HTMLImageElement>,onSuspendCapture : ReactEventHandler<HTMLImageElement>,onTimeUpdate : ReactEventHandler<HTMLImageElement>,onTimeUpdateCapture : ReactEventHandler<HTMLImageElement>,onToggle : ToggleEventHandler<HTMLImageElement>,onTouchCancel : TouchEventHandler<HTMLImageElement>,onTouchCancelCapture : TouchEventHandler<HTMLImageElement>,onTouchEnd : TouchEventHandler<HTMLImageElement>,onTouchEndCapture : TouchEventHandler<HTMLImageElement>,onTouchMove : TouchEventHandler<HTMLImageElement>,onTouchMoveCapture : TouchEventHandler<HTMLImageElement>,onTouchStart : TouchEventHandler<HTMLImageElement>,onTouchStartCapture : TouchEventHandler<HTMLImageElement>,onTransitionCancel : TransitionEventHandler<HTMLImageElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLImageElement>,onTransitionEnd : TransitionEventHandler<HTMLImageElement>,onTransitionEndCapture : TransitionEventHandler<HTMLImageElement>,onTransitionRun : TransitionEventHandler<HTMLImageElement>,onTransitionRunCapture : TransitionEventHandler<HTMLImageElement>,onTransitionStart : TransitionEventHandler<HTMLImageElement>,onTransitionStartCapture : TransitionEventHandler<HTMLImageElement>,onVolumeChange : ReactEventHandler<HTMLImageElement>,onVolumeChangeCapture : ReactEventHandler<HTMLImageElement>,onWaiting : ReactEventHandler<HTMLImageElement>,onWaitingCapture : ReactEventHandler<HTMLImageElement>,onWheel : WheelEventHandler<HTMLImageElement>,onWheelCapture : WheelEventHandler<HTMLImageElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,referrerPolicy : HTMLAttributeReferrerPolicy,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,sizes : string,slot : string,spellCheck : Booleanish,srcSet : string,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",useMap : string,vocab : string,width : string | number}
```

### Returns

```ts
let returnType: null | Element;
```

an `<img />` with the src of the chain icon
---

###### Connect SDK

## ChainName

This component fetches then shows the name of a chain. It inherits all the attributes of a HTML `<span>` component, hence you can style it just like how you would style a normal `<span>`

### Example

#### Basic usage

```tsx
import { ChainProvider, ChainName } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<ChainProvider {...props}>
  <ChainName />
</ChainProvider>;
```

Result:

```html
<span>Ethereum Mainnet</span>
```

#### Custom name resolver

By default ChainName will call the thirdweb API to retrieve the chain name. However if you have a different way to fetch the name, you can pass the function to the `nameResolver` prop. Note: nameResolver should either be a string or a function (async) that returns a string.

```tsx
async function fetchNameMethod() {
  // your own fetching logic
  return "the chain name";
}
 
<ChainName nameResolver={fetchNameMethod} />;
```

Alternatively you can also pass in a string directly:

```tsx
<ChainName nameResolver="ETH Mainnet" />;
```

#### Format the name (capitalize, truncate, etc.)

The ChainName component accepts a `formatFn` which takes in a string and outputs a string The function is used to modify the name of the chain

```tsx
const concatStr = (str: string):string => str + "Network"
 
<ChainProvider {...props}>
  <ChainName formatFn={concatStr} />
</ChainProvider>
```

Result:

```html
<span>Ethereum Mainnet Network</span>
```

#### Show a loading sign when the name is being fetched

```tsx
import { ChainProvider, ChainName } from "thirdweb/react";
 
<ChainProvider {...props}>
  <ChainName loadingComponent={<Spinner />} />
</ChainProvider>;
```

#### Fallback to something when the name fails to resolve

```tsx
<ChainProvider {...props}>
  <ChainName fallbackComponent={"Failed to load"} />
</ChainProvider>;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<ChainName
  queryOptions={{
    enabled: isEnabled,
    retry: 4,
  }}
/>;
```

```ts
function ChainName(__namedParameters: ChainNameProps): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,formatFn : (str: string) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise<string>),nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```
---

###### Connect SDK

## isZkSyncChain

Checks whether the given chain is part of the zksync stack

```ts
function isZkSyncChain(chain: Readonly): Promise<boolean>;
```

### Parameters

#### Type

```ts
let chain: Readonly;
```

### Returns

```ts
let returnType: Promise<boolean>;
```
---
# Contract
---

###### Connect SDK

## checkVerificationStatus

Checks the verification status of a contract.

### Example

```ts
import { checkVerificationStatus } from "thirdweb/contract";
const verificationStatus = await checkVerificationStatus({
  explorerApiUrl: "https://api.polygonscan.com/api",
  explorerApiKey: "YOUR_API_KEY",
  guid: "YOUR_GUID",
});
console.log(verificationStatus);
```

```ts
function checkVerificationStatus(
  options: CheckVerificationStatusOptions,
): Promise<unknown>;
```

### Parameters

The options for checking the verification status.

#### Type

```ts
let options: CheckVerificationStatusOptions;
```

### Returns

```ts
let returnType: Promise<unknown>;
```

A promise that resolves with the verification status data.
---

###### Connect SDK

## fetchPublishedContract

Fetches the published contract based on the provided options.

### Example

```ts
const publishedContract = await fetchPublishedContract({
  publisherAddress: "0x1234",
  contractName: "MyContract",
  version: "1.0.0",
  client: client,
});
```

```ts
function fetchPublishedContract(
  options: FetchPublishedContractOptions,
): Promise<{
  bytecodeHash: `0x${string}`;
  contractId: string;
  implementation: string;
  publishMetadataUri: string;
  publishTimestamp: bigint;
}>;
```

### Parameters

The options for fetching the published contract.

#### Type

```ts
let options: FetchPublishedContractOptions;
```

### Returns

```ts
let returnType: Promise<{
  bytecodeHash: `0x${string}`;
  contractId: string;
  implementation: string;
  publishMetadataUri: string;
  publishTimestamp: bigint;
}>;
```

The published contract.
---

###### Connect SDK

## getBytecode

Retrieves the bytecode of a contract.

### Example

```ts
import { getBytecode } from "thirdweb/contract";
const bytecode = await getBytecode(contract);
```

```ts
function getBytecode(contract: Readonly): Promise<`0x${string}`>;
```

### Parameters

The ThirdwebContract instance.

#### Type

```ts
let contract: Readonly;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A Promise that resolves to the bytecode of the contract.
---

###### Connect SDK

## getCompilerMetadata

Down the compiled metadata from thirdweb contract api and format it

### Example

```ts
import { getCompilerMetadata, getContract } from "thirdweb/contracts";
 
const contract = getContract({
  address: "0x...",
  chain: ethereum,
  client: "",
});
const metadata = await getCompilerMetadata(contract);
```

```ts
function getCompilerMetadata(
  contract: Readonly,
): Promise<CompilerMetadata>;
```

### Parameters

#### Type

```ts
let contract: Readonly;
```

### Returns

```ts
let returnType: Promise<CompilerMetadata>;
```

The compiler metadata for the contract
---

###### Connect SDK

## getContract

Creates a Thirdweb contract by combining the Thirdweb client and contract options.

### Example

```ts
import { createThirdwebClient, getContract } from "thirdweb";
import { sepolia } from "thirdweb/chains";
 
const client = createThirdwebClient({ clientId: "..." });
const contract = getContract({
 client,
 chain: sepolia,
 address: "0x123...",
 // optional ABI
 abi: [...],
});
```

```ts
function getContract(
  options: ContractOptions<abi>,
): Readonly<ContractOptions<abi, `0x${string}`>>;
```

### Parameters

The options for creating the contract.

#### Type

```ts
let options: ContractOptions<abi>;
```

### Returns

```ts
let returnType: Readonly<ContractOptions<abi, `0x${string}`>>;
```

The Thirdweb contract.
---

###### Connect SDK

## prepareMethod

Prepares a method for usage by converting it into a prepared method object.

### Example

```ts
import { prepareMethod } from "thirdweb/utils";
const method = "function transfer(address to, uint256 value)";
const preparedMethod = prepareMethod(method);
```

```ts
function prepareMethod(method: TMethod): PreparedMethod<TMethod>;
```

### Parameters

The method to prepare.

#### Type

```ts
let method: TMethod;
```

### Returns

```ts
let returnType: PreparedMethod<TMethod>;
```

The prepared method object.
---

###### Connect SDK

## resolveAbiFromBytecode

Resolves the ABI (Application Binary Interface) from the bytecode of a contract.

### Example

```ts
import { createThirdwebClient, getContract } from "thirdweb";
import { resolveAbiFromBytecode } from "thirdweb/contract";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const myContract = getContract({
  client,
  address: "...",
  chain: ethereum,
});
const abi = await resolveAbiFromBytecode(myContract);
```

```ts
function resolveAbiFromBytecode(
  contract: Readonly<ContractOptions<any, `0x${string}`>>,
): Promise<Abi>;
```

### Parameters

The ThirdwebContract instance.

#### Type

```ts
let contract: Readonly<ContractOptions<any, `0x${string}`>>;
```

### Returns

```ts
let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)>
```

The resolved ABI as a generic type.
---

###### Connect SDK

## resolveAbiFromContractApi

Resolves the ABI (Application Binary Interface) for a contract from the contract API.

### Example

```ts
import { createThirdwebClient, getContract } from "thirdweb";
import { resolveAbiFromContractApi } from "thirdweb/contract";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const myContract = getContract({
  client,
  address: "...",
  chain: ethereum,
});
const abi = await resolveAbiFromContractApi(myContract);
```

```ts
function resolveAbiFromContractApi(
  contract: Readonly<ContractOptions<any, `0x${string}`>>,
  contractApiBaseUrl: string,
): Promise<Abi>;
```

### Parameters

The ThirdwebContract instance representing the contract.

#### Type

```ts
let contract: Readonly<ContractOptions<any, `0x${string}`>>;
```

The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi".

#### Type

```ts
let contractApiBaseUrl: string;
```

### Returns

```ts
let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)>
```

A promise that resolves to the ABI of the contract.
---

###### Connect SDK

## resolveCompositeAbi

Resolves the ABI for a contract based on its bytecode. If the contract follows the plugin-pattern or dynamic pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the base router pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the diamond pattern, it resolves the ABIs for the facets and merges them with the root ABI.

### Example

```ts
import { createThirdwebClient, getContract } from "thirdweb";
import { resolveCompositeAbiFromBytecode } from "thirdweb/contract";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const myContract = getContract({
  client,
  address: "...",
  chain: ethereum,
});
const abi = await resolveCompositeAbiFromBytecode(myContract);
```

```ts
function resolveCompositeAbi(
  contract: Readonly,
  rootAbi?: Abi,
  resolveSubAbi?: (contract: Readonly) => Promise<Abi>,
): Promise<Abi>;
```

### Parameters

The contract for which to resolve the ABI.

#### Type

```ts
let contract: Readonly;
```

The root ABI to use for the contract. If not provided, it resolves the ABI from the contract's bytecode.

#### Type

```ts
let rootAbi: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)>
```

A function to resolve the ABI for a sub-contract. If not provided, it uses the default ABI resolution logic.

#### Type

```ts
let resolveSubAbi: (contract: Readonly) => Promise<Abi>;
```

### Returns

```ts
let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)>
```

The resolved ABI for the contract.
---

###### Connect SDK

## resolveContractAbi

Resolves the ABI (Application Binary Interface) for a given contract. If the ABI is already cached, it returns the cached value. Otherwise, it tries to resolve the ABI from the contract's API. If that fails, it resolves the ABI from the contract's bytecode.

### Example

```ts
import { createThirdwebClient, getContract } from "thirdweb";
import { resolveContractAbi } from "thirdweb/contract";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const myContract = getContract({
  client,
  address: "...",
  chain: ethereum,
});
const abi = await resolveContractAbi(myContract);
```

```ts
function resolveContractAbi(
  contract: Readonly<ContractOptions<abi, `0x${string}`>>,
  contractApiBaseUrl: string,
): Promise<abi>;
```

### Parameters

The contract for which to resolve the ABI.

#### Type

```ts
let contract: Readonly<ContractOptions<abi, `0x${string}`>>;
```

The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi".

#### Type

```ts
let contractApiBaseUrl: string;
```

### Returns

```ts
let returnType: Promise<abi>;
```

A promise that resolves to the ABI of the contract.
---

###### Connect SDK

## verifyContract

Verifies a contract by performing the following steps:

* Resolves the implementation of the contract.
* Extracts the IPFS URI from the contract bytecode.
* Downloads the contract source code from the IPFS URI.
* Fetches the source files from the compiler metadata.
* Compiles the contract source code using the Solidity compiler.
* Fetches the constructor parameters if not provided.
* Sends a request to the contract verification API to verify the contract source code.

### Example

```ts
import { getContract } from "thirdweb/contract";
import { verifyContract } from "thirdweb/contract";
 
const contract = getContract({ ... });
const verificationResult = await verifyContract({
 contract,
 explorerApiUrl: "https://api.polygonscan.com/api",
 explorerApiKey: "YOUR_API_KEY",
});
console.log(verificationResult);
```

```ts
function verifyContract(
  options: VerifyContractOptions,
): Promise<string | Array<string>>;
```

### Parameters

The options for contract verification.

#### Type

```ts
let options: VerifyContractOptions;
```

### Returns

```ts
let returnType: Promise<string | Array<string>>;
```

A promise that resolves to the verification result.
---

###### Connect SDK

## getInitializeTransaction

Prepares the initialization transaction for a contract deployment

```ts
function getInitializeTransaction(options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  deployMetadata: FetchDeployMetadataResult;
  implementationContract: Readonly;
  initializeParams?: Record<string, unknown>;
  modules?: Array<{
    deployMetadata: FetchDeployMetadataResult;
    initializeParams?: Record<string, unknown>;
  }>;
}): Promise<
  PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>
>;
```

### Parameters

The options for generating the initialize transaction

#### Type

```ts
let options: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
  deployMetadata: FetchDeployMetadataResult;
  implementationContract: Readonly;
  initializeParams?: Record<string, unknown>;
  modules?: Array<{
    deployMetadata: FetchDeployMetadataResult;
    initializeParams?: Record<string, unknown>;
  }>;
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

The prepared transaction for contract initialization
---

###### Connect SDK

## getOrDeployInfraForPublishedContract

Gets or deploys the infrastructure contracts needed for a published contract deployment

```ts
function getOrDeployInfraForPublishedContract(
  args: {
    account: Account;
    chain: Readonly;
    client: ThirdwebClient;
  } & {
    constructorParams?: Record<string, unknown>;
    contractId: string;
    publisher?: string;
    version?: string;
  },
): Promise<{
  cloneFactoryContract: Readonly;
  implementationContract: Readonly;
}>;
```

### Parameters

The arguments object

#### Type

```ts
let args: {
  account: Account;
  chain: Readonly;
  client: ThirdwebClient;
} & {
  constructorParams?: Record<string, unknown>;
  contractId: string;
  publisher?: string;
  version?: string;
};
```

### Returns

```ts
let returnType: Promise<{
  cloneFactoryContract: Readonly;
  implementationContract: Readonly;
}>;
```

An object containing:

* cloneFactoryContract: The factory contract used for creating clones
* implementationContract: The deployed implementation contract
---

###### Connect SDK

## getContractEvents

Get contract events

### Example

```ts
import { Insight } from "thirdweb";
 
const events = await Insight.getContractEvents({
  client,
  chains: [sepolia],
  contractAddress: "0x1234567890123456789012345678901234567890",
  event: transferEvent(),
  decodeLogs: true,
});
```

```ts
function getContractEvents(options: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  contractAddress: string;
  decodeLogs?: boolean;
  event?: PreparedEvent<AbiEvent>;
  queryOptions?: Omit<
    | undefined
    | {
        aggregate?: unknown;
        chain?: Array<number>;
        chain_id?: Array<number>;
        decode?: null | boolean;
        filter_block_hash?: string;
        filter_block_number?: null | number;
        filter_block_number_gt?: null | number;
        filter_block_number_gte?: null | number;
        filter_block_number_lt?: null | number;
        filter_block_number_lte?: null | number;
        filter_block_timestamp?: null | number;
        filter_block_timestamp_gt?: null | number;
        filter_block_timestamp_gte?: null | number;
        filter_block_timestamp_lt?: null | number;
        filter_block_timestamp_lte?: null | number;
        filter_log_index?: null | number;
        filter_log_index_gt?: null | number;
        filter_log_index_gte?: null | number;
        filter_log_index_lt?: null | number;
        filter_log_index_lte?: null | number;
        filter_topic_0?: string;
        filter_topic_1?: string;
        filter_topic_2?: string;
        filter_topic_3?: string;
        filter_transaction_hash?: string;
        filter_transaction_index?: null | number;
        filter_transaction_index_gt?: null | number;
        filter_transaction_index_gte?: null | number;
        filter_transaction_index_lt?: null | number;
        filter_transaction_index_lte?: null | number;
        group_by?: unknown;
        limit?: number;
        page?: null | number;
        sort_by?: string;
        sort_order?: "asc" | "desc";
      },
    "chain" | "decode"
  >;
}): Promise<
  Array<{
    address: string;
    block_hash: string;
    block_number: number;
    block_timestamp: number;
    chain_id: string;
    data: string;
    decoded?: {
      indexed_params: {};
      name: string;
      non_indexed_params: {};
      signature: string;
    };
    log_index: number;
    topics: Array<string>;
    transaction_hash: string;
    transaction_index: number;
  }>
>;
```

### Parameters

#### Type

```ts
let options: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  contractAddress: string;
  decodeLogs?: boolean;
  event?: PreparedEvent<AbiEvent>;
  queryOptions?: Omit<
    | undefined
    | {
        aggregate?: unknown;
        chain?: Array<number>;
        chain_id?: Array<number>;
        decode?: null | boolean;
        filter_block_hash?: string;
        filter_block_number?: null | number;
        filter_block_number_gt?: null | number;
        filter_block_number_gte?: null | number;
        filter_block_number_lt?: null | number;
        filter_block_number_lte?: null | number;
        filter_block_timestamp?: null | number;
        filter_block_timestamp_gt?: null | number;
        filter_block_timestamp_gte?: null | number;
        filter_block_timestamp_lt?: null | number;
        filter_block_timestamp_lte?: null | number;
        filter_log_index?: null | number;
        filter_log_index_gt?: null | number;
        filter_log_index_gte?: null | number;
        filter_log_index_lt?: null | number;
        filter_log_index_lte?: null | number;
        filter_topic_0?: string;
        filter_topic_1?: string;
        filter_topic_2?: string;
        filter_topic_3?: string;
        filter_transaction_hash?: string;
        filter_transaction_index?: null | number;
        filter_transaction_index_gt?: null | number;
        filter_transaction_index_gte?: null | number;
        filter_transaction_index_lt?: null | number;
        filter_transaction_index_lte?: null | number;
        group_by?: unknown;
        limit?: number;
        page?: null | number;
        sort_by?: string;
        sort_order?: "asc" | "desc";
      },
    "chain" | "decode"
  >;
};
```

### Returns

```ts
let returnType: Promise<
  Array<{
    address: string;
    block_hash: string;
    block_number: number;
    block_timestamp: number;
    chain_id: string;
    data: string;
    decoded?: {
      indexed_params: {};
      name: string;
      non_indexed_params: {};
      signature: string;
    };
    log_index: number;
    topics: Array<string>;
    transaction_hash: string;
    transaction_index: number;
  }>
>;
```
---

###### Connect SDK

## parseEventLogs

Parses logs and returns the corresponding events.

### Example

```ts
import { parseEventLogs } from "thirdweb";
const events = parseEventLogs({
  logs,
  events: [preparedEvent, preparedEvent2],
});
```

```ts
function parseEventLogs(
  options: ParseEventLogsOptions<abiEvents, TStrict>,
): ParseEventLogsResult<abiEvents, TStrict>;
```

### Parameters

The options for parsing logs.

#### Type

```ts
let options: ParseEventLogsOptions<abiEvents, TStrict>;
```

### Returns

```ts
let returnType: ParseEventLogsResult<abiEvents, TStrict>;
```

The parsed events.
---

###### Connect SDK

## prepareEvent

Prepares an event by parsing the signature, generating the event hash, and encoding the event topics.

### Example

```ts
import { prepareEvent } from "thirdweb";
const myEvent = prepareEvent({
  signature: "event MyEvent(uint256 myArg)",
});
```

```ts
function prepareEvent(
  options: PrepareEventOptions<TSignature>,
): PreparedEvent<ParseEvent<TSignature>>;
```

### Parameters

The options for preparing the event.

#### Type

```ts
let options: PrepareEventOptions<TSignature>;
```

### Returns

```ts
let returnType: PreparedEvent<ParseEvent<TSignature>>;
```

The prepared event object.
---

###### Connect SDK

## watchContractEvents

Listens for contract events from the blockchain.

### Example

#### Listen to all events for a contract

```ts
import { watchContractEvents } from "thirdweb";
const unwatch = watchContractEvents({
  contract: myContract,
  onEvents: (events) => {
    // do something with the events
  },
});
```

#### Listen to specific events for a contract

```ts
import { prepareEvent, watchContractEvents } from "thirdweb";
const myEvent = prepareEvent({
  event: "event MyEvent(uint256 myArg)",
});
const events = await watchContractEvents({
  contract: myContract,
  events: [myEvent],
  onEvents: (events) => {
    // do something with the events
  },
});
```

```ts
function watchContractEvents(options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  events?: abiEvents;
  latestBlockNumber?: bigint;
  onEvents: (
    events: ParseEventLogsResult<abiEvents, TStrict>,
  ) => void;
  strict?: TStrict;
  useIndexer?: boolean;
}): () => void;
```

### Parameters

The options for retrieving contract events.

#### Type

```ts
let options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  events?: abiEvents;
  latestBlockNumber?: bigint;
  onEvents: (
    events: ParseEventLogsResult<abiEvents, TStrict>,
  ) => void;
  strict?: TStrict;
  useIndexer?: boolean;
};
```

### Returns

```ts
let returnType: () => void;
```

The unwatch function.
---

###### Connect SDK

## resolveMethod

Resolves and returns the ABI function with the specified method name. Throws an error if the function is not found in the ABI.

### Example

```ts
import { resolveMethod, prepareContractCall } from "thirdweb";
const tx = prepareContractCall({
  contract,
  // automatically resolves the necessary abi to encode the transaction
  method: resolveMethod("transfer"),
  // however there is no type completion for params in this case (as the resolution is async and happens at runtime)
  params: [to, value],
});
```

```ts
function resolveMethod(
  method: string,
): (
  contract: Readonly<ContractOptions<TAbi, `0x${string}`>>,
) => Promise<AbiFunction>;
```

### Parameters

The name of the method to resolve.

#### Type

```ts
let method: string;
```

### Returns

```ts
let returnType: (
  contract: Readonly<ContractOptions<TAbi, `0x${string}`>>,
) => Promise<AbiFunction>;
```

The resolved ABI function.
---

###### Connect SDK

## detectMethod

Detects if the specified method is present in the contract bytecode.

### Example

```ts
import { detectMethod } from "thirdweb/utils/extensions/detect.js";
const hasDecimals = await detectMethod({
  method: "function decimals() view returns (uint8)",
  availableSelectors: ["0x313ce567"],
});
```

```ts
function detectMethod(options: DetectExtensionOptions): boolean;
```

### Parameters

The options for detecting the extension.

#### Type

```ts
let options: DetectExtensionOptions;
```

### Returns

```ts
let returnType: boolean;
```

A promise that resolves to a boolean indicating if the extension is detected.
---

###### Connect SDK

## isContractDeployed

Checks if a contract is deployed by verifying its bytecode.

### Example

```ts
import { getContract } from "thirdweb/contract";
import { isContractDeployed } from "thirdweb/contract/utils";
 
const contract = getContract({ ... });
const isDeployed = await isContractDeployed(contract);
console.log(isDeployed);
```

```ts
function isContractDeployed(contract: Readonly): Promise<boolean>;
```

### Parameters

The contract to check.

#### Type

```ts
let contract: Readonly;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A promise that resolves to a boolean indicating whether the contract is deployed or not.
---

###### Connect SDK

## resolveImplementation

Resolves the implementation address and bytecode for a given proxy contract.

### Example

```ts
import { resolveImplementation } from "thirdweb/utils";
const implementation = await resolveImplementation(contract);
```

```ts
function resolveImplementation(
  contract: Readonly<ContractOptions<any, `0x${string}`>>,
): Promise<{ address: string; bytecode: `0x${string}` }>;
```

### Parameters

The contract to resolve the implementation for.

#### Type

```ts
let contract: Readonly<ContractOptions<any, `0x${string}`>>;
```

### Returns

```ts
let returnType: Promise<{ address: string; bytecode: `0x${string}` }>;
```

A promise that resolves to an object containing the implementation address and bytecode.
---
# Transactions
---

###### Connect SDK

## getApprovalForTransaction

When dealing with transactions that involve ERC20 tokens (Airdropping ERC20, buy NFTs with ERC20, etc.) you often have to do a pre-check to see if the targeted contract has the sufficient allowance to "take" the ERC20 tokens from the caller's wallet.

This extension is a handy method that checks for the allowance and requests to approve for more if current allowance is insufficient

### Example

```ts
import { getApprovalForTransaction } from "thirdweb/extensions/erc20";
import { sendAndConfirmTransaction } from "thirdweb";
 
async function buyNFT() {
  const buyTransaction = ... // could be a marketplacev3's buyFromListing
 
  // Check if you need to approve spending for the involved ERC20 contract
  const approveTx = await getApprovalForTransaction({
    transaction: buyTransaction,
    account, // the connected account
  });
  if (approveTx) {
    await sendAndConfirmTransaction({
      transaction: approveTx,
      account,
    })
  }
  // Once approved, you can finally perform the buy transaction
  await sendAndConfirmTransaction({
    transaction: buyTransaction,
    account,
  });
}
```

```ts
function getApprovalForTransaction(
  options: GetApprovalForTransactionParams,
): Promise<null | PreparedTransaction>;
```

### Parameters

GetApprovalForTransactionParams

#### Type

```ts
let options: { account: Account; transaction: PreparedTransaction };
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

a PreparedTransaction
---

###### Connect SDK

## createContractQuery

Creates a `useQuery` hook for a contract call.

### Example

```jsx
import { createContractQuery } from "thirdweb/react";
import { totalSupply } from "thirdweb/extensions/erc20";
const useTotalSupply = createContractQuery(totalSupply);
const { data, isLoading } = useTotalSupply({ contract });
```

```ts
function createContractQuery(
  readCall: (
    options: BaseTransactionOptions<opts, abi>,
  ) => Promise<result>,
): (
  options: {
    contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  } & opts & { queryOptions?: Partial<{ enabled: boolean }> },
) => UseQueryResult<result, Error>;
```

### Parameters

A function that performs the contract function call and returns the result.

#### Type

```ts
let readCall: (
  options: BaseTransactionOptions<opts, abi>,
) => Promise<result>;
```

### Returns

```ts
let returnType: (
  options: {
    contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  } & opts & { queryOptions?: Partial<{ enabled: boolean }> },
) => UseQueryResult<result, Error>;
```

An object containing the created `useRead` hook.
---

###### Connect SDK

## encode

Encodes a transaction object into a hexadecimal string representation of the encoded data.

### Example

```ts
import { encode } from "thirdweb";
const encodedData = await encode(transaction);
```

```ts
function encode(
  transaction: PreparedTransaction<abi, abiFn>,
): Promise<`0x${string}`>;
```

### Parameters

The transaction object to encode.

#### Type

```ts
let transaction: PreparedTransaction<abi, abiFn>;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the encoded data as a hexadecimal string.
---

###### Connect SDK

## estimateGas

Estimates the gas required to execute a transaction. The gas is returned as a `bigint` and in gwei units.

### Example

```ts
import { estimateGas } from "thirdweb";
const gas = await estimateGas({
  transaction,
  from: "0x...",
});
```

```ts
function estimateGas(options: EstimateGasOptions): Promise<bigint>;
```

### Parameters

The options for estimating gas.

#### Type

```ts
let options: Prettify<
  { transaction: PreparedTransaction<any> } & (
    | { account: Account; from?: never }
    | { account?: never; from?: string | Account }
  )
>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the estimated gas as a bigint.
---

###### Connect SDK

## estimateGasCost

Estimate the gas cost of a transaction in ether and wei.

### Example

```ts
import { estimateGasCost } from "thirdweb";
 
const gasCost = await estimateGasCost({ transaction });
```

```ts
function estimateGasCost(
  options: EstimateGasOptions,
): Promise<EstimateGasCostResult>;
```

### Parameters

#### Type

```ts
let options: Prettify<
  { transaction: PreparedTransaction<any> } & (
    | { account: Account; from?: never }
    | { account?: never; from?: string | Account }
  )
>;
```

### Returns

```ts
let returnType: { ether: string; wei: bigint };
```
---

###### Connect SDK

## prepareContractCall

Prepares a contract call by resolving the ABI function, parameters and encoded data. Optionally specify other properties such as value or gas price.

### Example

#### Usage with a human-readable method signature:

```ts
import { prepareContractCall } from "thirdweb";
 
const transaction = prepareContractCall({
  contract,
  method: "function transfer(address to, uint256 value)",
  params: [to, value],
});
```

#### Usage with explicit gas price and/or value:

```ts
import { prepareContractCall } from "thirdweb";
import { toWei } from "thirdweb/utils";
 
const transaction = prepareContractCall({
  contract,
  method: "function transfer(address to, uint256 value)",
  params: [to, value],
  maxFeePerGas: 30n,
  maxPriorityFeePerGas: 1n,
  value: toWei("0.01"),
});
```

#### Usage with ERC20 value:

For transactions that transfer ERC20 tokens, you can specify the value as the amount of tokens to transfer.

You can use this in conjuction with the [getApprovalForTransaction](https://portal.thirdweb.com/references/typescript/v5/getApprovalForTransaction) function to easily create approval transactions for ERC20 tokens.

This value will also be read by the react hooks and UI components to present to total cost to the user.

```ts
import { prepareContractCall } from "thirdweb";
import { toWei } from "thirdweb/utils";
 
const transaction = prepareContractCall({
  contract,
  method: "function payWithCoin()",
  params: [],
  erc20Value: {
    tokenAddress: "0x...", // the address of the ERC20 token
    amountWei: toWei("0.1"), // the amount of tokens to transfer in wei
  },
});
```

#### Usage with a JSON ABI function object:

```ts
import { prepareContractCall } from "thirdweb";
 
const transaction = prepareContractCall({
  contract,
  method: {
    name: "transfer",
    type: "function",
    inputs: [
      { name: "to", type: "address" },
      { name: "value", type: "uint256" },
    ],
    outputs: [],
    stateMutability: "payable",
  },
  params: [to, value],
});
```

#### Usage with the ABI defined on the contract:

```ts
import { getContract, prepareContractCall } from "thirdweb";
const contract = getContract({
 ..., // chain, address, client
 abi: [...] // ABI with a "transfer" method
});
const transaction = prepareContractCall({
 contract,
 method: "transfer", // <- this gets inferred from the contract
 params: [to, value],
});
```

#### Passing extra call data to the transaction

```ts
import { getContract, prepareContractCall } from "thirdweb";
const contract = getContract({
  ..., // chain, address, client
});
 
const transaction = prepareContractCall({
  contract,
  method: "function transfer(address to, uint256 value)",
  params: [...],
  // The extra call data MUST be encoded to hex before passing
  extraCallData: "0x......."
});
```

```ts
function prepareContractCall(
  options: PrepareContractCallOptions<TAbi, TMethod, TPreparedMethod>,
): PreparedTransaction<
  TAbi,
  ParseMethod<TAbi, TMethod>,
  PrepareTransactionOptions
>;
```

### Parameters

The options for preparing the contract call.

#### Type

```ts
let options: PrepareContractCallOptions<
  TAbi,
  TMethod,
  TPreparedMethod
>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  TAbi,
  ParseMethod<TAbi, TMethod>,
  PrepareTransactionOptions
>;
```

A promise that resolves to the prepared transaction.
---

###### Connect SDK

## prepareTransaction

Prepares a transaction with the given options.

### Example

```ts
import { prepareTransaction, toWei } from "thirdweb";
import { ethereum } from "thirdweb/chains";
const transaction = prepareTransaction({
  to: "0x1234567890123456789012345678901234567890",
  chain: ethereum,
  client: thirdwebClient,
  value: toWei("1.0"),
  gasPrice: 30n,
});
```

```ts
function prepareTransaction(
  options: PrepareTransactionOptions,
  info?: Additional<abi, abiFn>,
): PreparedTransaction<abi, abiFn, PrepareTransactionOptions>;
```

### Parameters

The options for preparing the transaction.

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
} & PromisedObject<
  Omit<StaticPrepareTransactionOptions, "chain" | "client">
>;
```

Additional information about the ABI function.

#### Type

```ts
let info: Additional<abi, abiFn>;
```

### Returns

```ts
let returnType: PreparedTransaction<
  abi,
  abiFn,
  PrepareTransactionOptions
>;
```

The prepared transaction.
---

###### Connect SDK

## readContract

#### Reads state from a deployed smart contract.

Use this for raw read calls from a contract, but you can also use read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) for predefined methods for common standards.

### Example

#### Raw contract call (recommended)

You can read from any contract by using the solidity signature of the function you want to call.

```ts
import { getContract } from "thirdweb";
import { sepolia } from "thirdweb/chains";
import { useReadContract } from "thirdweb/react";
 
const contract = getContract({
  client,
  address: "0x...",
  chain: sepolia,
});
 
const { data, isLoading } = useReadContract({
  contract,
  method: "function tokenURI(uint256 tokenId) returns (string)",
  params: [1n],
});
```

Note that this is type safe, the params types will be enforced based on the signature.

#### Raw contract call with `resolveMethod`

If you don't have the solidity signature of the function you want to call, you can use the `resolveMethod` helper to resolve the method from any deployed contract.

Note that this is not type safe, and will also have a 1 time overhead of resolving the contract ABI.

```ts
import { getContract, resolveMethod } from "thirdweb";
import { sepolia } from "thirdweb/chains";
import { useReadContract } from "thirdweb/react";
 
const contract = getContract({
  client,
  address: "0x...",
  chain: sepolia,
});
 
const { data, isLoading } = useReadContract({
  contract,
  method: resolveMethod("tokenURI"),
  params: [1n],
});
```

```ts
function readContract(
  options: ReadContractOptions<TAbi, TMethod, TPreparedMethod>,
): Promise<ReadContractResult<TPreparedMethod[2]>>;
```

### Parameters

The transaction options.

#### Type

```ts
let options: ReadContractOptions<TAbi, TMethod, TPreparedMethod>;
```

### Returns

```ts
let returnType: outputs extends { length: 0 }
  ? never
  : outputs extends { length: 1 }
    ? AbiParametersToPrimitiveTypes<outputs>[0]
    : AbiParametersToPrimitiveTypes<outputs>;
```

A promise that resolves with the result of the read call.
---

###### Connect SDK

## sendAndConfirmTransaction

Sends a transaction using the provided wallet.

### Example

#### Basic usage

```ts
import { sendAndConfirmTransaction } from "thirdweb";
 
const transactionReceipt = await sendAndConfirmTransaction({
  account,
  transaction,
});
```

#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)

```ts
const transactionReceipt = await sendAndConfirmTransaction({
  account,
  transaction,
  gasless: {
    provider: "engine",
    relayerUrl:
      "https://thirdweb.engine-***.thirdweb.com/relayer/***",
    relayerForwarderAddress: "0x...",
  },
});
```

#### Gasless usage with OpenZeppelin

```ts
const transactionReceipt = await sendAndConfirmTransaction({
  account,
  transaction,
  gasless: {
    provider: "openzeppelin",
    relayerUrl: "https://...",
    relayerForwarderAddress: "0x...",
  },
});
```

```ts
function sendAndConfirmTransaction(
  options: SendTransactionOptions,
): Promise<TransactionReceipt>;
```

### Parameters

The options for sending the transaction.

#### Type

```ts
let options: {
  account: Account;
  gasless: GaslessOptions;
  transaction: PreparedTransaction<any>;
};
```

### Returns

```ts
let returnType: {
  blobGasPrice?: quantity;
  blobGasUsed?: quantity;
  blockHash: Hash;
  blockNumber: quantity;
  contractAddress: Address | null | undefined;
  cumulativeGasUsed: quantity;
  effectiveGasPrice: quantity;
  from: Address;
  gasUsed: quantity;
  logs: Array<Log<quantity, index, false>>;
  logsBloom: Hex;
  root?: Hash;
  status: status;
  to: Address | null;
  transactionHash: Hash;
  transactionIndex: index;
  type: type;
};
```

A promise that resolves to the confirmed transaction receipt.
---

###### Connect SDK

## sendBatchTransaction

Sends a batch transaction using the provided options.

### Example

```ts
import { sendBatchTransaction } from "thirdweb";
 
const waitForReceiptOptions = await sendBatchTransaction({
  account,
  transactions,
});
```

```ts
function sendBatchTransaction(
  options: SendBatchTransactionOptions,
): Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}>;
```

### Parameters

The options for sending the batch transaction.

#### Type

```ts
let options: {
  account: Account;
  transactions: Array<PreparedTransaction>;
};
```

### Returns

```ts
let returnType: Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}>;
```

A promise that resolves to the options for waiting for the receipt of the first transaction in the batch.
---

###### Connect SDK

## sendTransaction

Sends a transaction using the provided account.

You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/typescript/v5/extensions/use).

### Example

#### Using a prepared contract call

```ts
import {
  sendTransaction,
  getContract,
  prepareContractCall,
} from "thirdweb";
import { sepolia } from "thirdweb/chains";
 
const contract = getContract({
  address: "0x...",
  chain: sepolia,
  client,
});
 
const transaction = prepareContractCall({
  contract,
  method: "function transfer(address to, uint256 value)",
  params: [to, value],
});
 
const { transactionHash } = await sendTransaction({
  account,
  transaction,
});
```

#### Using a write extension

```ts
import { sendTransaction, getContract } from "thirdweb";
import { sepolia } from "thirdweb/chains";
import { mintTo } from "thirdweb/extensions/erc721";
 
const contract = getContract({
  address: "0x...",
  chain: sepolia,
  client,
});
 
const transaction = mintTo({
  contract,
  to: "0x...",
  nft: {
    name: "NFT Name",
    description: "NFT Description",
    image: "https://example.com/image.png",
  },
});
 
const { transactionHash } = await sendTransaction({
  account,
  transaction,
});
```

#### Using a prepared transaction

```ts
import {
  sendTransaction,
  getContract,
  prepareTransaction,
} from "thirdweb";
import { sepolia } from "thirdweb/chains";
 
const contract = getContract({
  address: "0x...",
  chain: sepolia,
  client,
});
 
const transaction = prepareTransaction({
  contract,
  to: "0x...",
  value: toWei("0.1"),
});
 
const { transactionHash } = await sendTransaction({
  account,
  transaction,
});
```

#### Send an EIP-7702 Transaction

_Note: This feature is in beta and is subject to breaking changes_

```ts
import {
  sendTransaction,
  prepareTransaction,
  signAuthorization,
} from "thirdweb";
import { sepolia } from "thirdweb/chains";
 
const authorization = await signAuthorization({
  request: {
    address: "0x...",
    chainId: 1,
    nonce: 0n,
  },
  account: myAccount,
});
 
const transaction = prepareTransaction({
  chain: sepolia,
  client: client,
  to: "0x...",
  value: 0n,
  authorizationList: [authorization],
});
 
const { transactionHash } = await sendTransaction({
  account,
  transaction,
});
```

#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)

```ts
const { transactionHash } = await sendTransaction({
  account,
  transaction,
  gasless: {
    provider: "engine",
    relayerUrl:
      "https://thirdweb.engine-***.thirdweb.com/relayer/***",
    relayerForwarderAddress: "0x...",
  },
});
```

#### Gasless usage with OpenZeppelin

```ts
const { transactionHash } = await sendTransaction({
  account,
  transaction,
  gasless: {
    provider: "openzeppelin",
    relayerUrl: "https://...",
    relayerForwarderAddress: "0x...",
  },
});
```

```ts
function sendTransaction(
  options: SendTransactionOptions,
): Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}>;
```

### Parameters

The options for sending the transaction.

#### Type

```ts
let options: {
  account: Account;
  gasless: GaslessOptions;
  transaction: PreparedTransaction<any>;
};
```

### Returns

```ts
let returnType: Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}>;
```

A promise that resolves to the transaction result.
---

###### Connect SDK

## serializeTransaction

Serializes a legacy, EIP-1559, EIP-2930, EIP-4844, or EIP-7702 transaction object.

### Example

```ts
import { serializeTransaction } from "thirdweb";
 
const serializedTransaction = serializeTransaction({
  transaction: {
    to: "0x",
    value: 0n,
  },
});
```

```ts
function serializeTransaction(
  options: SerializeTransactionOptions,
): `0x${string}`;
```

### Parameters

The serialization options.

#### Type

```ts
let options: {
  signature?:
    | ox__Signature.Signature<true, Hex>
    | ox__Signature.Legacy<Hex, bigint>;
  transaction: SerializableTransaction;
};
```

### Returns

```ts
let returnType: `0x${string}`;
```

The serialized transaction.
---

###### Connect SDK

## signAuthorization

Sign the given EIP-7702 authorization object.

```ts
function signAuthorization(options: {
  account: Account;
  request: AuthorizationRequest;
}): Promise<{
  address: string;
  chainId: number;
  nonce: bigint;
  r: bigint;
  s: bigint;
  yParity: number;
}>;
```

### Parameters

The options for `signAuthorization`Refer to the type [SignAuthorizationOptions](https://portal.thirdweb.com/references/typescript/v5/SignAuthorizationOptions)

#### Type

```ts
let options: { account: Account; request: AuthorizationRequest };
```

### Returns

```ts
let returnType: Promise<{
  address: string;
  chainId: number;
  nonce: bigint;
  r: bigint;
  s: bigint;
  yParity: number;
}>;
```

The signed authorization object

```ts
import { signAuthorization } from "thirdweb";
 
const authorization = await signAuthorization({
  request: {
    address: "0x...",
    chainId: 911867,
    nonce: 100n,
  },
  account: myAccount,
});
```
---

###### Connect SDK

## signTransaction

Signs a transaction to be sent to a node.

### Example

```ts
import { signTransaction } from "thirdweb";
signTransaction({
  transaction: {
    ...
  },
  privateKey: "0x...",
});
```

```ts
function signTransaction(
  options: SignTransactionOptions,
): `0x${string}`;
```

### Parameters

The options for signing.

#### Type

```ts
let options: {
  privateKey: Hex;
  transaction: SerializableTransaction;
};
```

### Returns

```ts
let returnType: `0x${string}`;
```

The signed transaction as a hex string
---

###### Connect SDK

## simulateTransaction

Simulates the execution of a transaction.

### Example

```ts
import { simulateTransaction } from "thirdweb";
const result = await simulateTransaction({
  transaction,
});
```

```ts
function simulateTransaction(
  options: SimulateOptions<abi, abiFn>,
): Promise<any>;
```

### Parameters

The options for simulating the transaction.

#### Type

```ts
let options: SimulateOptions<abi, abiFn>;
```

### Returns

```ts
let returnType: Promise<any>;
```

A promise that resolves to the result of the simulation.
---

###### Connect SDK

## toSerializableTransaction

Converts a prepared transaction to a transaction with populated options.

### Example

```ts
import {
  prepareTransaction,
  toSerializableTransaction,
} from "thirdweb";
 
const transaction = await prepareTransaction({
  transaction: {
    to: "0x...",
    value: 100,
  },
});
const finalTx = await toSerializableTransaction({
  transaction,
});
 
account.sendTransaction(finalTx);
```

```ts
function toSerializableTransaction(
  options: ToSerializableTransactionOptions,
): Promise<
  | {
      accessList: undefined | AccessList;
      authorizationList:
        | undefined
        | Array<{
            address: string;
            chainId: number;
            nonce: bigint;
            r: bigint;
            s: bigint;
            yParity: number;
          }>;
      chainId: number;
      data: `0x${string}`;
      gas: bigint;
      gasPrice?: undefined;
      maxFeePerGas?: bigint;
      maxPriorityFeePerGas?: bigint;
      nonce: undefined | number;
      to: undefined | string;
      type: undefined | TransactionType;
      value: undefined | bigint;
    }
  | {
      accessList: undefined | AccessList;
      authorizationList:
        | undefined
        | Array<{
            address: string;
            chainId: number;
            nonce: bigint;
            r: bigint;
            s: bigint;
            yParity: number;
          }>;
      chainId: number;
      data: `0x${string}`;
      gas: bigint;
      gasPrice?: bigint;
      maxFeePerGas?: undefined;
      maxPriorityFeePerGas?: undefined;
      nonce: undefined | number;
      to: undefined | string;
      type: undefined | TransactionType;
      value: undefined | bigint;
    }
>;
```

### Parameters

The transaction and additional options for conversion

#### Type

```ts
let options: {
  from?: string | Account;
  transaction: PreparedTransaction<any>;
};
```

### Returns

```ts
let returnType: Promise<
  | {
      accessList: undefined | AccessList;
      authorizationList:
        | undefined
        | Array<{
            address: string;
            chainId: number;
            nonce: bigint;
            r: bigint;
            s: bigint;
            yParity: number;
          }>;
      chainId: number;
      data: `0x${string}`;
      gas: bigint;
      gasPrice?: undefined;
      maxFeePerGas?: bigint;
      maxPriorityFeePerGas?: bigint;
      nonce: undefined | number;
      to: undefined | string;
      type: undefined | TransactionType;
      value: undefined | bigint;
    }
  | {
      accessList: undefined | AccessList;
      authorizationList:
        | undefined
        | Array<{
            address: string;
            chainId: number;
            nonce: bigint;
            r: bigint;
            s: bigint;
            yParity: number;
          }>;
      chainId: number;
      data: `0x${string}`;
      gas: bigint;
      gasPrice?: bigint;
      maxFeePerGas?: undefined;
      maxPriorityFeePerGas?: undefined;
      nonce: undefined | number;
      to: undefined | string;
      type: undefined | TransactionType;
      value: undefined | bigint;
    }
>;
```

A serializable transaction for inspection or submission to an account.

For easier transaction sending, sendTransaction
---

###### Connect SDK

## waitForReceipt

Waits for the transaction receipt of a given transaction hash on a specific contract.

### Example

```ts
import { waitForReceipt } from "thirdweb";
const receipt = await waitForReceipt({
  client,
  chain,
  transactionHash: "0x123...",
});
```

```ts
function waitForReceipt(options: {
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}): Promise<TransactionReceipt>;
```

### Parameters

The options for waiting for the receipt. By default, it's 100 blocks.

#### Type

```ts
let options: {
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
};
```

### Returns

```ts
let returnType: {
  blobGasPrice?: quantity;
  blobGasUsed?: quantity;
  blockHash: Hash;
  blockNumber: quantity;
  contractAddress: Address | null | undefined;
  cumulativeGasUsed: quantity;
  effectiveGasPrice: quantity;
  from: Address;
  gasUsed: quantity;
  logs: Array<Log<quantity, index, false>>;
  logsBloom: Hex;
  root?: Hash;
  status: status;
  to: Address | null;
  transactionHash: Hash;
  transactionIndex: index;
  type: type;
};
```

A promise that resolves with the transaction receipt.
---

###### Connect SDK

## getTransactionStore

Retrieve the transaction store for a given address.

### Example

```ts
import { getTransactionStore } from "thirdweb/transaction";
 
const store = getTransactionStore("0x...");
store.subscribe((transactions) => {
  console.log(transactions);
});
```

```ts
function getTransactionStore(
  address: string,
): Store<Array<StoredTransaction>>;
```

### Parameters

The address to retrieve the transaction store for.

#### Type

```ts
let address: string;
```

### Returns

```ts
let returnType: Store<Array<StoredTransaction>>;
```

A store of transactions for the given account to subscribe to.
---
# Insight
---

###### Connect SDK

## getContractEvents

Get contract events

### Example

```ts
import { Insight } from "thirdweb";
 
const events = await Insight.getContractEvents({
  client,
  chains: [sepolia],
  contractAddress: "0x1234567890123456789012345678901234567890",
  event: transferEvent(),
  decodeLogs: true,
});
```

```ts
function getContractEvents(options: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  contractAddress: string;
  decodeLogs?: boolean;
  event?: PreparedEvent<AbiEvent>;
  queryOptions?: Omit<
    | undefined
    | {
        aggregate?: unknown;
        chain?: Array<number>;
        chain_id?: Array<number>;
        decode?: null | boolean;
        filter_block_hash?: string;
        filter_block_number?: null | number;
        filter_block_number_gt?: null | number;
        filter_block_number_gte?: null | number;
        filter_block_number_lt?: null | number;
        filter_block_number_lte?: null | number;
        filter_block_timestamp?: null | number;
        filter_block_timestamp_gt?: null | number;
        filter_block_timestamp_gte?: null | number;
        filter_block_timestamp_lt?: null | number;
        filter_block_timestamp_lte?: null | number;
        filter_log_index?: null | number;
        filter_log_index_gt?: null | number;
        filter_log_index_gte?: null | number;
        filter_log_index_lt?: null | number;
        filter_log_index_lte?: null | number;
        filter_topic_0?: string;
        filter_topic_1?: string;
        filter_topic_2?: string;
        filter_topic_3?: string;
        filter_transaction_hash?: string;
        filter_transaction_index?: null | number;
        filter_transaction_index_gt?: null | number;
        filter_transaction_index_gte?: null | number;
        filter_transaction_index_lt?: null | number;
        filter_transaction_index_lte?: null | number;
        group_by?: unknown;
        limit?: number;
        page?: null | number;
        sort_by?: string;
        sort_order?: "asc" | "desc";
      },
    "chain" | "decode"
  >;
}): Promise<
  Array<{
    address: string;
    block_hash: string;
    block_number: number;
    block_timestamp: number;
    chain_id: string;
    data: string;
    decoded?: {
      indexed_params: {};
      name: string;
      non_indexed_params: {};
      signature: string;
    };
    log_index: number;
    topics: Array<string>;
    transaction_hash: string;
    transaction_index: number;
  }>
>;
```

### Parameters

#### Type

```ts
let options: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  contractAddress: string;
  decodeLogs?: boolean;
  event?: PreparedEvent<AbiEvent>;
  queryOptions?: Omit<
    | undefined
    | {
        aggregate?: unknown;
        chain?: Array<number>;
        chain_id?: Array<number>;
        decode?: null | boolean;
        filter_block_hash?: string;
        filter_block_number?: null | number;
        filter_block_number_gt?: null | number;
        filter_block_number_gte?: null | number;
        filter_block_number_lt?: null | number;
        filter_block_number_lte?: null | number;
        filter_block_timestamp?: null | number;
        filter_block_timestamp_gt?: null | number;
        filter_block_timestamp_gte?: null | number;
        filter_block_timestamp_lt?: null | number;
        filter_block_timestamp_lte?: null | number;
        filter_log_index?: null | number;
        filter_log_index_gt?: null | number;
        filter_log_index_gte?: null | number;
        filter_log_index_lt?: null | number;
        filter_log_index_lte?: null | number;
        filter_topic_0?: string;
        filter_topic_1?: string;
        filter_topic_2?: string;
        filter_topic_3?: string;
        filter_transaction_hash?: string;
        filter_transaction_index?: null | number;
        filter_transaction_index_gt?: null | number;
        filter_transaction_index_gte?: null | number;
        filter_transaction_index_lt?: null | number;
        filter_transaction_index_lte?: null | number;
        group_by?: unknown;
        limit?: number;
        page?: null | number;
        sort_by?: string;
        sort_order?: "asc" | "desc";
      },
    "chain" | "decode"
  >;
};
```

### Returns

```ts
let returnType: Promise<
  Array<{
    address: string;
    block_hash: string;
    block_number: number;
    block_timestamp: number;
    chain_id: string;
    data: string;
    decoded?: {
      indexed_params: {};
      name: string;
      non_indexed_params: {};
      signature: string;
    };
    log_index: number;
    topics: Array<string>;
    transaction_hash: string;
    transaction_index: number;
  }>
>;
```
---

###### Connect SDK

## getContractNFTs

Get all NFTs from a contract

### Example

```ts
import { Insight } from "thirdweb";
 
const nfts = await Insight.getContractNFTs({
  client,
  chains: [sepolia],
  contractAddress: "0x1234567890123456789012345678901234567890",
});
```

```ts
function getContractNFTs(args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  contractAddress: string;
  includeMetadata?: boolean;
  includeOwners?: boolean;
  queryOptions?: Omit<
    | undefined
    | {
        chain?: Array<number>;
        chain_id?: Array<number>;
        include_owners?: "false" | "true";
        limit?: number;
        page?: null | number;
        resolve_metadata_links?: "false" | "true";
      },
    "chain"
  >;
}): Promise<Array<NFT>>;
```

### Parameters

#### Type

```ts
let args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  contractAddress: string;
  includeMetadata?: boolean;
  includeOwners?: boolean;
  queryOptions?: Omit<
    | undefined
    | {
        chain?: Array<number>;
        chain_id?: Array<number>;
        include_owners?: "false" | "true";
        limit?: number;
        page?: null | number;
        resolve_metadata_links?: "false" | "true";
      },
    "chain"
  >;
};
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```
---

###### Connect SDK

## getNFT

Get NFT metadata by contract address and token id

### Example

```ts
import { Insight } from "thirdweb";
 
const nft = await Insight.getNFT({
  client,
  chain: sepolia,
  contractAddress: "0x1234567890123456789012345678901234567890",
  tokenId: 1n,
});
```

```ts
function getNFT(args: {
  chain: Readonly;
  client: ThirdwebClient;
  contractAddress: string;
  includeOwners?: boolean;
  queryOptions?: {
    chain?: Array<number>;
    chain_id?: Array<number>;
    include_owners?: "false" | "true";
    resolve_metadata_links?: "false" | "true";
  };
  tokenId: string | number | bigint;
}): Promise<undefined | NFT>;
```

### Parameters

#### Type

```ts
let args: {
  chain: Readonly;
  client: ThirdwebClient;
  contractAddress: string;
  includeOwners?: boolean;
  queryOptions?: {
    chain?: Array<number>;
    chain_id?: Array<number>;
    include_owners?: "false" | "true";
    resolve_metadata_links?: "false" | "true";
  };
  tokenId: string | number | bigint;
};
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```
---

###### Connect SDK

## getOwnedNFTs

Get NFTs owned by an address

### Example

```ts
import { Insight } from "thirdweb";
 
const nfts = await Insight.getOwnedNFTs({
  client,
  chains: [sepolia],
  ownerAddress: "0x1234567890123456789012345678901234567890",
});
```

```ts
function getOwnedNFTs(args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  includeMetadata?: boolean;
  ownerAddress: string;
  queryOptions?: Omit<
    {
      chain?: Array<number>;
      chain_id?: Array<number>;
      limit?: number;
      owner_address: string;
      page?: null | number;
      resolve_metadata_links?: "false" | "true";
    },
    "chain" | "owner_address"
  >;
}): Promise<Array<NFT & { quantityOwned: bigint }>>;
```

### Parameters

#### Type

```ts
let args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  includeMetadata?: boolean;
  ownerAddress: string;
  queryOptions?: Omit<
    {
      chain?: Array<number>;
      chain_id?: Array<number>;
      limit?: number;
      owner_address: string;
      page?: null | number;
      resolve_metadata_links?: "false" | "true";
    },
    "chain" | "owner_address"
  >;
};
```

### Returns

```ts
let returnType:
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC721";
    }
  | {
      chainId: number;
      id: bigint;
      metadata: NFTMetadata;
      owner: string | null;
      supply: bigint;
      tokenAddress: string;
      tokenURI: string;
      type: "ERC1155";
    };
```
---

###### Connect SDK

## getOwnedTokens

Get ERC20 tokens owned by an address

### Example

```ts
import { Insight } from "thirdweb";
 
const tokens = await Insight.getOwnedTokens({
  client,
  chains: [sepolia],
  ownerAddress: "0x1234567890123456789012345678901234567890",
});
```

```ts
function getOwnedTokens(args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  ownerAddress: string;
  queryOptions?: Omit<
    {
      chain?: Array<number>;
      chain_id?: Array<number>;
      include_native?: "false" | "true";
      include_spam?: "false" | "true";
      limit?: number;
      metadata?: "false" | "true";
      owner_address: string;
      page?: null | number;
      resolve_metadata_links?: "false" | "true";
    },
    "chain" | "chain_id" | "owner_address"
  >;
}): Promise<Array<GetBalanceResult>>;
```

### Parameters

#### Type

```ts
let args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  ownerAddress: string;
  queryOptions?: Omit<
    {
      chain?: Array<number>;
      chain_id?: Array<number>;
      include_native?: "false" | "true";
      include_spam?: "false" | "true";
      limit?: number;
      metadata?: "false" | "true";
      owner_address: string;
      page?: null | number;
      resolve_metadata_links?: "false" | "true";
    },
    "chain" | "chain_id" | "owner_address"
  >;
};
```

### Returns

```ts
let returnType: {
  chainId: number;
  decimals: number;
  displayValue: string;
  name: string;
  symbol: string;
  tokenAddress: string;
  value: bigint;
};
```
---

###### Connect SDK

## getTransactions

Get transactions for a wallet

### Example

```ts
import { Insight } from "thirdweb";
 
const transactions = await Insight.getTransactions({
  client,
  walletAddress: "0x1234567890123456789012345678901234567890",
  chains: [sepolia],
});
```

```ts
function getTransactions(args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  queryOptions?: {
    aggregate?: unknown;
    chain?: Array<number>;
    chain_id?: Array<number>;
    decode?: null | boolean;
    filter_block_hash?: string;
    filter_block_number?: null | number;
    filter_block_number_gt?: null | number;
    filter_block_number_gte?: null | number;
    filter_block_number_lt?: null | number;
    filter_block_number_lte?: null | number;
    filter_block_timestamp?: null | number;
    filter_block_timestamp_gt?: null | number;
    filter_block_timestamp_gte?: null | number;
    filter_block_timestamp_lt?: null | number;
    filter_block_timestamp_lte?: null | number;
    filter_function_selector?: string;
    filter_gas?: null | number;
    filter_gas_gt?: null | number;
    filter_gas_gte?: null | number;
    filter_gas_lt?: null | number;
    filter_gas_lte?: null | number;
    filter_gas_price?: null | number;
    filter_gas_price_gt?: null | number;
    filter_gas_price_gte?: null | number;
    filter_gas_price_lt?: null | number;
    filter_gas_price_lte?: null | number;
    filter_hash?: string;
    filter_transaction_index?: null | number;
    filter_transaction_index_gt?: null | number;
    filter_transaction_index_gte?: null | number;
    filter_transaction_index_lt?: null | number;
    filter_transaction_index_lte?: null | number;
    filter_value?: null | number;
    filter_value_gt?: null | number;
    filter_value_gte?: null | number;
    filter_value_lt?: null | number;
    filter_value_lte?: null | number;
    group_by?: unknown;
    limit?: number;
    page?: null | number;
    sort_by?: string;
    sort_order?: "asc" | "desc";
  };
  walletAddress: string;
}): Promise<
  Array<{
    access_list_json?: string;
    authorization_list_json?: string;
    blob_gas_price?: string;
    blob_gas_used?: number;
    block_hash: string;
    block_number: number;
    block_timestamp: number;
    chain_id: string;
    contract_address?: string;
    cumulative_gas_used?: number;
    data: string;
    decoded?: { inputs?: {}; name: string; signature: string };
    effective_gas_price?: string;
    from_address: string;
    function_selector: string;
    gas: number;
    gas_price: string;
    gas_used?: number;
    hash: string;
    logs_bloom?: string;
    max_fee_per_gas: string;
    max_priority_fee_per_gas: string;
    nonce: number;
    r: string;
    s: string;
    status?: number;
    to_address: string;
    transaction_index: number;
    transaction_type: number;
    v: string;
    value: string;
  }>
>;
```

### Parameters

#### Type

```ts
let args: {
  chains: Array<Readonly<ChainOptions & { rpc: string }>>;
  client: ThirdwebClient;
  queryOptions?: {
    aggregate?: unknown;
    chain?: Array<number>;
    chain_id?: Array<number>;
    decode?: null | boolean;
    filter_block_hash?: string;
    filter_block_number?: null | number;
    filter_block_number_gt?: null | number;
    filter_block_number_gte?: null | number;
    filter_block_number_lt?: null | number;
    filter_block_number_lte?: null | number;
    filter_block_timestamp?: null | number;
    filter_block_timestamp_gt?: null | number;
    filter_block_timestamp_gte?: null | number;
    filter_block_timestamp_lt?: null | number;
    filter_block_timestamp_lte?: null | number;
    filter_function_selector?: string;
    filter_gas?: null | number;
    filter_gas_gt?: null | number;
    filter_gas_gte?: null | number;
    filter_gas_lt?: null | number;
    filter_gas_lte?: null | number;
    filter_gas_price?: null | number;
    filter_gas_price_gt?: null | number;
    filter_gas_price_gte?: null | number;
    filter_gas_price_lt?: null | number;
    filter_gas_price_lte?: null | number;
    filter_hash?: string;
    filter_transaction_index?: null | number;
    filter_transaction_index_gt?: null | number;
    filter_transaction_index_gte?: null | number;
    filter_transaction_index_lt?: null | number;
    filter_transaction_index_lte?: null | number;
    filter_value?: null | number;
    filter_value_gt?: null | number;
    filter_value_gte?: null | number;
    filter_value_lt?: null | number;
    filter_value_lte?: null | number;
    group_by?: unknown;
    limit?: number;
    page?: null | number;
    sort_by?: string;
    sort_order?: "asc" | "desc";
  };
  walletAddress: string;
};
```

### Returns

```ts
let returnType: Promise<
  Array<{
    access_list_json?: string;
    authorization_list_json?: string;
    blob_gas_price?: string;
    blob_gas_used?: number;
    block_hash: string;
    block_number: number;
    block_timestamp: number;
    chain_id: string;
    contract_address?: string;
    cumulative_gas_used?: number;
    data: string;
    decoded?: { inputs?: {}; name: string; signature: string };
    effective_gas_price?: string;
    from_address: string;
    function_selector: string;
    gas: number;
    gas_price: string;
    gas_used?: number;
    hash: string;
    logs_bloom?: string;
    max_fee_per_gas: string;
    max_priority_fee_per_gas: string;
    nonce: number;
    r: string;
    s: string;
    status?: number;
    to_address: string;
    transaction_index: number;
    transaction_type: number;
    v: string;
    value: string;
  }>
>;
```
---
# Engine
---

###### Connect SDK

## createServerWallet

Create a new server wallet.

### Example

```ts
import { Engine } from "thirdweb";
 
const serverWallet = await Engine.createServerWallet({
  client,
  label: "My Server Wallet",
});
console.log(serverWallet.address);
console.log(serverWallet.smartAccountAddress);
```

```ts
function createServerWallet(
  params: CreateServerWalletArgs,
): Promise<{
  address: string;
  label?: string;
  smartAccountAddress?: string;
}>;
```

### Parameters

The parameters for the server wallet.

#### Type

```ts
let params: { client: ThirdwebClient; label: string };
```

### Returns

```ts
let returnType: Promise<{
  address: string;
  label?: string;
  smartAccountAddress?: string;
}>;
```

The server wallet signer address and the predicted smart account address.
---

###### Connect SDK

## getServerWallets

List all server wallets.

### Example

```ts
import { Engine } from "thirdweb";
 
const serverWallets = await Engine.getServerWallets({
  client,
});
console.log(serverWallets);
```

```ts
function getServerWallets(
  params: GetServerWalletsArgs,
): Promise<
  Array<{
    address: string;
    label?: string;
    smartAccountAddress?: string;
  }>
>;
```

### Parameters

The parameters for the server wallet.

#### Type

```ts
let params: { client: ThirdwebClient };
```

### Returns

```ts
let returnType: Promise<
  Array<{
    address: string;
    label?: string;
    smartAccountAddress?: string;
  }>
>;
```

an array of server wallets with their signer address and predicted smart account address.
---

###### Connect SDK

## getTransactionStatus

Get the execution status of a transaction.

### Example

```ts
import { Engine } from "thirdweb";
 
const executionResult = await Engine.getTransactionStatus({
  client,
  transactionId,
});
console.log(executionResult.status);
```

```ts
function getTransactionStatus(args: {
  client: ThirdwebClient;
  transactionId: string;
}): Promise<ExecutionResult>;
```

### Parameters

The arguments for the transaction.

#### Type

```ts
let args: { client: ThirdwebClient; transactionId: string };
```

### Returns

```ts
let returnType: Prettify<
  ExecutionResult4337Serialized & {
    cancelledAt: string | null;
    chain: Chain;
    confirmedAt: string | null;
    createdAt: string;
    from: string | undefined;
    id: string;
  }
>;
```
---

###### Connect SDK

## searchTransactions

Search for transactions by their ids.

### Example

### Search for transactions by their ids

```ts
import { Engine } from "thirdweb";
 
const transactions = await Engine.searchTransactions({
  client,
  filters: [
    {
      field: "id",
      values: ["1", "2", "3"],
    },
  ],
});
console.log(transactions);
```

### Search for transactions by chain id

```ts
import { Engine } from "thirdweb";
 
const transactions = await Engine.searchTransactions({
  client,
  filters: [
    {
      field: "chainId",
      values: ["1", "137"],
    },
  ],
});
console.log(transactions);
```

### Search for transactions by sender wallet address

```ts
import { Engine } from "thirdweb";
 
const transactions = await Engine.searchTransactions({
  client,
  filters: [
    {
      field: "from",
      values: ["0x1234567890123456789012345678901234567890"],
    },
  ],
});
console.log(transactions);
```

### Combined search

```ts
import { Engine } from "thirdweb";
 
const transactions = await Engine.searchTransactions({
  client,
  filters: [
    {
      filters: [
        {
          field: "from",
          values: ["0x1234567890123456789012345678901234567890"],
        },
        {
          field: "chainId",
          values: ["8453"],
        },
      ],
      operation: "AND",
    },
  ],
  pageSize: 100,
  page: 0,
});
console.log(transactions);
```

```ts
function searchTransactions(
  args: SearchTransactionsArgs,
): Promise<{
  pagination: { limit: number; page: number; totalCount: number };
  transactions: Array<{
    batchIndex: number;
    cancelledAt: null | string;
    chainId: string;
    clientId: string;
    confirmedAt: null | string;
    confirmedAtBlockNumber: null | string;
    createdAt: string;
    enrichedData:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
    errorMessage: null | string;
    executionParams:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
    executionResult:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
    from: null | string;
    id: string;
    transactionHash: null | string;
    transactionParams:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
  }>;
}>;
```

### Parameters

The arguments for the search.

#### Type

```ts
let args: {
  client: ThirdwebClient;
  filters?: Array<TransactionsFilterValue | TransactionsFilterNested>;
  page?: number;
  pageSize?: number;
};
```

### Returns

```ts
let returnType: Promise<{
  pagination: { limit: number; page: number; totalCount: number };
  transactions: Array<{
    batchIndex: number;
    cancelledAt: null | string;
    chainId: string;
    clientId: string;
    confirmedAt: null | string;
    confirmedAtBlockNumber: null | string;
    createdAt: string;
    enrichedData:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
    errorMessage: null | string;
    executionParams:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
    executionResult:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
    from: null | string;
    id: string;
    transactionHash: null | string;
    transactionParams:
      | null
      | string
      | number
      | boolean
      | Array<unknown>
      | {};
  }>;
}>;
```
---

###### Connect SDK

## ServerWallet

```ts
type ServerWallet = Account & {
  enqueueBatchTransaction: (args: {
    transactions: Array<PreparedTransaction>;
  }) => Promise<{ transactionId: string }>;
  enqueueTransaction: (args: {
    simulate?: boolean;
    transaction: PreparedTransaction;
  }) => Promise<{ transactionId: string }>;
};
```
---

###### Connect SDK

## waitForTransactionHash

Wait for a transaction to be submitted onchain and return the transaction hash.

### Example

```ts
import { Engine } from "thirdweb";
 
const { transactionHash } = await Engine.waitForTransactionHash({
  client,
  transactionId, // the transaction id returned from enqueueTransaction
});
```

```ts
function waitForTransactionHash(args: {
  client: ThirdwebClient;
  timeoutInSeconds?: number;
  transactionId: string;
}): Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}>;
```

### Parameters

The arguments for the transaction.

#### Type

```ts
let args: {
  client: ThirdwebClient;
  timeoutInSeconds?: number;
  transactionId: string;
};
```

### Returns

```ts
let returnType: Promise<{
  chain: Readonly;
  client: ThirdwebClient;
  maxBlocksWaitTime?: number;
  readonly transactionHash: `0x${string}`;
}>;
```
---
# Nebula
---

###### Connect SDK

## chat

Chat with Nebula.

### Example

```ts
import { Nebula } from "thirdweb/ai";
 
const response = await Nebula.chat({
  client: TEST_CLIENT,
  message:
    "What's the symbol of this contract: 0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8",
  contextFilter: {
    chains: [sepolia],
  },
});
```

Multi message prompt:

```ts
const response = await Nebula.chat({
  client,
  messages: [
    { role: "user", content: "What's my balance?" },
    { role: "assistant", content: "Your balance is 0.023 ETH" },
    { role: "user", content: "What about my NFTs?" },
  ],
  contextFilter: {
    chains: [sepolia],
  },
});
```

Extracting and sending transactions from a chat response:

```ts
const response = await Nebula.chat({ ... });
const transactions = response.transactions;
for (const transaction of transactions) {
  await sendTransaction({ transaction, account });
}
```

```ts
function chat(input: Input): Promise<Output>;
```

### Parameters

The input for the chat.

#### Type

```ts
let input: {
  account?: Account;
  client: ThirdwebClient;
  contextFilter?: {
    chains?: Array<Chain>;
    contractAddresses?: Array<string>;
    walletAddresses?: Array<string>;
  };
  sessionId?: string;
} & (
  | {
      messages: Array<{
        content: string;
        role: "user" | "assistant";
      }>;
    }
  | { message: string }
);
```

### Returns

```ts
let returnType: {
  message: string;
  sessionId: string;
  transactions: Array<PreparedTransaction>;
};
```

The chat response. This API is in early access and might change in the future.
---

###### Connect SDK

## execute

Execute a transaction based on a prompt.

### Example

```ts
import { Nebula } from "thirdweb/ai";
 
const wallet = createWallet("io.metamask");
const account = wallet.connect({ client });
 
const result = await Nebula.execute({
  client,
  account, // transactions will be sent from this account
  message: "send 0.0001 ETH to vitalik.eth",
  contextFilter: {
    chains: [sepolia],
  },
});
```

Multi message prompt:

```ts
Nebula.execute({
  client,
  account,
  messages: [
    { role: "user", content: "What's the address of vitalik.eth" },
    {
      role: "assistant",
      content:
        "The address of vitalik.eth is 0xd8dA6BF26964aF8E437eEa5e3616511D7G3a3298",
    },
    { role: "user", content: "Send them 0.0001 ETH" },
  ],
  contextFilter: {
    chains: [sepolia],
  },
});
```

```ts
function execute(
  input: Input & { account: Account },
): Promise<SendTransactionResult>;
```

### Parameters

The input for the transaction.

#### Type

```ts
let input: Input & { account: Account };
```

### Returns

```ts
let returnType: Promise<SendTransactionResult>;
```

The transaction hash. This API is in early access and might change in the future.
---
# Social API
---

###### Connect SDK

## getSocialProfiles

Fetches the wallet's available social profiles.

### Example

```ts
import { getSocialProfiles } from "thirdweb/social";
const profiles = await getSocialProfiles({
  address: "0x...",
  client,
});
```

```ts
function getSocialProfiles(args: {
  address: string;
  client: ThirdwebClient;
}): Promise<Array<SocialProfile>>;
```

### Parameters

The arguments to use when fetching the social profiles.

#### Type

```ts
let args: { address: string; client: ThirdwebClient };
```

### Returns

```ts
let returnType: {
  avatar?: string;
  bio?: string;
  metadata?: FarcasterProfile | LensProfile | EnsProfile;
  name?: string;
  type: "farcaster" | "lens" | "ens";
};
```

A promise resolving to the array of social profiles for the given address.
---
# Auth
---

###### Connect SDK

## createAuth

Creates an authentication object with the given options.

### Example

```ts
import { createAuth } from 'thirdweb/auth';
 
const auth = createAuth({...});
 
// 1. generate a login payload for a client on the server side
const loginPayload = await auth.generatePayload({ address: '0x123...' });
 
// 2. send the login payload to the client
 
// 3. verify the login payload that the client sends back later
const verifiedPayload = await auth.verifyPayload({ payload: loginPayload, signature: '0x123...' });
 
// 4. generate a JWT for the client
const jwt = await auth.generateJWT({ payload: verifiedPayload });
 
// 5. set the JWT as a cookie or otherwise provide it to the client
 
// 6. authenticate the client based on the JWT on subsequent calls
 const { valid, parsedJWT } = await auth.verifyJWT({ jwt });
```

```ts
function createAuth(options: AuthOptions): {
  generateJWT: (params: GenerateJWTParams) => Promise<string>;
  generatePayload: (
    __namedParameters: GenerateLoginPayloadParams,
  ) => Promise<LoginPayload>;
  verifyJWT: (params: VerifyJWTParams) => Promise<VerifyJWTResult>;
  verifyPayload: (
    __namedParameters: VerifyLoginPayloadParams,
  ) => Promise<VerifyLoginPayloadResult>;
};
```

### Parameters

The options for creating the authentication object.

#### Type

```ts
let options: {
  adminAccount?: Account;
  client?: ThirdwebClient;
  domain: string;
  jwt?: {
    expirationTimeSeconds?: number;
    jwtId?: {
      generate: () => string | Promise<string>;
      validate: (jwtId: string) => boolean | Promise<boolean>;
    };
  };
  login?: {
    nonce?: {
      generate: () => string | Promise<string>;
      validate: (nonce: string) => boolean | Promise<boolean>;
    };
    payloadExpirationTimeSeconds?: number;
    resources?: Array<string>;
    statement?: string;
    uri?: string;
    version?: string;
  };
};
```

### Returns

```ts
let returnType: {
  generateJWT: (params: GenerateJWTParams) => Promise<string>;
  generatePayload: (
    __namedParameters: GenerateLoginPayloadParams,
  ) => Promise<LoginPayload>;
  verifyJWT: (params: VerifyJWTParams) => Promise<VerifyJWTResult>;
  verifyPayload: (
    __namedParameters: VerifyLoginPayloadParams,
  ) => Promise<VerifyLoginPayloadResult>;
};
```

The created authentication object.
---

###### Connect SDK

## isErc6492Signature

Determines if a signature is compatible with [ERC6492](https://eips.ethereum.org/EIPS/eip-6492)

### Example

```ts
import { isErc6492Signature } from "thirdweb/auth";
 
const isErc6492 = isErc6492Signature(
  "0x1234567890123456789012345678901234567890",
);
```

```ts
function isErc6492Signature(signature: `0x${string}`): boolean;
```

### Parameters

The signature to check for ERC6492 compatibility

#### Type

```ts
let signature: `0x${string}`;
```

### Returns

```ts
let returnType: boolean;
```

True if the signature is compatible with ERC6492, false otherwise
---

###### Connect SDK

## parseErc6492Signature

Parses a serialized (Hex) [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492) signature. If the signature is not in ERC-6492 format, the original signature is returned.

### Example

```ts
import { parseErc6492Signature } from "thirdweb/auth";
 
const parsedSignature = parseErc6492Signature(
  "0x1234567890123456789012345678901234567890",
);
```

```ts
function parseErc6492Signature(
  signature: `0x${string}`,
): ParseErc6492SignatureReturnType;
```

### Parameters

The signature to parse

#### Type

```ts
let signature: `0x${string}`;
```

### Returns

```ts
let returnType: OneOf<Erc6492Signature | { signature: Hex }>;
```

ParseErc6492SignatureReturnType The parsed (or original) signature
---

###### Connect SDK

## serializeErc6492Signature

Serializes a signature for use with [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492). The signature must be generated by a signer for an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Account Factory account with counterfactual deployment addresses.

### Example

```ts
import { serializeErc6492Signature } from "thirdweb/auth";
 
const serializedSignature = serializeErc6492Signature({
  address: "0x...",
  data: "0x...",
  signature: "0x...",
});
// 0x000000000000000000000000cafebabecafebabecafebabecafebabecafebabe000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a461f509887bd19e312c0c58467ce8ff8e300d3c1a90b608a760c5b80318eaf15fe57c96f9175d6cd4daad4663763baa7e78836e067d0163e9a2ccf2ff753f5b1b000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492
```

```ts
function serializeErc6492Signature(
  __namedParameters: Erc6492Signature,
): `0x${string}`;
```

### Parameters

#### Type

```ts
let __namedParameters: { address: string; data: Hex; signature: Hex };
```

### Returns

```ts
let returnType: `0x${string}`;
```

The serialized signature
---

###### Connect SDK

## signLoginPayload

Signs the login payload using the provided account.

### Example

```ts
import { signLoginPayload } from "thirdweb/auth";
 
const { signature, payload } = await signLoginPayload({
  payload: loginPayload,
  account: account,
});
```

```ts
function signLoginPayload(
  options: SignLoginPayloadParams,
): Promise<{ payload: LoginPayload; signature: `0x${string}` }>;
```

### Parameters

The options for signing the login payload.

#### Type

```ts
let options: { account: Account; payload: LoginPayload };
```

### Returns

```ts
let returnType: {
  address: string;
  chain_id?: string;
  domain: string;
  expiration_time: string;
  invalid_before: string;
  issued_at: string;
  nonce: string;
  resources?: Array<string>;
  statement: string;
  uri?: string;
  version: string;
};
```

An object containing the signature and the payload.
---

###### Connect SDK

## verifyContractWalletSignature

Verifies a contract wallet signature using [ERC-6942](https://eips.ethereum.org/EIPS/eip-6942) Signature Validation for Predeploy Contracts. This function will validate signatures for both deployed and undeployed smart accounts of all signature types.

### Example

```ts
import { verifyContractWalletSignature } from 'thirdweb/auth';
 
const isValid = await verifyContractWalletSignature({
 message: '0x..',
 signature: '0x..',
 address: '0x...',
 chain: ...,
 client: ...,
});
```

```ts
function verifyContractWalletSignature(__namedParameters: {
  accountFactory?: {
    address: string;
    verificationCalldata: `0x${string}`;
  };
  address: string;
  chain: Readonly;
  client: ThirdwebClient;
  message: Message;
  signature: string | Uint8Array<ArrayBufferLike>;
}): Promise<boolean>;
```

### Parameters

#### Type

```ts
let __namedParameters: {
  accountFactory?: {
    address: string;
    verificationCalldata: `0x${string}`;
  };
  address: string;
  chain: Readonly;
  client: ThirdwebClient;
  message: Message;
  signature: string | Uint8Array<ArrayBufferLike>;
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean indicating whether the signature is valid.
---

###### Connect SDK

## verifyEOASignature

Verifies the signature of a message using an Ethereum account's EOA (Externally Owned Account).

### Example

```ts
import { verifyEOASignature } from "thirdweb/auth";
 
const isValid = await verifyEOASignature({
  message: "0x1234567890123456789012345678901234567890",
  signature: "0x1234567890123456789012345678901234567890",
  address: "0x1234567890123456789012345678901234567890",
});
```

```ts
function verifyEOASignature(
  options: VerifyEOASignatureParams,
): Promise<boolean>;
```

### Parameters

The options for verifying the signature.

#### Type

```ts
let options: {
  address: string;
  message: string | Message;
  signature: string | Uint8Array;
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean indicating whether the signature is valid.
---

###### Connect SDK

## verifySignature

Verifies the signature based on the provided options. Handles smart contract wallet signatures and EOA signatures._IMPORTANT: in order to check smart contract signatures, a chain and client must be provided. Or, you can use the `verifyContractWalletSignature` function directly if all signatures will be from smart accounts._

verifyContractWalletSignature

### Example

```ts
import { verifySignature } from "thirdweb/auth";
 
const isValid = await verifySignature({
  message: "Your message to sign",
  signature:
    "0x91db0222ec371a8c18d3b187a6d2e77789bffca1b96826ef6b8708e0d4a66c80312fc3ae95b8fbc147265abf539bb6f360152be61a0e1411d7f5771a599e769a1c",
  address: "0xda9C7A86AeE76701FC1c23ae548e8E93Ba3e42A5",
  client: thirdwebClient,
  chain: chain,
});
```

```ts
function verifySignature(options: {
  accountFactory?: {
    address: string;
    verificationCalldata: `0x${string}`;
  };
  address: string;
  chain?: Readonly<ChainOptions & { rpc: string }>;
  client?: ThirdwebClient;
  message: Message & (Message | undefined);
  signature: (string | Uint8Array<ArrayBufferLike>) &
    (undefined | string | Uint8Array<ArrayBufferLike>);
}): Promise<boolean>;
```

### Parameters

The options for signature verification.

#### Type

```ts
let options: {
  accountFactory?: {
    address: string;
    verificationCalldata: `0x${string}`;
  };
  address: string;
  chain?: Readonly<ChainOptions & { rpc: string }>;
  client?: ThirdwebClient;
  message: Message & (Message | undefined);
  signature: (string | Uint8Array<ArrayBufferLike>) &
    (undefined | string | Uint8Array<ArrayBufferLike>);
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A boolean indicating whether the signature is valid or not.
---

###### Connect SDK

## verifyTypedData

Verify am [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data signature. This function is interoperable with all wallet types (smart accounts or EOAs).

### Example

```ts
import { verifyTypedData } from "thirdweb/utils";
const isValid = await verifyTypedData({
  address: "0x...",
  signature: "0x...",
  client,
  chain,
  domain: {
    name: "Ether Mail",
    version: "1",
    chainId: 1,
    verifyingContract: "0x0000000000000000000000000000000000000000",
  },
  primaryType: "Mail",
  types: {
    Person: [
      { name: "name", type: "string" },
      { name: "wallet", type: "address" },
    ],
    Mail: [
      { name: "from", type: "Person" },
      { name: "to", type: "Person" },
      { name: "contents", type: "string" },
    ],
  },
  message: {
    from: {
      name: "Cow",
      wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
    },
    to: {
      name: "Bob",
      wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB",
    },
    contents: "Hello, Bob!",
  },
});
```

```ts
function verifyTypedData(
  __namedParameters: VerifyTypedDataParams<typedData, primaryType>,
): Promise<boolean>;
```

### Parameters

#### Type

```ts
let __namedParameters: VerifyTypedDataParams<typedData, primaryType>;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A promise that resolves to `true` if the signature is valid, or `false` otherwise.
---

###### Connect SDK

## decodeJWT

Decodes a JSON Web Token (JWT) and returns the decoded payload and signature.

### Example

```ts
import { decodeJWT } from "thirdweb/utils";
 
const { payload, signature } = decodeJWT(jwt);
```

```ts
function decodeJWT(jwt: string): {
  payload: JWTPayload;
  signature: `0x${string}`;
};
```

### Parameters

The JWT string to decode.

#### Type

```ts
let jwt: string;
```

### Returns

```ts
let returnType: { payload: JWTPayload; signature: `0x${string}` };
```

An object containing the decoded payload and signature.
---

###### Connect SDK

## encodeJWT

Builds a JSON Web Token (JWT) using the provided options.

### Example

```ts
import { encodeJWT } from "thirdweb/utils";
 
const jwt = await encodeJWT({
  payload: {
    iss: "0x1234567890123456789012345678901234567890",
    sub: "0x1234567890123456789012345678901234567890",
    aud: "0x1234567890123456789012345678901234567890",
    exp: new Date(Date.now() + 1000 * 60 * 60),
    nbf: new Date(),
    iat: new Date(),
    jti: "1234567890",
    ctx: {
      example: "example",
    },
  },
  wallet,
});
```

```ts
function encodeJWT(options: EncodeJWTParams): Promise<string>;
```

### Parameters

The options for building the JWT.

#### Type

```ts
let options: EncodeJWTParams;
```

### Returns

```ts
let returnType: Promise<string>;
```

The generated JWT.
---

###### Connect SDK

## refreshJWT

Refreshes a JSON Web Token (JWT) by encoding a new payload with updated expiration time.

### Example

```ts
import { refreshJWT } from "thirdweb/utils";
 
const jwt = await refreshJWT({
  account,
  jwt,
  expirationTime: 1000 * 60 * 60,
});
```

```ts
function refreshJWT(options: RefreshJWTParams): Promise<string>;
```

### Parameters

The options for refreshing the JWT.

#### Type

```ts
let options: {
  account: Account;
  expirationTime?: number;
  jwt: string;
};
```

### Returns

```ts
let returnType: Promise<string>;
```

A Promise that resolves to the refreshed JWT.
---
# NFT
---

###### Connect SDK

## NFTDescription

This component fetches and displays an NFT's description. It inherits all the attributes of a `<span>`so you can style it just like how you would style a `<span>` element.

### Example

#### Basic usage

```tsx
import { NFTProvider, NFTDescription } from "thirdweb/react";
 
<NFTProvider>
  <NFTDescription />
</NFTProvider>;
```

#### Show a loading sign while the description is being fetched

```tsx
import { NFTProvider, NFTDescription } from "thirdweb/react";
 
<NFTProvider>
  <NFTDescription loadingComponent={<YourLoadingSign />} />
</NFTProvider>;
```

#### Show something in case the description failed to resolve

```tsx
import { NFTProvider, NFTDescription } from "thirdweb/react";
 
<NFTProvider>
  <NFTDescription
    fallbackComponent={<span>Failed to load description</span>}
  />
</NFTProvider>;
```

#### Custom query options for useQuery (tanstack-query)

```tsx
import { NFTProvider, NFTDescription } from "thirdweb/react";
 
<NFTProvider>
  <NFTDescription queryOptions={{ retry: 3, enabled: false }} />
</NFTProvider>;
```

#### Override the description with the `descriptionResolver` prop

If you already have the url, you can skip the network requests and pass it directly to the NFTDescription

```tsx
<NFTDescription descriptionResolver="The desc of the NFT" />;
```

You can also pass in your own custom (async) function that retrieves the description

```tsx
const getDescription = async () => {
  // ...
  return description;
};
 
<NFTDescription descriptionResolver={getDescription} />;
```

```ts
function NFTDescription(
  __namedParameters: NFTDescriptionProps,
): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),descriptionResolver : string | (() => string) | (() => Promise<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```

A `<span>` element containing the description of the NFT
---

###### Connect SDK

## NFTMedia

This component fetches and displays an NFT's media. It uses thirdweb [MediaRenderer](https://portal.thirdweb.com/refernces/typescript/v5/MediaRenderer) under the hood so you can style it just like how you would style a MediaRenderer.

### Example

#### Basic usage

```tsx
import { NFTProvider, NFTMedia } from "thirdweb/react";
 
<NFTProvider>
  <NFTMedia />
</NFTProvider>;
```

#### Show a loading sign while the media is being fetched

```tsx
import { NFTProvider, NFTMedia } from "thirdweb/react";
 
<NFTProvider>
  <NFTMedia loadingComponent={<YourLoadingSign />} />
</NFTProvider>;
```

#### Show something in case the media failed to resolve

```tsx
import { NFTProvider, NFTMedia } from "thirdweb/react";
 
<NFTProvider>
  <NFTMedia fallbackComponent={<span>Failed to load media</span>} />
</NFTProvider>;
```

#### Custom query options for useQuery (tanstack-query)

```tsx
import { NFTProvider, NFTMedia } from "thirdweb/react";
 
<NFTProvider>
  <NFTMedia queryOptions={{ retry: 3, enabled: false }} />
</NFTProvider>;
```

#### Basic stylings

You can style NFTMedia with the `style` and `className` props.

```tsx
<NFTMedia style={{ borderRadius: "8px" }} className="mx-auto" />;
```

#### Override the media with the `mediaResolver` prop

If you already have the url, you can skip the network requests and pass it directly to the NFTMedia

```tsx
<NFTMedia
  mediaResolver={{
    src: "/cat_video.mp4",
    // Poster is applicable to medias that are videos and audios
    poster: "/cat-image.png",
  }}
/>;
```

You can also pass in your own custom (async) function that retrieves the media url

```tsx
const getMedia = async () => {
  const url = getNFTMedia(props);
  return url;
};
 
<NFTMedia mediaResolver={getMedia} />;
```

```ts
function NFTMedia(__namedParameters: NFTMediaProps): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: Omit<
  MediaRendererProps,
  "src" | "poster" | "client"
> & {
  fallbackComponent?: JSX.Element;
  loadingComponent?: JSX.Element;
  mediaResolver?:
    | NFTMediaInfo
    | (() => NFTMediaInfo)
    | (() => Promise<NFTMediaInfo>);
  queryOptions?: Omit<
    UseQueryOptions<NFTMediaInfo>,
    "queryFn" | "queryKey"
  >;
};
```

### Returns

```ts
let returnType: null | Element;
```

A MediaRenderer component
---

###### Connect SDK

## NFTName

This component fetches and displays an NFT's name. It takes in a `className` and `style` props so you can style it just like how you would style a `<span>` element.

### Example

#### Basic usage

```tsx
import { NFTProvider, NFTName } from "thirdweb/react";
 
<NFTProvider>
  <NFTName />
</NFTProvider>;
```

#### Show a loading sign while the name is being fetched

```tsx
import { NFTProvider, NFTName } from "thirdweb/react";
 
<NFTProvider>
  <NFTName loadingComponent={<YourLoadingSign />} />
</NFTProvider>;
```

#### Show something in case the name failed to resolve

```tsx
import { NFTProvider, NFTName } from "thirdweb/react";
 
<NFTProvider>
  <NFTName fallbackComponent={<span>Failed to load name</span>} />
</NFTProvider>;
```

#### Custom query options for useQuery (tanstack-query)

```tsx
import { NFTProvider, NFTName } from "thirdweb/react";
 
<NFTProvider>
  <NFTName queryOptions={{ retry: 3, enabled: false }} />
</NFTProvider>;
```

#### Override the name with the `nameResolver` prop

If you already have the name, you can skip the network requests and pass it directly to the NFTName

```tsx
<NFTName nameResolver="Doodles #1" />;
```

You can also pass in your own custom (async) function that retrieves the name

```tsx
const getName = async () => {
  // ...
  return name;
};
 
<NFTName nameResolver={getName} />;
```

```ts
function NFTName(__namedParameters: NFTNameProps): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise<string>),nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```

A `<span>` element containing the name of the NFT
---
# Tokens
---

###### Connect SDK

## TokenIcon

This component tries to resolve the icon of a given token, then return an image.

### Example

#### Basic usage

```tsx
import { TokenProvider, TokenIcon } from "thirdweb/react";
 
<TokenProvider
  address="0x-token-address"
  chain={chain}
  client={client}
>
  <TokenIcon />
</TokenProvider>;
```

Result: An `<img />` component with the src of the icon

```html
<img src="token-icon.png" />
```

#### Override the icon with the `iconResolver` prop

If you already have the icon url, you can skip the network requests and pass it directly to the TokenIcon

```tsx
<TokenIcon iconResolver="/usdc.png" />;
```

You can also pass in your own custom (async) function that retrieves the icon url

```tsx
const getIcon = async () => {
  const icon = getIconFromCoinMarketCap(tokenAddress, etc);
  return icon;
};
 
<TokenIcon iconResolver={getIcon} />;
```

#### Show a loading sign while the icon is being loaded

```tsx
<TokenIcon loadingComponent={<Spinner />} />;
```

#### Fallback to a dummy image if the token icon fails to resolve

```tsx
<TokenIcon fallbackComponent={<img src="blank-image.png" />} />;
```

#### Usage with queryOptions

TokenIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic

```tsx
<TokenIcon queryOptions={{ enabled: someLogic, retry: 3 }} />;
```

```ts
function TokenIcon(__namedParameters: TokenIconProps): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,alt : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,children : ReactNode,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,crossOrigin : CrossOrigin,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,decoding : "auto" | "async" | "sync",defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,fetchPriority : "auto" | "high" | "low",height : string | number,hidden : boolean,iconResolver : string | (() => string) | (() => Promise<string>),id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLImageElement>,onAbortCapture : ReactEventHandler<HTMLImageElement>,onAnimationEnd : AnimationEventHandler<HTMLImageElement>,onAnimationEndCapture : AnimationEventHandler<HTMLImageElement>,onAnimationIteration : AnimationEventHandler<HTMLImageElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLImageElement>,onAnimationStart : AnimationEventHandler<HTMLImageElement>,onAnimationStartCapture : AnimationEventHandler<HTMLImageElement>,onAuxClick : MouseEventHandler<HTMLImageElement>,onAuxClickCapture : MouseEventHandler<HTMLImageElement>,onBeforeInput : InputEventHandler<HTMLImageElement>,onBeforeInputCapture : FormEventHandler<HTMLImageElement>,onBeforeToggle : ToggleEventHandler<HTMLImageElement>,onBlur : FocusEventHandler<HTMLImageElement>,onBlurCapture : FocusEventHandler<HTMLImageElement>,onCanPlay : ReactEventHandler<HTMLImageElement>,onCanPlayCapture : ReactEventHandler<HTMLImageElement>,onCanPlayThrough : ReactEventHandler<HTMLImageElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLImageElement>,onChange : FormEventHandler<HTMLImageElement>,onChangeCapture : FormEventHandler<HTMLImageElement>,onClick : MouseEventHandler<HTMLImageElement>,onClickCapture : MouseEventHandler<HTMLImageElement>,onCompositionEnd : CompositionEventHandler<HTMLImageElement>,onCompositionEndCapture : CompositionEventHandler<HTMLImageElement>,onCompositionStart : CompositionEventHandler<HTMLImageElement>,onCompositionStartCapture : CompositionEventHandler<HTMLImageElement>,onCompositionUpdate : CompositionEventHandler<HTMLImageElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLImageElement>,onContextMenu : MouseEventHandler<HTMLImageElement>,onContextMenuCapture : MouseEventHandler<HTMLImageElement>,onCopy : ClipboardEventHandler<HTMLImageElement>,onCopyCapture : ClipboardEventHandler<HTMLImageElement>,onCut : ClipboardEventHandler<HTMLImageElement>,onCutCapture : ClipboardEventHandler<HTMLImageElement>,onDoubleClick : MouseEventHandler<HTMLImageElement>,onDoubleClickCapture : MouseEventHandler<HTMLImageElement>,onDrag : DragEventHandler<HTMLImageElement>,onDragCapture : DragEventHandler<HTMLImageElement>,onDragEnd : DragEventHandler<HTMLImageElement>,onDragEndCapture : DragEventHandler<HTMLImageElement>,onDragEnter : DragEventHandler<HTMLImageElement>,onDragEnterCapture : DragEventHandler<HTMLImageElement>,onDragExit : DragEventHandler<HTMLImageElement>,onDragExitCapture : DragEventHandler<HTMLImageElement>,onDragLeave : DragEventHandler<HTMLImageElement>,onDragLeaveCapture : DragEventHandler<HTMLImageElement>,onDragOver : DragEventHandler<HTMLImageElement>,onDragOverCapture : DragEventHandler<HTMLImageElement>,onDragStart : DragEventHandler<HTMLImageElement>,onDragStartCapture : DragEventHandler<HTMLImageElement>,onDrop : DragEventHandler<HTMLImageElement>,onDropCapture : DragEventHandler<HTMLImageElement>,onDurationChange : ReactEventHandler<HTMLImageElement>,onDurationChangeCapture : ReactEventHandler<HTMLImageElement>,onEmptied : ReactEventHandler<HTMLImageElement>,onEmptiedCapture : ReactEventHandler<HTMLImageElement>,onEncrypted : ReactEventHandler<HTMLImageElement>,onEncryptedCapture : ReactEventHandler<HTMLImageElement>,onEnded : ReactEventHandler<HTMLImageElement>,onEndedCapture : ReactEventHandler<HTMLImageElement>,onError : ReactEventHandler<HTMLImageElement>,onErrorCapture : ReactEventHandler<HTMLImageElement>,onFocus : FocusEventHandler<HTMLImageElement>,onFocusCapture : FocusEventHandler<HTMLImageElement>,onGotPointerCapture : PointerEventHandler<HTMLImageElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onInput : FormEventHandler<HTMLImageElement>,onInputCapture : FormEventHandler<HTMLImageElement>,onInvalid : FormEventHandler<HTMLImageElement>,onInvalidCapture : FormEventHandler<HTMLImageElement>,onKeyDown : KeyboardEventHandler<HTMLImageElement>,onKeyDownCapture : KeyboardEventHandler<HTMLImageElement>,onKeyPress : KeyboardEventHandler<HTMLImageElement>,onKeyPressCapture : KeyboardEventHandler<HTMLImageElement>,onKeyUp : KeyboardEventHandler<HTMLImageElement>,onKeyUpCapture : KeyboardEventHandler<HTMLImageElement>,onLoad : ReactEventHandler<HTMLImageElement>,onLoadCapture : ReactEventHandler<HTMLImageElement>,onLoadedData : ReactEventHandler<HTMLImageElement>,onLoadedDataCapture : ReactEventHandler<HTMLImageElement>,onLoadedMetadata : ReactEventHandler<HTMLImageElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLImageElement>,onLoadStart : ReactEventHandler<HTMLImageElement>,onLoadStartCapture : ReactEventHandler<HTMLImageElement>,onLostPointerCapture : PointerEventHandler<HTMLImageElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLImageElement>,onMouseDown : MouseEventHandler<HTMLImageElement>,onMouseDownCapture : MouseEventHandler<HTMLImageElement>,onMouseEnter : MouseEventHandler<HTMLImageElement>,onMouseLeave : MouseEventHandler<HTMLImageElement>,onMouseMove : MouseEventHandler<HTMLImageElement>,onMouseMoveCapture : MouseEventHandler<HTMLImageElement>,onMouseOut : MouseEventHandler<HTMLImageElement>,onMouseOutCapture : MouseEventHandler<HTMLImageElement>,onMouseOver : MouseEventHandler<HTMLImageElement>,onMouseOverCapture : MouseEventHandler<HTMLImageElement>,onMouseUp : MouseEventHandler<HTMLImageElement>,onMouseUpCapture : MouseEventHandler<HTMLImageElement>,onPaste : ClipboardEventHandler<HTMLImageElement>,onPasteCapture : ClipboardEventHandler<HTMLImageElement>,onPause : ReactEventHandler<HTMLImageElement>,onPauseCapture : ReactEventHandler<HTMLImageElement>,onPlay : ReactEventHandler<HTMLImageElement>,onPlayCapture : ReactEventHandler<HTMLImageElement>,onPlaying : ReactEventHandler<HTMLImageElement>,onPlayingCapture : ReactEventHandler<HTMLImageElement>,onPointerCancel : PointerEventHandler<HTMLImageElement>,onPointerCancelCapture : PointerEventHandler<HTMLImageElement>,onPointerDown : PointerEventHandler<HTMLImageElement>,onPointerDownCapture : PointerEventHandler<HTMLImageElement>,onPointerEnter : PointerEventHandler<HTMLImageElement>,onPointerLeave : PointerEventHandler<HTMLImageElement>,onPointerMove : PointerEventHandler<HTMLImageElement>,onPointerMoveCapture : PointerEventHandler<HTMLImageElement>,onPointerOut : PointerEventHandler<HTMLImageElement>,onPointerOutCapture : PointerEventHandler<HTMLImageElement>,onPointerOver : PointerEventHandler<HTMLImageElement>,onPointerOverCapture : PointerEventHandler<HTMLImageElement>,onPointerUp : PointerEventHandler<HTMLImageElement>,onPointerUpCapture : PointerEventHandler<HTMLImageElement>,onProgress : ReactEventHandler<HTMLImageElement>,onProgressCapture : ReactEventHandler<HTMLImageElement>,onRateChange : ReactEventHandler<HTMLImageElement>,onRateChangeCapture : ReactEventHandler<HTMLImageElement>,onReset : FormEventHandler<HTMLImageElement>,onResetCapture : FormEventHandler<HTMLImageElement>,onScroll : UIEventHandler<HTMLImageElement>,onScrollCapture : UIEventHandler<HTMLImageElement>,onScrollEnd : UIEventHandler<HTMLImageElement>,onScrollEndCapture : UIEventHandler<HTMLImageElement>,onSeeked : ReactEventHandler<HTMLImageElement>,onSeekedCapture : ReactEventHandler<HTMLImageElement>,onSeeking : ReactEventHandler<HTMLImageElement>,onSeekingCapture : ReactEventHandler<HTMLImageElement>,onSelect : ReactEventHandler<HTMLImageElement>,onSelectCapture : ReactEventHandler<HTMLImageElement>,onStalled : ReactEventHandler<HTMLImageElement>,onStalledCapture : ReactEventHandler<HTMLImageElement>,onSubmit : FormEventHandler<HTMLImageElement>,onSubmitCapture : FormEventHandler<HTMLImageElement>,onSuspend : ReactEventHandler<HTMLImageElement>,onSuspendCapture : ReactEventHandler<HTMLImageElement>,onTimeUpdate : ReactEventHandler<HTMLImageElement>,onTimeUpdateCapture : ReactEventHandler<HTMLImageElement>,onToggle : ToggleEventHandler<HTMLImageElement>,onTouchCancel : TouchEventHandler<HTMLImageElement>,onTouchCancelCapture : TouchEventHandler<HTMLImageElement>,onTouchEnd : TouchEventHandler<HTMLImageElement>,onTouchEndCapture : TouchEventHandler<HTMLImageElement>,onTouchMove : TouchEventHandler<HTMLImageElement>,onTouchMoveCapture : TouchEventHandler<HTMLImageElement>,onTouchStart : TouchEventHandler<HTMLImageElement>,onTouchStartCapture : TouchEventHandler<HTMLImageElement>,onTransitionCancel : TransitionEventHandler<HTMLImageElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLImageElement>,onTransitionEnd : TransitionEventHandler<HTMLImageElement>,onTransitionEndCapture : TransitionEventHandler<HTMLImageElement>,onTransitionRun : TransitionEventHandler<HTMLImageElement>,onTransitionRunCapture : TransitionEventHandler<HTMLImageElement>,onTransitionStart : TransitionEventHandler<HTMLImageElement>,onTransitionStartCapture : TransitionEventHandler<HTMLImageElement>,onVolumeChange : ReactEventHandler<HTMLImageElement>,onVolumeChangeCapture : ReactEventHandler<HTMLImageElement>,onWaiting : ReactEventHandler<HTMLImageElement>,onWaitingCapture : ReactEventHandler<HTMLImageElement>,onWheel : WheelEventHandler<HTMLImageElement>,onWheelCapture : WheelEventHandler<HTMLImageElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,referrerPolicy : HTMLAttributeReferrerPolicy,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,sizes : string,slot : string,spellCheck : Booleanish,srcSet : string,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",useMap : string,vocab : string,width : string | number}
```

### Returns

```ts
let returnType: null | Element;
```

an `<img />` with the src of the token icon
---

###### Connect SDK

## TokenName

This component fetches then shows the name of a token. For ERC20 tokens, it calls the `name` function in the ERC20 contract. It inherits all the attributes of a HTML `<span>` component, hence you can style it just like how you would style a normal `<span>`

### Example

#### Basic usage

```tsx
import { TokenProvider, TokenName } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<TokenProvider {...props}>
  <TokenName />
</TokenProvider>;
```

Result:

```html
<span>Ether</span>
```

#### Custom name resolver

By default TokenName will call the `name` method of the token contract. However if you have a different way to fetch the name, you can pass the function to the `nameResolver` prop. Note: nameResolver should either be a string or a function (async) that returns a string.

```tsx
async function fetchNameMethod() {
  // your own fetching logic
  return "the token name";
}
 
<TokenName nameResolver={fetchNameMethod} />;
```

Alternatively you can also pass in a string directly:

```tsx
<TokenName nameResolver="USD Coin Circle" />;
```

#### Format the name (capitalize, truncate, etc.)

The TokenName component accepts a `formatFn` which takes in a string and outputs a string The function is used to modify the name of the token

```tsx
const concatStr = (str: string):string => str + "Token"
 
<TokenName formatFn={concatStr} />
```

Result:

```html
<span>Ether Token</span>
```

#### Show a loading sign when the name is being fetched

```tsx
import { TokenProvider, TokenName } from "thirdweb/react";
 
<TokenProvider address="0x...">
  <TokenName loadingComponent={<Spinner />} />
</TokenProvider>;
```

#### Fallback to something when the name fails to resolve

```tsx
<TokenProvider address="0x...">
  <TokenName fallbackComponent={"Failed to load"} />
</TokenProvider>;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<TokenName
  queryOptions={{
    enabled: isEnabled,
    retry: 4,
  }}
/>;
```

```ts
function TokenName(__namedParameters: TokenNameProps): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,formatFn : (str: string) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise<string>),nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```
---

###### Connect SDK

## TokenSymbol

This component fetches then shows the symbol of a token. For ERC20 tokens, it calls the `symbol` function in the ERC20 contract. It inherits all the attributes of a HTML `<span>` component, hence you can style it just like how you would style a normal `<span>`

### Example

#### Basic usage

```tsx
import { TokenProvider, TokenSymbol } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
<TokenProvider {...props}>
  <TokenSymbol />
</TokenProvider>;
```

Result:

```html
<span>ETH</span>
```

#### Custom symbol resolver

By default, TokenSymbol calls the `symbol` function of your contract, however, if your token as an unconventional way to fetch the symbol, you can pass the custom logic to the `symbolResolver` prop. It can either be a string or a function (async) that returns or resolves to a string.

```tsx
async function getSymbol() {
  // your own fetching logic
  return "the symbol";
}
 
<TokenSymbol symbolResolver={getSymbol} />;
```

Alternatively, you can pass in a string directly:

```tsx
<TokenSymbol symbolResolver="USDC.e" />;
```

#### Format the symbol (capitalize, truncate, etc.)

The TokenSymbol component accepts a `formatFn` which takes in a string and outputs a string The function is used to modify the symbol of the token

```tsx
const concatStr = (str: string):string => str + "Token"
 
<TokenSymbol formatFn={concatStr} />
```

Result:

```html
<span>Ether Token</span>
```

#### Show a loading sign when the symbol is being fetched

```tsx
import { TokenProvider, TokenSymbol } from "thirdweb/react";
 
<TokenProvider address="0x...">
  <TokenSymbol loadingComponent={<Spinner />} />
</TokenProvider>;
```

#### Fallback to something when the symbol fails to resolve

```tsx
<TokenProvider address="0x...">
  <TokenSymbol fallbackComponent={"Failed to load"} />
</TokenProvider>;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<TokenSymbol
  queryOptions={{
    enabled: isEnabled,
    retry: 4,
  }}
/>;
```

```ts
function TokenSymbol(
  __namedParameters: TokenSymbolProps,
): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,formatFn : (str: string) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,symbolResolver : string | (() => string) | (() => Promise<string>),tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```
---
# Storage
---

###### Connect SDK

## download

Downloads a file from the specified IPFS, Arweave, or HTTP URI.

`download` will parse the provided URI based on its scheme (ipfs://, ar://, https://) and convert it to a URL to fetch the file from thirdweb's storage service.

### Example

Download a file from IPFS:

```ts
import { download } from "thirdweb/storage";
import { createThirdwebClient } from "thirdweb";
 
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
 
const file = await download({
  client,
  uri: "ipfs://Qm...",
});
```

Download a file from Arweave:

```ts
import { download } from "thirdweb/storage";
import { createThirdwebClient } from "thirdweb";
 
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
 
const file = await download({
  client,
  uri: "ar://{arweave-transaction-id}",
});
```

Download a file from HTTP:

```ts
import { download } from "thirdweb/storage";
import { createThirdwebClient } from "thirdweb";
 
const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
 
const file = await download({
  client,
  uri: "https://example.com/file.txt",
});
```

```ts
function download(options: {
  client: ThirdwebClient;
  requestTimeoutMs?: number;
  uri: string;
}): Promise<Response>;
```

### Parameters

The download options.

#### Type

```ts
let options: {
  client: ThirdwebClient;
  requestTimeoutMs?: number;
  uri: string;
};
```

### Returns

```ts
let returnType: Promise<Response>;
```

Asynchronously returns the network response from fetching the file.
---

###### Connect SDK

## resolveArweaveScheme

Resolves the scheme of a given Arweave URI and returns the corresponding URL.

### Example

```ts
import { resolveArweaveScheme } from "thirdweb/storage";
const url = resolveArweaveScheme({ uri: "ar://<fileId>" });
```

```ts
function resolveArweaveScheme(
  options: ResolveArweaveSchemeOptions,
): string;
```

### Parameters

The options object containing the Arweave URI

#### Type

```ts
let options: { gatewayUrl?: string; uri: string };
```

### Returns

```ts
let returnType: string;
```

The resolved URL
---

###### Connect SDK

## resolveScheme

Resolves the scheme of a given URI and returns the corresponding URL. If the URI starts with "ipfs://", it constructs a URL using the IPFS client ID and the IPFS gateway. If the URI starts with "http", it returns the URI as is. Otherwise, it throws an error indicating an invalid URI scheme.

### Example

```ts
import { resolveScheme } from "thirdweb/storage";
const url = resolveScheme({
  client,
  uri: "ipfs://Qm...",
});
```

```ts
function resolveScheme(options: ResolveSchemeOptions): string;
```

### Parameters

The options object containing the URI and the IPFS client.

#### Type

```ts
let options: { client: ThirdwebClient; uri: string };
```

### Returns

```ts
let returnType: string;
```

The resolved URL.
---

###### Connect SDK

## unpin

Unpins a file from IPFS. For security purposes, this method requires a secret key to be set in the ThirdwebClient instance.

### Example

```ts
import { unpin } from "thirdweb";
 
const result = await unpin({
  client: thirdwebClient,
  cid: "QmTzQ1N1z1Q1N1z1Q1N1z1Q1N1z1Q1N1z1Q1N1z1Q1N1z1",
});
```

```ts
function unpin(options: UnpinOptions): Promise<void>;
```

### Parameters

The options for unpinning the file.

#### Type

```ts
let options: { cid: string; client: ThirdwebClient };
```

### Returns

```ts
let returnType: Promise<void>;
```
---

###### Connect SDK

## upload

Uploads files based on the provided options.

### Example

#### Uploading JSON objects

```ts
import { upload } from "thirdweb/storage";
const uri = await upload({
  client,
  files: [
    {
      name: "something",
      data: {
        hello: "world",
      },
    },
  ],
});
```

#### Uploading files

```ts
import { upload } from "thirdweb/storage";
const uri = await upload({
  client,
  files: [new File(["hello world"], "hello.txt")],
});
```

```ts
function upload(
  options: UploadOptions<TFiles>,
): Promise<UploadReturnType<TFiles>>;
```

### Parameters

The upload options.

#### Type

```ts
let options: UploadOptions<TFiles>;
```

### Returns

```ts
let returnType: Promise<UploadReturnType<TFiles>>;
```

A promise that resolves to the uploaded file URI or URIs (when passing multiple files).
---

###### Connect SDK

## uploadMobile

Batch upload arbitrary file or JSON data using the configured decentralized storage system. Automatically uploads any file data within JSON objects and replaces them with hashes.

### Example

```jsx
// Upload an image
launchImageLibrary({ mediaType: "photo" }, async (response) => {
  if (response.assets?.[0]) {
    const { fileName, type, uri } = response.assets[0];
    if (!uri) {
      throw new Error("No uri");
    }
    const resp = await uploadMobile({
      uri,
      type,
      name: fileName,
    });
  }
});
 
// Upload an array of JSON objects
const objects = [
  { name: "JSON 1", text: "Hello World" },
  { name: "JSON 2", trait: "Awesome" },
];
const jsonUris = await uploadMobile(objects);
```

```ts
function uploadMobile(
  options: UploadMobileOptions,
): Promise<Array<string>>;
```

### Parameters

Options to pass through to the storage uploader class

#### Type

```ts
let options: InternalUploadMobileOptions & { client: ThirdwebClient };
```

### Returns

```ts
let returnType: Promise<Array<string>>;
```

The URIs of the uploaded data
---
# RPC
---

###### Connect SDK

## eth\_blockNumber

Retrieves the current block number from the Ethereum blockchain.

### Example

```ts
import { getRpcClient, eth_blockNumber } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const blockNumber = await eth_blockNumber(rpcRequest);
```

```ts
function eth_blockNumber(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
): Promise<bigint>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the current block number as a bigint.
---

###### Connect SDK

## eth\_call

Executes a call or a transaction on the Ethereum network.

### Example

```ts
import { getRpcClient, eth_call } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const result = await eth_call(rpcRequest, {
 to: "0x...",
 ...
});
```

```ts
function eth_call(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: Partial<RpcTransactionRequest> & {
    blockNumber?: number | bigint;
    blockTag?: BlockTag | undefined;
    stateOverrides?: StateOverride;
  },
): Promise<`0x${string}`>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for the call or transaction.

#### Type

```ts
let params: Partial<RpcTransactionRequest> & {
  blockNumber?: number | bigint;
  blockTag?: BlockTag | undefined;
  stateOverrides?: StateOverride;
};
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the result of the call or transaction.
---

###### Connect SDK

## eth\_estimateGas

Estimates the gas required to execute a transaction on the Ethereum network.

### Example

```ts
import { getRpcClient, eth_estimateGas } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const gas = await eth_estimateGas(rpcRequest, {
 to: "0x...",
 ...
});
```

```ts
function eth_estimateGas(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  transactionRequest: RpcTransactionRequest,
): Promise<bigint>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The transaction request object.

#### Type

```ts
let transactionRequest: RpcTransactionRequest;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the estimated gas as a bigint.
---

###### Connect SDK

## eth\_gasPrice

Retrieves the current gas price from the Ethereum network.

### Example

```ts
import { getRpcClient, eth_gasPrice } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const gasPrice = await eth_gasPrice(rpcRequest);
```

```ts
function eth_gasPrice(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
): Promise<bigint>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the gas price as a bigint.
---

###### Connect SDK

## eth\_getBalance

Retrieves the balance of the specified Ethereum address.

### Example

```ts
import { getRpcClient, eth_getBalance } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const balance = await eth_getBalance(rpcRequest, {
  address: "0x...",
});
```

```ts
function eth_getBalance(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetBalanceParams,
): Promise<bigint>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for retrieving the balance.

#### Type

```ts
let params: { address: string };
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the balance of the address in wei as bigint.
---

###### Connect SDK

## eth\_getBlockByHash

Retrieves a block by its hash.

### Example

```ts
import { getRpcClient, eth_getBlockByHash } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const block = await eth_getBlockByHash(rpcRequest, {
  blockHash: "0x...",
  includeTransactions: true,
});
```

```ts
function eth_getBlockByHash(request: EIP1193RequestFn<[{ Method: "web3_clientVersion"; Parameters?: undefined; ReturnType: string }, { Method: "web3_sha3"; Parameters: [data: `0x${string}`]; ReturnType: string }, { Method: "net_listening"; Parameters?: undefined; ReturnType: boolean }, { Method: "net_peerCount"; Parameters?: undefined; ReturnType: `0x${string}` }, { Method: "net_version"; Parameters?: undefined; ReturnType: `0x${string}` }]>, params: GetBlockByHashParams<TIncludeTransactions>) : Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: `0x${string}`; logsBloom: `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: `0x${string}`; number: bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array<Withdrawal>; withdrawalsRoot?: `0x${string}` }>
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for the block retrieval.

#### Type

```ts
let params: GetBlockByHashParams<TIncludeTransactions>;
```

### Returns

```ts
let returnType: Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: `0x${string}`; logsBloom: `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: `0x${string}`; number: bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array<Withdrawal>; withdrawalsRoot?: `0x${string}` }>
```

A promise that resolves to the retrieved block.
---

###### Connect SDK

## eth\_getBlockByNumber

Retrieves a block by its number or tag from the Ethereum blockchain.

### Example

```ts
import { getRpcClient, eth_getBlockByNumber } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const block = await eth_getBlockByNumber(rpcRequest, {
  blockNumber: 123456,
  includeTransactions: true,
});
```

```ts
function eth_getBlockByNumber(request: EIP1193RequestFn<[{ Method: "web3_clientVersion"; Parameters?: undefined; ReturnType: string }, { Method: "web3_sha3"; Parameters: [data: `0x${string}`]; ReturnType: string }, { Method: "net_listening"; Parameters?: undefined; ReturnType: boolean }, { Method: "net_peerCount"; Parameters?: undefined; ReturnType: `0x${string}` }, { Method: "net_version"; Parameters?: undefined; ReturnType: `0x${string}` }]>, params: GetBlockParameters<TIncludeTransactions, TBlockTag>) : Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: TBlockTag extends "pending" ? null : `0x${string}`; logsBloom: TBlockTag extends "pending" ? null : `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: TBlockTag extends "pending" ? null : `0x${string}`; number: TBlockTag extends "pending" ? null : bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array<Withdrawal>; withdrawalsRoot?: `0x${string}` }>
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for retrieving the block.

#### Type

```ts
let params: GetBlockParameters<TIncludeTransactions, TBlockTag>;
```

### Returns

```ts
let returnType: Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: TBlockTag extends "pending" ? null : `0x${string}`; logsBloom: TBlockTag extends "pending" ? null : `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: TBlockTag extends "pending" ? null : `0x${string}`; number: TBlockTag extends "pending" ? null : bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array<Withdrawal>; withdrawalsRoot?: `0x${string}` }>
```

A promise that resolves to the requested block.
---

###### Connect SDK

## eth\_getCode

Retrieves the bytecode of a smart contract at the specified address.

### Example

```ts
import { getRpcClient, eth_getCode } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const bytecode = await eth_getCode(rpcRequest, {
  address: "0x...",
});
```

```ts
function eth_getCode(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetCodeParams,
): Promise<`0x${string}`>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for the eth\_getCode method.

#### Type

```ts
let params: GetCodeParams;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the bytecode of the smart contract.
---

###### Connect SDK

## eth\_getLogs

Retrieves logs from the Ethereum blockchain based on the specified parameters.

### Example

```ts
import { getRpcClient, eth_getLogs } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const logs = await eth_getLogs(rpcRequest, {
  address: "0x...",
  fromBlock: 123456n,
  toBlock: 123456n,
});
```

```ts
function eth_getLogs(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetLogsParams,
): Promise<Array<Log>>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for retrieving logs.

#### Type

```ts
let params: GetLogsParams;
```

### Returns

```ts
let returnType: Promise<Array<Log>>;
```

A promise that resolves to the retrieved logs.
---

###### Connect SDK

## eth\_getStorageAt

Retrieves the value stored at a specific position in the storage of a contract.

### Example

```ts
import { getRpcClient, eth_getStorageAt } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const storageValue = await eth_getStorageAt(rpcRequest, {
  address: "0x...",
  position: 0n,
});
```

```ts
function eth_getStorageAt(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetStorageAtParams,
): Promise<`0x${string}`>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for the eth\_getStorageAt method.

#### Type

```ts
let params: GetStorageAtParams;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the value stored at the specified position.
---

###### Connect SDK

## eth\_getTransactionByHash

Retrieves a transaction by its hash.

### Example

```ts
import { getRpcClient, eth_getTransactionByHash } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const transaction = await eth_getTransactionByHash(rpcRequest, {
  hash: "0x...",
});
```

```ts
function eth_getTransactionByHash(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetTransactionByHashParameters,
): Promise<Transaction>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for retrieving the transaction.

#### Type

```ts
let params: GetTransactionByHashParameters;
```

### Returns

```ts
let returnType: NonNullable<
  GetV1WalletsByWalletAddressTransactionsResponse["data"]
>[number];
```

A promise that resolves to the transaction.
---

###### Connect SDK

## eth\_getTransactionCount

Retrieves the transaction count (nonce) for a given Ethereum address.

### Example

```ts
import { getRpcClient, eth_getTransactionCount } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const transactionCount = await eth_getTransactionCount(rpcRequest, {
  address: "0x...",
});
```

```ts
function eth_getTransactionCount(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetTransactionCountParameters,
): Promise<number>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for retrieving the transaction count.

#### Type

```ts
let params: GetTransactionCountParameters;
```

### Returns

```ts
let returnType: Promise<number>;
```

A promise that resolves to the transaction count as a number.
---

###### Connect SDK

## eth\_getTransactionReceipt

Retrieves the transaction receipt for a given transaction hash. Throws an error if the receipt is not found.

### Example

```ts
import {
  getRpcClient,
  eth_getTransactionReceipt,
} from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const transactionReceipt = await eth_getTransactionReceipt(
  rpcRequest,
  {
    hash: "0x...",
  },
);
```

```ts
function eth_getTransactionReceipt(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  params: GetTransactionReceiptParameters,
): Promise<TransactionReceipt>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The parameters for retrieving the transaction receipt.

#### Type

```ts
let params: GetTransactionReceiptParameters;
```

### Returns

```ts
let returnType: {
  blobGasPrice?: quantity;
  blobGasUsed?: quantity;
  blockHash: Hash;
  blockNumber: quantity;
  contractAddress: Address | null | undefined;
  cumulativeGasUsed: quantity;
  effectiveGasPrice: quantity;
  from: Address;
  gasUsed: quantity;
  logs: Array<Log<quantity, index, false>>;
  logsBloom: Hex;
  root?: Hash;
  status: status;
  to: Address | null;
  transactionHash: Hash;
  transactionIndex: index;
  type: type;
};
```

A promise that resolves to the transaction receipt.
---

###### Connect SDK

## eth\_maxPriorityFeePerGas

Retrieves the maximum priority fee per gas from the Ethereum network.

### Example

```ts
import { getRpcClient, eth_maxPriorityFeePerGas } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const maxPriorityFeePerGas =
  await eth_maxPriorityFeePerGas(rpcRequest);
```

```ts
function eth_maxPriorityFeePerGas(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
): Promise<bigint>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to a bigint representing the maximum priority fee per gas.
---

###### Connect SDK

## eth\_sendRawTransaction

Sends a raw transaction to the Ethereum network.

### Example

```ts
import { getRpcClient, eth_sendRawTransaction } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const transactionHash = await eth_sendRawTransaction(
  rpcRequest,
  "0x...",
);
```

```ts
function eth_sendRawTransaction(
  request: EIP1193RequestFn<
    [
      {
        Method: "web3_clientVersion";
        Parameters?: undefined;
        ReturnType: string;
      },
      {
        Method: "web3_sha3";
        Parameters: [data: `0x${string}`];
        ReturnType: string;
      },
      {
        Method: "net_listening";
        Parameters?: undefined;
        ReturnType: boolean;
      },
      {
        Method: "net_peerCount";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
      {
        Method: "net_version";
        Parameters?: undefined;
        ReturnType: `0x${string}`;
      },
    ]
  >,
  signedTransaction: `0x${string}`,
): Promise<`0x${string}`>;
```

### Parameters

The EIP1193 request function.

#### Type

```ts
let request: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The signed transaction in hex format.

#### Type

```ts
let signedTransaction: `0x${string}`;
```

### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

A promise that resolves to the transaction hash.
---

###### Connect SDK

## getRpcClient

Returns an RPC request that can be used to make JSON-RPC requests.

### Example

```ts
import { createThirdwebClient } from "thirdweb";
import { getRpcClient } from "thirdweb/rpc";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const rpcRequest = getRpcClient({ client, chain: ethereum });
const blockNumber = await rpcRequest({
  method: "eth_blockNumber",
});
```

```ts
function getRpcClient(
  options: Readonly,
): EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

### Parameters

The RPC options.

#### Type

```ts
let options: Readonly;
```

### Returns

```ts
let returnType: EIP1193RequestFn<
  [
    {
      Method: "web3_clientVersion";
      Parameters?: undefined;
      ReturnType: string;
    },
    {
      Method: "web3_sha3";
      Parameters: [data: `0x${string}`];
      ReturnType: string;
    },
    {
      Method: "net_listening";
      Parameters?: undefined;
      ReturnType: boolean;
    },
    {
      Method: "net_peerCount";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
    {
      Method: "net_version";
      Parameters?: undefined;
      ReturnType: `0x${string}`;
    },
  ]
>;
```

The RPC request function.
---

###### Connect SDK

## watchBlockNumber

Watches the block number for a specific chain.

### Example

```ts
import { watchBlockNumber } from "thirdweb";
const unwatch = watchBlockNumber({
  client,
  chainId,
  onNewBlockNumber: (blockNumber) => {
    // do something with the block number
  },
  onError: (err) => {
    // do something if getting the block number fails
  },
});
 
// later stop watching
unwatch();
```

```ts
function watchBlockNumber(opts: WatchBlockNumberOptions): () => void;
```

### Parameters

The options for watching the block number.

#### Type

```ts
let opts: {
  chain: Chain;
  client: ThirdwebClient;
  latestBlockNumber?: bigint;
  onError?: (error: Error) => void;
  onNewBlockNumber: (blockNumber: bigint) => void;
  overPollRatio?: number;
};
```

### Returns

```ts
let returnType: () => void;
```

The unwatch function.
---
# Theme
---

###### Connect SDK

## darkTheme

Create a custom dark theme object by using the default dark theme as a base and applying overrides.

### Example

#### Get the default dark theme

```ts
const defaultDarkTheme = darkTheme();
```

#### Create a custom dark theme

```ts
const customTheme = darkTheme({
  colors: {
    modalBg: "red",
  },
});
```

```ts
function darkTheme(overrides?: ThemeOverrides): Theme;
```

### Parameters

The overrides to apply to the default dark theme.

#### Type

```ts
let overrides: {
  [key in Exclude<keyof Theme, "type">]: Partial<Theme[key]>;
};
```

### Returns

```ts
let returnType: {
  colors: {
    accentButtonBg: string;
    accentButtonText: string;
    accentText: string;
    borderColor: string;
    connectedButtonBg: string;
    connectedButtonBgHover: string;
    danger: string;
    inputAutofillBg: string;
    modalBg: string;
    modalOverlayBg: string;
    primaryButtonBg: string;
    primaryButtonText: string;
    primaryText: string;
    scrollbarBg: string;
    secondaryButtonBg: string;
    secondaryButtonHoverBg: string;
    secondaryButtonText: string;
    secondaryIconColor: string;
    secondaryIconHoverBg: string;
    secondaryIconHoverColor: string;
    secondaryText: string;
    selectedTextBg: string;
    selectedTextColor: string;
    separatorLine: string;
    skeletonBg: string;
    success: string;
    tertiaryBg: string;
    tooltipBg: string;
    tooltipText: string;
  };
  fontFamily: string;
  type: "light" | "dark";
};
```

Theme object
---

###### Connect SDK

## lightTheme

Create a custom light theme object by using the default dark theme as a base and applying overrides.

### Example

#### Get the default light theme

```ts
const defaultLightTheme = lightTheme();
```

#### Create a custom light theme

```ts
const customTheme = lightTheme({
  colors: {
    modalBg: "red",
  },
});
```

```ts
function lightTheme(overrides?: ThemeOverrides): Theme;
```

### Parameters

The overrides to apply to the default light theme.

#### Type

```ts
let overrides: {
  [key in Exclude<keyof Theme, "type">]: Partial<Theme[key]>;
};
```

### Returns

```ts
let returnType: {
  colors: {
    accentButtonBg: string;
    accentButtonText: string;
    accentText: string;
    borderColor: string;
    connectedButtonBg: string;
    connectedButtonBgHover: string;
    danger: string;
    inputAutofillBg: string;
    modalBg: string;
    modalOverlayBg: string;
    primaryButtonBg: string;
    primaryButtonText: string;
    primaryText: string;
    scrollbarBg: string;
    secondaryButtonBg: string;
    secondaryButtonHoverBg: string;
    secondaryButtonText: string;
    secondaryIconColor: string;
    secondaryIconHoverBg: string;
    secondaryIconHoverColor: string;
    secondaryText: string;
    selectedTextBg: string;
    selectedTextColor: string;
    separatorLine: string;
    skeletonBg: string;
    success: string;
    tertiaryBg: string;
    tooltipBg: string;
    tooltipText: string;
  };
  fontFamily: string;
  type: "light" | "dark";
};
```

Theme object
---
# Utils
---

###### Connect SDK

## getContractPublisher

Returns the default publisher contract on polygon

```ts
function getContractPublisher(
  client: ThirdwebClient,
): Readonly<ContractOptions<[], `0x${string}`>>;
```

### Parameters

#### Type

```ts
let client: {
  readonly clientId: string;
  readonly secretKey: string | undefined;
} & Readonly<ClientOptions>;
```

### Returns

```ts
let returnType: Readonly<ContractOptions<[], `0x${string}`>>;
```
---

###### Connect SDK

## getDefaultToken

Get the default token for a given chain and symbol

### Example

```ts
import { getDefaultToken } from "thirdweb/react";
import { ethereum } from "thirdweb/chains";
 
const token = getDefaultToken(ethereum, "USDC");
```

```ts
function getDefaultToken(
  chain: Readonly,
  symbol:
    | "WETH"
    | "USDT"
    | "USDC"
    | "WBTC"
    | "WMATIC"
    | "WBNB"
    | "BUSD"
    | "WFTM"
    | "WAVAX",
): undefined | TokenInfo;
```

### Parameters

The chain to get the token for

#### Type

```ts
let chain: Readonly;
```

The symbol of the token to get

#### Type

```ts
let symbol:
  | "WETH"
  | "USDT"
  | "USDC"
  | "WBTC"
  | "WMATIC"
  | "WBNB"
  | "BUSD"
  | "WFTM"
  | "WAVAX";
```

### Returns

```ts
let returnType: undefined | TokenInfo;
```

The default token for the given chain and symbol
---

###### Connect SDK

## getLastAuthProvider

Retrieves the last authentication provider used from local storage.

This function is designed to work only in a browser environment.

### Example

```typescript
import { getLastAuthProvider } from "thirdweb/react";
 
const lastAuthProvider = await getLastAuthProvider();
```

```ts
function getLastAuthProvider(): Promise<
  | null
  | OAuthOption
  | "backend"
  | "email"
  | "phone"
  | "passkey"
  | "wallet"
  | "jwt"
  | "auth_endpoint"
  | "iframe_email_verification"
  | "iframe"
>;
```

### Returns

```ts
let returnType: Promise<
  | null
  | OAuthOption
  | "backend"
  | "email"
  | "phone"
  | "passkey"
  | "wallet"
  | "jwt"
  | "auth_endpoint"
  | "iframe_email_verification"
  | "iframe"
>;
```

A promise that resolves to the last authentication provider strategy used, or `null` if none is found.
---

###### Connect SDK

## boolToBytes

Converts a boolean value to a Uint8Array of bytes.

### Example

```ts
import { boolToBytes } from "thirdweb/utils";
const bytes = boolToBytes(true);
console.log(bytes); // Uint8Array(1) [ 1 ]
```

```ts
function boolToBytes(
  value: boolean,
  opts: Options,
): Uint8Array<ArrayBufferLike>;
```

### Parameters

The boolean value to convert.

#### Type

```ts
let value: boolean;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: Uint8Array<ArrayBufferLike>;
```

The Uint8Array of bytes representing the boolean value.
---

###### Connect SDK

## boolToHex

Converts a boolean value to a hexadecimal string representation.

### Example

```ts
import { boolToHex } from "thirdweb/utils";
const hex = boolToHex(true);
console.log(hex); // "0x01"
```

```ts
function boolToHex(value: boolean, opts: Options): `0x${string}`;
```

### Parameters

The boolean value to convert.

#### Type

```ts
let value: boolean;
```

Optional options for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The hexadecimal string representation of the boolean value.
---

###### Connect SDK

## bytesToBigInt

Converts a Uint8Array of bytes to a bigint.

### Example

```ts
import { bytesToBigInt } from "thirdweb/utils";
const bytes = new Uint8Array([1, 164]);
const bigInt = bytesToBigInt(bytes);
console.log(bigInt); // 420n
```

```ts
function bytesToBigInt(
  bytes: Uint8Array,
  opts: BytesToBigIntOpts,
): bigint;
```

### Parameters

The Uint8Array of bytes to convert.

#### Type

```ts
let bytes: Uint8Array;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: { signed?: boolean; size?: number };
```

### Returns

```ts
let returnType: bigint;
```

The converted bigint.
---

###### Connect SDK

## bytesToBool

Converts a byte array to a boolean value.

### Example

```ts
import { bytesToBool } from "thirdweb/utils";
const bytes = new Uint8Array([1]);
const bool = bytesToBool(bytes);
console.log(bool); // true
```

```ts
function bytesToBool(bytes_: Uint8Array, opts: Options): boolean;
```

### Parameters

The byte array to convert.

#### Type

```ts
let bytes_: Uint8Array;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: boolean;
```

The boolean value converted from the byte array.
---

###### Connect SDK

## bytesToNumber

Converts a Uint8Array of bytes to a number.

### Example

```ts
import { bytesToNumber } from "thirdweb/utils";
const bytes = new Uint8Array([1, 164]);
const number = bytesToNumber(bytes);
console.log(number); // 420
```

```ts
function bytesToNumber(
  bytes: Uint8Array,
  opts: BytesToBigIntOpts,
): number;
```

### Parameters

The Uint8Array of bytes to convert.

#### Type

```ts
let bytes: Uint8Array;
```

Optional configuration options.

#### Type

```ts
let opts: { signed?: boolean; size?: number };
```

### Returns

```ts
let returnType: number;
```

The converted number.
---

###### Connect SDK

## bytesToString

Converts an array of bytes to a string using UTF-8 encoding.

### Example

```ts
import { bytesToString } from "thirdweb/utils";
const bytes = new Uint8Array([72, 101, 108, 108, 111]);
const string = bytesToString(bytes);
console.log(string); // "Hello"
```

```ts
function bytesToString(bytes_: Uint8Array, opts: Options): string;
```

### Parameters

The array of bytes to convert.

#### Type

```ts
let bytes_: Uint8Array;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: string;
```

The resulting string.
---

###### Connect SDK

## concatHex

Concatenates an array of hexadecimal values into a single hexadecimal value.

```ts
function concatHex(values: readonly Array<`0x${string}`>) : `0x${string}`
```

### Parameters

An array of hexadecimal values to concatenate.

#### Type

```ts
let values: readonly Array<`0x${string}`>
```

### Returns

```ts
let returnType: `0x${string}`;
```

The concatenated hexadecimal value.
---

###### Connect SDK

## fromBytes

Converts a Uint8Array to the specified type.

### Example

```ts
import { fromBytes } from "thirdweb/utils";
const bytes = new Uint8Array([1, 164]);
const number = fromBytes(bytes, "number");
console.log(number); // 420
```

```ts
function fromBytes(
  bytes: Uint8Array,
  toOrOpts: FromBytesParameters<TTo>,
): FromBytesReturnType<TTo>;
```

### Parameters

The Uint8Array to convert.

#### Type

```ts
let bytes: Uint8Array;
```

The target type or conversion options.

#### Type

```ts
let toOrOpts: FromBytesParameters<TTo>;
```

### Returns

```ts
let returnType: FromBytesReturnType<TTo>;
```

The converted value of the specified type.
---

###### Connect SDK

## fromGwei

Converts the specified number from gwei to wei.

### Example

```ts
import { fromGwei } from "thirdweb/utils";
fromGwei("1");
// 1000000000n
```

```ts
function fromGwei(gwei: string): bigint;
```

### Parameters

The number of gwei to convert.

#### Type

```ts
let gwei: string;
```

### Returns

```ts
let returnType: bigint;
```

The converted value in wei.
---

###### Connect SDK

## fromHex

Converts a hexadecimal string to the specified type.

### Example

```ts
import { fromHex } from "thirdweb/utils";
const string = fromHex("0x48656c6c6f2c20776f726c6421", "string");
console.log(string); // "Hello, world!"
```

```ts
function fromHex(
  hex: `0x${string}`,
  toOrOpts: FromHexParameters<TTo>,
): FromHexReturnType<TTo>;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex: `0x${string}`;
```

The target type or conversion options.

#### Type

```ts
let toOrOpts: FromHexParameters<TTo>;
```

### Returns

```ts
let returnType: FromHexReturnType<TTo>;
```

The converted value of the specified type.
---

###### Connect SDK

## getAddress

Retrieves the address after performing validation and checksumming.

### Example

```ts
import { getAddress } from "thirdweb/utils";
 
getAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed");
//=> '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed'
```

```ts
function getAddress(address: string): `0x${string}`;
```

### Parameters

The address to be validated and checksummed.

#### Type

```ts
let address: string;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The validated and checksummed address.
---

###### Connect SDK

## getGasPrice

Retrieves the gas price for a transaction on a specific chain.

### Example

```ts
import { getGasPrice } from "thirdweb";
 
const gasPrice = await getGasPrice({ client, chain });
```

```ts
function getGasPrice(options: GetGasPriceOptions): Promise<bigint>;
```

### Parameters

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
  percentMultiplier?: number;
};
```

### Returns

```ts
let returnType: Promise<bigint>;
```

A promise that resolves to the gas price as a bigint.
---

###### Connect SDK

## hexToBigInt

Converts a hexadecimal string to a BigInt.

### Example

```ts
import { hexToBigInt } from "thirdweb/utils";
const bigInt = hexToBigInt("0x1a4");
console.log(bigInt); // 420n
```

```ts
function hexToBigInt(hex: `0x${string}`, opts: Options): bigint;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex: `0x${string}`;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: bigint;
```

The BigInt representation of the hexadecimal string.
---

###### Connect SDK

## hexToBool

Converts a hexadecimal string to a boolean value.

### Example

```ts
import { hexToBool } from "thirdweb/utils";
const bool = hexToBool("0x01");
console.log(bool); // true
```

```ts
function hexToBool(hex: `0x${string}`, opts: Options): boolean;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex: `0x${string}`;
```

Optional options for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: boolean;
```

The boolean value corresponding to the hexadecimal string.
---

###### Connect SDK

## hexToBytes

Converts a hexadecimal string to a Uint8Array of bytes.

### Example

```ts
import { hexToBytes } from "thirdweb/utils";
const bytes = hexToBytes("0x1a4");
console.log(bytes); // Uint8Array(2) [ 1, 164 ]
```

```ts
function hexToBytes(hex_: `0x${string}`, opts: Options): Uint8Array;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex_: `0x${string}`;
```

Options for converting the hexadecimal string.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: Uint8Array;
```

The Uint8Array of bytes.
---

###### Connect SDK

## hexToNumber

Converts a hexadecimal string to a number.

### Example

```ts
import { hexToNumber } from "thirdweb/utils";
const number = hexToNumber("0x1a4");
console.log(number); // 420
```

```ts
function hexToNumber(hex: `0x${string}`, opts: Options): number;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex: `0x${string}`;
```

Optional options for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: number;
```

The converted number.
---

###### Connect SDK

## hexToString

Converts a hexadecimal string to a UTF-8 string.

### Example

```ts
import { hexToString } from "thirdweb/utils";
const string = hexToString("0x48656c6c6f2c20776f726c6421");
console.log(string); // "Hello, world!"
```

```ts
function hexToString(hex: `0x${string}`, opts: Options): string;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex: `0x${string}`;
```

The options for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: string;
```

The UTF-8 string representation of the hexadecimal string.
---

###### Connect SDK

## hexToUint8Array

Converts a hexadecimal string to a Uint8Array.

### Example

```ts
import { hexToUint8Array } from "thirdweb/utils";
const bytes = hexToUint8Array("0x48656c6c6f2c20776f726c6421");
console.log(bytes); // Uint8Array([72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33])
```

```ts
function hexToUint8Array(
  hex: `0x${string}`,
  opts: Options,
): Uint8Array;
```

### Parameters

The hexadecimal string to convert.

#### Type

```ts
let hex: `0x${string}`;
```

Options for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: Uint8Array;
```

The Uint8Array representation of the hexadecimal string.
---

###### Connect SDK

## isAddress

Checks if a given string is a valid address.

### Example

```ts
import { isAddress } from "thirdweb/utils";
 
isAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed");
//=> true
```

```ts
function isAddress(address: string): address is `0x${string}`;
```

### Parameters

The address to check.

#### Type

```ts
let address: string;
```

### Returns

```ts
let returnType: address is (`0x${string}`)
```

True if the address is valid, false otherwise.
---

###### Connect SDK

## isHex

Checks if a value is a valid hexadecimal string.

### Example

```ts
import { isHex } from "thirdweb/utils";
const result = isHex("0x1a4");
console.log(result); // true
```

```ts
function isHex(
  value: unknown,
  options: Options,
): value is `0x${string}`;
```

### Parameters

The value to be checked.

#### Type

```ts
let value: unknown;
```

Optional configuration for the validation.

#### Type

```ts
let options: Options;
```

### Returns

```ts
let returnType: value is (`0x${string}`)
```

True if the value is a valid hexadecimal string, false otherwise.
---

###### Connect SDK

## keccak256

Calculates the Keccak-256 hash of the given value.

### Example

```ts
import { keccak256 } from "thirdweb/utils";
const hash = keccak256("0x1234");
```

```ts
function keccak256(
  value: `0x${string}` | Uint8Array<ArrayBufferLike>,
  to?: TTo,
): Keccak256Hash<TTo>;
```

### Parameters

The value to hash, either as a hexadecimal string or a Uint8Array.

#### Type

```ts
let value: `0x${string}` | Uint8Array<ArrayBufferLike>;
```

The desired output format of the hash (optional). Defaults to 'hex'.

#### Type

```ts
let to: TTo;
```

### Returns

```ts
let returnType: Keccak256Hash<TTo>;
```

The Keccak-256 hash of the value in the specified format.
---

###### Connect SDK

## numberToBytes

Converts a number to bytes.

### Example

```ts
import { numberToBytes } from "thirdweb/utils";
const bytes = numberToBytes(420);
console.log(bytes); // Uint8Array(2) [ 1, 164 ]
```

```ts
function numberToBytes(
  value: number | bigint,
  opts?: Options,
): Uint8Array<ArrayBufferLike>;
```

### Parameters

The number to convert.

#### Type

```ts
let value: number | bigint;
```

Options for converting the number to hex.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: Uint8Array<ArrayBufferLike>;
```

The bytes representation of the number.
---

###### Connect SDK

## numberToHex

Converts a number or bigint to a hexadecimal string.

### Example

```ts
import { numberToHex } from "thirdweb/utils";
const hex = numberToHex(420);
console.log(hex); // "0x1a4"
```

```ts
function numberToHex(
  value_: number | bigint,
  opts: Options,
): `0x${string}`;
```

### Parameters

The number or bigint value to convert.

#### Type

```ts
let value_: number | bigint;
```

Optional configuration options.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The hexadecimal representation of the input value.
---

###### Connect SDK

## padHex

Pads a hexadecimal string with zeros to a specified size.

### Example

```ts
import { padHex } from "thirdweb/utils";
const paddedHex = padHex("0x1a4", { size: 32 });
console.log(paddedHex); // "0x000000000000000000000000000001a4"
```

```ts
function padHex(
  hex_: `0x${string}`,
  options: PadOptions,
): `0x${string}`;
```

### Parameters

The hexadecimal string to pad.

#### Type

```ts
let hex_: `0x${string}`;
```

The padding options.

#### Type

```ts
let options: PadOptions;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The padded hexadecimal string.
---

###### Connect SDK

## sha256

Calculates the SHA256 hash of the given value.

### Example

```ts
import { sha256 } from "thirdweb/utils";
const hash = sha256("0x1234");
```

```ts
function sha256(
  value: `0x${string}` | Uint8Array<ArrayBufferLike>,
  to?: TTo,
): Sha256Hash<TTo>;
```

### Parameters

The value to hash. It can be either a hexadecimal string or a Uint8Array.

#### Type

```ts
let value: `0x${string}` | Uint8Array<ArrayBufferLike>;
```

(Optional) The desired output format of the hash. Defaults to 'hex'.

#### Type

```ts
let to: TTo;
```

### Returns

```ts
let returnType: Sha256Hash<TTo>;
```

The SHA256 hash of the value in the specified format.
---

###### Connect SDK

## stringToBytes

Converts a string to an array of bytes.

### Example

```ts
import { stringToBytes } from "thirdweb/utils";
const bytes = stringToBytes("Hello, world!");
console.log(bytes); // Uint8Array(13) [ 72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33 ]
```

```ts
function stringToBytes(
  value: string,
  opts: StringToBytesOpts,
): Uint8Array;
```

### Parameters

The string to convert.

#### Type

```ts
let value: string;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: { size?: number };
```

### Returns

```ts
let returnType: Uint8Array;
```

The array of bytes representing the string.
---

###### Connect SDK

## stringToHex

Converts a string to its hexadecimal representation.

### Example

```ts
import { stringToHex } from "thirdweb/utils";
const hex = stringToHex("Hello, world!");
console.log(hex); // "0x48656c6c6f2c20776f726c6421"
```

```ts
function stringToHex(value_: string, opts: Options): `0x${string}`;
```

### Parameters

The string to convert to hexadecimal.

#### Type

```ts
let value_: string;
```

Options for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The hexadecimal representation of the input string.
---

###### Connect SDK

## toBytes

Converts a value to an array of bytes.

### Example

```ts
import { toBytes } from "thirdweb/utils";
const bytes = toBytes("0x1a4");
console.log(bytes); // Uint8Array(2) [ 1, 164 ]
```

```ts
function toBytes(
  value: string | number | bigint | boolean,
  opts: ToBytesParameters,
): Uint8Array;
```

### Parameters

The value to convert.

#### Type

```ts
let value: string | number | bigint | boolean;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: { size?: number };
```

### Returns

```ts
let returnType: Uint8Array;
```

The array of bytes representing the value.
---

###### Connect SDK

## toEther

Converts a value from wei to ether.

### Example

```ts
import { toEther } from "thirdweb/utils";
toEther(1000000000000000000n);
// '1'
```

```ts
function toEther(wei: bigint): string;
```

### Parameters

The value in wei to be converted.

#### Type

```ts
let wei: bigint;
```

### Returns

```ts
let returnType: string;
```

The converted value in ether.
---

###### Connect SDK

## toHex

Converts a value to its hexadecimal representation.

### Example

```ts
import { toHex } from "thirdweb/utils";
const hex = toHex(420);
console.log(hex); // "0x1a4"
```

```ts
function toHex(
  value:
    | string
    | number
    | bigint
    | boolean
    | Uint8Array<ArrayBufferLike>,
  opts: ToHexParameters,
): `0x${string}`;
```

### Parameters

The value to convert to hexadecimal.

#### Type

```ts
let value:
  | string
  | number
  | bigint
  | boolean
  | Uint8Array<ArrayBufferLike>;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: { size?: number };
```

### Returns

```ts
let returnType: `0x${string}`;
```

The hexadecimal representation of the value.
---

###### Connect SDK

## toTokens

Converts a given number of units to a string representation with a specified number of decimal places.

### Example

```ts
import { toTokens } from "thirdweb/utils";
toTokens(1000000000000000000n, 18);
// '1'
```

```ts
function toTokens(units: bigint, decimals: number): string;
```

### Parameters

The number of units to convert.

#### Type

```ts
let units: bigint;
```

The number of decimal places to include in the string representation.

#### Type

```ts
let decimals: number;
```

### Returns

```ts
let returnType: string;
```

The string representation of the converted units.
---

###### Connect SDK

## toUnits

Converts a string representation of a number with decimal places to a BigInt representation.

### Example

```ts
import { toUnits } from "thirdweb/utils";
toUnits("1", 18);
// 1000000000000000000n
```

```ts
function toUnits(tokens: string, decimals: number): bigint;
```

### Parameters

The string representation of the number, including the integer and fraction parts.

#### Type

```ts
let tokens: string;
```

The number of decimal places to include in the BigInt representation.

#### Type

```ts
let decimals: number;
```

### Returns

```ts
let returnType: bigint;
```

The BigInt representation of the number.
---

###### Connect SDK

## toWei

Converts the specified number of tokens to Wei.

### Example

```ts
import { toWei } from "thirdweb/utils";
toWei("1");
// 1000000000000000000n
```

```ts
function toWei(tokens: string): bigint;
```

### Parameters

The number of tokens to convert.

#### Type

```ts
let tokens: string;
```

### Returns

```ts
let returnType: bigint;
```

The converted value in Wei.
---

###### Connect SDK

## uint8ArrayToHex

Converts an array of bytes to a hexadecimal string.

### Example

```ts
import { uint8arrayToHex } from "thirdweb/utils";
const hex = uint8arrayToHex(
  new Uint8Array([
    72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100,
  ]),
);
console.log(hex); // "0x48656c6c6f2c20776f726c64"
```

```ts
function uint8ArrayToHex(
  value: Uint8Array,
  opts: Options,
): `0x${string}`;
```

### Parameters

The array of bytes to convert.

#### Type

```ts
let value: Uint8Array;
```

Optional parameters for the conversion.

#### Type

```ts
let opts: Options;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The hexadecimal string representation of the bytes.
---

###### Connect SDK

## checksumAddress

Calculates the checksum address for the given address.

### Example

```ts
import { checksumAddress } from "thirdweb/utils";
 
checksumAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed");
//=> '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed'
```

```ts
function checksumAddress(address: string): `0x${string}`;
```

### Parameters

The address to calculate the checksum for.

#### Type

```ts
let address: string;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The checksum address.
---

###### Connect SDK

## computeDeploymentAddress

Computes the deployment address for a contract based on the given options.

### Example

```ts
import { computeDeploymentAddress } from "thirdweb/utils";
const deploymentAddress = computeDeploymentAddress({
  bytecode,
  encodedArgs,
  create2FactoryAddress,
  salt,
});
```

```ts
function computeDeploymentAddress(
  options: ComputeDeploymentAddressOptions,
): string;
```

### Parameters

The options for computing the deployment address.

#### Type

```ts
let options: ComputeDeploymentAddressOptions;
```

### Returns

```ts
let returnType: string;
```

The computed deployment address.
---

###### Connect SDK

## decodeError

Decodes an error.

### Example

```ts
import { decodeError } from "thirdweb/utils";
 
const data = "0x...";
const error = await decodeError({ contract, data });
```

```ts
function decodeError(options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  data: `0x${string}`;
}): Promise<unknown>;
```

### Parameters

The options object.

#### Type

```ts
let options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  data: `0x${string}`;
};
```

### Returns

```ts
let returnType: Promise<unknown>;
```

The decoded error.
---

###### Connect SDK

## decodeFunctionData

Decodes the data of a function call.

### Example

```ts
import { decodeFunctionData } from "thirdweb/utils";
 
const data = "0x...";
const decodedData = await decodeFunctionData({ contract, data });
```

```ts
function decodeFunctionData(options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  data: `0x${string}`;
}): Promise<
  ReturnType<ReturnType<abi, Name<abi>, undefined, AbiFunction>>
>;
```

### Parameters

The options object.

#### Type

```ts
let options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  data: `0x${string}`;
};
```

### Returns

```ts
let returnType: Promise<
  ReturnType<ReturnType<abi, Name<abi>, undefined, AbiFunction>>
>;
```

The decoded data.
---

###### Connect SDK

## decodeFunctionResult

Decodes the result of a function call.

### Example

```ts
import { decodeFunctionResult } from "thirdweb/utils";
 
const data = "0x...";
const result = await decodeFunctionResult({ contract, data });
```

```ts
function decodeFunctionResult(options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  data: `0x${string}`;
}): Promise<
  ReturnType<
    ReturnType<abi, Name<abi>, undefined, AbiFunction>,
    "Array"
  >
>;
```

### Parameters

The options object.

#### Type

```ts
let options: {
  contract: Readonly<ContractOptions<abi, `0x${string}`>>;
  data: `0x${string}`;
};
```

### Returns

```ts
let returnType: Promise<
  ReturnType<
    ReturnType<abi, Name<abi>, undefined, AbiFunction>,
    "Array"
  >
>;
```

The decoded result.
---

###### Connect SDK

## encodeAbiParameters

Encodes the given ABI parameters and values into a hexadecimal string.

### Example

```ts
import { encodeAbiParameters } from "viem";
 
const params = [
  { name: "param1", type: "uint256" },
  { name: "param2", type: "string" },
];
const values = [123, "hello"];
 
const data = encodeAbiParameters(params, values);
console.log(data);
```

```ts
function encodeAbiParameters(params: TParams, values: TParams extends readonly Array<AbiParameter> ? {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TParams<TParams>[key<key>], AbiParameterKind>}[key]} : never) : `0x${string}`
```

### Parameters

The ABI parameters.

#### Type

```ts
let params: TParams;
```

The corresponding values for the ABI parameters.

#### Type

```ts
let values: TParams extends readonly Array<AbiParameter> ? {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TParams<TParams>[key<key>], AbiParameterKind>}[key]} : never
```

### Returns

```ts
let returnType: `0x${string}`;
```

* The encoded ABI parameters as a hexadecimal string.
---

###### Connect SDK

## ensureBytecodePrefix

Ensures that the given bytecode has the correct prefix. If the bytecode already starts with "0x", it is returned as is. Otherwise, the prefix "0x" is added to the bytecode.

### Example

```ts
import { ensureBytecodePrefix } from "thirdweb/utils/bytecode/prefix";
const bytecode =
  "363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3";
const prefixedBytecode = ensureBytecodePrefix(bytecode);
console.log(prefixedBytecode);
```

```ts
function ensureBytecodePrefix(bytecode: string): `0x${string}`;
```

### Parameters

The bytecode to ensure the prefix for.

#### Type

```ts
let bytecode: string;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The bytecode with the correct prefix.
---

###### Connect SDK

## extractIPFSUri

Extracts the IPFS URI from the given bytecode.

### Example

```ts
import { extractIPFSUri } from "thirdweb/utils/bytecode/extractIPFS";
const bytecode =
  "0x363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3";
const ipfsHash = extractIPFSUri(bytecode);
console.log(ipfsHash);
```

```ts
function extractIPFSUri(bytecode: string): undefined | string;
```

### Parameters

The bytecode to extract the IPFS URI from.

#### Type

```ts
let bytecode: string;
```

### Returns

```ts
let returnType: undefined | string;
```

The IPFS URI if found, otherwise undefined.
---

###### Connect SDK

## extractMinimalProxyImplementationAddress

Extracts the implementation address from a given bytecode string if it matches any of the known minimal proxy patterns.

### Example

```ts
import { extractMinimalProxyImplementationAddress } from "thirdweb/utils";
const bytecode = "0x363d3d373d3d3d363d73...";
const implementationAddress =
  extractMinimalProxyImplementationAddress(bytecode);
```

```ts
function extractMinimalProxyImplementationAddress(
  bytecode: string,
): undefined | string;
```

### Parameters

The bytecode string to extract the implementation address from.

#### Type

```ts
let bytecode: string;
```

### Returns

```ts
let returnType: undefined | string;
```

The implementation address as a string if a match is found, otherwise undefined.
---

###### Connect SDK

## formatNumber

Round up a number to a certain decimal place

### Example

```ts
import { formatNumber } from "thirdweb/utils";
const value = formatNumber(12.1214141, 1); // 12.1
```

```ts
function formatNumber(value: number, decimalPlaces: number): number;
```

### Parameters

#### Type

```ts
let value: number;
```

#### Type

```ts
let decimalPlaces: number;
```

### Returns

```ts
let returnType: number;
```
---

###### Connect SDK

## getClaimParams

Get the claim parameters for a given drop

### Example

```ts
import { getClaimParams } from "thirdweb/utils";
 
const claimParams = await getClaimParams({
  contract,
  to: "0x...",
  quantity: 1n,
  type: "erc1155",
  tokenId: 0n,
});
```

```ts
function getClaimParams(
  options: GetClaimParamsOptions,
): Promise<{
  allowlistProof: OverrideProof;
  currency: string;
  data: `0x${string}`;
  overrides: {
    erc20Value:
      | undefined
      | { amountWei: bigint; tokenAddress: string };
    value: bigint;
  };
  pricePerToken: bigint;
  quantity: bigint;
  receiver: string;
  tokenId: undefined | bigint;
}>;
```

### Parameters

The options for getting the claim parameters

#### Type

```ts
let options: {
  contract: ThirdwebContract;
  from?: string;
  quantity: bigint;
  singlePhaseDrop?: boolean;
  to: string;
} & (
  | { type: "erc721" }
  | { tokenDecimals: number; type: "erc20" }
  | { tokenId: bigint; type: "erc1155" }
);
```

### Returns

```ts
let returnType: Promise<{
  allowlistProof: OverrideProof;
  currency: string;
  data: `0x${string}`;
  overrides: {
    erc20Value:
      | undefined
      | { amountWei: bigint; tokenAddress: string };
    value: bigint;
  };
  pricePerToken: bigint;
  quantity: bigint;
  receiver: string;
  tokenId: undefined | bigint;
}>;
```

The claim parameters
---

###### Connect SDK

## getInitBytecodeWithSalt

Generates the initialization bytecode with salt for a contract deployment.

### Example

```ts
import { getInitBytecodeWithSalt } from "thirdweb/utils";
const initBytecodeWithSalt = getInitBytecodeWithSalt({
  bytecode,
  encodedArgs,
  salt,
});
```

```ts
function getInitBytecodeWithSalt(
  options: GetInitiBytecodeWithSaltOptions,
): `0x${string}`;
```

### Parameters

The options for generating the initialization bytecode.

#### Type

```ts
let options: GetInitiBytecodeWithSaltOptions;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The initialization bytecode with salt.
---

###### Connect SDK

## getSaltHash

Calculates the salt hash for a given bytecode.

### Example

```ts
import { getSaltHash } from "thirdweb";
const saltHash = getSaltHash(bytecode);
```

```ts
function getSaltHash(bytecode: string): `0x${string}`;
```

### Parameters

The bytecode to calculate the salt hash for.

#### Type

```ts
let bytecode: string;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The salt hash of the bytecode.
---

###### Connect SDK

## hashMessage

Ethereum Signed Message hashing

### Example

```ts
import { hashMessage } from "thirdweb/utils";
const hash = hashMessage("hello world");
```

```ts
function hashMessage(
  message: SignableMessage,
  to_?: TTo,
): HashMessage<TTo>;
```

### Parameters

The message to hash, either as a string, a Uint8Array, or an object with a `raw` property containing a Uint8Array.

#### Type

```ts
let message: SignableMessage;
```

The desired output format of the hash (optional). Defaults to 'hex'.

#### Type

```ts
let to_: TTo;
```

### Returns

```ts
let returnType: HashMessage<TTo>;
```

The Ethereum Signed Message hash of the message in the specified format.
---

###### Connect SDK

## isEIP155Enforced

Checks whether EIP-155 is enforced by sending a random transaction of legacy type (pre-EIP-155) and parsing the error message.

### Example

```ts
import { isEIP155Enforced } from "thirdweb/utils";
const isEIP155 = await isEIP155Enforced({ chain, client });
```

```ts
function isEIP155Enforced(
  options: IsEIP155EnforcedOptions,
): Promise<boolean>;
```

### Parameters

The options for checking EIP-155 enforcement.

#### Type

```ts
let options: IsEIP155EnforcedOptions;
```

### Returns

```ts
let returnType: Promise<boolean>;
```

A promise that resolves to a boolean indicating whether EIP-155 is enforced.
---

###### Connect SDK

## keccakId

Calculates the keccak ID of the given input.

### Example

```ts
import { keccackId } from "thirdweb/utils";
const keccakId = keccackId(input);
```

```ts
function keccakId(input: string): `0x${string}`;
```

### Parameters

The input value to calculate the keccak ID for.

#### Type

```ts
let input: string;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The keccak ID as a Hex string.
---

###### Connect SDK

## max

Returns the maximum of two BigInt values.

### Example

```ts
max(1n, 2n);
// 2n
```

```ts
function max(a: bigint, b: bigint): bigint;
```

### Parameters

The first BigInt value.

#### Type

```ts
let a: bigint;
```

The second BigInt value.

#### Type

```ts
let b: bigint;
```

### Returns

```ts
let returnType: bigint;
```

The larger of the two BigInt values.
---

###### Connect SDK

## min

Returns the minimum of two BigInt values.

### Example

```ts
min(1n, 2n);
// 1n
```

```ts
function min(a: bigint, b: bigint): bigint;
```

### Parameters

The first BigInt value.

#### Type

```ts
let a: bigint;
```

The second BigInt value.

#### Type

```ts
let b: bigint;
```

### Returns

```ts
let returnType: bigint;
```

The smaller of the two BigInt values.
---

###### Connect SDK

## parseAbiParams

Converts an array of parameter values to their respective types based on the provided type array.

This utility function is particularly useful for ensuring that parameter values are correctly formatted according to the expected types before they are used in further processing or passed to a Solidity smart contract.

### Example

```ts
import { parseAbiParams } from "thirdweb/utils";
 
const example1 = parseAbiParams(
  ["address", "uint256"],
  ["0x.....", "1200000"],
); // result: ["0x......", 1200000n]
 
const example2 = parseAbiParams(
  ["address", "bool"],
  ["0x.....", "true"],
); // result: ["0x......", true]
```

```ts
function parseAbiParams(
  constructorParamTypes: Array<string>,
  constructorParamValues: Array<unknown>,
): Array<string | bigint | boolean>;
```

### Parameters

An array of type strings indicating the expected types of the values, following Solidity type conventions (e.g., "address", "uint256", "bool").

#### Type

```ts
let constructorParamTypes: Array<string>;
```

An array of values to be converted according to the types.

#### Type

```ts
let constructorParamValues: Array<unknown>;
```

### Returns

```ts
let returnType: Array<string | bigint | boolean>;
```

* An array of values converted to their respective types.
---

###### Connect SDK

## resolveSignature

Resolves a signature by converting a hexadecimal string into a function or event signature.

### Example

```ts
import { resolveSignature } from "thirdweb/utils";
const res = await resolveSignature("0x1f931c1c");
console.log(res);
```

```ts
function resolveSignature(
  hexSig: string,
): Promise<{
  event: null | `event ${string}`;
  function: null | `function ${string}`;
}>;
```

### Parameters

The hexadecimal signature to resolve.

#### Type

```ts
let hexSig: string;
```

### Returns

```ts
let returnType: Promise<{
  event: null | `event ${string}`;
  function: null | `function ${string}`;
}>;
```

A promise that resolves to an object containing the function and event signatures.
---

###### Connect SDK

## resolveSignatures

Resolves the signatures of the given hexadecimal signatures.

### Example

```ts
import { resolveSignatures } from "thirdweb/utils";
const res = await resolveSignatures(["0x1f931c1c", "0x1f931c1c"]);
console.log(res);
```

```ts
function resolveSignatures(
  hexSigs: Array<string>,
): Promise<{
  events: Array<`event ${string}`>;
  functions: Array<`function ${string}`>;
}>;
```

### Parameters

An array of hexadecimal signatures.

#### Type

```ts
let hexSigs: Array<string>;
```

### Returns

```ts
let returnType: Promise<{
  events: Array<`event ${string}`>;
  functions: Array<`function ${string}`>;
}>;
```

A promise that resolves to an object containing the resolved functions and events.
---

###### Connect SDK

## shortenAddress

Checksums and formats an address if valid. Note this function does not check if the provided address is an ENS.

### Example

```ts
import { shortenAddress } from "thirdweb/utils";
 
shortenAddress("0xa0cf798816d4b9b9866b5330eea46a18382f251e");
//=> '0xA0Cf...251e'
```

```ts
function shortenAddress(address: string, length: number): string;
```

### Parameters

The address to shorten.

#### Type

```ts
let address: string;
```

The number of characters to keep from the start and end of the address.

#### Type

```ts
let length: number;
```

### Returns

```ts
let returnType: string;
```

The shortened address.
---

###### Connect SDK

## shortenHex

Shortens a hexadecimal string without performing any validation or checksumming.

### Example

```ts
import { shortenHex } from "thirdweb/utils";
 
shortenHex("0xa0cf798816d4b9b9866b5330eea46a18382f251e");
//=> '0xa0cf...251e'
```

```ts
function shortenHex(hex: string, length: number): string;
```

### Parameters

The hexadecimal string to shorten.

#### Type

```ts
let hex: string;
```

The number of characters to keep from the start and end of the string.

#### Type

```ts
let length: number;
```

### Returns

```ts
let returnType: string;
```

The shortened hexadecimal string.
---

###### Connect SDK

## shortenLargeNumber

Shorten the string for large value Mainly used for Examples: 10\_000 -> 10k 1\_000\_000 -> 1M 1\_000\_000\_000 -> 1B

### Example

```ts
import { shortenLargeNumber } from "thirdweb/utils";
const numStr = shortenLargeNumber(1_000_000_000);
```

```ts
function shortenLargeNumber(value: number): string;
```

### Parameters

#### Type

```ts
let value: number;
```

### Returns

```ts
let returnType: string;
```
---

###### Connect SDK

## sign

Generates the signature for the provided transaction hash.

### Example

```ts
import { sign } from "thirdweb/utils";
 
const signature = sign({
  hash: "0x",
  privateKey: "0x",
});
```

```ts
function sign(options: SignOptions): {
  r: `0x${string}`;
  s: `0x${string}`;
  v: bigint;
  yParity: number;
};
```

### Parameters

The options for signing.

#### Type

```ts
let options: { hash: Hex; privateKey: Hex };
```

### Returns

```ts
let returnType: {
  r: `0x${string}`;
  s: `0x${string}`;
  v: bigint;
  yParity: number;
};
```

The transaction signature.
---

###### Connect SDK

## signatureToHex

Converts a signature to a hex string.

### Example

```ts
import { signatureToHex } from "thirdweb/utils";
 
const hex = signatureToHex({
  r: toHex(
    49782753348462494199823712700004552394425719014458918871452329774910450607807n,
  ),
  s: toHex(
    33726695977844476214676913201140481102225469284307016937915595756355928419768n,
  ),
  v: 28n,
});
 
console.log(hex);
// "0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c"
```

```ts
function signatureToHex(signature: {
  r: `0x${string}`;
  s: `0x${string}`;
  v?: number | bigint | `0x${string}`;
  yParity?: number | bigint | `0x${string}`;
}): `0x${string}`;
```

### Parameters

The signature to convert.

#### Type

```ts
let signature: {
  r: `0x${string}`;
  s: `0x${string}`;
  v?: number | bigint | `0x${string}`;
  yParity?: number | bigint | `0x${string}`;
};
```

### Returns

```ts
let returnType: `0x${string}`;
```

The hex string representation of the signature.
---

###### Connect SDK

## signMessage

### Signature#1

Signs a string message with a given private key.

#### Example

```ts
import { signMessage } from "thirdweb/utils";
signMessage({
  message: "Hello, world!",
  privateKey: "0x...",
});
```

```ts
function signMessage(options: SignMessageOptions): `0x${string}`;
```

#### Parameters

The options for signing.

##### Type

```ts
let options: { message: Message; privateKey: Hex };
```

#### Returns

```ts
let returnType: `0x${string}`;
```

The signature as a hex string

### Signature#2

Signs a string message with a given account.

#### Example

```ts
import { signMessage } from "thirdweb/utils";
await signMessage({
  message: "Hello, world!",
  account,
});
```

```ts
function signMessage(options: {
  account: Account;
  message: Message;
}): Promise<`0x${string}`>;
```

#### Parameters

The options for signing.

##### Type

```ts
let options: { account: Account; message: Message };
```

#### Returns

```ts
let returnType: Promise<`0x${string}`>;
```

The signature as a hex string
---

###### Connect SDK

## signTypedData

Signs a typed data object with a given private key according to EIP712.

### Example

```ts
import { signTypedData } from "thirdweb/utils";
signTypedData({
  privateKey: "0x...",
  ...typedData,
});
```

```ts
function signTypedData(
  options: SignTypedDataOptions<typedData, primaryType>,
): `0x${string}`;
```

### Parameters

The typed data is passed within options alongside the private key

#### Type

```ts
let options: SignTypedDataOptions<typedData, primaryType>;
```

### Returns

```ts
let returnType: `0x${string}`;
```

The signature as a hex string
---

###### Connect SDK

## stringify

Stringify a JSON object and convert all bigint values to string

If you are getting this error: "Exception: Do not know how to serialize a BigInt", you probably can use this function to parse the data. Because bigint is not an accepted value of the JSON format.

### Example

```ts
import { stringify } from "thirdweb/utils";
const obj = { tokenId: 0n };
const str = stringify(obj); // "{"tokenId":"0"}"
```

```ts
function stringify(
  value: any,
  replacer?: null | ((this: any, key: string, value: any) => any),
  space?: string | number,
): string;
```

### Parameters

#### Type

```ts
let value: any;
```

#### Type

```ts
let replacer: null | ((this: any, key: string, value: any) => any);
```

#### Type

```ts
let space: string | number;
```

### Returns

```ts
let returnType: string;
```

An object with all bigint values converted to string
---
# Miscellaneous
---

###### Connect SDK

## installPublishedExtension

Install a published extension on a dynamic contract

### Example

```ts
import { installPublishedExtension } from "thirdweb/dynamic-contracts";
const transaction = installPublishedExtension({
  client,
  chain,
  account,
  contract,
  extensionName: "MyExtension",
  publisherAddress: "0x...",
});
await sendTransaction({ transaction, account });
```

```ts
function installPublishedExtension(
  options: InstallPublishedExtensionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for installing a published extension

#### Type

```ts
let options: {
  account: Account;
  constructorParams?: Record<string, unknown>;
  contract: ThirdwebContract;
  extensionName: string;
  publisher?: string;
  version?: string;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction to send
---

###### Connect SDK

## uninstallExtension

Uninstall an extension on a dynamic contract

### Example

```ts
import { uninstallExtension } from "thirdweb/dynamic-contracts";
const transaction = uninstallExtension({
  client,
  chain,
  account,
  contract,
  extensionName: "MyExtension",
});
await sendTransaction({ transaction, account });
```

```ts
function uninstallExtension(
  options: UninstallExtensionOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options for uninstalling an extension

#### Type

```ts
let options: {
  account: Account;
  contract: ThirdwebContract;
  extensionName: string;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

A prepared transaction to send
---

###### Connect SDK

## activateStylusContract

Activate a stylus contract by calling ArbWasm Precompile

### Example

```ts
import { activateStylusContract } from "thirdweb/stylus";
const transaction = activateStylusContract({
  client,
  chain,
  contractAddress,
});
await sendTransaction({ transaction, account });
```

```ts
function activateStylusContract(
  options: ActivateStylusContractOptions,
): Promise<
  PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>
>;
```

### Parameters

The options for activating the contract

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
  contractAddress: string;
};
```

### Returns

```ts
let returnType: Readonly<options> & {
  __contract?: ThirdwebContract<abi>;
  __preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};
```

A prepared transaction to send
---

###### Connect SDK

## deployWithStylusConstructor

Deploy stylus contract with constructor params

### Example

```ts
import { deployWithStylusConstructor } from "thirdweb/stylus";
const transaction = deployWithStylusConstructor({
  client,
  chain,
  bytecode,
  constructorParams,
  abi,
});
await sendTransaction({ transaction, account });
```

```ts
function deployWithStylusConstructor(
  options: DeployWithStylusConstructorOptions,
): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
```

### Parameters

The options deploying contract with constructor

#### Type

```ts
let options: {
  abi: Abi;
  bytecode: `0x${string}`;
  chain: Chain;
  client: ThirdwebClient;
  constructorParams: Record<string, unknown>;
};
```

### Returns

```ts
let returnType: PreparedTransaction<
  any,
  AbiFunction,
  PrepareTransactionOptions
>;
```

Prepared transaction to call stylus deployer
---

###### Connect SDK

## isContractActivated

```ts
function isContractActivated(
  options: IsContractActivatedOptions,
): Promise<boolean>;
```

### Parameters

#### Type

```ts
let options: {
  bytecode: `0x${string}`;
  chain: Chain;
  client: ThirdwebClient;
};
```

### Returns

```ts
let returnType: Promise<boolean>;
```
---

###### Connect SDK

## convertCryptoToFiat

Get a price of a token (using tokenAddress + chainId) in fiat. Only USD is supported at the moment.

### Example

#### Basic usage

For native token (non-ERC20), you should use NATIVE\_TOKEN\_ADDRESS as the value for `tokenAddress`

```ts
import { convertCryptoToFiat } from "thirdweb/pay";
 
// Get Ethereum price
const result = convertCryptoToFiat({
  fromTokenAddress: NATIVE_TOKEN_ADDRESS,
  to: "USD",
  chain: ethereum,
  fromAmount: 1,
});
 
// Result: `{ result: 3404.11 }`
```

```ts
function convertCryptoToFiat(
  options: ConvertCryptoToFiatParams,
): Promise<{ result: number }>;
```

### Parameters

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
  fromAmount: number;
  fromTokenAddress: Address;
  to: SupportedFiatCurrency;
};
```

### Returns

```ts
let returnType: Promise<{ result: number }>;
```

a number representing the price (in selected fiat) of "x" token, with "x" being the `fromAmount`.
---

###### Connect SDK

## convertFiatToCrypto

Convert a fiat value to a token. Currently only USD is supported.

### Example

#### Basic usage

```ts
import { convertFiatToCrypto } from "thirdweb/pay";
 
// Convert 2 cents to ETH
const result = await convertFiatToCrypto({
  from: "USD",
  // the token address. For native token, use NATIVE_TOKEN_ADDRESS
  to: "0x...",
  // the chain (of the chain where the token belong to)
  chain: ethereum,
  // 2 cents
  fromAmount: 0.02,
});
```

Result: `{ result: 0.0000057 }`

```ts
function convertFiatToCrypto(
  options: ConvertFiatToCryptoParams,
): Promise<{ result: number }>;
```

### Parameters

#### Type

```ts
let options: {
  chain: Chain;
  client: ThirdwebClient;
  from: SupportedFiatCurrency;
  fromAmount: number;
  to: Address;
};
```

### Returns

```ts
let returnType: Promise<{ result: number }>;
```
---

###### Connect SDK

## getBuyHistory

Get Buy transaction history for a given wallet address.

This includes both "Buy with Cryto" and "Buy with Fiat" transactions

### Example

```ts
import { createThirdwebClient } from "thirdweb";
import { getBuyHistory } from "thirdweb/pay";
 
const client = createThirdwebClient({ clientId: "..." });
 
const history = await getBuyHistory({
  client,
  walletAddress: "0x...",
});
```

```ts
function getBuyHistory(
  params: BuyHistoryParams,
): Promise<BuyHistoryData>;
```

### Parameters

Object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  count: number;
  start: number;
  walletAddress: string;
};
```

### Returns

```ts
let returnType: {
  hasNextPage: boolean;
  page: Array<
    | { buyWithFiatStatus: BuyWithFiatStatus }
    | { buyWithCryptoStatus: BuyWithCryptoStatus }
  >;
};
```
---

###### Connect SDK

## getBuyWithCryptoHistory

Deprecated

Gets the History of purchases for a given wallet address

### Example

```ts
import { createThirdwebClient } from "thirdweb";
import { BuyWithCryptoHistoryData } from "thirdweb/pay";
 
const client = createThirdwebClient({ clientId: "..." });
const walletAddress = "0x...";
const params = {
  client,
  walletAddress,
};
 
// grabs the history of purchase transactions for the wallet address
const status = await getBuyWithCryptoHistory(params);
```

```ts
function getBuyWithCryptoHistory(
  params: BuyWithCryptoHistoryParams,
): Promise<BuyWithCryptoHistoryData>;
```

### Parameters

Object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  count: number;
  start: number;
  walletAddress: string;
};
```

### Returns

```ts
let returnType: {
  hasNextPage: boolean;
  page: Array<BuyWithCryptoStatus>;
};
```

Object of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData)
---

###### Connect SDK

## getBuyWithCryptoQuote

Deprecated

Get a quote of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) to buy any given token with crypto. This quote contains the information about the swap such as token amounts, processing fees, estimated time etc.

Once you have the quote, you can use `prepareTransaction` and prepare the transaction for submission.

### Example

```ts
import { getBuyWithCryptoQuote } from "thirdweb/pay";
 
const quote = await getBuyWithCryptoQuote({
  client,
  fromAddress: "0x...", // wallet address
  fromChainId: 137, // chain id of the source token
  fromTokenAddress: "0x...", // token address of the source token
  fromAmount: "10", // amount of source token to swap
  // optionally, you can use `toAmount` instead if you only want a certain amount of destination token
  toChainId: 10, // chain id of the destination token
  toTokenAddress: "0x...", // token address of the destination token
  toAddress: "0x...", // optional: send the tokens to a different address
  maxSlippageBPS: 50, // optional: max 0.5% slippage
});
```

```ts
function getBuyWithCryptoQuote(
  params: GetBuyWithCryptoQuoteParams,
): Promise<BuyWithCryptoQuote>;
```

### Parameters

object of type [GetBuyWithCryptoQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoQuoteParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  fromAddress: string;
  fromChainId: number;
  fromTokenAddress: string;
  intentId?: string;
  maxSlippageBPS?: number;
  paymentLinkId?: string;
  purchaseData?: PurchaseData;
  toAddress: string;
  toChainId: number;
  toTokenAddress: string;
} & (
  | { fromAmount: string; toAmount?: never }
  | { fromAmount?: never; toAmount: string }
);
```

### Returns

```ts
let returnType: {
  approvalData?: QuoteApprovalInfo;
  client: ThirdwebClient;
  paymentTokens: Array<QuotePaymentToken>;
  processingFees: Array<QuotePaymentToken>;
  swapDetails: {
    estimated: {
      durationSeconds?: number;
      feesUSDCents: number;
      fromAmountUSDCents: number;
      gasCostUSDCents?: number;
      slippageBPS: number;
      toAmountMinUSDCents: number;
      toAmountUSDCents: number;
    };
    fromAddress: string;
    fromAmount: string;
    fromAmountWei: string;
    fromToken: QuoteTokenInfo;
    maxSlippageBPS: number;
    toAddress: string;
    toAmount: string;
    toAmountMin: string;
    toAmountMinWei: string;
    toAmountWei: string;
    toToken: QuoteTokenInfo;
  };
  transactionRequest: PrepareTransactionOptions;
};
```

Object of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) which contains the information about the quote such as processing fees, estimated time, converted token amounts, etc.
---

###### Connect SDK

## getBuyWithCryptoStatus

Deprecated

use Bridge.status instead

Gets the status of a buy with crypto transaction

### Example

```ts
import { sendTransaction } from "thirdweb";
import { getBuyWithCryptoStatus, getBuyWithCryptoQuote } from "thirdweb/pay";
 
// get a quote between two tokens
const quote = await getBuyWithCryptoQuote(quoteParams);
 
// if approval is required, send the approval transaction
if (quote.approval) {
 const txResult = await sendTransaction({
   transaction: quote.approval,
   account: account, // account from connected wallet
 });
 
 await waitForReceipt(txResult);
}
 
// send the quoted transaction
const swapTxResult = await sendTransaction({
   transaction: quote.transactionRequest,
   account: account, // account from connected wallet
 });
 
await waitForReceipt(swapTxResult);
 
// keep polling the status of the quoted transaction until it returns a success or failure status
const status = await getBuyWithCryptoStatus({
   client,
   transactionHash: swapTxResult.transactionHash,
}});
```

```ts
function getBuyWithCryptoStatus(
  buyWithCryptoTransaction: BuyWithCryptoTransaction,
): Promise<BuyWithCryptoStatus>;
```

### Parameters

Object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction)

#### Type

```ts
let buyWithCryptoTransaction: {
  chainId: number;
  client: ThirdwebClient;
  transactionHash: string;
};
```

### Returns

```ts
let returnType:
  | { status: "NOT_FOUND" }
  | {
      bridge?: string;
      destination?: PayOnChainTransactionDetails;
      failureMessage?: string;
      fromAddress: string;
      purchaseData?: PurchaseData;
      quote: BuyWithCryptoQuoteSummary;
      source?: PayOnChainTransactionDetails;
      status: BuyWithCryptoStatuses;
      subStatus: BuyWithCryptoSubStatuses;
      swapType: SwapType;
      toAddress: string;
    };
```

Object of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus)
---

###### Connect SDK

## getBuyWithCryptoTransfer

Deprecated

Get a quote of type [BuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransfer) to facilitate a token transfer transaction. Using this instead of a native transfer allows you to receive status and webhooks about successful or failed payments.

Once you have the quote, you can use `prepareTransaction` and prepare the transaction for submission.

### Example

```ts
import { getBuyWithCryptoTransfer } from "thirdweb/pay";
 
const transfer = await getBuyWithCryptoTransfer({
  client,
  fromAddress: "0x...", // wallet address
  toAddress: "0x...", // recipient address - likely to be your wallet
  chainId: 10, // chain id of the token
  tokenAddress: "0x...", // address of the token
  amount: "10", // amount of token to transfer
  purchaseData: {
    // any metadata for you to attribute this purchase
    customerId: "yourId",
  },
});
```

```ts
function getBuyWithCryptoTransfer(
  params: GetBuyWithCryptoTransferParams,
): Promise<BuyWithCryptoTransfer>;
```

### Parameters

object of type [GetBuyWithCryptoTransferParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoTransferParams)

#### Type

```ts
let params: {
  amount: string;
  chainId: number;
  client: ThirdwebClient;
  feePayer?: "sender" | "receiver";
  fromAddress: string;
  paymentLinkId?: string;
  purchaseData?: PurchaseData;
  toAddress: string;
  tokenAddress: string;
};
```

### Returns

```ts
let returnType: {
  approvalData?: QuoteApprovalInfo;
  client: ThirdwebClient;
  estimatedGasCostUSDCents: number;
  fromAddress: string;
  paymentToken: QuotePaymentToken;
  processingFee: QuotePaymentToken;
  toAddress: string;
  transactionRequest: PrepareTransactionOptions;
};
```

Object of type [BuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransfer) which contains the information about the transfer
---

###### Connect SDK

## getBuyWithFiatHistory

Deprecated

Get the "Buy with fiat" transaction history for a given wallet address

### Example

```ts
import { createThirdwebClient } from "thirdweb";
import { getBuyWithFiatHistory } from "thirdweb/pay";
 
const client = createThirdwebClient({ clientId: "..." });
 
// get the 10 latest "Buy with fiat" transactions dony by the wallet
const history = await getBuyWithFiatHistory({
  client: client,
  walletAddress: "0x...",
  start: 0,
  count: 10,
});
```

```ts
function getBuyWithFiatHistory(
  params: BuyWithFiatHistoryParams,
): Promise<BuyWithFiatHistoryData>;
```

### Parameters

Object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  count: number;
  start: number;
  walletAddress: string;
};
```

### Returns

```ts
let returnType: {
  hasNextPage: boolean;
  page: Array<BuyWithFiatStatus>;
};
```

Object of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData)
---

###### Connect SDK

## getBuyWithFiatQuote

Deprecated

Get a quote of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) to buy given token with fiat currency. This quote contains the information about the swap such as token amounts, processing fees, estimated time etc.

#### Rendering the On-Ramp provider UI

Once you have the `quote`, you can open the `quote.onRampLink` in a new tab - This will prompt the user to buy the token with fiat currency

#### Determining the steps required

If `quote.onRampToken.token` is same as `quote.toToken` ( same chain + same token address ) - This means that the token can be directly bought from the on-ramp provider. But if they are different, On-ramp provider will send the `quote.onRampToken` to the user's wallet address and a swap is required to swap it to the desired token onchain.

You can use the [isSwapRequiredPostOnramp](https://portal.thirdweb.com/references/typescript/v5/isSwapRequiredPostOnramp) utility function to check if a swap is required after the on-ramp is done.

#### Polling for the status

Once you open the `quote.onRampLink` in a new tab, you can start polling for the status using [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatStatus) to get the status of the transaction.

`getBuyWithFiatStatus` returns a status object of type [BuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatStatus).

* If no swap is required - the status will become `"ON_RAMP_TRANSFER_COMPLETED"` once the on-ramp provider has sent the desired token to the user's wallet address. Once you receive this status, the process is complete.
* If a swap is required - the status will become `"CRYPTO_SWAP_REQUIRED"` once the on-ramp provider has sent the tokens to the user's wallet address. Once you receive this status, you need to start the swap process.

#### Swap Process

On receiving the `"CRYPTO_SWAP_REQUIRED"` status, you can use the [getPostOnRampQuote](https://portal.thirdweb.com/references/typescript/v5/getPostOnRampQuote) function to get the quote for the swap of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote).

Once you have this quote - You can follow the same steps as mentioned in the [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote) documentation to perform the swap.

### Example

Get a quote for buying 10 USDC on polygon chain (chainId: 137) with USD fiat currency:

```ts
import { getBuyWithFiatQuote } from "thirdweb/pay";
 
const quote = await getBuyWithFiatQuote({
 client: client, // thirdweb client
 fromCurrencySymbol: "USD", // fiat currency symbol
 toChainId: 137, // polygon chain id
 toAmount: "10", // amount of USDC to buy
 toTokenAddress: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" // USDC token address in polygon chain
 toAddress: "0x...", // user's wallet address
 isTestMode: false, // whether to use onramp in test mode for testing purpose (defaults to false)
});
 
window.open(quote.onRampLink, "_blank");
```

```ts
function getBuyWithFiatQuote(
  params: GetBuyWithFiatQuoteParams,
): Promise<BuyWithFiatQuote>;
```

### Parameters

object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams)

#### Type

```ts
let params: {
  client: ThirdwebClient;
  fromAddress: string;
  fromAmount?: string;
  fromCurrencySymbol: CurrencyMeta["shorthand"];
  isTestMode?: boolean;
  maxSlippageBPS?: number;
  onrampChainId?: number;
  onrampTokenAddress?: string;
  paymentLinkId?: string;
  preferredProvider?: FiatProvider;
  purchaseData?: PurchaseData;
  toAddress: string;
  toAmount?: string;
  toChainId: number;
  toGasAmountWei?: string;
  toTokenAddress: string;
};
```

### Returns

```ts
let returnType: {
  estimatedDurationSeconds: number;
  estimatedToAmountMin: string;
  estimatedToAmountMinWei: string;
  fromAddress: string;
  fromCurrency: {
    amount: string;
    amountUnits: string;
    currencySymbol: string;
    decimals: number;
  };
  fromCurrencyWithFees: {
    amount: string;
    amountUnits: string;
    currencySymbol: string;
    decimals: number;
  };
  intentId: string;
  maxSlippageBPS: number;
  onRampLink: string;
  onRampToken: {
    amount: string;
    amountUSDCents: number;
    amountWei: string;
    token: PayTokenInfo;
  };
  processingFees: Array<{
    amount: string;
    amountUnits: string;
    currencySymbol: string;
    decimals: number;
    feeType: "ON_RAMP" | "NETWORK";
  }>;
  provider: FiatProvider;
  routingToken?: {
    amount: string;
    amountUSDCents: number;
    amountWei: string;
    token: PayTokenInfo;
  };
  toAddress: string;
  toAmountMin: string;
  toAmountMinWei: string;
  toToken: PayTokenInfo;
};
```

Object of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) which contains the information about the quote such as processing fees, estimated time, converted token amounts, etc.
---

###### Connect SDK

## getBuyWithFiatStatus

Deprecated

Once you get a `quote` from [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote)and open the `quote.onRampLink` in a new tab, you can start polling for the transaction status using `getBuyWithFiatStatus`

You should keep calling this function at regular intervals while the status is in one of the pending states such as - "PENDING\_PAYMENT", "PENDING\_ON\_RAMP\_TRANSFER", "ON\_RAMP\_TRANSFER\_IN\_PROGRESS", "CRYPTO\_SWAP\_IN\_PROGRESS" etc..

If `quote.onRampToken` is same as `quote.toToken` (same chain + same token address) - This means that the token can be directly bought from the on-ramp provider. But if they are different - On-ramp provider will send the `quote.onRampToken` to the user's wallet address and a swap is required to convert it to the desired token. You can use the [isSwapRequiredPostOnramp](https://portal.thirdweb.com/references/typescript/v5/isSwapRequiredPostOnramp) utility function to check if a swap is required after the on-ramp is done.

##### When no swap is required

If there is no swap required - the status will become `"ON_RAMP_TRANSFER_COMPLETED"` once the on-ramp provider has sent the tokens to the user's wallet address. Once you receive this status, the process is complete.

#### When a swap is required

If a swap is required - the status will become `"CRYPTO_SWAP_REQUIRED"` once the on-ramp provider has sent the tokens to the user's wallet address. Once you receive this status, you need to start the swap process.

On receiving the `"CRYPTO_SWAP_REQUIRED"` status, you can use the [getPostOnRampQuote](https://portal.thirdweb.com/references/typescript/v5/getPostOnRampQuote) function to get the quote for the swap of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote).

Once you have this quote - You can follow the same steps as mentioned in the [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote) documentation to perform the swap.

### Example

```ts
// step 1 - get a quote
const fiatQuote = await getBuyWithFiatQuote(fiatQuoteParams);
 
// step 2 - open the on-ramp provider UI
window.open(quote.onRampLink, "_blank");
 
// step 3 - keep calling getBuyWithFiatStatus while the status is in one of the pending states
const fiatStatus = await getBuyWithFiatStatus({
  client,
  intentId: fiatQuote.intentId,
});
 
// when the fiatStatus.status is "ON_RAMP_TRANSFER_COMPLETED" - the process is complete
```

```ts
function getBuyWithFiatStatus(
  params: GetBuyWithFiatStatusParams,
): Promise<BuyWithFiatStatus>;
```

### Parameters

Object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatStatusParams)

#### Type

```ts
let params: { client: ThirdwebClient; intentId: string };
```

### Returns

```ts
let returnType:
  | { status: "NOT_FOUND" }
  | {
      destination?: PayOnChainTransactionDetails;
      failureMessage?: string;
      fromAddress: string;
      intentId: string;
      purchaseData?: PurchaseData;
      quote: {
        createdAt: string;
        estimatedDurationSeconds?: number;
        estimatedOnRampAmount: string;
        estimatedOnRampAmountWei: string;
        estimatedToTokenAmount: string;
        estimatedToTokenAmountWei: string;
        fromCurrency: {
          amount: string;
          amountUnits: string;
          currencySymbol: string;
          decimals: number;
        };
        fromCurrencyWithFees: {
          amount: string;
          amountUnits: string;
          currencySymbol: string;
          decimals: number;
        };
        onRampToken: PayTokenInfo;
        toToken: PayTokenInfo;
      };
      source?: PayOnChainTransactionDetails;
      status:
        | "NONE"
        | "PENDING_PAYMENT"
        | "PAYMENT_FAILED"
        | "ON_RAMP_TRANSFER_COMPLETED";
      toAddress: string;
    };
```
---

###### Connect SDK

## getPostOnRampQuote

Deprecated

When buying a token with fiat currency - It only involes doing on-ramp if the on-ramp provider supports buying the given destination token directly.

If the on-ramp provider does not support buying the destination token directly, user can be sent an intermediate token with fiat currency from the on-ramp provider which can be swapped to destination token onchain.

`getPostOnRampQuote` function is used to get the quote for swapping the on-ramp token to destination token.

When you get a "Buy with Fiat" status of type "CRYPTO\_SWAP\_REQUIRED" from the [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatStatus) function, you can use `getPostOnRampQuote` function to get the quote of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) for swapping the on-ramp token to destination token

Once you have the quote, you can start the Swap process by following the same steps as mentioned in the [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote) documentation.

### Example

```ts
import {
  getPostOnRampQuote,
  getBuyWithFiatStatus,
} from "thirdweb/pay";
 
// previous steps
const fiatQuote = await getBuyWithFiatQuote(fiatQuoteParams);
window.open(fiatQuote.onRampLink, "_blank");
const buyWithFiatStatus = await getBuyWithFiatStatus({
  client,
  intentId,
}); // keep calling this until status is "settled" state
 
// when a swap is required after onramp
if (buyWithFiatStatus.status === "CRYPTO_SWAP_REQUIRED") {
  const buyWithCryptoQuote = await getPostOnRampQuote({
    client,
    buyWithFiatStatus,
  });
}
```

```ts
function getPostOnRampQuote(
  params: GetPostOnRampQuoteParams,
): Promise<BuyWithCryptoQuote>;
```

### Parameters

object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams)

#### Type

```ts
let params: {
  buyWithFiatStatus: BuyWithFiatStatus;
  client: ThirdwebClient;
  paymentLinkId?: string;
};
```

### Returns

```ts
let returnType: {
  approvalData?: QuoteApprovalInfo;
  client: ThirdwebClient;
  paymentTokens: Array<QuotePaymentToken>;
  processingFees: Array<QuotePaymentToken>;
  swapDetails: {
    estimated: {
      durationSeconds?: number;
      feesUSDCents: number;
      fromAmountUSDCents: number;
      gasCostUSDCents?: number;
      slippageBPS: number;
      toAmountMinUSDCents: number;
      toAmountUSDCents: number;
    };
    fromAddress: string;
    fromAmount: string;
    fromAmountWei: string;
    fromToken: QuoteTokenInfo;
    maxSlippageBPS: number;
    toAddress: string;
    toAmount: string;
    toAmountMin: string;
    toAmountMinWei: string;
    toAmountWei: string;
    toToken: QuoteTokenInfo;
  };
  transactionRequest: PrepareTransactionOptions;
};
```

Object of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) which contains the information about the quote such as processing fees, estimated time, converted token amounts, etc.
---

###### Connect SDK

## isSwapRequiredPostOnramp

Deprecated

Check if a Swap is required after on-ramp when buying a token with fiat currency.

If `quote.toToken` and `quote.onRampToken` are the same (same token and chain), it means on-ramp provider can directly send the desired token to the user's wallet and no swap is required.

If `quote.toToken` and `quote.onRampToken` are different (different token or chain), A swap is required to swap the on-ramp token to the desired token.

```ts
function isSwapRequiredPostOnramp(
  buyWithFiatQuote: Pick<BuyWithFiatQuote, "toToken" | "onRampToken">,
): boolean;
```

### Parameters

The quote of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) returned by the [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function.

#### Type

```ts
let buyWithFiatQuote: Pick<
  BuyWithFiatQuote,
  "toToken" | "onRampToken"
>;
```

### Returns

```ts
let returnType: boolean;
```
---

###### Connect SDK

## WalletName

This component fetches then shows the name of a wallet. It inherits all the attributes of a HTML `<span>` component, hence you can style it just like how you would style a normal `<span>`

### Example

#### Basic usage

```tsx
import { WalletProvider, WalletName } from "thirdweb/react";
 
<WalletProvider id="io.metamask">
  <WalletName />
</WalletProvider>;
```

Result:

```html
<span>MetaMask</span>
```

#### Show a loading sign when the name is being fetched

```tsx
import { WalletProvider, WalletName } from "thirdweb/react";
 
<WalletProvider {...props}>
  <WalletName loadingComponent={<Spinner />} />
</WalletProvider>;
```

#### Fallback to something when the name fails to resolve

```tsx
<WalletProvider {...props}>
  <WalletName fallbackComponent={<span>Failed to load</span>} />
</WalletProvider>;
```

#### Custom query options for useQuery

This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control

```tsx
<WalletName
  queryOptions={{
    enabled: isEnabled,
    retry: 4,
  }}
/>
@component
@beta
@wallet
```

```ts
function WalletName(
  __namedParameters: WalletNameProps,
): null | Element;
```

### Parameters

#### Type

```ts
let __namedParameters: {about : string,accessKey : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "assertive" | "polite",aria-modal : Booleanish,aria-multiline : Booleanish,aria-multiselectable : Booleanish,aria-orientation : "horizontal" | "vertical",aria-owns : string,aria-placeholder : string,aria-posinset : number,aria-pressed : boolean | "false" | "true" | "mixed",aria-readonly : Booleanish,aria-relevant : "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals",aria-required : Booleanish,aria-roledescription : string,aria-rowcount : number,aria-rowindex : number,aria-rowindextext : string,aria-rowspan : number,aria-selected : Booleanish,aria-setsize : number,aria-sort : "none" | "ascending" | "descending" | "other",aria-valuemax : number,aria-valuemin : number,aria-valuenow : number,aria-valuetext : string,autoCapitalize : (string & ({  })) | "on" | "off" | "none" | "sentences" | "words" | "characters",autoCorrect : string,autoFocus : boolean,autoSave : string,className : string,color : string,content : string,contentEditable : "inherit" | (Booleanish) | "plaintext-only",contextMenu : string,dangerouslySetInnerHTML : { __html: string | (TrustedHTML) },datatype : string,defaultChecked : boolean,defaultValue : string | number | (readonly Array<string>),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",exportparts : string,fallbackComponent : Element,formatFn : (str: string) => string,hidden : boolean,id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "decimal" | "tel" | "numeric",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler<HTMLSpanElement>,onAbortCapture : ReactEventHandler<HTMLSpanElement>,onAnimationEnd : AnimationEventHandler<HTMLSpanElement>,onAnimationEndCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationIteration : AnimationEventHandler<HTMLSpanElement>,onAnimationIterationCapture : AnimationEventHandler<HTMLSpanElement>,onAnimationStart : AnimationEventHandler<HTMLSpanElement>,onAnimationStartCapture : AnimationEventHandler<HTMLSpanElement>,onAuxClick : MouseEventHandler<HTMLSpanElement>,onAuxClickCapture : MouseEventHandler<HTMLSpanElement>,onBeforeInput : InputEventHandler<HTMLSpanElement>,onBeforeInputCapture : FormEventHandler<HTMLSpanElement>,onBeforeToggle : ToggleEventHandler<HTMLSpanElement>,onBlur : FocusEventHandler<HTMLSpanElement>,onBlurCapture : FocusEventHandler<HTMLSpanElement>,onCanPlay : ReactEventHandler<HTMLSpanElement>,onCanPlayCapture : ReactEventHandler<HTMLSpanElement>,onCanPlayThrough : ReactEventHandler<HTMLSpanElement>,onCanPlayThroughCapture : ReactEventHandler<HTMLSpanElement>,onChange : FormEventHandler<HTMLSpanElement>,onChangeCapture : FormEventHandler<HTMLSpanElement>,onClick : MouseEventHandler<HTMLSpanElement>,onClickCapture : MouseEventHandler<HTMLSpanElement>,onCompositionEnd : CompositionEventHandler<HTMLSpanElement>,onCompositionEndCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionStart : CompositionEventHandler<HTMLSpanElement>,onCompositionStartCapture : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdate : CompositionEventHandler<HTMLSpanElement>,onCompositionUpdateCapture : CompositionEventHandler<HTMLSpanElement>,onContextMenu : MouseEventHandler<HTMLSpanElement>,onContextMenuCapture : MouseEventHandler<HTMLSpanElement>,onCopy : ClipboardEventHandler<HTMLSpanElement>,onCopyCapture : ClipboardEventHandler<HTMLSpanElement>,onCut : ClipboardEventHandler<HTMLSpanElement>,onCutCapture : ClipboardEventHandler<HTMLSpanElement>,onDoubleClick : MouseEventHandler<HTMLSpanElement>,onDoubleClickCapture : MouseEventHandler<HTMLSpanElement>,onDrag : DragEventHandler<HTMLSpanElement>,onDragCapture : DragEventHandler<HTMLSpanElement>,onDragEnd : DragEventHandler<HTMLSpanElement>,onDragEndCapture : DragEventHandler<HTMLSpanElement>,onDragEnter : DragEventHandler<HTMLSpanElement>,onDragEnterCapture : DragEventHandler<HTMLSpanElement>,onDragExit : DragEventHandler<HTMLSpanElement>,onDragExitCapture : DragEventHandler<HTMLSpanElement>,onDragLeave : DragEventHandler<HTMLSpanElement>,onDragLeaveCapture : DragEventHandler<HTMLSpanElement>,onDragOver : DragEventHandler<HTMLSpanElement>,onDragOverCapture : DragEventHandler<HTMLSpanElement>,onDragStart : DragEventHandler<HTMLSpanElement>,onDragStartCapture : DragEventHandler<HTMLSpanElement>,onDrop : DragEventHandler<HTMLSpanElement>,onDropCapture : DragEventHandler<HTMLSpanElement>,onDurationChange : ReactEventHandler<HTMLSpanElement>,onDurationChangeCapture : ReactEventHandler<HTMLSpanElement>,onEmptied : ReactEventHandler<HTMLSpanElement>,onEmptiedCapture : ReactEventHandler<HTMLSpanElement>,onEncrypted : ReactEventHandler<HTMLSpanElement>,onEncryptedCapture : ReactEventHandler<HTMLSpanElement>,onEnded : ReactEventHandler<HTMLSpanElement>,onEndedCapture : ReactEventHandler<HTMLSpanElement>,onError : ReactEventHandler<HTMLSpanElement>,onErrorCapture : ReactEventHandler<HTMLSpanElement>,onFocus : FocusEventHandler<HTMLSpanElement>,onFocusCapture : FocusEventHandler<HTMLSpanElement>,onGotPointerCapture : PointerEventHandler<HTMLSpanElement>,onGotPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onInput : FormEventHandler<HTMLSpanElement>,onInputCapture : FormEventHandler<HTMLSpanElement>,onInvalid : FormEventHandler<HTMLSpanElement>,onInvalidCapture : FormEventHandler<HTMLSpanElement>,onKeyDown : KeyboardEventHandler<HTMLSpanElement>,onKeyDownCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyPress : KeyboardEventHandler<HTMLSpanElement>,onKeyPressCapture : KeyboardEventHandler<HTMLSpanElement>,onKeyUp : KeyboardEventHandler<HTMLSpanElement>,onKeyUpCapture : KeyboardEventHandler<HTMLSpanElement>,onLoad : ReactEventHandler<HTMLSpanElement>,onLoadCapture : ReactEventHandler<HTMLSpanElement>,onLoadedData : ReactEventHandler<HTMLSpanElement>,onLoadedDataCapture : ReactEventHandler<HTMLSpanElement>,onLoadedMetadata : ReactEventHandler<HTMLSpanElement>,onLoadedMetadataCapture : ReactEventHandler<HTMLSpanElement>,onLoadStart : ReactEventHandler<HTMLSpanElement>,onLoadStartCapture : ReactEventHandler<HTMLSpanElement>,onLostPointerCapture : PointerEventHandler<HTMLSpanElement>,onLostPointerCaptureCapture : PointerEventHandler<HTMLSpanElement>,onMouseDown : MouseEventHandler<HTMLSpanElement>,onMouseDownCapture : MouseEventHandler<HTMLSpanElement>,onMouseEnter : MouseEventHandler<HTMLSpanElement>,onMouseLeave : MouseEventHandler<HTMLSpanElement>,onMouseMove : MouseEventHandler<HTMLSpanElement>,onMouseMoveCapture : MouseEventHandler<HTMLSpanElement>,onMouseOut : MouseEventHandler<HTMLSpanElement>,onMouseOutCapture : MouseEventHandler<HTMLSpanElement>,onMouseOver : MouseEventHandler<HTMLSpanElement>,onMouseOverCapture : MouseEventHandler<HTMLSpanElement>,onMouseUp : MouseEventHandler<HTMLSpanElement>,onMouseUpCapture : MouseEventHandler<HTMLSpanElement>,onPaste : ClipboardEventHandler<HTMLSpanElement>,onPasteCapture : ClipboardEventHandler<HTMLSpanElement>,onPause : ReactEventHandler<HTMLSpanElement>,onPauseCapture : ReactEventHandler<HTMLSpanElement>,onPlay : ReactEventHandler<HTMLSpanElement>,onPlayCapture : ReactEventHandler<HTMLSpanElement>,onPlaying : ReactEventHandler<HTMLSpanElement>,onPlayingCapture : ReactEventHandler<HTMLSpanElement>,onPointerCancel : PointerEventHandler<HTMLSpanElement>,onPointerCancelCapture : PointerEventHandler<HTMLSpanElement>,onPointerDown : PointerEventHandler<HTMLSpanElement>,onPointerDownCapture : PointerEventHandler<HTMLSpanElement>,onPointerEnter : PointerEventHandler<HTMLSpanElement>,onPointerLeave : PointerEventHandler<HTMLSpanElement>,onPointerMove : PointerEventHandler<HTMLSpanElement>,onPointerMoveCapture : PointerEventHandler<HTMLSpanElement>,onPointerOut : PointerEventHandler<HTMLSpanElement>,onPointerOutCapture : PointerEventHandler<HTMLSpanElement>,onPointerOver : PointerEventHandler<HTMLSpanElement>,onPointerOverCapture : PointerEventHandler<HTMLSpanElement>,onPointerUp : PointerEventHandler<HTMLSpanElement>,onPointerUpCapture : PointerEventHandler<HTMLSpanElement>,onProgress : ReactEventHandler<HTMLSpanElement>,onProgressCapture : ReactEventHandler<HTMLSpanElement>,onRateChange : ReactEventHandler<HTMLSpanElement>,onRateChangeCapture : ReactEventHandler<HTMLSpanElement>,onReset : FormEventHandler<HTMLSpanElement>,onResetCapture : FormEventHandler<HTMLSpanElement>,onScroll : UIEventHandler<HTMLSpanElement>,onScrollCapture : UIEventHandler<HTMLSpanElement>,onScrollEnd : UIEventHandler<HTMLSpanElement>,onScrollEndCapture : UIEventHandler<HTMLSpanElement>,onSeeked : ReactEventHandler<HTMLSpanElement>,onSeekedCapture : ReactEventHandler<HTMLSpanElement>,onSeeking : ReactEventHandler<HTMLSpanElement>,onSeekingCapture : ReactEventHandler<HTMLSpanElement>,onSelect : ReactEventHandler<HTMLSpanElement>,onSelectCapture : ReactEventHandler<HTMLSpanElement>,onStalled : ReactEventHandler<HTMLSpanElement>,onStalledCapture : ReactEventHandler<HTMLSpanElement>,onSubmit : FormEventHandler<HTMLSpanElement>,onSubmitCapture : FormEventHandler<HTMLSpanElement>,onSuspend : ReactEventHandler<HTMLSpanElement>,onSuspendCapture : ReactEventHandler<HTMLSpanElement>,onTimeUpdate : ReactEventHandler<HTMLSpanElement>,onTimeUpdateCapture : ReactEventHandler<HTMLSpanElement>,onToggle : ToggleEventHandler<HTMLSpanElement>,onTouchCancel : TouchEventHandler<HTMLSpanElement>,onTouchCancelCapture : TouchEventHandler<HTMLSpanElement>,onTouchEnd : TouchEventHandler<HTMLSpanElement>,onTouchEndCapture : TouchEventHandler<HTMLSpanElement>,onTouchMove : TouchEventHandler<HTMLSpanElement>,onTouchMoveCapture : TouchEventHandler<HTMLSpanElement>,onTouchStart : TouchEventHandler<HTMLSpanElement>,onTouchStartCapture : TouchEventHandler<HTMLSpanElement>,onTransitionCancel : TransitionEventHandler<HTMLSpanElement>,onTransitionCancelCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionEnd : TransitionEventHandler<HTMLSpanElement>,onTransitionEndCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionRun : TransitionEventHandler<HTMLSpanElement>,onTransitionRunCapture : TransitionEventHandler<HTMLSpanElement>,onTransitionStart : TransitionEventHandler<HTMLSpanElement>,onTransitionStartCapture : TransitionEventHandler<HTMLSpanElement>,onVolumeChange : ReactEventHandler<HTMLSpanElement>,onVolumeChangeCapture : ReactEventHandler<HTMLSpanElement>,onWaiting : ReactEventHandler<HTMLSpanElement>,onWaitingCapture : ReactEventHandler<HTMLSpanElement>,onWheel : WheelEventHandler<HTMLSpanElement>,onWheelCapture : WheelEventHandler<HTMLSpanElement>,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit<UseQueryOptions<string, Error, string, readonly Array<unknown>>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,slot : string,spellCheck : Booleanish,style : CSSProperties,suppressContentEditableWarning : boolean,suppressHydrationWarning : boolean,tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string}
```

### Returns

```ts
let returnType: null | Element;
```
---

###### Connect SDK

## decodeAbiParameters

```ts
function decodeAbiParameters(params: params, data: (`0x${string}`) | (ByteArray)) : {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<params extends readonly Array<AbiParameter> ? params<params> : Array<AbiParameter>[key<key>], AbiParameterKind>}[key]}
```

### Parameters

#### Type

```ts
let params: params;
```

#### Type

```ts
let data: `0x${string}` | ByteArray;
```

### Returns

```ts
let returnType: {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<params extends readonly Array<AbiParameter> ? params<params> : Array<AbiParameter>[key<key>], AbiParameterKind>}[key]}
```
---

###### Connect SDK

## encodePacked

```ts
function encodePacked(
  types: packedAbiTypes,
  values: EncodePackedValues<packedAbiTypes>,
): `0x${string}`;
```

### Parameters

#### Type

```ts
let types: packedAbiTypes;
```

#### Type

```ts
let values: EncodePackedValues<packedAbiTypes>;
```

### Returns

```ts
let returnType: `0x${string}`;
```
---

###### Connect SDK

## isBytes

```ts
function isBytes(value: unknown): value is ByteArray;
```

### Parameters

#### Type

```ts
let value: unknown;
```

### Returns

```ts
let returnType: value is (ByteArray)
```
---

###### Connect SDK

## isValidENSName

Checks if a string is a valid ENS name. It does not check if the ENS name is currently registered or resolves to an address - it only validates the string format.

### Example

```ts
isValidENSName("thirdweb.eth"); // true
isValidENSName("foo.bar.com"); // true
isValidENSName("xyz"); // false
```

```ts
function isValidENSName(name: string): boolean;
```

### Parameters

The ENS name to check.

#### Type

```ts
let name: string;
```

### Returns

```ts
let returnType: boolean;
```
---

###### Connect SDK

## setServiceKey

```ts
function setServiceKey(key: null | string): void;
```

### Parameters

#### Type

```ts
let key: null | string;
```

### Returns

```ts
let returnType: void;
```
---

###### Connect SDK

## setThirdwebDomains

```ts
function setThirdwebDomains(DomainOverrides: DomainOverrides): void;
```

### Parameters

#### Type

```ts
let DomainOverrides: DomainOverrides;
```

### Returns

```ts
let returnType: void;
```
---

###### Connect SDK

## toEventSelector

Returns the hash (of the function/event signature) for a given event or function definition.

```ts
function toEventSelector(
  fn: string | AbiEvent | AbiFunction,
): `0x${string}`;
```

### Parameters

#### Type

```ts
let fn: string | AbiEvent | AbiFunction;
```

### Returns

```ts
let returnType: `0x${string}`;
```
---

###### Connect SDK

## toFunctionSelector

```ts
function toFunctionSelector(fn: string | AbiFunction): `0x${string}`;
```

### Parameters

#### Type

```ts
let fn: string | AbiFunction;
```

### Returns

```ts
let returnType: `0x${string}`;
```
---

###### Connect SDK

## getInstalledWallets

Get All currently installed wallets. Uses EIP-6963 to discover installed browser extension wallets.

```ts
function getInstalledWallets(): Array<Wallet>;
```

### Returns

```ts
let returnType: Array<Wallet>;
```

a list of installed wallets
---

###### Connect SDK

## randomPrivateKey

Generates a random ECDSA private key on the secp256k1 curve.

### Example

```ts
import { Secp256k1 } from "ox";
 
const privateKey = Secp256k1.randomPrivateKey();
```

```ts
function randomPrivateKey(options?: Options<as>): ReturnType<as>;
```

### Parameters

The options to generate the private key.

#### Type

```ts
let options: Options<as>;
```

### Returns

```ts
let returnType: ReturnType<as>;
```

The generated private key.
---

###### Connect SDK

## create7702MinimalAccount

```ts
function create7702MinimalAccount(args: {
  adminAccount: Account;
  client: ThirdwebClient;
  sponsorGas?: boolean;
}): Account;
```

### Parameters

#### Type

```ts
let args: {
  adminAccount: Account;
  client: ThirdwebClient;
  sponsorGas?: boolean;
};
```

### Returns

```ts
let returnType: {
  address: Address;
  estimateGas?: (tx: PreparedTransaction) => Promise<bigint>;
  onTransactionRequested?: (
    transaction: PreparedTransaction<any>,
  ) => Promise<void>;
  sendBatchTransaction?: (
    txs: Array<SendTransactionOption>,
  ) => Promise<SendTransactionResult>;
  sendRawTransaction?: (
    tx: SendRawTransactionOptions,
  ) => Promise<SendTransactionResult>;
  sendTransaction: (
    tx: SendTransactionOption,
  ) => Promise<SendTransactionResult>;
  signAuthorization?: (
    authorization: AuthorizationRequest,
  ) => Promise<SignedAuthorization>;
  signMessage: ({
    message,
    originalMessage,
    chainId,
  }: {
    chainId?: number;
    message: SignableMessage;
    originalMessage?: string;
  }) => Promise<Hex>;
  signTransaction?: (tx: SerializableTransaction) => Promise<Hex>;
  signTypedData: (
    _typedData: ox__TypedData.Definition<typedData, primaryType>,
  ) => Promise<Hex>;
  watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;
};
```
