diff --git a/apps/portal/public/llms-full.txt b/apps/portal/public/llms-full.txt index 0b2c8a3df62..aa114f28cbe 100644 --- a/apps/portal/public/llms-full.txt +++ b/apps/portal/public/llms-full.txt @@ -5,6 +5,366 @@ --- **UI Components** --- +# Universal Bridge +--- +## Widgets +--- + +## 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"; + +; +``` + +#### Buy a specific token + +You can specify a token to purchase by passing the `tokenAddress` prop. + +```tsx +; +``` + +#### Customize the UI + +You can customize the UI of the `BuyWidget` component by passing a custom theme object to the `theme` prop. + +```tsx +; +``` + +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 +; +``` + +#### Configure the wallet connection + +You can customize the wallet connection flow by passing a `connectOptions` object to the `BuyWidget` component. + +```tsx +; +``` + +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; + description?: string; + hiddenWallets?: Array; + image?: string; + locale?: LocaleId; + onCancel?: () => void; + onError?: (error: Error) => void; + onSuccess?: () => void; + paymentLinkId?: string; + presetOptions?: [number, number, number]; + purchaseData?: Record; + style?: React.CSSProperties; + supportedTokens?: SupportedTokens; + theme?: "light" | "dark" | Theme; + title?: string; + tokenAddress?: Address; +}; +``` + +### Returns + +```ts +let returnType: Element; +``` +--- + +## 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 +; +``` + +#### Customize the UI + +You can customize the UI of the `CheckoutWidget` component by passing a custom theme object to the `theme` prop. + +```tsx +; +``` + +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 +; +``` + +#### Configure the wallet connection + +You can customize the wallet connection flow by passing a `connectOptions` object to the `CheckoutWidget` component. + +```tsx +; +``` + +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; + description?: string; + feePayer?: "user" | "seller"; + hiddenWallets?: Array; + image?: string; + locale?: LocaleId; + name?: string; + onCancel?: () => void; + onError?: (error: Error) => void; + onSuccess?: () => void; + paymentLinkId?: string; + presetOptions?: [number, number, number]; + purchaseData?: Record; + seller: Address; + style?: React.CSSProperties; + supportedTokens?: SupportedTokens; + theme?: "light" | "dark" | Theme; + tokenAddress?: Address; +}; +``` + +### Returns + +```ts +let returnType: Element; +``` +--- + +## 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 +; +``` + +#### Customize the UI + +You can customize the UI of the `TransactionWidget` component by passing a custom theme object to the `theme` prop. + +```tsx +; +``` + +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 +; +``` + +#### Configure the wallet connection + +You can customize the wallet connection flow by passing a `connectOptions` object to the `TransactionWidget` component. + +```tsx +; +``` + +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; + description?: string; + feePayer?: "user" | "seller"; + hiddenWallets?: Array; + image?: string; + locale?: LocaleId; + onCancel?: () => void; + onError?: (error: Error) => void; + onSuccess?: () => void; + paymentLinkId?: string; + presetOptions?: [number, number, number]; + purchaseData?: Record; + style?: React.CSSProperties; + supportedTokens?: SupportedTokens; + theme?: "light" | "dark" | Theme; + title?: string; + tokenAddress?: Address; + transaction: PreparedTransaction; +}; +``` + +### Returns + +```ts +let returnType: Element; +``` +--- # Wallets --- @@ -62,7 +422,7 @@ function AccountAddress( #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,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 @@ -205,7 +565,7 @@ function SocialIcon(__namedParameters: SocialIconProps): Element; #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,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 @@ -452,8 +812,8 @@ A fully featured wallet connection component that allows to: Once connected, the component allows to: -* Reolve ENS names and avatars -* Manage multipple connected wallets +* 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 @@ -697,6 +1057,7 @@ let props: { connectModal?: ConnectButton_connectModalOptions; detailsButton?: ConnectButton_detailsButtonOptions; detailsModal?: ConnectButton_detailsModalOptions; + hiddenWallets?: Array; locale?: LocaleId; onConnect?: (wallet: Wallet) => void; onDisconnect?: (info: { account: Account; wallet: Wallet }) => void; @@ -874,6 +1235,7 @@ let props: { className?: string; client: ThirdwebClient; header?: { title?: string; titleIcon?: string } | true; + hiddenWallets?: Array; locale?: LocaleId; modalSize?: "compact" | "wide"; onConnect?: (wallet: Wallet) => void; @@ -1596,322 +1958,6 @@ let props: PropsWithChildren; ### Returns -```ts -let returnType: Element; -``` ---- -# Buy Crypto ---- - -## 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"; - - -``` - -#### Buy a specific token - -You can specify a token to purchase by passing the `tokenAddress` prop. - -```tsx - -``` - -#### Customize the UI - -You can customize the UI of the `BuyWidget` component by passing a custom theme object to the `theme` prop. - -```tsx - -``` - -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 - -``` - -#### Configure the wallet connection - -You can customize the wallet connection flow by passing a `connectOptions` object to the `BuyWidget` component. - -```tsx - -``` - -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; - description?: string; - hiddenWallets?: Array; - image?: string; - locale?: LocaleId; - onCancel?: () => void; - onError?: (error: Error) => void; - onSuccess?: () => void; - paymentLinkId?: string; - presetOptions?: [number, number, number]; - purchaseData?: Record; - style?: React.CSSProperties; - supportedTokens?: SupportedTokens; - theme?: "light" | "dark" | Theme; - title?: string; - tokenAddress?: Address; -}; -``` - -### Returns - -```ts -let returnType: Element; -``` - -## CheckoutWidget - -Widget is a prebuilt UI for making direct payments to a wallet address. - -### Example - -#### Basic usage - -The `CheckoutWidget` component requires `client`, `chain`, `amount`, `tokenAddress`, and `sellerAddress` props to function. - -```tsx -import { base } from "thirdweb/chains"; -import { getDefaultToken } from "thirdweb/utils"; - - -``` - -#### With metadata - -You can add metadata to display product information. - -```tsx - -``` - -```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; - description?: string; - hiddenWallets?: Array; - image?: string; - locale?: LocaleId; - onCancel?: () => void; - onError?: (error: Error) => void; - onSuccess?: () => void; - paymentLinkId?: string; - purchaseData?: Record; - sellerAddress: Address; - style?: React.CSSProperties; - supportedTokens?: SupportedTokens; - theme?: "light" | "dark" | Theme; - title?: string; - tokenAddress: Address; -}; -``` - -### Returns - -```ts -let returnType: Element; -``` - -## TransactionWidget - -Widget is a prebuilt UI for executing a transaction with a different wallet, chain or token. - -### Example - -#### Basic usage - -The `TransactionWidget` component requires `client` and `transaction` props to function. - -```tsx -import { claimTo } from "thirdweb/extensions/erc1155"; - - -``` - -#### With metadata - -You can add metadata to display transaction information. - -```tsx - -``` - -#### ERC20 payments - -You can handle ERC20 payments by passing `erc20value` to your transaction: - -```tsx -import { prepareContractCall } from "thirdweb"; -import { toUnits } from "thirdweb/utils"; - - -``` - -```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; - className?: string; - client: ThirdwebClient; - connectOptions?: TransactionWidgetConnectOptions; - description?: string; - hiddenWallets?: Array; - image?: string; - locale?: LocaleId; - onCancel?: () => void; - onError?: (error: Error) => void; - onSuccess?: () => void; - paymentLinkId?: string; - purchaseData?: Record; - style?: React.CSSProperties; - supportedTokens?: SupportedTokens; - theme?: "light" | "dark" | Theme; - title?: string; - transaction: PreparedTransaction; -}; -``` - -### Returns - ```ts let returnType: Element; ``` @@ -2001,6 +2047,194 @@ let props: MediaRendererProps & RefAttributes; let returnType: ReactNode; ``` --- + +## 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 +; +``` + +#### 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 +; +``` + +#### Direct Payments + +You can set the `mode` option to `"direct_payment"` to allow users to make a direct payment to a wallet address. + +```tsx +; +``` + +#### Transactions + +You can set the `mode` option to `"transaction"` to allow users to execute a transaction with a different wallet, chain or token. + +```tsx +; +``` + +You can also handle ERC20 payments by passing `erc20value` to your transaction: + +```tsx + +``` + +#### Enable/Disable payment methods + +You can disable the use of crypto or fiat by setting the `buyWithCrypto` or `buyWithFiat` options to `false`. + +```tsx +; +``` + +#### Customize the UI + +You can customize the UI of the `PayEmbed` component by passing a custom theme object to the `theme` prop. + +```tsx +; +``` + +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 +; +``` + +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; + locale?: LocaleId; + paymentLinkId?: string; + payOptions?: PayUIOptions; + style?: React.CSSProperties; + supportedTokens?: SupportedTokens; + theme?: "light" | "dark" | Theme; +}; +``` + +### Returns + +```ts +let returnType: Element; +``` +--- **React Hooks** --- # Extensions @@ -2707,11 +2941,32 @@ const onClick = () => { }; ``` +#### 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, - { client: ThirdwebClient; profileToUnlink: Profile }, + { + allowAccountDeletion?: boolean; + client: ThirdwebClient; + profileToUnlink: Profile; + }, unknown >; ``` @@ -2722,7 +2977,11 @@ function useUnlinkProfile(): UseMutationResult< let returnType: UseMutationResult< void, Error, - { client: ThirdwebClient; profileToUnlink: Profile }, + { + allowAccountDeletion?: boolean; + client: ThirdwebClient; + profileToUnlink: Profile; + }, unknown >; ``` @@ -3901,6 +4160,11 @@ const onClick = () => { value: toWei("0.1"), chain: sepolia, client: thirdwebClient, + // Specify a token required for the transaction + erc20Value: { + amountWei: toWei("0.1"), + tokenAddress: "0x...", + }, }); sendTx(transaction); }; @@ -4082,7 +4346,94 @@ let returnType: UseQueryResult, Error>; A React Query result containing the social profiles. --- -# Buy Crypto +# Utils +--- + +## 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 +--- + +## 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; +``` + +### Parameters + +Parameters for fetching routes including client and filter options + +#### Type + +```ts +let params: RoutesTypes.Options & { enabled?: boolean }; +``` + +### Returns + +```ts +let returnType: UseQueryResult; +``` + +React Query result with routes data, loading state, and error handling --- ## useBuyHistory @@ -4524,6 +4875,8 @@ let params: { fromCurrencySymbol: CurrencyMeta["shorthand"]; isTestMode?: boolean; maxSlippageBPS?: number; + onrampChainId?: number; + onrampTokenAddress?: string; paymentLinkId?: string; preferredProvider?: FiatProvider; purchaseData?: object; @@ -4650,49 +5003,6 @@ let returnType: UseQueryResult; 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. --- -# Utils ---- - -## 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. ---- **Core Functions** --- # Extensions @@ -22460,19 +22770,19 @@ let returnType: boolean; A boolean indicating if the `getAllSigners` method is supported. --- -## ERC4337.isIsAccountDeployedSupported +## ERC4337.isIsActiveSignerSupported -Checks if the `getAddress` method is supported by the given contract. +Checks if the `isActiveSigner` method is supported by the given contract. ### Example ```ts -import { isGetAddressSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAddressSupported(["0x..."]); +import { isIsActiveSignerSupported } from "thirdweb/extensions/erc4337"; +const supported = isIsActiveSignerSupported(["0x..."]); ``` ```ts -function isIsAccountDeployedSupported( +function isIsActiveSignerSupported( availableSelectors: Array, ): boolean; ``` @@ -22493,22 +22803,22 @@ let availableSelectors: Array; let returnType: boolean; ``` -A boolean indicating if the `getAddress` method is supported. +A boolean indicating if the `isActiveSigner` method is supported. --- -## ERC4337.isIsActiveSignerSupported +## ERC4337.isIsAdminSupported -Checks if the `isActiveSigner` method is supported by the given contract. +Checks if the `isAdmin` method is supported by the given contract. ### Example ```ts -import { isIsActiveSignerSupported } from "thirdweb/extensions/erc4337"; -const supported = isIsActiveSignerSupported(["0x..."]); +import { isIsAdminSupported } from "thirdweb/extensions/erc4337"; +const supported = isIsAdminSupported(["0x..."]); ``` ```ts -function isIsActiveSignerSupported( +function isIsAdminSupported( availableSelectors: Array, ): boolean; ``` @@ -22529,22 +22839,22 @@ let availableSelectors: Array; let returnType: boolean; ``` -A boolean indicating if the `isActiveSigner` method is supported. +A boolean indicating if the `isAdmin` method is supported. --- -## ERC4337.isIsAdminSupported +## ERC4337.isPredictAccountAddressSupported -Checks if the `isAdmin` method is supported by the given contract. +Checks if the `getAddress` method is supported by the given contract. ### Example ```ts -import { isIsAdminSupported } from "thirdweb/extensions/erc4337"; -const supported = isIsAdminSupported(["0x..."]); +import { isGetAddressSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAddressSupported(["0x..."]); ``` ```ts -function isIsAdminSupported( +function isPredictAccountAddressSupported( availableSelectors: Array, ): boolean; ``` @@ -22565,7 +22875,7 @@ let availableSelectors: Array; let returnType: boolean; ``` -A boolean indicating if the `isAdmin` method is supported. +A boolean indicating if the `getAddress` method is supported. --- ## ERC4337.isRegistered @@ -38022,6 +38332,95 @@ let returnType: { A promise that resolves with the final getCallsStatus result. --- +## ERC7702 +--- + +## ERC7702.createSessionKey + +Creates session key permissions for a specified address. + +### Example + +```ts +import { createSessionKey } from "thirdweb/extensions/7702"; +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, +): PreparedTransaction; +``` + +### Parameters + +The options for the createSessionKey function. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +The transaction object to be sent. +--- + +## 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, +): 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; +``` + +### Returns + +```ts +let returnType: boolean; +``` + +A boolean indicating if the `isAddSessionKeySupported` method is supported. +--- # Modules --- ## BatchMetadataERC1155 @@ -43478,6 +43877,8 @@ const quote = await Bridge.Buy.prepare({ destinationChainId: 10, destinationTokenAddress: NATIVE_TOKEN_ADDRESS, amount: toWei("0.01"), + sender: "0x...", + receiver: "0x...", client: thirdwebClient, }); ``` @@ -43566,6 +43967,8 @@ const quote = await Bridge.Buy.prepare({ 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", @@ -43583,6 +43986,8 @@ const quote = await Bridge.Buy.prepare({ 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, }); @@ -43714,6 +44119,175 @@ let returnType: Promise; A promise that resolves to a non-finalized quote for the requested buy. --- +## Onramp +--- + +## 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; +``` + +### Parameters + +The options for preparing the onramp. + +#### Type + +```ts +let options: Options; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the prepared onramp details, including the link and quote. +--- + +## 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; +``` + +### Parameters + +The options for fetching the onramp status. + +#### Type + +```ts +let options: Options; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the status of the onramp session. +--- ## Sell --- @@ -44127,7 +44701,7 @@ function AccountAvatar( #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -44226,7 +44800,7 @@ function AccountBalance( #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,showBalanceInFiat : "USD" | "CAD" | "GBP" | "EUR" | "JPY" | "AUD" | "NZD",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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryFn" | "queryKey">,radioGroup : string,rel : string,resource : string,results : number,rev : string,role : AriaRole,security : string,showBalanceInFiat : "USD" | "CAD" | "GBP" | "EUR" | "JPY" | "AUD" | "NZD",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 @@ -44300,7 +44874,7 @@ function AccountName(props: AccountNameProps): null | Element; #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -44369,7 +44943,7 @@ function WalletIcon( #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -45998,6 +46572,8 @@ Disconnects an existing profile (authentication method) from the current user. O ### Example +#### Unlinking an authentication method + ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -46014,6 +46590,32 @@ const updatedProfiles = await unlinkProfile({ }); ``` +#### 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>; ``` @@ -47704,7 +48306,7 @@ function ChainIcon(__namedParameters: ChainIconProps): null | Element; #### 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" | "polite" | "assertive",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),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),id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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),id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -47816,7 +48418,7 @@ function ChainName(__namedParameters: ChainNameProps): null | Element; #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise),nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise),nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -48501,7 +49103,8 @@ function getContractEvents(options: { | undefined | { aggregate?: unknown; - chain?: unknown; + chain?: Array; + chain_id?: Array; decode?: null | boolean; filter_block_hash?: string; filter_block_number?: null | number; @@ -48541,9 +49144,9 @@ function getContractEvents(options: { Array<{ address: string; block_hash: string; - block_number: string; - block_timestamp: string; - chain_id: number; + block_number: number; + block_timestamp: number; + chain_id: string; data: string; decoded?: { indexed_params: {}; @@ -48574,7 +49177,8 @@ let options: { | undefined | { aggregate?: unknown; - chain?: unknown; + chain?: Array; + chain_id?: Array; decode?: null | boolean; filter_block_hash?: string; filter_block_number?: null | number; @@ -48620,9 +49224,9 @@ let returnType: Promise< Array<{ address: string; block_hash: string; - block_number: string; - block_timestamp: string; - chain_id: number; + block_number: number; + block_timestamp: number; + chain_id: string; data: string; decoded?: { indexed_params: {}; @@ -50285,7 +50889,8 @@ function getContractEvents(options: { | undefined | { aggregate?: unknown; - chain?: unknown; + chain?: Array; + chain_id?: Array; decode?: null | boolean; filter_block_hash?: string; filter_block_number?: null | number; @@ -50325,9 +50930,9 @@ function getContractEvents(options: { Array<{ address: string; block_hash: string; - block_number: string; - block_timestamp: string; - chain_id: number; + block_number: number; + block_timestamp: number; + chain_id: string; data: string; decoded?: { indexed_params: {}; @@ -50358,7 +50963,8 @@ let options: { | undefined | { aggregate?: unknown; - chain?: unknown; + chain?: Array; + chain_id?: Array; decode?: null | boolean; filter_block_hash?: string; filter_block_number?: null | number; @@ -50404,9 +51010,9 @@ let returnType: Promise< Array<{ address: string; block_hash: string; - block_number: string; - block_timestamp: string; - chain_id: number; + block_number: number; + block_timestamp: number; + chain_id: string; data: string; decoded?: { indexed_params: {}; @@ -50449,10 +51055,12 @@ function getContractNFTs(args: { queryOptions?: Omit< | undefined | { - chain?: unknown; + chain?: Array; + chain_id?: Array; include_owners?: "false" | "true"; limit?: number; page?: null | number; + resolve_metadata_links?: "false" | "true"; }, "chain" >; @@ -50473,10 +51081,12 @@ let args: { queryOptions?: Omit< | undefined | { - chain?: unknown; + chain?: Array; + chain_id?: Array; include_owners?: "false" | "true"; limit?: number; page?: null | number; + resolve_metadata_links?: "false" | "true"; }, "chain" >; @@ -50533,8 +51143,10 @@ function getNFT(args: { contractAddress: string; includeOwners?: boolean; queryOptions?: { - chain?: unknown; + chain?: Array; + chain_id?: Array; include_owners?: "false" | "true"; + resolve_metadata_links?: "false" | "true"; }; tokenId: string | number | bigint; }): Promise; @@ -50551,8 +51163,10 @@ let args: { contractAddress: string; includeOwners?: boolean; queryOptions?: { - chain?: unknown; + chain?: Array; + chain_id?: Array; include_owners?: "false" | "true"; + resolve_metadata_links?: "false" | "true"; }; tokenId: string | number | bigint; }; @@ -50608,10 +51222,12 @@ function getOwnedNFTs(args: { ownerAddress: string; queryOptions?: Omit< { - chain?: unknown; + chain?: Array; + chain_id?: Array; limit?: number; owner_address: string; page?: null | number; + resolve_metadata_links?: "false" | "true"; }, "chain" | "owner_address" >; @@ -50630,10 +51246,12 @@ let args: { ownerAddress: string; queryOptions?: Omit< { - chain?: unknown; + chain?: Array; + chain_id?: Array; limit?: number; owner_address: string; page?: null | number; + resolve_metadata_links?: "false" | "true"; }, "chain" | "owner_address" >; @@ -50687,13 +51305,20 @@ function getOwnedTokens(args: { chains: Array>; client: ThirdwebClient; ownerAddress: string; - queryOptions?: { - chain?: unknown; - include_spam?: "false" | "true"; - limit?: number; - metadata?: "false" | "true"; - page?: null | number; - }; + queryOptions?: Omit< + { + chain?: Array; + chain_id?: Array; + 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>; ``` @@ -50706,13 +51331,20 @@ let args: { chains: Array>; client: ThirdwebClient; ownerAddress: string; - queryOptions?: { - chain?: unknown; - include_spam?: "false" | "true"; - limit?: number; - metadata?: "false" | "true"; - page?: null | number; - }; + queryOptions?: Omit< + { + chain?: Array; + chain_id?: Array; + 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" + >; }; ``` @@ -50753,7 +51385,8 @@ function getTransactions(args: { client: ThirdwebClient; queryOptions?: { aggregate?: unknown; - chain?: unknown; + chain?: Array; + chain_id?: Array; decode?: null | boolean; filter_block_hash?: string; filter_block_number?: null | number; @@ -50798,36 +51431,36 @@ function getTransactions(args: { }): Promise< Array<{ access_list_json?: string; - blob_gas_price?: number; + authorization_list_json?: string; + blob_gas_price?: string; blob_gas_used?: number; block_hash: string; - block_number: string; - block_timestamp: string; - chain_id: number; + block_number: number; + block_timestamp: number; + chain_id: string; contract_address?: string; cumulative_gas_used?: number; data: string; decoded?: { inputs?: {}; name: string; signature: string }; - decodedData?: { inputs?: {}; name: string; signature: string }; - effective_gas_price?: number; + effective_gas_price?: string; from_address: string; function_selector: string; gas: number; - gas_price: number; + gas_price: string; gas_used?: number; hash: string; logs_bloom?: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; nonce: number; - r: number; - s: number; + r: string; + s: string; status?: number; to_address: string; transaction_index: number; transaction_type: number; - v: number; - value: number; + v: string; + value: string; }> >; ``` @@ -50842,7 +51475,8 @@ let args: { client: ThirdwebClient; queryOptions?: { aggregate?: unknown; - chain?: unknown; + chain?: Array; + chain_id?: Array; decode?: null | boolean; filter_block_hash?: string; filter_block_number?: null | number; @@ -50893,36 +51527,36 @@ let args: { let returnType: Promise< Array<{ access_list_json?: string; - blob_gas_price?: number; + authorization_list_json?: string; + blob_gas_price?: string; blob_gas_used?: number; block_hash: string; - block_number: string; - block_timestamp: string; - chain_id: number; + block_number: number; + block_timestamp: number; + chain_id: string; contract_address?: string; cumulative_gas_used?: number; data: string; decoded?: { inputs?: {}; name: string; signature: string }; - decodedData?: { inputs?: {}; name: string; signature: string }; - effective_gas_price?: number; + effective_gas_price?: string; from_address: string; function_selector: string; gas: number; - gas_price: number; + gas_price: string; gas_used?: number; hash: string; logs_bloom?: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; nonce: number; - r: number; - s: number; + r: string; + s: string; status?: number; to_address: string; transaction_index: number; transaction_type: number; - v: number; - value: number; + v: string; + value: string; }> >; ``` @@ -50930,6 +51564,108 @@ let returnType: Promise< # Engine --- +## createServerWallet + +Create a 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. +--- + +## 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. +--- + ## getTransactionStatus Get the execution status of a transaction. @@ -50979,10 +51715,212 @@ let returnType: Prettify< ``` --- +## 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 + | {}; + errorMessage: null | string; + executionParams: + | null + | string + | number + | boolean + | Array + | {}; + executionResult: + | null + | string + | number + | boolean + | Array + | {}; + from: null | string; + id: string; + transactionHash: null | string; + transactionParams: + | null + | string + | number + | boolean + | Array + | {}; + }>; +}>; +``` + +### Parameters + +The arguments for the search. + +#### Type + +```ts +let args: { + client: ThirdwebClient; + filters?: Array; + 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 + | {}; + errorMessage: null | string; + executionParams: + | null + | string + | number + | boolean + | Array + | {}; + executionResult: + | null + | string + | number + | boolean + | Array + | {}; + from: null | string; + id: string; + transactionHash: null | string; + transactionParams: + | null + | string + | number + | boolean + | Array + | {}; + }>; +}>; +``` +--- + ## ServerWallet ```ts type ServerWallet = Account & { + enqueueBatchTransaction: (args: { + transactions: Array; + }) => Promise<{ transactionId: string }>; enqueueTransaction: (args: { simulate?: boolean; transaction: PreparedTransaction; @@ -51961,7 +52899,7 @@ function NFTDescription( #### 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" | "polite" | "assertive",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),descriptionResolver : string | (() => string) | (() => Promise),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),descriptionResolver : string | (() => string) | (() => Promise),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -52161,7 +53099,7 @@ function NFTName(__namedParameters: NFTNameProps): null | Element; #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise),nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise),nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 @@ -52172,37 +53110,76 @@ let returnType: null | Element; A `` element containing the name of the NFT --- -# Buy Crypto +# Tokens --- -## convertCryptoToFiat +## TokenIcon -Get a price of a token (using tokenAddress + chainId) in fiat. Only USD is supported at the moment. +This component tries to resolve the icon of a given token, then return an image. ### 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"; +```tsx +import { TokenProvider, TokenIcon } from "thirdweb/react"; -// Get Ethereum price -const result = convertCryptoToFiat({ - fromTokenAddress: NATIVE_TOKEN_ADDRESS, - to: "USD", - chain: ethereum, - fromAmount: 1, -}); + + +; +``` + +Result: An `` component with the src of the icon + +```html + +``` + +#### 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 +; +``` + +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; +}; -// Result: `{ result: 3404.11 }` +; +``` + +#### Show a loading sign while the icon is being loaded + +```tsx +} />; +``` + +#### Fallback to a dummy image if the token icon fails to resolve + +```tsx +} />; +``` + +#### 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 +; ``` ```ts -function convertCryptoToFiat( - options: ConvertCryptoToFiatParams, -): Promise<{ result: number }>; +function TokenIcon(__namedParameters: TokenIconProps): null | Element; ``` ### Parameters @@ -52210,53 +53187,109 @@ function convertCryptoToFiat( #### Type ```ts -let options: { - chain: Chain; - client: ThirdwebClient; - fromAmount: number; - fromTokenAddress: Address; - to: SupportedFiatCurrency; -}; +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),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),id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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: Promise<{ result: number }>; +let returnType: null | Element; ``` -a number representing the price (in selected fiat) of "x" token, with "x" being the `fromAmount`. +an `` with the src of the token icon --- -## convertFiatToCrypto +## TokenName -Convert a fiat value to a token. Currently only USD is supported. +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 `` component, hence you can style it just like how you would style a normal `` ### Example #### Basic usage -```ts -import { convertFiatToCrypto } from "thirdweb/pay"; +```tsx +import { TokenProvider, TokenName } from "thirdweb/react"; +import { ethereum } from "thirdweb/chains"; -// 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 }` +Result: + +```html +Ether +``` + +#### 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"; +} + +; +``` + +Alternatively you can also pass in a string directly: + +```tsx +; +``` + +#### 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" + + +``` + +Result: + +```html +Ether Token +``` + +#### Show a loading sign when the name is being fetched + +```tsx +import { TokenProvider, TokenName } from "thirdweb/react"; + + + } /> +; +``` + +#### Fallback to something when the name fails to resolve + +```tsx + + +; +``` + +#### 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 +; +``` ```ts -function convertFiatToCrypto( - options: ConvertFiatToCryptoParams, -): Promise<{ result: number }>; +function TokenName(__namedParameters: TokenNameProps): null | Element; ``` ### Parameters @@ -52264,1213 +53297,229 @@ function convertFiatToCrypto( #### Type ```ts -let options: { - chain: Chain; - client: ThirdwebClient; - from: SupportedFiatCurrency; - fromAmount: number; - to: Address; -}; +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise),nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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: Promise<{ result: number }>; +let returnType: null | Element; ``` --- -## getBuyHistory - -Get Buy transaction history for a given wallet address. +## TokenSymbol -This includes both "Buy with Cryto" and "Buy with Fiat" transactions +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 `` component, hence you can style it just like how you would style a normal `` ### Example -```ts -import { createThirdwebClient } from "thirdweb"; -import { getBuyHistory } from "thirdweb/pay"; +#### Basic usage + +```tsx +import { TokenProvider, TokenSymbol } from "thirdweb/react"; +import { ethereum } from "thirdweb/chains"; -const client = createThirdwebClient({ clientId: "..." }); + + +; +``` + +Result: + +```html +ETH +``` + +#### 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"; +} -const history = await getBuyHistory({ - client, - walletAddress: "0x...", -}); +; +``` + +Alternatively, you can pass in a string directly: + +```tsx +; +``` + +#### 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" + + +``` + +Result: + +```html +Ether Token +``` + +#### Show a loading sign when the symbol is being fetched + +```tsx +import { TokenProvider, TokenSymbol } from "thirdweb/react"; + + + } /> +; +``` + +#### Fallback to something when the symbol fails to resolve + +```tsx + + +; +``` + +#### 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 +; ``` ```ts -function getBuyHistory( - params: BuyHistoryParams, -): Promise; +function TokenSymbol( + __namedParameters: TokenSymbolProps, +): null | Element; ``` ### 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; -}; +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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),tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string} ``` ### Returns ```ts -let returnType: { - hasNextPage: boolean; - page: Array< - | { buyWithFiatStatus: BuyWithFiatStatus } - | { buyWithCryptoStatus: BuyWithCryptoStatus } - >; -}; +let returnType: null | Element; ``` --- +# Storage +--- -## getBuyWithCryptoHistory +## download -Deprecated +Downloads a file from the specified IPFS, Arweave, or HTTP URI. -Gets the History of purchases for a given wallet address +`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"; -import { BuyWithCryptoHistoryData } from "thirdweb/pay"; -const client = createThirdwebClient({ clientId: "..." }); -const walletAddress = "0x..."; -const params = { +const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); + +const file = await download({ client, - walletAddress, -}; + uri: "ipfs://Qm...", +}); +``` + +Download a file from Arweave: + +```ts +import { download } from "thirdweb/storage"; +import { createThirdwebClient } from "thirdweb"; -// grabs the history of purchase transactions for the wallet address -const status = await getBuyWithCryptoHistory(params); +const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); + +const file = await download({ + client, + uri: "ar://{arweave-transaction-id}", +}); ``` +Download a file from HTTP: + ```ts -function getBuyWithCryptoHistory( - params: BuyWithCryptoHistoryParams, -): Promise; +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; ``` ### Parameters -Object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams) +The download options. #### Type ```ts -let params: { +let options: { client: ThirdwebClient; - count: number; - start: number; - walletAddress: string; + requestTimeoutMs?: number; + uri: string; }; ``` ### Returns ```ts -let returnType: { - hasNextPage: boolean; - page: Array; -}; +let returnType: Promise; ``` -Object of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData) +Asynchronously returns the network response from fetching the file. --- -## 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. +## resolveArweaveScheme -Once you have the quote, you can use `prepareTransaction` and prepare the transaction for submission. +Resolves the scheme of a given Arweave URI and returns the corresponding URL. ### 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 -}); +import { resolveArweaveScheme } from "thirdweb/storage"; +const url = resolveArweaveScheme({ uri: "ar://" }); ``` ```ts -function getBuyWithCryptoQuote( - params: GetBuyWithCryptoQuoteParams, -): Promise; +function resolveArweaveScheme( + options: ResolveArweaveSchemeOptions, +): string; ``` ### 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?: object; - toAddress: string; - toChainId: number; - toTokenAddress: string; -} & ( - | { fromAmount: string; toAmount?: never } - | { fromAmount?: never; toAmount: string } -); -``` - -### Returns - -```ts -let returnType: { - approvalData?: QuoteApprovalInfo; - client: ThirdwebClient; - paymentTokens: Array; - processingFees: Array; - 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. ---- - -## 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; -``` - -### 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?: object; - quote: BuyWithCryptoQuoteSummary; - source?: PayOnChainTransactionDetails; - status: BuyWithCryptoStatuses; - subStatus: BuyWithCryptoSubStatuses; - swapType: SwapType; - toAddress: string; - }; -``` - -Object of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) ---- - -## 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; -``` - -### 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?: object; - 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 ---- - -## 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; -``` - -### 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; -}; -``` - -Object of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData) ---- - -## getBuyWithFiatQuote - -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; -``` - -### 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; - paymentLinkId?: string; - preferredProvider?: FiatProvider; - purchaseData?: object; - 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. ---- - -## 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; -``` - -### 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?: object; - 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; - }; -``` ---- - -## 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; -``` - -### 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; - processingFees: Array; - 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. ---- - -## 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, -): 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; -``` ---- -# Tokens ---- - -## 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"; - - - -; -``` - -Result: An `` component with the src of the icon - -```html - -``` - -#### 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 -; -``` - -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; -}; - -; -``` - -#### Show a loading sign while the icon is being loaded - -```tsx -} />; -``` - -#### Fallback to a dummy image if the token icon fails to resolve - -```tsx -} />; -``` - -#### 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 -; -``` - -```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" | "polite" | "assertive",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),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),id : string,inert : boolean,inlist : any,inputMode : "search" | "email" | "url" | "text" | "none" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loading : "lazy" | "eager",loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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 `` with the src of the token icon ---- - -## 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 `` component, hence you can style it just like how you would style a normal `` - -### Example - -#### Basic usage - -```tsx -import { TokenProvider, TokenName } from "thirdweb/react"; -import { ethereum } from "thirdweb/chains"; - - - -; -``` - -Result: - -```html -Ether -``` - -#### 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"; -} - -; -``` - -Alternatively you can also pass in a string directly: - -```tsx -; -``` - -#### 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" - - -``` - -Result: - -```html -Ether Token -``` - -#### Show a loading sign when the name is being fetched - -```tsx -import { TokenProvider, TokenName } from "thirdweb/react"; - - - } /> -; -``` - -#### Fallback to something when the name fails to resolve - -```tsx - - -; -``` - -#### 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 -; -``` - -```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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nameResolver : string | (() => string) | (() => Promise),nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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; -``` ---- - -## 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 `` component, hence you can style it just like how you would style a normal `` - -### Example - -#### Basic usage - -```tsx -import { TokenProvider, TokenSymbol } from "thirdweb/react"; -import { ethereum } from "thirdweb/chains"; - - - -; -``` - -Result: - -```html -ETH -``` - -#### 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"; -} - -; -``` - -Alternatively, you can pass in a string directly: - -```tsx -; -``` - -#### 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" - - -``` - -Result: - -```html -Ether Token -``` - -#### Show a loading sign when the symbol is being fetched - -```tsx -import { TokenProvider, TokenSymbol } from "thirdweb/react"; - - - } /> -; -``` - -#### Fallback to something when the symbol fails to resolve - -```tsx - - -; -``` - -#### 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 -; -``` - -```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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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),tabIndex : number,title : string,translate : "yes" | "no",typeof : string,unselectable : "on" | "off",vocab : string} -``` - -### Returns - -```ts -let returnType: null | Element; -``` ---- -# Storage ---- - -## 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; -``` - -### Parameters - -The download options. - -#### Type - -```ts -let options: { - client: ThirdwebClient; - requestTimeoutMs?: number; - uri: string; -}; -``` - -### Returns - -```ts -let returnType: Promise; -``` - -Asynchronously returns the network response from fetching the file. ---- - -## 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://" }); -``` - -```ts -function resolveArweaveScheme( - options: ResolveArweaveSchemeOptions, -): string; -``` - -### Parameters - -The options object containing the Arweave URI +The options object containing the Arweave URI #### Type @@ -55915,186 +55964,703 @@ let returnType: string; The resulting string. --- -## concatHex +## 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. +--- + +## 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, +): FromBytesReturnType; +``` + +### Parameters + +The Uint8Array to convert. + +#### Type + +```ts +let bytes: Uint8Array; +``` + +The target type or conversion options. + +#### Type + +```ts +let toOrOpts: FromBytesParameters; +``` + +### Returns + +```ts +let returnType: FromBytesReturnType; +``` + +The converted value of the specified type. +--- + +## 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. +--- + +## 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, +): FromHexReturnType; +``` + +### Parameters + +The hexadecimal string to convert. + +#### Type + +```ts +let hex: `0x${string}`; +``` + +The target type or conversion options. + +#### Type + +```ts +let toOrOpts: FromHexParameters; +``` + +### Returns + +```ts +let returnType: FromHexReturnType; +``` + +The converted value of the specified type. +--- + +## 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. +--- + +## 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; +``` + +### Parameters + +#### Type + +```ts +let options: { + chain: Chain; + client: ThirdwebClient; + percentMultiplier?: number; +}; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the gas price as a bigint. +--- + +## 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. +--- + +## 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. +--- + +## 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. +--- + +## 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. +--- + +## 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. +--- + +## 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. +--- + +## isAddress + +Checks if a given string is a valid address. + +### Example -Concatenates an array of hexadecimal values into a single hexadecimal value. +```ts +import { isAddress } from "thirdweb/utils"; + +isAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); +//=> true +``` ```ts -function concatHex(values: readonly Array<`0x${string}`>) : `0x${string}` +function isAddress(address: string): address is `0x${string}`; ``` ### Parameters -An array of hexadecimal values to concatenate. +The address to check. #### Type ```ts -let values: readonly Array<`0x${string}`> +let address: string; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: address is (`0x${string}`) ``` -The concatenated hexadecimal value. +True if the address is valid, false otherwise. --- -## fromBytes +## isHex -Converts a Uint8Array to the specified type. +Checks if a value is a valid hexadecimal string. ### Example ```ts -import { fromBytes } from "thirdweb/utils"; -const bytes = new Uint8Array([1, 164]); -const number = fromBytes(bytes, "number"); -console.log(number); // 420 +import { isHex } from "thirdweb/utils"; +const result = isHex("0x1a4"); +console.log(result); // true ``` ```ts -function fromBytes( - bytes: Uint8Array, - toOrOpts: FromBytesParameters, -): FromBytesReturnType; +function isHex( + value: unknown, + options: Options, +): value is `0x${string}`; ``` ### Parameters -The Uint8Array to convert. +The value to be checked. #### Type ```ts -let bytes: Uint8Array; +let value: unknown; ``` -The target type or conversion options. +Optional configuration for the validation. #### Type ```ts -let toOrOpts: FromBytesParameters; +let options: Options; ``` ### Returns ```ts -let returnType: FromBytesReturnType; +let returnType: value is (`0x${string}`) ``` -The converted value of the specified type. +True if the value is a valid hexadecimal string, false otherwise. --- -## fromGwei +## keccak256 -Converts the specified number from gwei to wei. +Calculates the Keccak-256 hash of the given value. ### Example ```ts -import { fromGwei } from "thirdweb/utils"; -fromGwei("1"); -// 1000000000n +import { keccak256 } from "thirdweb/utils"; +const hash = keccak256("0x1234"); ``` ```ts -function fromGwei(gwei: string): bigint; +function keccak256( + value: `0x${string}` | Uint8Array, + to?: TTo, +): Keccak256Hash; ``` ### Parameters -The number of gwei to convert. +The value to hash, either as a hexadecimal string or a Uint8Array. #### Type ```ts -let gwei: string; +let value: `0x${string}` | Uint8Array; +``` + +The desired output format of the hash (optional). Defaults to 'hex'. + +#### Type + +```ts +let to: TTo; ``` ### Returns ```ts -let returnType: bigint; +let returnType: Keccak256Hash; ``` -The converted value in wei. +The Keccak-256 hash of the value in the specified format. --- -## fromHex +## numberToBytes -Converts a hexadecimal string to the specified type. +Converts a number to bytes. ### Example ```ts -import { fromHex } from "thirdweb/utils"; -const string = fromHex("0x48656c6c6f2c20776f726c6421", "string"); -console.log(string); // "Hello, world!" +import { numberToBytes } from "thirdweb/utils"; +const bytes = numberToBytes(420); +console.log(bytes); // Uint8Array(2) [ 1, 164 ] ``` ```ts -function fromHex( - hex: `0x${string}`, - toOrOpts: FromHexParameters, -): FromHexReturnType; +function numberToBytes( + value: number | bigint, + opts?: Options, +): Uint8Array; ``` ### Parameters -The hexadecimal string to convert. +The number to convert. #### Type ```ts -let hex: `0x${string}`; +let value: number | bigint; ``` -The target type or conversion options. +Options for converting the number to hex. #### Type ```ts -let toOrOpts: FromHexParameters; +let opts: Options; ``` ### Returns ```ts -let returnType: FromHexReturnType; +let returnType: Uint8Array; ``` -The converted value of the specified type. +The bytes representation of the number. --- -## getAddress +## numberToHex -Retrieves the address after performing validation and checksumming. +Converts a number or bigint to a hexadecimal string. ### Example ```ts -import { getAddress } from "thirdweb/utils"; - -getAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); -//=> '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed' +import { numberToHex } from "thirdweb/utils"; +const hex = numberToHex(420); +console.log(hex); // "0x1a4" ``` ```ts -function getAddress(address: string): `0x${string}`; +function numberToHex( + value_: number | bigint, + opts: Options, +): `0x${string}`; ``` ### Parameters -The address to be validated and checksummed. +The number or bigint value to convert. #### Type ```ts -let address: string; +let value_: number | bigint; +``` + +Optional configuration options. + +#### Type + +```ts +let opts: Options; ``` ### Returns @@ -56103,159 +56669,173 @@ let address: string; let returnType: `0x${string}`; ``` -The validated and checksummed address. +The hexadecimal representation of the input value. --- -## getGasPrice +## padHex -Retrieves the gas price for a transaction on a specific chain. +Pads a hexadecimal string with zeros to a specified size. ### Example ```ts -import { getGasPrice } from "thirdweb"; - -const gasPrice = await getGasPrice({ client, chain }); +import { padHex } from "thirdweb/utils"; +const paddedHex = padHex("0x1a4", { size: 32 }); +console.log(paddedHex); // "0x000000000000000000000000000001a4" ``` ```ts -function getGasPrice(options: GetGasPriceOptions): Promise; +function padHex( + hex_: `0x${string}`, + options: PadOptions, +): `0x${string}`; ``` ### Parameters +The hexadecimal string to pad. + #### Type ```ts -let options: { - chain: Chain; - client: ThirdwebClient; - percentMultiplier?: number; -}; +let hex_: `0x${string}`; +``` + +The padding options. + +#### Type + +```ts +let options: PadOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: `0x${string}`; ``` -A promise that resolves to the gas price as a bigint. +The padded hexadecimal string. --- -## hexToBigInt +## sha256 -Converts a hexadecimal string to a BigInt. +Calculates the SHA256 hash of the given value. ### Example ```ts -import { hexToBigInt } from "thirdweb/utils"; -const bigInt = hexToBigInt("0x1a4"); -console.log(bigInt); // 420n +import { sha256 } from "thirdweb/utils"; +const hash = sha256("0x1234"); ``` ```ts -function hexToBigInt(hex: `0x${string}`, opts: Options): bigint; +function sha256( + value: `0x${string}` | Uint8Array, + to?: TTo, +): Sha256Hash; ``` ### Parameters -The hexadecimal string to convert. +The value to hash. It can be either a hexadecimal string or a Uint8Array. #### Type ```ts -let hex: `0x${string}`; +let value: `0x${string}` | Uint8Array; ``` -Optional parameters for the conversion. +(Optional) The desired output format of the hash. Defaults to 'hex'. #### Type ```ts -let opts: Options; +let to: TTo; ``` ### Returns ```ts -let returnType: bigint; +let returnType: Sha256Hash; ``` -The BigInt representation of the hexadecimal string. +The SHA256 hash of the value in the specified format. --- -## hexToBool +## stringToBytes -Converts a hexadecimal string to a boolean value. +Converts a string to an array of bytes. ### Example ```ts -import { hexToBool } from "thirdweb/utils"; -const bool = hexToBool("0x01"); -console.log(bool); // true +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 hexToBool(hex: `0x${string}`, opts: Options): boolean; +function stringToBytes( + value: string, + opts: StringToBytesOpts, +): Uint8Array; ``` ### Parameters -The hexadecimal string to convert. +The string to convert. #### Type ```ts -let hex: `0x${string}`; +let value: string; ``` -Optional options for the conversion. +Optional parameters for the conversion. #### Type ```ts -let opts: Options; +let opts: { size?: number }; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Uint8Array; ``` -The boolean value corresponding to the hexadecimal string. +The array of bytes representing the string. --- -## hexToBytes +## stringToHex -Converts a hexadecimal string to a Uint8Array of bytes. +Converts a string to its hexadecimal representation. ### Example ```ts -import { hexToBytes } from "thirdweb/utils"; -const bytes = hexToBytes("0x1a4"); -console.log(bytes); // Uint8Array(2) [ 1, 164 ] +import { stringToHex } from "thirdweb/utils"; +const hex = stringToHex("Hello, world!"); +console.log(hex); // "0x48656c6c6f2c20776f726c6421" ``` ```ts -function hexToBytes(hex_: `0x${string}`, opts: Options): Uint8Array; +function stringToHex(value_: string, opts: Options): `0x${string}`; ``` ### Parameters -The hexadecimal string to convert. +The string to convert to hexadecimal. #### Type ```ts -let hex_: `0x${string}`; +let value_: string; ``` -Options for converting the hexadecimal string. +Options for the conversion. #### Type @@ -56266,87 +56846,82 @@ let opts: Options; ### Returns ```ts -let returnType: Uint8Array; +let returnType: `0x${string}`; ``` -The Uint8Array of bytes. +The hexadecimal representation of the input string. --- -## hexToNumber +## toBytes -Converts a hexadecimal string to a number. +Converts a value to an array of bytes. ### Example ```ts -import { hexToNumber } from "thirdweb/utils"; -const number = hexToNumber("0x1a4"); -console.log(number); // 420 +import { toBytes } from "thirdweb/utils"; +const bytes = toBytes("0x1a4"); +console.log(bytes); // Uint8Array(2) [ 1, 164 ] ``` ```ts -function hexToNumber(hex: `0x${string}`, opts: Options): number; +function toBytes( + value: string | number | bigint | boolean, + opts: ToBytesParameters, +): Uint8Array; ``` ### Parameters -The hexadecimal string to convert. +The value to convert. #### Type ```ts -let hex: `0x${string}`; +let value: string | number | bigint | boolean; ``` -Optional options for the conversion. +Optional parameters for the conversion. #### Type ```ts -let opts: Options; +let opts: { size?: number }; ``` ### Returns ```ts -let returnType: number; +let returnType: Uint8Array; ``` -The converted number. +The array of bytes representing the value. --- -## hexToString +## toEther -Converts a hexadecimal string to a UTF-8 string. +Converts a value from wei to ether. ### Example ```ts -import { hexToString } from "thirdweb/utils"; -const string = hexToString("0x48656c6c6f2c20776f726c6421"); -console.log(string); // "Hello, world!" +import { toEther } from "thirdweb/utils"; +toEther(1000000000000000000n); +// '1' ``` ```ts -function hexToString(hex: `0x${string}`, opts: Options): string; +function toEther(wei: bigint): string; ``` ### Parameters -The hexadecimal string to convert. - -#### Type - -```ts -let hex: `0x${string}`; -``` - -The options for the conversion. +The value in wei to be converted. #### Type ```ts -let opts: Options; +let wei: bigint; ``` ### Returns @@ -56355,212 +56930,220 @@ let opts: Options; let returnType: string; ``` -The UTF-8 string representation of the hexadecimal string. +The converted value in ether. --- -## hexToUint8Array +## toHex -Converts a hexadecimal string to a Uint8Array. +Converts a value to its hexadecimal representation. ### 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]) +import { toHex } from "thirdweb/utils"; +const hex = toHex(420); +console.log(hex); // "0x1a4" ``` ```ts -function hexToUint8Array( - hex: `0x${string}`, - opts: Options, -): Uint8Array; +function toHex( + value: + | string + | number + | bigint + | boolean + | Uint8Array, + opts: ToHexParameters, +): `0x${string}`; ``` ### Parameters -The hexadecimal string to convert. +The value to convert to hexadecimal. #### Type ```ts -let hex: `0x${string}`; +let value: + | string + | number + | bigint + | boolean + | Uint8Array; ``` -Options for the conversion. +Optional parameters for the conversion. #### Type ```ts -let opts: Options; +let opts: { size?: number }; ``` ### Returns ```ts -let returnType: Uint8Array; +let returnType: `0x${string}`; ``` -The Uint8Array representation of the hexadecimal string. +The hexadecimal representation of the value. --- -## isAddress +## toTokens -Checks if a given string is a valid address. +Converts a given number of units to a string representation with a specified number of decimal places. ### Example ```ts -import { isAddress } from "thirdweb/utils"; - -isAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); -//=> true +import { toTokens } from "thirdweb/utils"; +toTokens(1000000000000000000n, 18); +// '1' ``` ```ts -function isAddress(address: string): address is `0x${string}`; +function toTokens(units: bigint, decimals: number): string; ``` ### Parameters -The address to check. +The number of units to convert. #### Type ```ts -let address: string; +let units: bigint; +``` + +The number of decimal places to include in the string representation. + +#### Type + +```ts +let decimals: number; ``` ### Returns ```ts -let returnType: address is (`0x${string}`) +let returnType: string; ``` -True if the address is valid, false otherwise. +The string representation of the converted units. --- -## isHex +## toUnits -Checks if a value is a valid hexadecimal string. +Converts a string representation of a number with decimal places to a BigInt representation. ### Example ```ts -import { isHex } from "thirdweb/utils"; -const result = isHex("0x1a4"); -console.log(result); // true +import { toUnits } from "thirdweb/utils"; +toUnits("1", 18); +// 1000000000000000000n ``` ```ts -function isHex( - value: unknown, - options: Options, -): value is `0x${string}`; +function toUnits(tokens: string, decimals: number): bigint; ``` ### Parameters -The value to be checked. +The string representation of the number, including the integer and fraction parts. #### Type ```ts -let value: unknown; +let tokens: string; ``` -Optional configuration for the validation. +The number of decimal places to include in the BigInt representation. #### Type ```ts -let options: Options; +let decimals: number; ``` ### Returns ```ts -let returnType: value is (`0x${string}`) +let returnType: bigint; ``` -True if the value is a valid hexadecimal string, false otherwise. +The BigInt representation of the number. --- -## keccak256 +## toWei -Calculates the Keccak-256 hash of the given value. +Converts the specified number of tokens to Wei. ### Example ```ts -import { keccak256 } from "thirdweb/utils"; -const hash = keccak256("0x1234"); +import { toWei } from "thirdweb/utils"; +toWei("1"); +// 1000000000000000000n ``` ```ts -function keccak256( - value: `0x${string}` | Uint8Array, - to?: TTo, -): Keccak256Hash; +function toWei(tokens: string): bigint; ``` ### Parameters -The value to hash, either as a hexadecimal string or a Uint8Array. - -#### Type - -```ts -let value: `0x${string}` | Uint8Array; -``` - -The desired output format of the hash (optional). Defaults to 'hex'. +The number of tokens to convert. #### Type ```ts -let to: TTo; +let tokens: string; ``` ### Returns ```ts -let returnType: Keccak256Hash; +let returnType: bigint; ``` -The Keccak-256 hash of the value in the specified format. +The converted value in Wei. --- -## numberToBytes +## uint8ArrayToHex -Converts a number to bytes. +Converts an array of bytes to a hexadecimal string. ### Example ```ts -import { numberToBytes } from "thirdweb/utils"; -const bytes = numberToBytes(420); -console.log(bytes); // Uint8Array(2) [ 1, 164 ] +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 numberToBytes( - value: number | bigint, - opts?: Options, -): Uint8Array; +function uint8ArrayToHex( + value: Uint8Array, + opts: Options, +): `0x${string}`; ``` ### Parameters -The number to convert. +The array of bytes to convert. #### Type ```ts -let value: number | bigint; +let value: Uint8Array; ``` -Options for converting the number to hex. +Optional parameters for the conversion. #### Type @@ -56571,227 +57154,268 @@ let opts: Options; ### Returns ```ts -let returnType: Uint8Array; +let returnType: `0x${string}`; ``` -The bytes representation of the number. +The hexadecimal string representation of the bytes. --- -## numberToHex +## checksumAddress -Converts a number or bigint to a hexadecimal string. +Calculates the checksum address for the given address. ### Example ```ts -import { numberToHex } from "thirdweb/utils"; -const hex = numberToHex(420); -console.log(hex); // "0x1a4" +import { checksumAddress } from "thirdweb/utils"; + +checksumAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); +//=> '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed' ``` ```ts -function numberToHex( - value_: number | bigint, - opts: Options, -): `0x${string}`; +function checksumAddress(address: string): `0x${string}`; ``` ### Parameters -The number or bigint value to convert. +The address to calculate the checksum for. #### Type ```ts -let value_: number | bigint; +let address: string; +``` + +### Returns + +```ts +let returnType: `0x${string}`; +``` + +The checksum address. +--- + +## 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; ``` -Optional configuration options. +### Parameters + +The options for computing the deployment address. #### Type ```ts -let opts: Options; +let options: ComputeDeploymentAddressOptions; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: string; ``` -The hexadecimal representation of the input value. +The computed deployment address. --- -## padHex +## decodeError -Pads a hexadecimal string with zeros to a specified size. +Decodes an error. ### Example ```ts -import { padHex } from "thirdweb/utils"; -const paddedHex = padHex("0x1a4", { size: 32 }); -console.log(paddedHex); // "0x000000000000000000000000000001a4" +import { decodeError } from "thirdweb/utils"; + +const data = "0x..."; +const error = await decodeError({ contract, data }); ``` ```ts -function padHex( - hex_: `0x${string}`, - options: PadOptions, -): `0x${string}`; +function decodeError(options: { + contract: Readonly>; + data: `0x${string}`; +}): Promise; ``` ### Parameters -The hexadecimal string to pad. - -#### Type - -```ts -let hex_: `0x${string}`; -``` - -The padding options. +The options object. #### Type ```ts -let options: PadOptions; +let options: { + contract: Readonly>; + data: `0x${string}`; +}; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: Promise; ``` -The padded hexadecimal string. +The decoded error. --- -## sha256 +## decodeFunctionData -Calculates the SHA256 hash of the given value. +Decodes the data of a function call. ### Example ```ts -import { sha256 } from "thirdweb/utils"; -const hash = sha256("0x1234"); +import { decodeFunctionData } from "thirdweb/utils"; + +const data = "0x..."; +const decodedData = await decodeFunctionData({ contract, data }); ``` ```ts -function sha256( - value: `0x${string}` | Uint8Array, - to?: TTo, -): Sha256Hash; +function decodeFunctionData(options: { + contract: Readonly>; + data: `0x${string}`; +}): Promise< + ReturnType, undefined, AbiFunction>> +>; ``` ### Parameters -The value to hash. It can be either a hexadecimal string or a Uint8Array. - -#### Type - -```ts -let value: `0x${string}` | Uint8Array; -``` - -(Optional) The desired output format of the hash. Defaults to 'hex'. +The options object. #### Type ```ts -let to: TTo; +let options: { + contract: Readonly>; + data: `0x${string}`; +}; ``` ### Returns ```ts -let returnType: Sha256Hash; +let returnType: Promise< + ReturnType, undefined, AbiFunction>> +>; ``` -The SHA256 hash of the value in the specified format. +The decoded data. --- -## stringToBytes +## decodeFunctionResult -Converts a string to an array of bytes. +Decodes the result of a function call. ### 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 ] +import { decodeFunctionResult } from "thirdweb/utils"; + +const data = "0x..."; +const result = await decodeFunctionResult({ contract, data }); ``` ```ts -function stringToBytes( - value: string, - opts: StringToBytesOpts, -): Uint8Array; +function decodeFunctionResult(options: { + contract: Readonly>; + data: `0x${string}`; +}): Promise< + ReturnType< + ReturnType, undefined, AbiFunction>, + "Array" + > +>; ``` ### Parameters -The string to convert. - -#### Type - -```ts -let value: string; -``` - -Optional parameters for the conversion. +The options object. #### Type ```ts -let opts: { size?: number }; +let options: { + contract: Readonly>; + data: `0x${string}`; +}; ``` ### Returns ```ts -let returnType: Uint8Array; +let returnType: Promise< + ReturnType< + ReturnType, undefined, AbiFunction>, + "Array" + > +>; ``` -The array of bytes representing the string. +The decoded result. --- -## stringToHex +## encodeAbiParameters -Converts a string to its hexadecimal representation. +Encodes the given ABI parameters and values into a hexadecimal string. ### Example ```ts -import { stringToHex } from "thirdweb/utils"; -const hex = stringToHex("Hello, world!"); -console.log(hex); // "0x48656c6c6f2c20776f726c6421" +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 stringToHex(value_: string, opts: Options): `0x${string}`; +function encodeAbiParameters(params: TParams, values: TParams extends readonly Array ? {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType[key], AbiParameterKind>}[key]} : never) : `0x${string}` ``` ### Parameters -The string to convert to hexadecimal. +The ABI parameters. #### Type ```ts -let value_: string; +let params: TParams; ``` -Options for the conversion. +The corresponding values for the ABI parameters. #### Type ```ts -let opts: Options; +let values: TParams extends readonly Array ? {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType[key], AbiParameterKind>}[key]} : never ``` ### Returns @@ -56800,306 +57424,301 @@ let opts: Options; let returnType: `0x${string}`; ``` -The hexadecimal representation of the input string. +* The encoded ABI parameters as a hexadecimal string. --- -## toBytes +## ensureBytecodePrefix -Converts a value to an array of bytes. +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 { toBytes } from "thirdweb/utils"; -const bytes = toBytes("0x1a4"); -console.log(bytes); // Uint8Array(2) [ 1, 164 ] +import { ensureBytecodePrefix } from "thirdweb/utils/bytecode/prefix"; +const bytecode = + "363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"; +const prefixedBytecode = ensureBytecodePrefix(bytecode); +console.log(prefixedBytecode); ``` ```ts -function toBytes( - value: string | number | bigint | boolean, - opts: ToBytesParameters, -): Uint8Array; +function ensureBytecodePrefix(bytecode: string): `0x${string}`; ``` ### Parameters -The value to convert. - -#### Type - -```ts -let value: string | number | bigint | boolean; -``` - -Optional parameters for the conversion. +The bytecode to ensure the prefix for. #### Type ```ts -let opts: { size?: number }; +let bytecode: string; ``` ### Returns ```ts -let returnType: Uint8Array; +let returnType: `0x${string}`; ``` -The array of bytes representing the value. +The bytecode with the correct prefix. --- -## toEther +## extractIPFSUri -Converts a value from wei to ether. +Extracts the IPFS URI from the given bytecode. ### Example ```ts -import { toEther } from "thirdweb/utils"; -toEther(1000000000000000000n); -// '1' +import { extractIPFSUri } from "thirdweb/utils/bytecode/extractIPFS"; +const bytecode = + "0x363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"; +const ipfsHash = extractIPFSUri(bytecode); +console.log(ipfsHash); ``` ```ts -function toEther(wei: bigint): string; +function extractIPFSUri(bytecode: string): undefined | string; ``` ### Parameters -The value in wei to be converted. +The bytecode to extract the IPFS URI from. #### Type ```ts -let wei: bigint; +let bytecode: string; ``` ### Returns ```ts -let returnType: string; +let returnType: undefined | string; ``` -The converted value in ether. +The IPFS URI if found, otherwise undefined. --- -## toHex +## extractMinimalProxyImplementationAddress -Converts a value to its hexadecimal representation. +Extracts the implementation address from a given bytecode string if it matches any of the known minimal proxy patterns. ### Example ```ts -import { toHex } from "thirdweb/utils"; -const hex = toHex(420); -console.log(hex); // "0x1a4" +import { extractMinimalProxyImplementationAddress } from "thirdweb/utils"; +const bytecode = "0x363d3d373d3d3d363d73..."; +const implementationAddress = + extractMinimalProxyImplementationAddress(bytecode); ``` ```ts -function toHex( - value: - | string - | number - | bigint - | boolean - | Uint8Array, - opts: ToHexParameters, -): `0x${string}`; +function extractMinimalProxyImplementationAddress( + bytecode: string, +): undefined | string; ``` ### Parameters -The value to convert to hexadecimal. - -#### Type - -```ts -let value: - | string - | number - | bigint - | boolean - | Uint8Array; -``` - -Optional parameters for the conversion. +The bytecode string to extract the implementation address from. #### Type ```ts -let opts: { size?: number }; +let bytecode: string; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: undefined | string; ``` -The hexadecimal representation of the value. +The implementation address as a string if a match is found, otherwise undefined. --- -## toTokens +## formatNumber -Converts a given number of units to a string representation with a specified number of decimal places. +Round up a number to a certain decimal place ### Example ```ts -import { toTokens } from "thirdweb/utils"; -toTokens(1000000000000000000n, 18); -// '1' +import { formatNumber } from "thirdweb/utils"; +const value = formatNumber(12.1214141, 1); // 12.1 ``` ```ts -function toTokens(units: bigint, decimals: number): string; +function formatNumber(value: number, decimalPlaces: number): number; ``` ### Parameters -The number of units to convert. - #### Type ```ts -let units: bigint; +let value: number; ``` -The number of decimal places to include in the string representation. - #### Type ```ts -let decimals: number; +let decimalPlaces: number; ``` ### Returns ```ts -let returnType: string; +let returnType: number; ``` - -The string representation of the converted units. --- -## toUnits +## getClaimParams -Converts a string representation of a number with decimal places to a BigInt representation. +Get the claim parameters for a given drop ### Example ```ts -import { toUnits } from "thirdweb/utils"; -toUnits("1", 18); -// 1000000000000000000n +import { getClaimParams } from "thirdweb/utils"; + +const claimParams = await getClaimParams({ + contract, + to: "0x...", + quantity: 1n, + type: "erc1155", + tokenId: 0n, +}); ``` ```ts -function toUnits(tokens: string, decimals: number): bigint; +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 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. +The options for getting the claim parameters #### Type ```ts -let decimals: number; +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: bigint; +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 BigInt representation of the number. +The claim parameters --- -## toWei +## getInitBytecodeWithSalt -Converts the specified number of tokens to Wei. +Generates the initialization bytecode with salt for a contract deployment. ### Example ```ts -import { toWei } from "thirdweb/utils"; -toWei("1"); -// 1000000000000000000n +import { getInitBytecodeWithSalt } from "thirdweb/utils"; +const initBytecodeWithSalt = getInitBytecodeWithSalt({ + bytecode, + encodedArgs, + salt, +}); ``` ```ts -function toWei(tokens: string): bigint; +function getInitBytecodeWithSalt( + options: GetInitiBytecodeWithSaltOptions, +): `0x${string}`; ``` ### Parameters -The number of tokens to convert. +The options for generating the initialization bytecode. #### Type ```ts -let tokens: string; +let options: GetInitiBytecodeWithSaltOptions; ``` ### Returns ```ts -let returnType: bigint; +let returnType: `0x${string}`; ``` -The converted value in Wei. +The initialization bytecode with salt. --- -## uint8ArrayToHex +## getSaltHash -Converts an array of bytes to a hexadecimal string. +Calculates the salt hash for a given bytecode. ### 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" +import { getSaltHash } from "thirdweb"; +const saltHash = getSaltHash(bytecode); ``` ```ts -function uint8ArrayToHex( - value: Uint8Array, - opts: Options, -): `0x${string}`; +function getSaltHash(bytecode: string): `0x${string}`; ``` ### Parameters -The array of bytes to convert. - -#### Type - -```ts -let value: Uint8Array; -``` - -Optional parameters for the conversion. +The bytecode to calculate the salt hash for. #### Type ```ts -let opts: Options; +let bytecode: string; ``` ### Returns @@ -57108,568 +57727,561 @@ let opts: Options; let returnType: `0x${string}`; ``` -The hexadecimal string representation of the bytes. +The salt hash of the bytecode. --- -## checksumAddress +## hashMessage -Calculates the checksum address for the given address. +Ethereum Signed Message hashing ### Example ```ts -import { checksumAddress } from "thirdweb/utils"; - -checksumAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); -//=> '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed' +import { hashMessage } from "thirdweb/utils"; +const hash = hashMessage("hello world"); ``` ```ts -function checksumAddress(address: string): `0x${string}`; +function hashMessage( + message: SignableMessage, + to_?: TTo, +): HashMessage; ``` ### Parameters -The address to calculate the checksum for. +The message to hash, either as a string, a Uint8Array, or an object with a `raw` property containing a Uint8Array. #### Type ```ts -let address: string; +let message: SignableMessage; +``` + +The desired output format of the hash (optional). Defaults to 'hex'. + +#### Type + +```ts +let to_: TTo; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: HashMessage; ``` -The checksum address. +The Ethereum Signed Message hash of the message in the specified format. --- -## computeDeploymentAddress +## isEIP155Enforced -Computes the deployment address for a contract based on the given options. +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 { computeDeploymentAddress } from "thirdweb/utils"; -const deploymentAddress = computeDeploymentAddress({ - bytecode, - encodedArgs, - create2FactoryAddress, - salt, -}); +import { isEIP155Enforced } from "thirdweb/utils"; +const isEIP155 = await isEIP155Enforced({ chain, client }); ``` ```ts -function computeDeploymentAddress( - options: ComputeDeploymentAddressOptions, -): string; +function isEIP155Enforced( + options: IsEIP155EnforcedOptions, +): Promise; ``` ### Parameters -The options for computing the deployment address. +The options for checking EIP-155 enforcement. #### Type ```ts -let options: ComputeDeploymentAddressOptions; +let options: IsEIP155EnforcedOptions; ``` ### Returns ```ts -let returnType: string; +let returnType: Promise; ``` -The computed deployment address. +A promise that resolves to a boolean indicating whether EIP-155 is enforced. --- -## decodeError +## keccakId -Decodes an error. +Calculates the keccak ID of the given input. ### Example ```ts -import { decodeError } from "thirdweb/utils"; - -const data = "0x..."; -const error = await decodeError({ contract, data }); +import { keccackId } from "thirdweb/utils"; +const keccakId = keccackId(input); ``` ```ts -function decodeError(options: { - contract: Readonly>; - data: `0x${string}`; -}): Promise; +function keccakId(input: string): `0x${string}`; ``` ### Parameters -The options object. +The input value to calculate the keccak ID for. #### Type ```ts -let options: { - contract: Readonly>; - data: `0x${string}`; -}; +let input: string; ``` ### Returns ```ts -let returnType: Promise; +let returnType: `0x${string}`; ``` -The decoded error. +The keccak ID as a Hex string. --- -## decodeFunctionData +## max -Decodes the data of a function call. +Returns the maximum of two BigInt values. ### Example -```ts -import { decodeFunctionData } from "thirdweb/utils"; - -const data = "0x..."; -const decodedData = await decodeFunctionData({ contract, data }); +```ts +max(1n, 2n); +// 2n ``` ```ts -function decodeFunctionData(options: { - contract: Readonly>; - data: `0x${string}`; -}): Promise< - ReturnType, undefined, AbiFunction>> ->; +function max(a: bigint, b: bigint): bigint; ``` ### Parameters -The options object. +The first BigInt value. #### Type ```ts -let options: { - contract: Readonly>; - data: `0x${string}`; -}; +let a: bigint; +``` + +The second BigInt value. + +#### Type + +```ts +let b: bigint; ``` ### Returns ```ts -let returnType: Promise< - ReturnType, undefined, AbiFunction>> ->; +let returnType: bigint; ``` -The decoded data. +The larger of the two BigInt values. --- -## decodeFunctionResult +## min -Decodes the result of a function call. +Returns the minimum of two BigInt values. ### Example ```ts -import { decodeFunctionResult } from "thirdweb/utils"; - -const data = "0x..."; -const result = await decodeFunctionResult({ contract, data }); +min(1n, 2n); +// 1n ``` ```ts -function decodeFunctionResult(options: { - contract: Readonly>; - data: `0x${string}`; -}): Promise< - ReturnType< - ReturnType, undefined, AbiFunction>, - "Array" - > ->; +function min(a: bigint, b: bigint): bigint; ``` ### Parameters -The options object. +The first BigInt value. #### Type ```ts -let options: { - contract: Readonly>; - data: `0x${string}`; -}; +let a: bigint; +``` + +The second BigInt value. + +#### Type + +```ts +let b: bigint; ``` ### Returns ```ts -let returnType: Promise< - ReturnType< - ReturnType, undefined, AbiFunction>, - "Array" - > ->; +let returnType: bigint; ``` -The decoded result. +The smaller of the two BigInt values. --- -## encodeAbiParameters +## parseAbiParams -Encodes the given ABI parameters and values into a hexadecimal string. +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 { encodeAbiParameters } from "viem"; +import { parseAbiParams } from "thirdweb/utils"; -const params = [ - { name: "param1", type: "uint256" }, - { name: "param2", type: "string" }, -]; -const values = [123, "hello"]; +const example1 = parseAbiParams( + ["address", "uint256"], + ["0x.....", "1200000"], +); // result: ["0x......", 1200000n] -const data = encodeAbiParameters(params, values); -console.log(data); +const example2 = parseAbiParams( + ["address", "bool"], + ["0x.....", "true"], +); // result: ["0x......", true] ``` ```ts -function encodeAbiParameters(params: TParams, values: TParams extends readonly Array ? {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType[key], AbiParameterKind>}[key]} : never) : `0x${string}` +function parseAbiParams( + constructorParamTypes: Array, + constructorParamValues: Array, +): Array; ``` ### Parameters -The ABI 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 params: TParams; +let constructorParamTypes: Array; ``` -The corresponding values for the ABI parameters. +An array of values to be converted according to the types. #### Type ```ts -let values: TParams extends readonly Array ? {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType[key], AbiParameterKind>}[key]} : never +let constructorParamValues: Array; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: Array; ``` -* The encoded ABI parameters as a hexadecimal string. +* An array of values converted to their respective types. --- -## ensureBytecodePrefix +## resolveSignature -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. +Resolves a signature by converting a hexadecimal string into a function or event signature. ### Example ```ts -import { ensureBytecodePrefix } from "thirdweb/utils/bytecode/prefix"; -const bytecode = - "363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"; -const prefixedBytecode = ensureBytecodePrefix(bytecode); -console.log(prefixedBytecode); +import { resolveSignature } from "thirdweb/utils"; +const res = await resolveSignature("0x1f931c1c"); +console.log(res); ``` ```ts -function ensureBytecodePrefix(bytecode: string): `0x${string}`; +function resolveSignature( + hexSig: string, +): Promise<{ + event: null | `event ${string}`; + function: null | `function ${string}`; +}>; ``` ### Parameters -The bytecode to ensure the prefix for. +The hexadecimal signature to resolve. #### Type ```ts -let bytecode: string; +let hexSig: string; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: Promise<{ + event: null | `event ${string}`; + function: null | `function ${string}`; +}>; ``` -The bytecode with the correct prefix. +A promise that resolves to an object containing the function and event signatures. --- -## extractIPFSUri +## resolveSignatures -Extracts the IPFS URI from the given bytecode. +Resolves the signatures of the given hexadecimal signatures. ### Example ```ts -import { extractIPFSUri } from "thirdweb/utils/bytecode/extractIPFS"; -const bytecode = - "0x363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"; -const ipfsHash = extractIPFSUri(bytecode); -console.log(ipfsHash); +import { resolveSignatures } from "thirdweb/utils"; +const res = await resolveSignatures(["0x1f931c1c", "0x1f931c1c"]); +console.log(res); ``` ```ts -function extractIPFSUri(bytecode: string): undefined | string; +function resolveSignatures( + hexSigs: Array, +): Promise<{ + events: Array<`event ${string}`>; + functions: Array<`function ${string}`>; +}>; ``` ### Parameters -The bytecode to extract the IPFS URI from. +An array of hexadecimal signatures. #### Type ```ts -let bytecode: string; +let hexSigs: Array; ``` ### Returns ```ts -let returnType: undefined | string; +let returnType: Promise<{ + events: Array<`event ${string}`>; + functions: Array<`function ${string}`>; +}>; ``` -The IPFS URI if found, otherwise undefined. +A promise that resolves to an object containing the resolved functions and events. --- -## extractMinimalProxyImplementationAddress +## shortenAddress -Extracts the implementation address from a given bytecode string if it matches any of the known minimal proxy patterns. +Checksums and formats an address if valid. Note this function does not check if the provided address is an ENS. ### Example ```ts -import { extractMinimalProxyImplementationAddress } from "thirdweb/utils"; -const bytecode = "0x363d3d373d3d3d363d73..."; -const implementationAddress = - extractMinimalProxyImplementationAddress(bytecode); +import { shortenAddress } from "thirdweb/utils"; + +shortenAddress("0xa0cf798816d4b9b9866b5330eea46a18382f251e"); +//=> '0xA0Cf...251e' ``` ```ts -function extractMinimalProxyImplementationAddress( - bytecode: string, -): undefined | string; +function shortenAddress(address: string, length: number): string; ``` ### Parameters -The bytecode string to extract the implementation address from. +The address to shorten. #### Type ```ts -let bytecode: string; +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: undefined | string; +let returnType: string; ``` -The implementation address as a string if a match is found, otherwise undefined. +The shortened address. --- -## formatNumber +## shortenHex -Round up a number to a certain decimal place +Shortens a hexadecimal string without performing any validation or checksumming. ### Example ```ts -import { formatNumber } from "thirdweb/utils"; -const value = formatNumber(12.1214141, 1); // 12.1 +import { shortenHex } from "thirdweb/utils"; + +shortenHex("0xa0cf798816d4b9b9866b5330eea46a18382f251e"); +//=> '0xa0cf...251e' ``` ```ts -function formatNumber(value: number, decimalPlaces: number): number; +function shortenHex(hex: string, length: number): string; ``` ### Parameters +The hexadecimal string to shorten. + #### Type ```ts -let value: number; +let hex: string; ``` +The number of characters to keep from the start and end of the string. + #### Type ```ts -let decimalPlaces: number; +let length: number; ``` ### Returns ```ts -let returnType: number; +let returnType: string; ``` + +The shortened hexadecimal string. --- -## getClaimParams +## shortenLargeNumber -Get the claim parameters for a given drop +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 { getClaimParams } from "thirdweb/utils"; - -const claimParams = await getClaimParams({ - contract, - to: "0x...", - quantity: 1n, - type: "erc1155", - tokenId: 0n, -}); +import { shortenLargeNumber } from "thirdweb/utils"; +const numStr = shortenLargeNumber(1_000_000_000); ``` ```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; -}>; +function shortenLargeNumber(value: number): string; ``` ### 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" } -); +let value: number; ``` ### 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; -}>; +let returnType: string; ``` - -The claim parameters --- -## getInitBytecodeWithSalt +## sign -Generates the initialization bytecode with salt for a contract deployment. +Generates the signature for the provided transaction hash. ### Example ```ts -import { getInitBytecodeWithSalt } from "thirdweb/utils"; -const initBytecodeWithSalt = getInitBytecodeWithSalt({ - bytecode, - encodedArgs, - salt, +import { sign } from "thirdweb/utils"; + +const signature = sign({ + hash: "0x", + privateKey: "0x", }); ``` ```ts -function getInitBytecodeWithSalt( - options: GetInitiBytecodeWithSaltOptions, -): `0x${string}`; +function sign(options: SignOptions): { + r: `0x${string}`; + s: `0x${string}`; + v: bigint; + yParity: number; +}; ``` ### Parameters -The options for generating the initialization bytecode. +The options for signing. #### Type ```ts -let options: GetInitiBytecodeWithSaltOptions; +let options: { hash: Hex; privateKey: Hex }; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: { + r: `0x${string}`; + s: `0x${string}`; + v: bigint; + yParity: number; +}; ``` -The initialization bytecode with salt. +The transaction signature. --- -## getSaltHash +## signatureToHex -Calculates the salt hash for a given bytecode. +Converts a signature to a hex string. ### Example ```ts -import { getSaltHash } from "thirdweb"; -const saltHash = getSaltHash(bytecode); +import { signatureToHex } from "thirdweb/utils"; + +const hex = signatureToHex({ + r: toHex( + 49782753348462494199823712700004552394425719014458918871452329774910450607807n, + ), + s: toHex( + 33726695977844476214676913201140481102225469284307016937915595756355928419768n, + ), + v: 28n, +}); + +console.log(hex); +// "0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c" ``` ```ts -function getSaltHash(bytecode: string): `0x${string}`; +function signatureToHex(signature: { + r: `0x${string}`; + s: `0x${string}`; + v?: number | bigint | `0x${string}`; + yParity?: number | bigint | `0x${string}`; +}): `0x${string}`; ``` ### Parameters -The bytecode to calculate the salt hash for. +The signature to convert. #### Type ```ts -let bytecode: string; +let signature: { + r: `0x${string}`; + s: `0x${string}`; + v?: number | bigint | `0x${string}`; + yParity?: number | bigint | `0x${string}`; +}; ``` ### Returns @@ -57678,896 +58290,1224 @@ let bytecode: string; let returnType: `0x${string}`; ``` -The salt hash of the bytecode. +The hex string representation of the signature. --- -## hashMessage +## signMessage -Ethereum Signed Message hashing +### Signature#1 -### Example +Signs a string message with a given private key. + +#### Example ```ts -import { hashMessage } from "thirdweb/utils"; -const hash = hashMessage("hello world"); +import { signMessage } from "thirdweb/utils"; +signMessage({ + message: "Hello, world!", + privateKey: "0x...", +}); ``` ```ts -function hashMessage( - message: SignableMessage, - to_?: TTo, -): HashMessage; +function signMessage(options: SignMessageOptions): `0x${string}`; ``` -### Parameters +#### Parameters -The message to hash, either as a string, a Uint8Array, or an object with a `raw` property containing a Uint8Array. +The options for signing. -#### Type +##### Type ```ts -let message: SignableMessage; +let options: { message: Message; privateKey: Hex }; ``` -The desired output format of the hash (optional). Defaults to 'hex'. +#### Returns -#### Type +```ts +let returnType: `0x${string}`; +``` + +The signature as a hex string + +### Signature#2 + +Signs a string message with a given account. + +#### Example ```ts -let to_: TTo; +import { signMessage } from "thirdweb/utils"; +await signMessage({ + message: "Hello, world!", + account, +}); ``` -### Returns +```ts +function signMessage(options: { + account: Account; + message: Message; +}): Promise<`0x${string}`>; +``` + +#### Parameters + +The options for signing. + +##### Type ```ts -let returnType: HashMessage; +let options: { account: Account; message: Message }; ``` -The Ethereum Signed Message hash of the message in the specified format. +#### Returns + +```ts +let returnType: Promise<`0x${string}`>; +``` + +The signature as a hex string --- -## isEIP155Enforced +## signTypedData -Checks whether EIP-155 is enforced by sending a random transaction of legacy type (pre-EIP-155) and parsing the error message. +Signs a typed data object with a given private key according to EIP712. ### Example ```ts -import { isEIP155Enforced } from "thirdweb/utils"; -const isEIP155 = await isEIP155Enforced({ chain, client }); +import { signTypedData } from "thirdweb/utils"; +signTypedData({ + privateKey: "0x...", + ...typedData, +}); ``` ```ts -function isEIP155Enforced( - options: IsEIP155EnforcedOptions, -): Promise; +function signTypedData( + options: SignTypedDataOptions, +): `0x${string}`; ``` ### Parameters -The options for checking EIP-155 enforcement. +The typed data is passed within options alongside the private key #### Type ```ts -let options: IsEIP155EnforcedOptions; +let options: SignTypedDataOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: `0x${string}`; ``` -A promise that resolves to a boolean indicating whether EIP-155 is enforced. +The signature as a hex string --- -## keccakId +## stringify -Calculates the keccak ID of the given input. +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 { keccackId } from "thirdweb/utils"; -const keccakId = keccackId(input); +import { stringify } from "thirdweb/utils"; +const obj = { tokenId: 0n }; +const str = stringify(obj); // "{"tokenId":"0"}" ``` ```ts -function keccakId(input: string): `0x${string}`; +function stringify( + value: any, + replacer?: null | ((this: any, key: string, value: any) => any), + space?: string | number, +): string; ``` ### Parameters -The input value to calculate the keccak ID for. +#### Type + +```ts +let value: any; +``` #### Type ```ts -let input: string; +let replacer: null | ((this: any, key: string, value: any) => any); +``` + +#### Type + +```ts +let space: string | number; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: string; ``` -The keccak ID as a Hex string. +An object with all bigint values converted to string +--- +# Miscellaneous --- -## max +## installPublishedExtension -Returns the maximum of two BigInt values. +Install a published extension on a dynamic contract ### Example ```ts -max(1n, 2n); -// 2n +import { installPublishedExtension } from "thirdweb/dynamic-contracts"; +const transaction = installPublishedExtension({ + client, + chain, + account, + contract, + extensionName: "MyExtension", + publisherAddress: "0x...", +}); +await sendTransaction({ transaction, account }); ``` ```ts -function max(a: bigint, b: bigint): bigint; +function installPublishedExtension( + options: InstallPublishedExtensionOptions, +): PreparedTransaction; ``` ### Parameters -The first BigInt value. - -#### Type - -```ts -let a: bigint; -``` - -The second BigInt value. +The options for installing a published extension #### Type ```ts -let b: bigint; +let options: { + account: Account; + constructorParams?: Record; + contract: ThirdwebContract; + extensionName: string; + publisher?: string; + version?: string; +}; ``` ### Returns ```ts -let returnType: bigint; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` -The larger of the two BigInt values. +A prepared transaction to send --- -## min +## uninstallExtension -Returns the minimum of two BigInt values. +Uninstall an extension on a dynamic contract ### Example ```ts -min(1n, 2n); -// 1n +import { uninstallExtension } from "thirdweb/dynamic-contracts"; +const transaction = uninstallExtension({ + client, + chain, + account, + contract, + extensionName: "MyExtension", +}); +await sendTransaction({ transaction, account }); ``` ```ts -function min(a: bigint, b: bigint): bigint; +function uninstallExtension( + options: UninstallExtensionOptions, +): PreparedTransaction; ``` ### Parameters -The first BigInt value. - -#### Type - -```ts -let a: bigint; -``` - -The second BigInt value. +The options for uninstalling an extension #### Type ```ts -let b: bigint; +let options: { + account: Account; + contract: ThirdwebContract; + extensionName: string; +}; ``` ### Returns ```ts -let returnType: bigint; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` -The smaller of the two BigInt values. +A prepared transaction to send --- -## parseAbiParams - -Converts an array of parameter values to their respective types based on the provided type array. +## activateStylusContract -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. +Activate a stylus contract by calling ArbWasm Precompile ### 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] +import { activateStylusContract } from "thirdweb/stylus"; +const transaction = activateStylusContract({ + client, + chain, + contractAddress, +}); +await sendTransaction({ transaction, account }); ``` ```ts -function parseAbiParams( - constructorParamTypes: Array, - constructorParamValues: Array, -): Array; +function activateStylusContract( + options: ActivateStylusContractOptions, +): Promise< + PreparedTransaction +>; ``` ### 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; -``` - -An array of values to be converted according to the types. +The options for activating the contract #### Type ```ts -let constructorParamValues: Array; +let options: { + chain: Chain; + client: ThirdwebClient; + contractAddress: string; +}; ``` ### Returns ```ts -let returnType: Array; +let returnType: Readonly & { + __contract?: ThirdwebContract; + __preparedMethod?: () => Promise>; +}; ``` -* An array of values converted to their respective types. +A prepared transaction to send --- -## resolveSignature +## convertCryptoToFiat -Resolves a signature by converting a hexadecimal string into a function or event signature. +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 { resolveSignature } from "thirdweb/utils"; -const res = await resolveSignature("0x1f931c1c"); -console.log(res); +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 resolveSignature( - hexSig: string, -): Promise<{ - event: null | `event ${string}`; - function: null | `function ${string}`; -}>; +function convertCryptoToFiat( + options: ConvertCryptoToFiatParams, +): Promise<{ result: number }>; ``` ### Parameters -The hexadecimal signature to resolve. - #### Type ```ts -let hexSig: string; +let options: { + chain: Chain; + client: ThirdwebClient; + fromAmount: number; + fromTokenAddress: Address; + to: SupportedFiatCurrency; +}; ``` ### Returns ```ts -let returnType: Promise<{ - event: null | `event ${string}`; - function: null | `function ${string}`; -}>; +let returnType: Promise<{ result: number }>; ``` -A promise that resolves to an object containing the function and event signatures. +a number representing the price (in selected fiat) of "x" token, with "x" being the `fromAmount`. --- -## resolveSignatures +## convertFiatToCrypto -Resolves the signatures of the given hexadecimal signatures. +Convert a fiat value to a token. Currently only USD is supported. ### Example +#### Basic usage + ```ts -import { resolveSignatures } from "thirdweb/utils"; -const res = await resolveSignatures(["0x1f931c1c", "0x1f931c1c"]); -console.log(res); +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 resolveSignatures( - hexSigs: Array, -): Promise<{ - events: Array<`event ${string}`>; - functions: Array<`function ${string}`>; -}>; +function convertFiatToCrypto( + options: ConvertFiatToCryptoParams, +): Promise<{ result: number }>; ``` ### Parameters -An array of hexadecimal signatures. - #### Type ```ts -let hexSigs: Array; +let options: { + chain: Chain; + client: ThirdwebClient; + from: SupportedFiatCurrency; + fromAmount: number; + to: Address; +}; ``` ### Returns ```ts -let returnType: Promise<{ - events: Array<`event ${string}`>; - functions: Array<`function ${string}`>; -}>; +let returnType: Promise<{ result: number }>; ``` - -A promise that resolves to an object containing the resolved functions and events. --- -## shortenAddress +## getBuyHistory -Checksums and formats an address if valid. Note this function does not check if the provided address is an ENS. +Get Buy transaction history for a given wallet address. + +This includes both "Buy with Cryto" and "Buy with Fiat" transactions ### Example ```ts -import { shortenAddress } from "thirdweb/utils"; +import { createThirdwebClient } from "thirdweb"; +import { getBuyHistory } from "thirdweb/pay"; -shortenAddress("0xa0cf798816d4b9b9866b5330eea46a18382f251e"); -//=> '0xA0Cf...251e' +const client = createThirdwebClient({ clientId: "..." }); + +const history = await getBuyHistory({ + client, + walletAddress: "0x...", +}); ``` ```ts -function shortenAddress(address: string, length: number): string; +function getBuyHistory( + params: BuyHistoryParams, +): Promise; ``` ### Parameters -The address to shorten. - -#### Type - -```ts -let address: string; -``` - -The number of characters to keep from the start and end of the address. +Object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams) #### Type ```ts -let length: number; +let params: { + client: ThirdwebClient; + count: number; + start: number; + walletAddress: string; +}; ``` ### Returns ```ts -let returnType: string; +let returnType: { + hasNextPage: boolean; + page: Array< + | { buyWithFiatStatus: BuyWithFiatStatus } + | { buyWithCryptoStatus: BuyWithCryptoStatus } + >; +}; ``` - -The shortened address. --- -## shortenHex +## getBuyWithCryptoHistory -Shortens a hexadecimal string without performing any validation or checksumming. +Deprecated + +Gets the History of purchases for a given wallet address ### Example ```ts -import { shortenHex } from "thirdweb/utils"; +import { createThirdwebClient } from "thirdweb"; +import { BuyWithCryptoHistoryData } from "thirdweb/pay"; -shortenHex("0xa0cf798816d4b9b9866b5330eea46a18382f251e"); -//=> '0xa0cf...251e' +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 shortenHex(hex: string, length: number): string; +function getBuyWithCryptoHistory( + params: BuyWithCryptoHistoryParams, +): Promise; ``` ### 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. +Object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams) #### Type ```ts -let length: number; +let params: { + client: ThirdwebClient; + count: number; + start: number; + walletAddress: string; +}; ``` ### Returns ```ts -let returnType: string; +let returnType: { + hasNextPage: boolean; + page: Array; +}; ``` -The shortened hexadecimal string. +Object of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData) --- -## shortenLargeNumber +## getBuyWithCryptoQuote -Shorten the string for large value Mainly used for Examples: 10\_000 -> 10k 1\_000\_000 -> 1M 1\_000\_000\_000 -> 1B +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 { shortenLargeNumber } from "thirdweb/utils"; -const numStr = shortenLargeNumber(1_000_000_000); +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 shortenLargeNumber(value: number): string; +function getBuyWithCryptoQuote( + params: GetBuyWithCryptoQuoteParams, +): Promise; ``` ### Parameters +object of type [GetBuyWithCryptoQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoQuoteParams) + #### Type ```ts -let value: number; +let params: { + client: ThirdwebClient; + fromAddress: string; + fromChainId: number; + fromTokenAddress: string; + intentId?: string; + maxSlippageBPS?: number; + paymentLinkId?: string; + purchaseData?: object; + toAddress: string; + toChainId: number; + toTokenAddress: string; +} & ( + | { fromAmount: string; toAmount?: never } + | { fromAmount?: never; toAmount: string } +); ``` ### Returns ```ts -let returnType: string; +let returnType: { + approvalData?: QuoteApprovalInfo; + client: ThirdwebClient; + paymentTokens: Array; + processingFees: Array; + 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. --- -## sign +## getBuyWithCryptoStatus -Generates the signature for the provided transaction hash. +Deprecated + +use Bridge.status instead + +Gets the status of a buy with crypto transaction ### Example ```ts -import { sign } from "thirdweb/utils"; +import { sendTransaction } from "thirdweb"; +import { getBuyWithCryptoStatus, getBuyWithCryptoQuote } from "thirdweb/pay"; -const signature = sign({ - hash: "0x", - privateKey: "0x", -}); +// 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 sign(options: SignOptions): { - r: `0x${string}`; - s: `0x${string}`; - v: bigint; - yParity: number; -}; +function getBuyWithCryptoStatus( + buyWithCryptoTransaction: BuyWithCryptoTransaction, +): Promise; ``` ### Parameters -The options for signing. +Object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) #### Type ```ts -let options: { hash: Hex; privateKey: Hex }; +let buyWithCryptoTransaction: { + chainId: number; + client: ThirdwebClient; + transactionHash: string; +}; ``` ### Returns ```ts -let returnType: { - r: `0x${string}`; - s: `0x${string}`; - v: bigint; - yParity: number; -}; +let returnType: + | { status: "NOT_FOUND" } + | { + bridge?: string; + destination?: PayOnChainTransactionDetails; + failureMessage?: string; + fromAddress: string; + purchaseData?: object; + quote: BuyWithCryptoQuoteSummary; + source?: PayOnChainTransactionDetails; + status: BuyWithCryptoStatuses; + subStatus: BuyWithCryptoSubStatuses; + swapType: SwapType; + toAddress: string; + }; ``` -The transaction signature. +Object of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) --- -## signatureToHex +## getBuyWithCryptoTransfer -Converts a signature to a hex string. +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 { signatureToHex } from "thirdweb/utils"; +import { getBuyWithCryptoTransfer } from "thirdweb/pay"; -const hex = signatureToHex({ - r: toHex( - 49782753348462494199823712700004552394425719014458918871452329774910450607807n, - ), - s: toHex( - 33726695977844476214676913201140481102225469284307016937915595756355928419768n, - ), - v: 28n, +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", + }, }); - -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}`; +function getBuyWithCryptoTransfer( + params: GetBuyWithCryptoTransferParams, +): Promise; ``` ### Parameters -The signature to convert. +object of type [GetBuyWithCryptoTransferParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoTransferParams) #### Type ```ts -let signature: { - r: `0x${string}`; - s: `0x${string}`; - v?: number | bigint | `0x${string}`; - yParity?: number | bigint | `0x${string}`; +let params: { + amount: string; + chainId: number; + client: ThirdwebClient; + feePayer?: "sender" | "receiver"; + fromAddress: string; + paymentLinkId?: string; + purchaseData?: object; + toAddress: string; + tokenAddress: string; }; ``` ### Returns ```ts -let returnType: `0x${string}`; +let returnType: { + approvalData?: QuoteApprovalInfo; + client: ThirdwebClient; + estimatedGasCostUSDCents: number; + fromAddress: string; + paymentToken: QuotePaymentToken; + processingFee: QuotePaymentToken; + toAddress: string; + transactionRequest: PrepareTransactionOptions; +}; ``` -The hex string representation of the signature. +Object of type [BuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransfer) which contains the information about the transfer --- -## signMessage +## getBuyWithFiatHistory -### Signature#1 +Deprecated -Signs a string message with a given private key. +Get the "Buy with fiat" transaction history for a given wallet address -#### Example +### Example ```ts -import { signMessage } from "thirdweb/utils"; -signMessage({ - message: "Hello, world!", - privateKey: "0x...", +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 signMessage(options: SignMessageOptions): `0x${string}`; +function getBuyWithFiatHistory( + params: BuyWithFiatHistoryParams, +): Promise; ``` -#### Parameters +### Parameters -The options for signing. +Object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams) -##### Type +#### Type ```ts -let options: { message: Message; privateKey: Hex }; +let params: { + client: ThirdwebClient; + count: number; + start: number; + walletAddress: string; +}; ``` -#### Returns +### Returns ```ts -let returnType: `0x${string}`; +let returnType: { + hasNextPage: boolean; + page: Array; +}; ``` -The signature as a hex string +Object of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData) +--- -### Signature#2 +## getBuyWithFiatQuote -Signs a string message with a given account. +Deprecated -#### Example +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. -```ts -import { signMessage } from "thirdweb/utils"; -await signMessage({ - message: "Hello, world!", - account, -}); -``` +#### Rendering the On-Ramp provider UI -```ts -function signMessage(options: { - account: Account; - message: Message; -}): Promise<`0x${string}`>; -``` +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 -#### Parameters +#### Determining the steps required -The options for signing. +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. -##### Type +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. -```ts -let options: { account: Account; message: Message }; -``` +#### Polling for the status -#### Returns +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. -```ts -let returnType: Promise<`0x${string}`>; -``` +`getBuyWithFiatStatus` returns a status object of type [BuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatStatus). -The signature as a hex string ---- +* 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. -## signTypedData +#### Swap Process -Signs a typed data object with a given private key according to EIP712. +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 { signTypedData } from "thirdweb/utils"; -signTypedData({ - privateKey: "0x...", - ...typedData, +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 signTypedData( - options: SignTypedDataOptions, -): `0x${string}`; +function getBuyWithFiatQuote( + params: GetBuyWithFiatQuoteParams, +): Promise; ``` ### Parameters -The typed data is passed within options alongside the private key +object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams) #### Type ```ts -let options: SignTypedDataOptions; +let params: { + client: ThirdwebClient; + fromAddress: string; + fromAmount?: string; + fromCurrencySymbol: CurrencyMeta["shorthand"]; + isTestMode?: boolean; + maxSlippageBPS?: number; + onrampChainId?: number; + onrampTokenAddress?: string; + paymentLinkId?: string; + preferredProvider?: FiatProvider; + purchaseData?: object; + toAddress: string; + toAmount?: string; + toChainId: number; + toGasAmountWei?: string; + toTokenAddress: string; +}; ``` ### Returns ```ts -let returnType: `0x${string}`; +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; +}; ``` -The signature as a hex string +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. --- -## 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 +## getBuyWithFiatStatus -```ts -let value: any; -``` +Deprecated -#### Type +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` -```ts -let replacer: null | ((this: any, key: string, value: any) => any); -``` +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.. -#### Type +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. -```ts -let space: string | number; -``` +##### When no swap is required -### Returns +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. -```ts -let returnType: string; -``` +#### When a swap is required -An object with all bigint values converted to string ---- -# Miscellaneous ---- +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. -## installPublishedExtension +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). -Install a published extension on a dynamic contract +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 -import { installPublishedExtension } from "thirdweb/dynamic-contracts"; -const transaction = installPublishedExtension({ +// 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, - chain, - account, - contract, - extensionName: "MyExtension", - publisherAddress: "0x...", + intentId: fiatQuote.intentId, }); -await sendTransaction({ transaction, account }); + +// when the fiatStatus.status is "ON_RAMP_TRANSFER_COMPLETED" - the process is complete ``` ```ts -function installPublishedExtension( - options: InstallPublishedExtensionOptions, -): PreparedTransaction; +function getBuyWithFiatStatus( + params: GetBuyWithFiatStatusParams, +): Promise; ``` ### Parameters -The options for installing a published extension +Object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatStatusParams) #### Type ```ts -let options: { - account: Account; - constructorParams?: Record; - contract: ThirdwebContract; - extensionName: string; - publisher?: string; - version?: string; -}; +let params: { client: ThirdwebClient; intentId: string }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: + | { status: "NOT_FOUND" } + | { + destination?: PayOnChainTransactionDetails; + failureMessage?: string; + fromAddress: string; + intentId: string; + purchaseData?: object; + 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; + }; ``` - -A prepared transaction to send --- -## uninstallExtension +## getPostOnRampQuote -Uninstall an extension on a dynamic contract +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 { uninstallExtension } from "thirdweb/dynamic-contracts"; -const transaction = uninstallExtension({ +import { + getPostOnRampQuote, + getBuyWithFiatStatus, +} from "thirdweb/pay"; + +// previous steps +const fiatQuote = await getBuyWithFiatQuote(fiatQuoteParams); +window.open(fiatQuote.onRampLink, "_blank"); +const buyWithFiatStatus = await getBuyWithFiatStatus({ client, - chain, - account, - contract, - extensionName: "MyExtension", -}); -await sendTransaction({ transaction, account }); + 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 uninstallExtension( - options: UninstallExtensionOptions, -): PreparedTransaction; +function getPostOnRampQuote( + params: GetPostOnRampQuoteParams, +): Promise; ``` ### Parameters -The options for uninstalling an extension +object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams) #### Type ```ts -let options: { - account: Account; - contract: ThirdwebContract; - extensionName: string; +let params: { + buyWithFiatStatus: BuyWithFiatStatus; + client: ThirdwebClient; + paymentLinkId?: string; }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: { + approvalData?: QuoteApprovalInfo; + client: ThirdwebClient; + paymentTokens: Array; + processingFees: Array; + 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; +}; ``` -A prepared transaction to send +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. --- -## activateStylusContract +## isSwapRequiredPostOnramp -Activate a stylus contract by calling ArbWasm Precompile +Deprecated -### Example +Check if a Swap is required after on-ramp when buying a token with fiat currency. -```ts -import { activateStylusContract } from "thirdweb/stylus"; -const transaction = activateStylusContract({ - client, - chain, - contractAddress, -}); -await sendTransaction({ transaction, account }); -``` +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 activateStylusContract( - options: ActivateStylusContractOptions, -): Promise< - PreparedTransaction ->; +function isSwapRequiredPostOnramp( + buyWithFiatQuote: Pick, +): boolean; ``` ### Parameters -The options for activating the contract +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 options: { - chain: Chain; - client: ThirdwebClient; - contractAddress: string; -}; +let buyWithFiatQuote: Pick< + BuyWithFiatQuote, + "toToken" | "onRampToken" +>; ``` ### Returns ```ts -let returnType: Readonly & { - __contract?: ThirdwebContract; - __preparedMethod?: () => Promise>; -}; +let returnType: boolean; ``` - -A prepared transaction to send --- ## WalletName @@ -58637,7 +59577,7 @@ function WalletName( #### 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" | "polite" | "assertive",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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : FormEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "queryKey" | "queryFn">,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} +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),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" | "tel" | "numeric" | "decimal",is : string,itemID : string,itemProp : string,itemRef : string,itemScope : boolean,itemType : string,lang : string,loadingComponent : Element,nonce : string,onAbort : ReactEventHandler,onAbortCapture : ReactEventHandler,onAnimationEnd : AnimationEventHandler,onAnimationEndCapture : AnimationEventHandler,onAnimationIteration : AnimationEventHandler,onAnimationIterationCapture : AnimationEventHandler,onAnimationStart : AnimationEventHandler,onAnimationStartCapture : AnimationEventHandler,onAuxClick : MouseEventHandler,onAuxClickCapture : MouseEventHandler,onBeforeInput : InputEventHandler,onBeforeInputCapture : FormEventHandler,onBeforeToggle : ToggleEventHandler,onBlur : FocusEventHandler,onBlurCapture : FocusEventHandler,onCanPlay : ReactEventHandler,onCanPlayCapture : ReactEventHandler,onCanPlayThrough : ReactEventHandler,onCanPlayThroughCapture : ReactEventHandler,onChange : FormEventHandler,onChangeCapture : FormEventHandler,onClick : MouseEventHandler,onClickCapture : MouseEventHandler,onCompositionEnd : CompositionEventHandler,onCompositionEndCapture : CompositionEventHandler,onCompositionStart : CompositionEventHandler,onCompositionStartCapture : CompositionEventHandler,onCompositionUpdate : CompositionEventHandler,onCompositionUpdateCapture : CompositionEventHandler,onContextMenu : MouseEventHandler,onContextMenuCapture : MouseEventHandler,onCopy : ClipboardEventHandler,onCopyCapture : ClipboardEventHandler,onCut : ClipboardEventHandler,onCutCapture : ClipboardEventHandler,onDoubleClick : MouseEventHandler,onDoubleClickCapture : MouseEventHandler,onDrag : DragEventHandler,onDragCapture : DragEventHandler,onDragEnd : DragEventHandler,onDragEndCapture : DragEventHandler,onDragEnter : DragEventHandler,onDragEnterCapture : DragEventHandler,onDragExit : DragEventHandler,onDragExitCapture : DragEventHandler,onDragLeave : DragEventHandler,onDragLeaveCapture : DragEventHandler,onDragOver : DragEventHandler,onDragOverCapture : DragEventHandler,onDragStart : DragEventHandler,onDragStartCapture : DragEventHandler,onDrop : DragEventHandler,onDropCapture : DragEventHandler,onDurationChange : ReactEventHandler,onDurationChangeCapture : ReactEventHandler,onEmptied : ReactEventHandler,onEmptiedCapture : ReactEventHandler,onEncrypted : ReactEventHandler,onEncryptedCapture : ReactEventHandler,onEnded : ReactEventHandler,onEndedCapture : ReactEventHandler,onError : ReactEventHandler,onErrorCapture : ReactEventHandler,onFocus : FocusEventHandler,onFocusCapture : FocusEventHandler,onGotPointerCapture : PointerEventHandler,onGotPointerCaptureCapture : PointerEventHandler,onInput : FormEventHandler,onInputCapture : FormEventHandler,onInvalid : FormEventHandler,onInvalidCapture : FormEventHandler,onKeyDown : KeyboardEventHandler,onKeyDownCapture : KeyboardEventHandler,onKeyPress : KeyboardEventHandler,onKeyPressCapture : KeyboardEventHandler,onKeyUp : KeyboardEventHandler,onKeyUpCapture : KeyboardEventHandler,onLoad : ReactEventHandler,onLoadCapture : ReactEventHandler,onLoadedData : ReactEventHandler,onLoadedDataCapture : ReactEventHandler,onLoadedMetadata : ReactEventHandler,onLoadedMetadataCapture : ReactEventHandler,onLoadStart : ReactEventHandler,onLoadStartCapture : ReactEventHandler,onLostPointerCapture : PointerEventHandler,onLostPointerCaptureCapture : PointerEventHandler,onMouseDown : MouseEventHandler,onMouseDownCapture : MouseEventHandler,onMouseEnter : MouseEventHandler,onMouseLeave : MouseEventHandler,onMouseMove : MouseEventHandler,onMouseMoveCapture : MouseEventHandler,onMouseOut : MouseEventHandler,onMouseOutCapture : MouseEventHandler,onMouseOver : MouseEventHandler,onMouseOverCapture : MouseEventHandler,onMouseUp : MouseEventHandler,onMouseUpCapture : MouseEventHandler,onPaste : ClipboardEventHandler,onPasteCapture : ClipboardEventHandler,onPause : ReactEventHandler,onPauseCapture : ReactEventHandler,onPlay : ReactEventHandler,onPlayCapture : ReactEventHandler,onPlaying : ReactEventHandler,onPlayingCapture : ReactEventHandler,onPointerCancel : PointerEventHandler,onPointerCancelCapture : PointerEventHandler,onPointerDown : PointerEventHandler,onPointerDownCapture : PointerEventHandler,onPointerEnter : PointerEventHandler,onPointerLeave : PointerEventHandler,onPointerMove : PointerEventHandler,onPointerMoveCapture : PointerEventHandler,onPointerOut : PointerEventHandler,onPointerOutCapture : PointerEventHandler,onPointerOver : PointerEventHandler,onPointerOverCapture : PointerEventHandler,onPointerUp : PointerEventHandler,onPointerUpCapture : PointerEventHandler,onProgress : ReactEventHandler,onProgressCapture : ReactEventHandler,onRateChange : ReactEventHandler,onRateChangeCapture : ReactEventHandler,onReset : FormEventHandler,onResetCapture : FormEventHandler,onScroll : UIEventHandler,onScrollCapture : UIEventHandler,onScrollEnd : UIEventHandler,onScrollEndCapture : UIEventHandler,onSeeked : ReactEventHandler,onSeekedCapture : ReactEventHandler,onSeeking : ReactEventHandler,onSeekingCapture : ReactEventHandler,onSelect : ReactEventHandler,onSelectCapture : ReactEventHandler,onStalled : ReactEventHandler,onStalledCapture : ReactEventHandler,onSubmit : FormEventHandler,onSubmitCapture : FormEventHandler,onSuspend : ReactEventHandler,onSuspendCapture : ReactEventHandler,onTimeUpdate : ReactEventHandler,onTimeUpdateCapture : ReactEventHandler,onToggle : ToggleEventHandler,onTouchCancel : TouchEventHandler,onTouchCancelCapture : TouchEventHandler,onTouchEnd : TouchEventHandler,onTouchEndCapture : TouchEventHandler,onTouchMove : TouchEventHandler,onTouchMoveCapture : TouchEventHandler,onTouchStart : TouchEventHandler,onTouchStartCapture : TouchEventHandler,onTransitionCancel : TransitionEventHandler,onTransitionCancelCapture : TransitionEventHandler,onTransitionEnd : TransitionEventHandler,onTransitionEndCapture : TransitionEventHandler,onTransitionRun : TransitionEventHandler,onTransitionRunCapture : TransitionEventHandler,onTransitionStart : TransitionEventHandler,onTransitionStartCapture : TransitionEventHandler,onVolumeChange : ReactEventHandler,onVolumeChangeCapture : ReactEventHandler,onWaiting : ReactEventHandler,onWaitingCapture : ReactEventHandler,onWheel : WheelEventHandler,onWheelCapture : WheelEventHandler,part : string,popover : "" | "auto" | "manual",popoverTarget : string,popoverTargetAction : "toggle" | "hide" | "show",prefix : string,property : string,queryOptions : Omit>, "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 diff --git a/apps/portal/public/llms.txt b/apps/portal/public/llms.txt index d143a72e8f4..d3d9f8a942f 100644 --- a/apps/portal/public/llms.txt +++ b/apps/portal/public/llms.txt @@ -5,6 +5,13 @@ --- **UI Components** --- +# Universal Bridge +--- +## Widgets +* [Widgets.BuyWidget](https://portal.thirdweb.com/references/typescript/v5/widgets/BuyWidget): Widget is a prebuilt UI for purchasing a specific token. +* [Widgets.CheckoutWidget](https://portal.thirdweb.com/references/typescript/v5/widgets/CheckoutWidget): Widget a prebuilt UI for purchasing a specific token. +* [Widgets.TransactionWidget](https://portal.thirdweb.com/references/typescript/v5/widgets/TransactionWidget): Widget a prebuilt UI for purchasing a specific token. +--- # Wallets * [AccountAddress](https://portal.thirdweb.com/references/typescript/v5/AccountAddress): Result: * [AccountBlobbie](https://portal.thirdweb.com/references/typescript/v5/AccountBlobbie): A wrapper for the Blobbie component @@ -33,14 +40,12 @@ # NFT * [NFTProvider](https://portal.thirdweb.com/references/typescript/v5/NFTProvider): A React context provider component that supplies NFT-related data to its child components. --- -# Buy Crypto -* [PayEmbed](https://portal.thirdweb.com/references/typescript/v5/PayEmbed): Embed a prebuilt UI for funding wallets, purchases or transactions with crypto or fiat. ---- # Tokens * [TokenProvider](https://portal.thirdweb.com/references/typescript/v5/TokenProvider): A React context provider component that supplies Token-related data to its child components. --- # Miscellaneous * [MediaRenderer](https://portal.thirdweb.com/references/typescript/v5/MediaRenderer): Refer to [MediaRendererProps](https://portal.thirdweb.com/references/typescript/v5/MediaRendererProps) to see the available props. +* [PayEmbed](https://portal.thirdweb.com/references/typescript/v5/PayEmbed): Use `BuyWidget`, `CheckoutWidget` or `TransactionWidget` instead. --- **React Hooks** --- @@ -101,7 +106,11 @@ # Social API * [useSocialProfiles](https://portal.thirdweb.com/references/typescript/v5/useSocialProfiles): Fetches the wallet's available social profiles. --- -# Buy Crypto +# Utils +* [useBlockNumber](https://portal.thirdweb.com/references/typescript/v5/useBlockNumber): Hook that watches for changes in the block number on a given chain. +--- +# Miscellaneous +* [useBridgeRoutes](https://portal.thirdweb.com/references/typescript/v5/useBridgeRoutes): Hook that fetches available bridge routes with caching and retry logic * [useBuyHistory](https://portal.thirdweb.com/references/typescript/v5/useBuyHistory): Hook to get the history of Buy transactions for a given wallet - This includes both "buy with crypto" and "buy with fiat" transactions. * [useBuyWithCryptoHistory](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoHistory): Hook to get the "Buy with crypto" transaction history for a given wallet address. * [useBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoQuote): 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. @@ -111,9 +120,6 @@ * [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus): A hook to get a status of a "Buy with Fiat" transaction to determine if the transaction is completed, failed or pending. * [usePostOnRampQuote](https://portal.thirdweb.com/references/typescript/v5/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. --- -# Utils -* [useBlockNumber](https://portal.thirdweb.com/references/typescript/v5/useBlockNumber): Hook that watches for changes in the block number on a given chain. ---- **Core Functions** --- # Extensions @@ -481,9 +487,9 @@ * [ERC4337.isGetAllActiveSignersSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllActiveSignersSupported): Checks if the `getAllActiveSigners` method is supported by the given contract. * [ERC4337.isGetAllAdminsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllAdminsSupported): Checks if the `getAllAdmins` method is supported by the given contract. * [ERC4337.isGetAllSignersSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllSignersSupported): Checks if the `getAllSigners` method is supported by the given contract. -* [ERC4337.isIsAccountDeployedSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isIsAccountDeployedSupported): Checks if the `getAddress` method is supported by the given contract. * [ERC4337.isIsActiveSignerSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isIsActiveSignerSupported): Checks if the `isActiveSigner` method is supported by the given contract. * [ERC4337.isIsAdminSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isIsAdminSupported): Checks if the `isAdmin` method is supported by the given contract. +* [ERC4337.isPredictAccountAddressSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isPredictAccountAddressSupported): Checks if the `getAddress` method is supported by the given contract. * [ERC4337.isRegistered](https://portal.thirdweb.com/references/typescript/v5/erc4337/isRegistered): Calls the "isRegistered" function on the contract. * [ERC4337.isRemoveAdminSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isRemoveAdminSupported): Checks if the `isRemoveAdminSupported` method is supported by the given contract. * [ERC4337.isRemoveSessionKeySupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isRemoveSessionKeySupported): Checks if the `isRemoveSessionKeySupported` method is supported by the given contract. @@ -830,6 +836,10 @@ * [EIP5792.sendCalls](https://portal.thirdweb.com/references/typescript/v5/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. * [EIP5792.waitForCallsReceipt](https://portal.thirdweb.com/references/typescript/v5/eip5792/waitForCallsReceipt): Waits for the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle to be confirmed. --- +## ERC7702 +* [ERC7702.createSessionKey](https://portal.thirdweb.com/references/typescript/v5/erc7702/createSessionKey): Creates session key permissions for a specified address. +* [ERC7702.isCreateSessionKeySupported](https://portal.thirdweb.com/references/typescript/v5/erc7702/isCreateSessionKeySupported): Checks if the `isCreateSessionKeySupported` method is supported by the given contract. +--- # Modules --- ## BatchMetadataERC1155 @@ -978,6 +988,10 @@ * [Buy.prepare](https://portal.thirdweb.com/references/typescript/v5/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. * [Buy.quote](https://portal.thirdweb.com/references/typescript/v5/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. --- +## Onramp +* [Onramp.prepare](https://portal.thirdweb.com/references/typescript/v5/onramp/prepare): Prepares an onramp transaction, returning a link from the specified provider to onramp to the specified token. +* [Onramp.status](https://portal.thirdweb.com/references/typescript/v5/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. +--- ## Sell * [Sell.prepare](https://portal.thirdweb.com/references/typescript/v5/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. * [Sell.quote](https://portal.thirdweb.com/references/typescript/v5/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. @@ -1099,7 +1113,10 @@ * [getTransactions](https://portal.thirdweb.com/references/typescript/v5/getTransactions): Get transactions for a wallet --- # Engine +* [createServerWallet](https://portal.thirdweb.com/references/typescript/v5/createServerWallet): Create a server wallet. +* [getServerWallets](https://portal.thirdweb.com/references/typescript/v5/getServerWallets): List all server wallets. * [getTransactionStatus](https://portal.thirdweb.com/references/typescript/v5/getTransactionStatus): Get the execution status of a transaction. +* [searchTransactions](https://portal.thirdweb.com/references/typescript/v5/searchTransactions): Search for transactions by their ids. * [ServerWallet](https://portal.thirdweb.com/references/typescript/v5/serverWallet): Reference for ServerWallet * [waitForTransactionHash](https://portal.thirdweb.com/references/typescript/v5/waitForTransactionHash): Wait for a transaction to be submitted onchain and return the transaction hash. --- @@ -1129,20 +1146,6 @@ * [NFTMedia](https://portal.thirdweb.com/references/typescript/v5/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. * [NFTName](https://portal.thirdweb.com/references/typescript/v5/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 `` element. --- -# Buy Crypto -* [convertCryptoToFiat](https://portal.thirdweb.com/references/typescript/v5/convertCryptoToFiat): Get a price of a token (using tokenAddress + chainId) in fiat. Only USD is supported at the moment. -* [convertFiatToCrypto](https://portal.thirdweb.com/references/typescript/v5/convertFiatToCrypto): Convert a fiat value to a token. Currently only USD is supported. -* [getBuyHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyHistory): Get Buy transaction history for a given wallet address. -* [getBuyWithCryptoHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoHistory): Gets the History of purchases for a given wallet address -* [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote): 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. -* [getBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus): use Bridge.status instead -* [getBuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoTransfer): 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. -* [getBuyWithFiatHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatHistory): Get the "Buy with fiat" transaction history for a given wallet address -* [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote): 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. -* [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatStatus): 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` -* [getPostOnRampQuote](https://portal.thirdweb.com/references/typescript/v5/getPostOnRampQuote): 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. -* [isSwapRequiredPostOnramp](https://portal.thirdweb.com/references/typescript/v5/isSwapRequiredPostOnramp): Check if a Swap is required after on-ramp when buying a token with fiat currency. ---- # Tokens * [TokenIcon](https://portal.thirdweb.com/references/typescript/v5/TokenIcon): This component tries to resolve the icon of a given token, then return an image. * [TokenName](https://portal.thirdweb.com/references/typescript/v5/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 `` component, hence you can style it just like how you would style a normal `` @@ -1251,6 +1254,18 @@ * [installPublishedExtension](https://portal.thirdweb.com/references/typescript/v5/installPublishedExtension): Install a published extension on a dynamic contract * [uninstallExtension](https://portal.thirdweb.com/references/typescript/v5/uninstallExtension): Uninstall an extension on a dynamic contract * [activateStylusContract](https://portal.thirdweb.com/references/typescript/v5/activateStylusContract): Activate a stylus contract by calling ArbWasm Precompile +* [convertCryptoToFiat](https://portal.thirdweb.com/references/typescript/v5/convertCryptoToFiat): Get a price of a token (using tokenAddress + chainId) in fiat. Only USD is supported at the moment. +* [convertFiatToCrypto](https://portal.thirdweb.com/references/typescript/v5/convertFiatToCrypto): Convert a fiat value to a token. Currently only USD is supported. +* [getBuyHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyHistory): Get Buy transaction history for a given wallet address. +* [getBuyWithCryptoHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoHistory): Gets the History of purchases for a given wallet address +* [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote): 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. +* [getBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus): use Bridge.status instead +* [getBuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoTransfer): 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. +* [getBuyWithFiatHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatHistory): Get the "Buy with fiat" transaction history for a given wallet address +* [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote): 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. +* [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatStatus): 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` +* [getPostOnRampQuote](https://portal.thirdweb.com/references/typescript/v5/getPostOnRampQuote): 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. +* [isSwapRequiredPostOnramp](https://portal.thirdweb.com/references/typescript/v5/isSwapRequiredPostOnramp): Check if a Swap is required after on-ramp when buying a token with fiat currency. * [WalletName](https://portal.thirdweb.com/references/typescript/v5/WalletName): This component fetches then shows the name of a wallet. It inherits all the attributes of a HTML `` component, hence you can style it just like how you would style a normal `` * [decodeAbiParameters](https://portal.thirdweb.com/references/typescript/v5/decodeAbiParameters): Reference for decodeAbiParameters * [encodePacked](https://portal.thirdweb.com/references/typescript/v5/encodePacked): Reference for encodePacked diff --git a/apps/portal/src/app/references/components/TDoc/fetchDocs/fetchTypeScriptDoc.ts b/apps/portal/src/app/references/components/TDoc/fetchDocs/fetchTypeScriptDoc.ts index 6c3e05bd878..91e61fa072d 100644 --- a/apps/portal/src/app/references/components/TDoc/fetchDocs/fetchTypeScriptDoc.ts +++ b/apps/portal/src/app/references/components/TDoc/fetchDocs/fetchTypeScriptDoc.ts @@ -1,6 +1,7 @@ import { transform } from "typedoc-better-json"; let v5Prom: Promise> | null = null; +type TransformArg = Parameters[0]; export async function fetchTypeScriptDoc() { // v5 case (default) @@ -12,8 +13,7 @@ export async function fetchTypeScriptDoc() { "../../../../../../../../packages/thirdweb/typedoc/documentation.json" ); - // @ts-expect-error - works fine! - return transform(doc); + return transform(doc.default as TransformArg); })(); return v5Prom; }