From 5c22ce869715bf83b510d575bb4945892e399276 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Fri, 23 May 2025 22:24:39 -0700 Subject: [PATCH] fix portal build --- apps/portal/public/llms-full.txt | 32525 ++++++++-------- apps/portal/public/llms.txt | 1646 +- .../references/components/TDoc/Summary.tsx | 3 +- .../TDoc/utils/getSidebarLinkgroups.ts | 15 +- .../components/TDoc/utils/uniqueSlugger.ts | 2 +- .../typescript/[version]/[[...slug]]/page.tsx | 3 +- 6 files changed, 18201 insertions(+), 15993 deletions(-) diff --git a/apps/portal/public/llms-full.txt b/apps/portal/public/llms-full.txt index f7e49d4c12f..cdb88df40da 100644 --- a/apps/portal/public/llms-full.txt +++ b/apps/portal/public/llms-full.txt @@ -12,7 +12,7 @@ ### Example -#### Basic usage +#### Basic usage ```tsx import { AccountProvider, AccountAddress } from "thirdweb/react"; @@ -25,13 +25,13 @@ import { AccountProvider, AccountAddress } from "thirdweb/react"; ; ``` - Result: +Result: ```html 0x12345674b599ce99958242b3D3741e7b01841DF3 ``` -#### Shorten the address +#### Shorten the address ```tsx import { AccountProvider, AccountAddress } from "thirdweb/react"; @@ -45,7 +45,7 @@ import { shortenAddress } from "thirdweb/utils"; ; ``` - Result: +Result: ```html 0x1234...1DF3 @@ -62,7 +62,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" | "step" | "page" | "location" | "date",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" | "tree" | "listbox",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",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -71,12 +71,12 @@ let __namedParameters: {about : string,accessKey : string,aria-activedescendant let returnType: Element; ``` - a `` containing the full wallet address of the account +a `` containing the full wallet address of the account --- ## AccountBlobbie - A wrapper for the Blobbie component +A wrapper for the Blobbie component ```ts function AccountBlobbie( @@ -86,7 +86,7 @@ function AccountBlobbie( ### Parameters - BlobbieProps +BlobbieProps #### Type @@ -103,9 +103,9 @@ let returnType: Element; ## AccountProvider - A React context provider component that supplies Account-related data to its child components. +A React context provider component that supplies Account-related data to its child components. - This component serves as a wrapper around the `AccountProviderContext.Provider` and passes the provided account data down to all of its child components through the context API. +This component serves as a wrapper around the `AccountProviderContext.Provider` and passes the provided account data down to all of its child components through the context API. ### Example @@ -117,7 +117,7 @@ import { AccountAddress, } from "thirdweb/react"; - + @@ -147,7 +147,7 @@ let returnType: Element; ## Blobbie - A unique gradient avatar based on the provided address. +A unique gradient avatar based on the provided address. ### Example @@ -163,7 +163,7 @@ function Blobbie(props: BlobbieProps): Element; ### Parameters - The component props. +The component props. #### Type @@ -178,24 +178,67 @@ let returnType: Element; ``` --- +## SocialIcon + +Social auth provider icon + +### Example + +```tsx +import { SocialIcon } from "thirdweb/react"; + +; +``` + +Result: An `` component with the src of the icon + +```html + +``` + +```ts +function SocialIcon(__namedParameters: SocialIconProps): Element; +``` + +### Parameters + +#### Type + +```ts +let __namedParameters: {about : string,accessKey : string,alt : string,aria-activedescendant : string,aria-atomic : Booleanish,aria-autocomplete : "inline" | "none" | "list" | "both",aria-braillelabel : string,aria-brailleroledescription : string,aria-busy : Booleanish,aria-checked : boolean | "false" | "true" | "mixed",aria-colcount : number,aria-colindex : number,aria-colindextext : string,aria-colspan : number,aria-controls : string,aria-current : boolean | "false" | "true" | "time" | "date" | "page" | "step" | "location",aria-describedby : string,aria-description : string,aria-details : string,aria-disabled : Booleanish,aria-dropeffect : "link" | "popup" | "execute" | "none" | "copy" | "move",aria-errormessage : string,aria-expanded : Booleanish,aria-flowto : string,aria-grabbed : Booleanish,aria-haspopup : boolean | "false" | "true" | "dialog" | "menu" | "grid" | "listbox" | "tree",aria-hidden : Booleanish,aria-invalid : boolean | "false" | "true" | "grammar" | "spelling",aria-keyshortcuts : string,aria-label : string,aria-labelledby : string,aria-level : number,aria-live : "off" | "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} +``` + +### Returns + +```ts +let returnType: Element; +``` + +an `` component with the src set to the svg +--- + ## WalletProvider - /\*\* +A React context provider component that supplies Wallet-related data to its child components. -* A React context provider component that supplies Wallet-related data to its child components. -* This component serves as a wrapper around the `WalletProviderContext.Provider` and passes -* the provided wallet data down to all of its child components through the context API. +This component serves as a wrapper around the `WalletProviderContext.Provider` and passes the provided wallet data down to all of its child components through the context API. ### Example -* #### Basic usage -* ```tsx +#### Basic usage + +```tsx +import { + WalletProvider, + WalletIcon, + WalletName, +} from "thirdweb/react"; + + + + +; ``` -* import { WalletProvider, WalletIcon, WalletName } from "thirdweb/react"; -* `` -* `` -* `` -* `` ```ts function WalletProvider( @@ -230,14 +273,20 @@ type AutoConnectProps = { client: ThirdwebClient; onConnect?: (wallet: Wallet) => void; onTimeout?: () => void; + siweAuth?: { + doLogin: () => Promise; + isLoggedIn: boolean | undefined; + isLoggingIn: boolean | undefined; + requiresAuth: boolean; + }; timeout?: number; wallets?: Array; }; ``` - Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options. +Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options. - If you are connecting to smart wallet using personal wallet - setting this configuration will autoConnect the personal wallet and then connect to the smart wallet. +If you are connecting to smart wallet using personal wallet - setting this configuration will autoConnect the personal wallet and then connect to the smart wallet. ```tsx Account | undefined; + getAuthToken?: () => string | null; getConfig: () => CreateWalletArgs[1]; id: TWalletId; onConnectRequested?: () => Promise; @@ -320,9 +370,7 @@ let wallet: { getChain: () => | undefined | Readonly; - switchChain: ( - chain: Readonly, - ) => Promise; + switchChain: (chain: Readonly) => Promise; }; ``` @@ -342,9 +390,18 @@ function onTimeout(): void; let returnType: void; ``` - if the autoConnection does not succeed within given timeout in milliseconds, it will be cancelled. +```ts +type siweAuth = { + doLogin: () => Promise; + isLoggedIn: boolean | undefined; + isLoggingIn: boolean | undefined; + requiresAuth: boolean; +}; +``` + +if the autoConnection does not succeed within given timeout in milliseconds, it will be cancelled. - By default, the timeout is set to 15000ms (15 seconds). +By default, the timeout is set to 15000ms (15 seconds). ```tsx ; @@ -386,14 +443,14 @@ function Example() { ## ConnectButton - A fully featured wallet connection component that allows to: +A fully featured wallet connection component that allows to: * Connect to 500+ external wallets * Connect with email, phone, passkey or socials * Convert any wallet to a ERC4337 smart wallet for gasless transactions * Sign in with ethereum (Auth) - Once connected, the component allows to: +Once connected, the component allows to: * Reolve ENS names and avatars * Manage multipple connected wallets @@ -405,7 +462,7 @@ function Example() { ### Example -### Default setup +### Default setup ```tsx import { createThirdwebClient } from "thirdweb"; @@ -416,11 +473,11 @@ const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); ; ``` -[ View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) +[View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) -### Customization options +### Customization options -#### Customizing wallet options +#### Customizing wallet options ```tsx ; ``` -[ View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) +[View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) -#### Customizing the default chain to connect to +#### Customizing the default chain to connect to ```tsx import { sepolia } from "thirdweb/chains"; @@ -443,9 +500,9 @@ import { sepolia } from "thirdweb/chains"; ; ``` -#### Enabling Account Abstraction +#### Enabling Account Abstraction - By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts. And by setting `sponsorGas` to `true` , all transactions done with those smart accounts will be sponsored. +By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts. And by setting `sponsorGas` to `true`, all transactions done with those smart accounts will be sponsored. ```tsx ; ``` - Note that this prop doesn't affect ecosystem wallets. Ecosystem wallets will only be converted to smart accounts if the ecosystem owner has enabled account abstraction. +Note that this prop doesn't affect ecosystem wallets. Ecosystem wallets will only be converted to smart accounts if the ecosystem owner has enabled account abstraction. -#### Enabling sign in with ethereum (Auth) +#### Enabling sign in with ethereum (Auth) ```tsx ; ``` -#### Customizing the theme +#### Customizing the theme ```tsx ; ``` - For more granular control, you can also pass a custom theme object: +For more granular control, you can also pass a custom theme object: ```tsx ; ``` -[ View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme) +[View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme) -#### Changing the display language +#### Changing the display language ```tsx ; ``` -[ View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId) +[View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId) -#### Customizing the connect button UI +#### Customizing the connect button UI ```tsx ; ``` -#### Customizing the modal UI +#### Customizing the modal UI ```tsx ; ``` -#### Customizing details button UI (after connecting) +#### Customizing details button UI (after connecting) ```tsx ; ``` -[ View all available auth helper functions](https://portal.thirdweb.com/references/typescript/v5/createAuth) +[View all available auth helper functions](https://portal.thirdweb.com/references/typescript/v5/createAuth) -#### Customizing the Auth sign in button (after connecting, but before authenticating) +#### Customizing the Auth sign in button (after connecting, but before authenticating) ```tsx ; ``` -#### Customizing supported Tokens and NFTs +#### Customizing supported Tokens and NFTs - These tokens and NFTs will be shown in the modal when the user clicks "View Assets", as well as the send token screen. +These tokens and NFTs will be shown in the modal when the user clicks "View Assets", as well as the send token screen. ```tsx ; ``` -#### Customizing the orders of the tabs in the \[View Funds\] screen +#### Customizing the orders of the tabs in the \[View Funds\] screen - When you click on "View Assets", by default the "Tokens" tab is shown first. If you want to show the "NFTs" tab first, change the order of the asset tabs to: \["nft", "token"\] Note: If an empty array is passed, the \[View Funds\] button will be hidden +When you click on "View Assets", by default the "Tokens" tab is shown first. If you want to show the "NFTs" tab first, change the order of the asset tabs to: \["nft", "token"\] Note: If an empty array is passed, the \[View Funds\] button will be hidden ```tsx ; ``` -#### Callback for when the details modal is closed +#### Callback for when the details modal is closed ```tsx ` component. +A JSX element that renders the `` component. --- ## ConnectEmbed - An inline wallet connection component that allows to: +An inline wallet connection component that allows to: * Connect to 500+ external wallets * Connect with email, phone, passkey or socials * Convert any wallet to a ERC4337 smart wallet for gasless transactions * Sign in with ethereum (Auth) - It renders the same UI as the [ConnectButton](https://portal.thirdweb.com/react/v5/ConnectButton) component's modal - but directly inline in the page instead of being in a modal. +It renders the same UI as the [ConnectButton](https://portal.thirdweb.com/react/v5/ConnectButton) component's modal - but directly inline in the page instead of being in a modal. - Once connected, the component does not render any UI. It only renders UI if wallet is not connected. +Once connected, the component does not render any UI. It only renders UI if wallet is not connected. ### Example -### Default setup +### Default setup ```tsx import { createThirdwebClient } from "thirdweb"; @@ -698,11 +755,11 @@ const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); ; ``` -[ View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) +[View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) -### Customization options +### Customization options -#### Customizing wallet options +#### Customizing wallet options ```tsx ; ``` -[ View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) +[View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) -#### Customizing the default chain to connect to +#### Customizing the default chain to connect to ```tsx import { base } from "thirdweb/chains"; @@ -725,9 +782,9 @@ import { base } from "thirdweb/chains"; ; ``` -#### Enabling Account Abstraction +#### Enabling Account Abstraction - By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts. And by setting `sponsorGas` to `true` , all transactions done with those smart accounts will be sponsored. +By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts. And by setting `sponsorGas` to `true`, all transactions done with those smart accounts will be sponsored. ```tsx ; ``` - Note that this prop doesn't affect ecosystem wallets. Ecosystem wallets will only be converted to smart accounts if the ecosystem owner has enabled account abstraction. +Note that this prop doesn't affect ecosystem wallets. Ecosystem wallets will only be converted to smart accounts if the ecosystem owner has enabled account abstraction. -#### Enabling sign in with ethereum (Auth) +#### Enabling sign in with ethereum (Auth) ```tsx ; ``` -#### Customizing the theme +#### Customizing the theme ```tsx ; ``` - For more granular control, you can also pass a custom theme object: +For more granular control, you can also pass a custom theme object: ```tsx ; ``` -[ View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme) +[View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme) -#### Changing the display language +#### Changing the display language ```tsx ; ``` -[ View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId) +[View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId) ```ts function ConnectEmbed(props: ConnectEmbedProps): Element; @@ -800,9 +857,9 @@ function ConnectEmbed(props: ConnectEmbedProps): Element; ### Parameters - The props for the `ConnectEmbed` component. +The props for the `ConnectEmbed` component. - Refer to the [ConnectEmbedProps](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details +Refer to the [ConnectEmbedProps](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details #### Type @@ -840,16 +897,16 @@ let props: { let returnType: Element; ``` - A JSX element that renders the `` component. +A JSX element that renders the `` component. --- ## SiteEmbed - Embeds another thirdweb-supported site for seamless in-app and ecosystem wallet connection. +Embeds another thirdweb-supported site for seamless in-app and ecosystem wallet connection. - Make sure the embedded site includes `` and supports frame ancestors, see [ here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) for more information. +Make sure the embedded site includes `` and supports frame ancestors, see [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) for more information. - The embedded site must support the connected wallet (ecosystem or in-app). +The embedded site must support the connected wallet (ecosystem or in-app). ### Example @@ -876,7 +933,7 @@ function SiteEmbed( ### Parameters - The props to pass to the iframe +The props to pass to the iframe #### Type @@ -898,9 +955,9 @@ let returnType: Element; ## SiteLink - Creates a link to another thirdweb-supported site with wallet connection parameters. +Creates a link to another thirdweb-supported site with wallet connection parameters. - The target site must support the connected wallet (ecosystem or in-app). +The target site must support the connected wallet (ecosystem or in-app). ### Example @@ -929,7 +986,7 @@ function SiteLink( ### Parameters - The props to pass to the anchor tag +The props to pass to the anchor tag #### Type @@ -951,7 +1008,7 @@ let returnType: Element; ## ThirdwebProvider - The ThirdwebProvider is component is a provider component that sets up the React Query client. +The ThirdwebProvider is component is a provider component that sets up the React Query client. ### Example @@ -994,9 +1051,7 @@ function ThirdwebProvider( isAutoConnecting: Store; removeConnectedWallet: (wallet: Wallet) => void; setActiveWallet: (activeWallet: Wallet) => Promise; - switchActiveWalletChain: ( - chain: Readonly, - ) => Promise; + switchActiveWalletChain: (chain: Readonly) => Promise; }; }>, ): Element; @@ -1004,7 +1059,7 @@ function ThirdwebProvider( ### Parameters - The props for the ThirdwebProvider +The props for the ThirdwebProvider #### Type @@ -1034,9 +1089,7 @@ let props: PropsWithChildren<{ isAutoConnecting: Store; removeConnectedWallet: (wallet: Wallet) => void; setActiveWallet: (activeWallet: Wallet) => Promise; - switchActiveWalletChain: ( - chain: Readonly, - ) => Promise; + switchActiveWalletChain: (chain: Readonly) => Promise; }; }>; ``` @@ -1052,13 +1105,13 @@ let returnType: Element; ## ChainProvider - A React context provider component that supplies Chain-related data to its child components. +A React context provider component that supplies Chain-related data to its child components. - This component serves as a wrapper around the `ChainProviderContext.Provider` and passes the provided chain data down to all of its child components through the context API. +This component serves as a wrapper around the `ChainProviderContext.Provider` and passes the provided chain data down to all of its child components through the context API. ### Example -#### Basic usage +#### Basic usage ```tsx import { ChainProvider, ChainIcon, ChainName } from "thirdweb/react"; @@ -1070,7 +1123,7 @@ import { ethereum } from "thirdweb/chains"; ; ``` -#### Usage with defineChain +#### Usage with defineChain ```tsx import { defineChain } from "thirdweb/chains"l @@ -1108,11 +1161,11 @@ let returnType: Element; ## BuyDirectListingButton - This button is used with thirdweb Marketplace v3 contract, for buying NFT(s) from a listing. +This button is used with thirdweb Marketplace v3 contract, for buying NFT(s) from a listing. - Under the hood, it prepares a transaction using the [buyFromListing extension](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyFromListing)and then pass it to a `` +Under the hood, it prepares a transaction using the [buyFromListing extension](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyFromListing)and then pass it to a `` - Since it uses the TransactionButton, it can take in any props that can be passed to the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton) +Since it uses the TransactionButton, it can take in any props that can be passed to the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton) ### Example @@ -1130,7 +1183,7 @@ import { BuyDirectListingButton } from "thirdweb/react"; ``` - For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs. +For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs. ```ts function BuyDirectListingButton( @@ -1140,6 +1193,8 @@ function BuyDirectListingButton( ### Parameters +props of type [BuyDirectListingButtonProps](https://portal.thirdweb.com/references/typescript/v5/BuyDirectListingButtonProps) + #### Type ```ts @@ -1157,23 +1212,21 @@ let props: Omit & { ```ts let returnType: Element; ``` - -`` --- ## ClaimButton - This button is used to claim tokens (NFT or ERC20) from a given thirdweb Drop contract. +This button is used to claim tokens (NFT or ERC20) from a given thirdweb Drop contract. - there are 3 type of Drop contract: NFT Drop (DropERC721), Edition Drop (DropERC1155) and Token Drop (DropERC20) +there are 3 type of Drop contract: NFT Drop (DropERC721), Edition Drop (DropERC1155) and Token Drop (DropERC20) - Learn more: https://thirdweb.com/explore/drops +Learn more: https://thirdweb.com/explore/drops - Note: This button only works with thirdweb Drop contracts. For custom contract, please use [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton) +Note: This button only works with thirdweb Drop contracts. For custom contract, please use [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton) ### Example - Example for claiming NFT from an NFT Drop contract +Example for claiming NFT from an NFT Drop contract ```tsx import { ClaimButton } from "thirdweb/react"; @@ -1192,7 +1245,7 @@ import { ethereum } from "thirdweb/chains"; ; ``` - For Edition Drop (ERC1155) +For Edition Drop (ERC1155) ```tsx ; ``` - For Token Drop (ERC20) +For Token Drop (ERC20) ```tsx ; ``` - Attach custom Pay metadata +Attach custom Pay metadata ```tsx ; ``` - Since this button uses the `TransactionButton` , it can take in any props that can be passed to the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton) +Since this button uses the `TransactionButton`, it can take in any props that can be passed to the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton) - For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs. +For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs. ```ts function ClaimButton(props: ClaimButtonProps): Element; @@ -1268,14 +1321,14 @@ let props: Omit & { let returnType: Element; ``` - A wrapper for TransactionButton +A wrapper for TransactionButton --- ## CreateDirectListingButton - This button is used to create Direct listings for the thirdweb Marketplace v3 contract +This button is used to create Direct listings for the thirdweb Marketplace v3 contract - It uses the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)and the [createListing extension](https://portal.thirdweb.com/references/typescript/v5/marketplace/createListing) under the hood which means it inherits all the props of those 2 components. +It uses the [TransactionButton](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)and the [createListing extension](https://portal.thirdweb.com/references/typescript/v5/marketplace/createListing) under the hood which means it inherits all the props of those 2 components. ### Example @@ -1296,7 +1349,7 @@ import { CreateDirectListingButton } from "thirdweb/react"; ``` - For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs. +For error handling & callbacks on transaction-sent and transaction-confirmed, please refer to the TransactionButton docs. ```ts function CreateDirectListingButton( @@ -1326,11 +1379,11 @@ let returnType: Element; ## TransactionButton - TransactionButton component is used to render a button that triggers a transaction. It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction. +TransactionButton component is used to render a button that triggers a transaction. It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction. ### Example -#### Basic usage +#### Basic usage ```tsx ; ``` -#### Customize the styling by passing the `unstyled` prop and your inline styles and/or classes: +#### Customize the styling by passing the `unstyled` prop and your inline styles and/or classes: ```tsx ; ``` -#### Handle errors +#### Handle errors ```tsx ``` -#### Alert when a transaction is sent +#### Alert when a transaction is sent ```tsx ``` -#### Alert when a transaction is completed +#### Alert when a transaction is completed ```tsx ``` -#### The onClick prop, if provided, will be called before the transaction is sent. +#### The onClick prop, if provided, will be called before the transaction is sent. ```tsx ``` -#### Attach custom Pay metadata +#### Attach custom Pay metadata ```tsx ; ``` -#### Gasless usage with [ thirdweb Engine](https://portal.thirdweb.com/engine) +#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine) ```tsx ; ``` -#### Gasless usage with OpenZeppelin +#### Gasless usage with OpenZeppelin ```tsx ; let returnType: Element; ``` --- -# Tokens ---- - -## TokenProvider - - A React context provider component that supplies Token-related data to its child components. - - This component serves as a wrapper around the `TokenProviderContext.Provider` and passes the provided token data down to all of its child components through the context API. - -### Example - -#### Basic usage - -```tsx -import { TokenProvider, TokenIcon, TokenName } from "thirdweb/react"; -import { ethereum } from "thirdweb/chains"; - - - - - -``` - -#### This component also works with native token! - -```tsx -import { NATIVE_TOKEN_ADDRESS } from "thirdweb"; -import { ethereum } from "thirdweb/chains"; - - - // "ETH" -; -``` - -```ts -function TokenProvider( - props: PropsWithChildren, -): Element; -``` - -### Parameters - -#### Type - -```ts -let props: PropsWithChildren; -``` - -### Returns - -```ts -let returnType: Element; -``` ---- -# Miscellaneous ---- - -## MediaRenderer - -```ts -function MediaRenderer( - props: MediaRendererProps & RefAttributes, -): ReactNode; -``` - -### Parameters - - Refer to [MediaRendererProps](https://portal.thirdweb.com/references/typescript/v5/MediaRendererProps) to see the available props. - -#### Type - -```ts -let props: MediaRendererProps & RefAttributes; -``` - -### Returns - -```ts -let returnType: ReactNode; -``` +# Buy Crypto --- ## PayEmbed - Embed a prebuilt UI for funding wallets, purchases or transactions with crypto or fiat. +Embed a prebuilt UI for funding wallets, purchases or transactions with crypto or fiat. ### Example -#### Default configuration +#### Default configuration - By default, the `PayEmbed` component will allows users to fund their wallets with crypto or fiat on any of the supported chains.. +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 +#### Top up wallets - You can set the `mode` option to `"fund_wallet"` to allow users to top up their wallets with crypto or fiat. +You can set the `mode` option to `"fund_wallet"` to allow users to top up their wallets with crypto or fiat. ```tsx ; ``` -#### Direct Payments +#### Direct Payments - You can set the `mode` option to `"direct_payment"` to allow users to make a direct payment to a wallet address. +You can set the `mode` option to `"direct_payment"` to allow users to make a direct payment to a wallet address. ```tsx ; ``` -#### Transactions +#### Transactions - You can set the `mode` option to `"transaction"` to allow users to execute a transaction with a different wallet, chain or token. +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: +You can also handle ERC20 payments by passing `erc20value` to your transaction: ```tsx ``` -#### Enable/Disable payment methods +#### Enable/Disable payment methods - You can disable the use of crypto or fiat by setting the `buyWithCrypto` or `buyWithFiat` options to `false` . +You can disable the use of crypto or fiat by setting the `buyWithCrypto` or `buyWithFiat` options to `false`. ```tsx - -### Customize the UI - +/>; +``` + +#### 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. +Refer to the [Theme](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details. -#### Configure the wallet connection +#### Configure the wallet connection - You can customize the wallet connection flow by passing a `connectOptions` object to the `PayEmbed` component. +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. - - @buyCrypto +Refer to the [PayEmbedConnectOptions](https://portal.thirdweb.com/references/typescript/v5/PayEmbedConnectOptions) type for more details. ```ts function PayEmbed(props: PayEmbedProps): Element; @@ -1791,17 +1760,19 @@ function PayEmbed(props: PayEmbedProps): Element; ### Parameters - Props of type [PayEmbedProps](https://portal.thirdweb.com/references/typescript/v5/PayEmbedProps) to configure the PayEmbed component. +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; @@ -1815,6 +1786,91 @@ let props: { let returnType: Element; ``` --- +# Tokens +--- + +## TokenProvider + +A React context provider component that supplies Token-related data to its child components. + +This component serves as a wrapper around the `TokenProviderContext.Provider` and passes the provided token data down to all of its child components through the context API. + +### Example + +#### Basic usage + +```tsx +import { TokenProvider, TokenIcon, TokenName } from "thirdweb/react"; +import { ethereum } from "thirdweb/chains"; + + + + + +``` + +#### This component also works with native token! + +```tsx +import { NATIVE_TOKEN_ADDRESS } from "thirdweb"; +import { ethereum } from "thirdweb/chains"; + + + // "ETH" +; +``` + +```ts +function TokenProvider( + props: PropsWithChildren, +): Element; +``` + +### Parameters + +#### Type + +```ts +let props: PropsWithChildren; +``` + +### Returns + +```ts +let returnType: Element; +``` +--- +# Miscellaneous +--- + +## MediaRenderer + +```ts +function MediaRenderer( + props: MediaRendererProps & RefAttributes, +): ReactNode; +``` + +### Parameters + +Refer to [MediaRendererProps](https://portal.thirdweb.com/references/typescript/v5/MediaRendererProps) to see the available props. + +#### Type + +```ts +let props: MediaRendererProps & RefAttributes; +``` + +### Returns + +```ts +let returnType: ReactNode; +``` +--- **React Hooks** --- # Extensions @@ -1822,28 +1878,24 @@ let returnType: Element; ## EIP5792 --- -## useCallsStatus +## EIP5792.useCapabilities - A hook to get a call bundle's current status according to [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) . +A hook to get the current wallet's capabilities according to [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792). - This function is dependent on the wallet's support for EIP-5792 and could throw an error if it's not supported. +This function is dependent on the wallet's support for EIP-5792, but will not throw._The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792._ ### Example ```tsx -import { useCallsStatus } from "thirdweb/react"; -const { data: status, isLoading } = useCallsStatus({ - bundleId, - client, -}); +import { useCapabilities } from "thirdweb/react"; +const { data: capabilities, isLoading } = useCapabilities(); ``` ```ts -function useCallsStatus(options: { - bundleId: string; - client: ThirdwebClient; +function useCapabilities(options?: { + chainId?: number; queryOptions?: { enabled?: boolean; retry?: number }; -}): UseQueryResult; +}): UseQueryResult<{ message?: string }>; ``` ### Parameters @@ -1852,8 +1904,7 @@ function useCallsStatus(options: { ```ts let options: { - bundleId: string; - client: ThirdwebClient; + chainId?: number; queryOptions?: { enabled?: boolean; retry?: number }; }; ``` @@ -1861,29 +1912,97 @@ let options: { ### Returns ```ts -let returnType: UseQueryResult; +let returnType: UseQueryResult<{ message?: string }>; ``` - a React Query object. +a React Query object. --- -## useCapabilities +## EIP5792.useSendAndConfirmCalls + +A hook to send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be batched and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions. - A hook to get the current wallet's capabilities according to [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) . +When calls are sent, all contracts that are interacted with will have their corresponding reads revalidated via React Query. - This function is dependent on the wallet's support for EIP-5792, but will not throw. _The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792._ +This hook is dependent on the wallet's support for EIP-5792 and could fail. The mutation function will use your currently connected wallet by default, but you can pass it a specific wallet to use if you'd like. ### Example ```tsx -import { useCapabilities } from "thirdweb/react"; -const { data: capabilities, isLoading } = useCapabilities(); +import { useSendCalls } from "thirdweb/react"; + +const sendTx1 = approve({ + contract: USDT_CONTRACT, + amount: 100, + spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6", +}); +const sendTx2 = approve({ + contract: USDT_CONTRACT, + amount: 100, + spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", +}); +const { mutate: sendCalls, data: result } = useSendAndConfirmCalls(); +await sendCalls({ + client, + calls: [sendTx1, sendTx2], +}); + +console.log( + "Transaction hash:", + result.receipts?.[0]?.transactionHash, +); ``` +Sponsor transactions with a paymaster: + ```ts -function useCapabilities(options?: { - queryOptions?: { enabled?: boolean; retry?: number }; -}): UseQueryResult; +const { mutate: sendAndConfirmCalls, data: id } = + useSendAndConfirmCalls(); +const result = await sendAndConfirmCalls({ + client, + calls: [sendTx1, sendTx2], + capabilities: { + paymasterService: { + url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`, + }, + }, +}); +console.log( + "Transaction hash:", + result.receipts?.[0]?.transactionHash, +); +``` + +We recommend proxying any paymaster calls via an API route you setup and control. + +```ts +function useSendAndConfirmCalls(args?: { + maxBlocksWaitTime?: number; +}): UseMutationResult< + { + atomic: boolean; + chainId: number; + id: string; + receipts?: Array< + WalletCallReceipt + >; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; + }, + Error, + Omit< + { + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; + }, + "chain" | "wallet" + > & { wallet?: Wallet } +>; ``` ### Parameters @@ -1891,25 +2010,49 @@ function useCapabilities(options?: { #### Type ```ts -let options: { queryOptions?: { enabled?: boolean; retry?: number } }; +let args: { maxBlocksWaitTime?: number }; ``` ### Returns ```ts -let returnType: UseQueryResult; +let returnType: UseMutationResult< + { + atomic: boolean; + chainId: number; + id: string; + receipts?: Array< + WalletCallReceipt + >; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; + }, + Error, + Omit< + { + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; + }, + "chain" | "wallet" + > & { wallet?: Wallet } +>; ``` - a React Query object. +A React Query mutation object to interact with sendAndConfirmCalls --- -## useSendCalls +## EIP5792.useSendCalls - A hook to send [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions. +A hook to send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions. - When calls are sent, all contracts that are interacted with will have their corresponding reads revalidated via React Query. +When calls are sent, all contracts that are interacted with will have their corresponding reads revalidated via React Query. - This hook is dependent on the wallet's support for EIP-5792 and could fail. The mutatuon function will use your currently connected wallet by default, but you can pass it a specific wallet to use if you'd like. +This hook is dependent on the wallet's support for EIP-5792 and could fail. The mutatuon function will use your currently connected wallet by default, but you can pass it a specific wallet to use if you'd like. ### Example @@ -1926,9 +2069,7 @@ const sendTx2 = approve({ amount: 100, spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", }); -const { mutate: sendCalls, data: bundleId } = useSendCalls({ - client, -}); +const { mutate: sendCalls, data: id } = useSendCalls(); await sendCalls({ wallet, client, @@ -1936,24 +2077,24 @@ await sendCalls({ }); ``` - Await the bundle's full confirmation: +Await the bundle's full confirmation: ```tsx -const { mutate: sendCalls, data: bundleId } = useSendCalls({ - client, - waitForResult: true, -}); +const { mutate: sendCalls, data } = useSendCalls(); +const { data: result, isLoading } = useWaitForCallsReceipt(data); await sendCalls({ wallet, client, calls: [sendTx1, sendTx2], }); + +console.log("Receipts:", result.receipts); ``` - Sponsor transactions with a paymaster: +Sponsor transactions with a paymaster: ```ts -const { mutate: sendCalls, data: bundleId } = useSendCalls(); +const { mutate: sendCalls, data: id } = useSendCalls(); await sendCalls({ client, calls: [sendTx1, sendTx2], @@ -1965,16 +2106,107 @@ await sendCalls({ }); ``` - We recommend proxying any paymaster calls via an API route you setup and control. +We recommend proxying any paymaster calls via an API route you setup and control. ```ts -function useSendCalls(__namedParameters: { - client: ThirdwebClient; - waitForResult?: boolean; -}): UseMutationResult< - GetCallsStatusResponse | WalletSendCallsId, +function useSendCalls(): UseMutationResult< + { + chain: Readonly; + client: ThirdwebClient; + id: string; + wallet: Wallet; + }, Error, - Omit & { wallet?: Wallet } + Omit< + { + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; + }, + "chain" | "wallet" + > & { wallet?: Wallet } +>; +``` + +### Returns + +```ts +let returnType: UseMutationResult< + { + chain: Readonly; + client: ThirdwebClient; + id: string; + wallet: Wallet; + }, + Error, + Omit< + { + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; + }, + "chain" | "wallet" + > & { wallet?: Wallet } +>; +``` + +A React Query mutatuon object to interact with sendCalls +--- + +## EIP5792.useWaitForCallsReceipt + +A hook to wait for the receipt of eip5792 calls. + +### Example + +```tsx +const { data: receipt, isLoading } = useWaitForCallsReceipt({ + id, + client, + chain, + wallet, +}); +``` + +Example with useSendCalls: + +```tsx +const { mutate: sendCalls, data } = useSendCalls(); +const { data: receipt, isLoading } = useWaitForCallsReceipt(data); +``` + +```ts +function useWaitForCallsReceipt( + args: + | undefined + | ({ + chain: Readonly; + client: ThirdwebClient; + id: string; + wallet: Wallet; + } & { + maxBlocksWaitTime?: number; + queryOptions?: { enabled?: boolean }; + }), +): UseQueryResult< + { + atomic: boolean; + chainId: number; + id: string; + receipts?: Array< + WalletCallReceipt + >; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; + }, + Error >; ``` @@ -1983,30 +2215,46 @@ function useSendCalls(__namedParameters: { #### Type ```ts -let __namedParameters: { - client: ThirdwebClient; - waitForResult?: boolean; -}; +let args: + | undefined + | ({ + chain: Readonly; + client: ThirdwebClient; + id: string; + wallet: Wallet; + } & { + maxBlocksWaitTime?: number; + queryOptions?: { enabled?: boolean }; + }); ``` ### Returns ```ts -let returnType: UseMutationResult< - GetCallsStatusResponse | WalletSendCallsId, - Error, - Omit & { wallet?: Wallet } +let returnType: UseQueryResult< + { + atomic: boolean; + chainId: number; + id: string; + receipts?: Array< + WalletCallReceipt + >; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; + }, + Error >; ``` - A React Query mutatuon object to interact with sendCalls +A useQuery object. --- ## ENS --- -## useEnsAvatar +## ENS.useEnsAvatar - Get the ENS avatar for an ENS name +Get the ENS avatar for an ENS name ### Example @@ -2028,7 +2276,7 @@ function useEnsAvatar(options: { ### Parameters - the client and ENS name to get the avatar for +the client and ENS name to get the avatar for #### Type @@ -2048,9 +2296,9 @@ let returnType: UseQueryResult; * a query object that resolves to the avatar --- -## useEnsName +## ENS.useEnsName - Get the ENS name and avatar for an address +Get the ENS name and avatar for an address ### Example @@ -2072,7 +2320,7 @@ function useEnsName(options: { ### Parameters - the client and address to get the ENS name and avatar for +the client and address to get the ENS name and avatar for #### Type @@ -2091,13 +2339,47 @@ let returnType: UseQueryResult; # Wallets --- +## useAuthToken + +A hook that returns the authentication token (JWT) for the currently active wallet. This token can be used to authorize API calls to your backend server. + +### Example + +```tsx +function MyComponent() { + const authToken = useAuthToken(); + + const fetchData = async () => { + const response = await fetch("https://api.example.com/data", { + headers: { + Authorization: `Bearer ${authToken}`, + }, + }); + // ... handle response + }; +} +``` + +```ts +function useAuthToken(): null | string; +``` + +### Returns + +```ts +let returnType: null | string; +``` + +The JWT string if the active wallet is an in-app wallet and matches the active account, null otherwise +--- + ## useLinkProfile - Links a web2 or web3 profile to the connected in-app or ecosystem account. _When a profile is linked to the account, that profile can then be used to sign into the same account._ +Links a web2 or web3 profile to the connected in-app or ecosystem account._When a profile is linked to the account, that profile can then be used to sign into the same account._ ### Example -#### Linking a social profile +#### Linking a social profile ```jsx import { useLinkProfile } from "thirdweb/react"; @@ -2112,7 +2394,7 @@ const onClick = () => { }; ``` -#### Linking an email +#### Linking an email ```jsx import { useLinkProfile } from "thirdweb/react"; @@ -2140,9 +2422,9 @@ const onClick = (code: string) => { }; ``` - The same process can be used for phone and email, simply swap out the `strategy` parameter. +The same process can be used for phone and email, simply swap out the `strategy` parameter. -#### Linking a wallet +#### Linking a wallet ```jsx import { useLinkProfile } from "thirdweb/react"; @@ -2182,7 +2464,7 @@ let returnType: UseMutationResult< ## useNetworkSwitcherModal - Hook to open the Wallet Network Switcher Modal that shows allows users to switch to different network. +Hook to open the Wallet Network Switcher Modal that shows allows users to switch to different network. ### Example @@ -2232,7 +2514,7 @@ let returnType: { ## useProfiles - Retrieves all linked profiles of the connected in-app or ecosystem account. +Retrieves all linked profiles of the connected in-app or ecosystem account. ### Example @@ -2267,16 +2549,16 @@ let args: { client: ThirdwebClient }; let returnType: UseQueryResult>; ``` - A React Query result containing the linked profiles for the connected in-app account. This hook will only run if the connected wallet supports account linking. +A React Query result containing the linked profiles for the connected in-app account. This hook will only run if the connected wallet supports account linking. --- ## useUnlinkProfile - Unlinks a web2 or web3 profile currently connected in-app or ecosystem account. _When a profile is unlinked from the account, it will no longer be able to be used to sign into the account._ +Unlinks a web2 or web3 profile currently connected in-app or ecosystem account._When a profile is unlinked from the account, it will no longer be able to be used to sign into the account._ ### Example -#### Unlinking an email account +#### Unlinking an email account ```jsx import { useUnlinkProfile } from "thirdweb/react"; @@ -2318,11 +2600,11 @@ let returnType: UseMutationResult< ## useWalletBalance - Fetch the balance of a wallet in native currency or for a specific token. Leave `tokenAddress` undefined to fetch the native token balance. +Fetch the balance of a wallet in native currency or for a specific token. Leave `tokenAddress` undefined to fetch the native token balance. ### Example -#### Fetching the native token balance +#### Fetching the native token balance ```ts import { useWalletBalance } from "thirdweb/react"; @@ -2335,7 +2617,7 @@ const { data, isLoading, isError } = useWalletBalance({ console.log("balance", data?.displayValue, data?.symbol); ``` -#### Fetching a specific token balance +#### Fetching a specific token balance ```ts import { useWalletBalance } from "thirdweb/react"; @@ -2360,12 +2642,12 @@ function useWalletBalance( tokenAddress?: string; }, queryOptions?: UseWalletBalanceQueryOptions, -): UseQueryResult; +): UseQueryResult; ``` ### Parameters - GetWalletBalanceOptions - The options for fetching the wallet balance. +GetWalletBalanceOptions - The options for fetching the wallet balance. #### Type @@ -2387,19 +2669,19 @@ let queryOptions: UseWalletBalanceQueryOptions; ### Returns ```ts -let returnType: UseQueryResult; +let returnType: UseQueryResult; ``` - GetWalletBalanceResult The result of the query. +GetWalletBalanceResult The result of the query. --- ## useWalletDetailsModal - Hook to open the Wallet Details Modal that shows various information about the connected wallet and allows users to perform various actions like sending funds, receiving funds, switching networks, Buying tokens, etc. +Hook to open the Wallet Details Modal that shows various information about the connected wallet and allows users to perform various actions like sending funds, receiving funds, switching networks, Buying tokens, etc. ### Example -#### Basic usage +#### Basic usage ```tsx import { createThirdwebClient } from "thirdweb"; @@ -2420,7 +2702,7 @@ function Example() { } ``` -#### Callback for when the modal is closed +#### Callback for when the modal is closed ```tsx detailsModal.open({ @@ -2446,7 +2728,7 @@ let returnType: { ## useWalletImage - Returns the wallet icon for the provided wallet id. +Returns the wallet icon for the provided wallet id. ### Example @@ -2481,7 +2763,7 @@ let returnType: UseQueryResult; ## useWalletInfo - Returns the wallet info for the provided wallet id. +Returns the wallet info for the provided wallet id. ### Example @@ -2489,7 +2771,7 @@ let returnType: UseQueryResult; import { useWalletInfo } from "thirdweb/react"; const { data: walletInfo } = useWalletInfo("io.metamask"); -console.log("Walelt name", walletInfo?.name); +console.log("wallet name", walletInfo?.name); ``` ```ts @@ -2517,7 +2799,7 @@ let returnType: UseQueryResult; ## useActiveAccount - A hook that returns the active account +A hook that returns the active account ### Example @@ -2538,16 +2820,16 @@ function useActiveAccount(): undefined | Account; let returnType: undefined | Account; ``` - The active `Account` or `undefined` if no active account is set. +The active `Account` or `undefined` if no active account is set. --- ## useActiveWallet - A hook that returns the active wallet +A hook that returns the active wallet ### Example -#### Basic usage +#### Basic usage ```jsx import { useActiveWallet } from "thirdweb/react"; @@ -2555,7 +2837,7 @@ import { useActiveWallet } from "thirdweb/react"; const wallet = useActiveWallet(); ``` -#### Listen to account change event +#### Listen to account change event ```jsx const wallet = useActiveWallet(); @@ -2565,7 +2847,7 @@ wallet?.subscribe("accountChanged", (account) => { }); ``` -#### Listen to multiple accounts changed event +#### Listen to multiple accounts changed event ```jsx const wallet = useActiveWallet(); @@ -2575,7 +2857,7 @@ wallet?.subscribe("accountsChanged", (addresses) => { }); ``` -#### Listen to network change event +#### Listen to network change event ```jsx const wallet = useActiveWallet(); @@ -2595,12 +2877,12 @@ function useActiveWallet(): undefined | Wallet; let returnType: undefined | Wallet; ``` - The active `Wallet` or `undefined` if no active wallet is set. +The active `Wallet` or `undefined` if no active wallet is set. --- ## useActiveWalletChain - A hook that returns the chain the active wallet is connected to +A hook that returns the chain the active wallet is connected to ### Example @@ -2622,12 +2904,12 @@ function useActiveWalletChain(): let returnType: undefined | Readonly; ``` - The chain the active wallet is connected to or null if no active wallet. +The chain the active wallet is connected to or null if no active wallet. --- ## useActiveWalletConnectionStatus - A hook that returns the active account's connection status. +A hook that returns the active account's connection status. ### Example @@ -2648,15 +2930,19 @@ function useActiveWalletConnectionStatus(): ConnectionStatus; ### Returns ```ts -let returnType: "connected" | "disconnected" | "connecting"; +let returnType: + | "connected" + | "disconnected" + | "connecting" + | "unknown"; ``` - The active wallet's connection status. +The active wallet's connection status. --- ## useAdminWallet - Get the admin wallet for the active wallet Useful for smart wallets to get the underlying personal account +Get the admin wallet for the active wallet Useful for smart wallets to get the underlying personal account ```ts function useAdminWallet(): undefined | Wallet; @@ -2668,12 +2954,12 @@ function useAdminWallet(): undefined | Wallet; let returnType: undefined | Wallet; ``` - The admin wallet for the active wallet, or the active wallet if it doesn't have an admin account +The admin wallet for the active wallet, or the active wallet if it doesn't have an admin account --- ## useAutoConnect - Autoconnect the last previously connected wallet. +Autoconnect the last previously connected wallet. ### Example @@ -2697,7 +2983,7 @@ function useAutoConnect( ### Parameters - The props for auto connect. +The props for auto connect. #### Type @@ -2709,6 +2995,12 @@ let props: { client: ThirdwebClient; onConnect?: (wallet: Wallet) => void; onTimeout?: () => void; + siweAuth?: { + doLogin: () => Promise; + isLoggedIn: boolean | undefined; + isLoggingIn: boolean | undefined; + requiresAuth: boolean; + }; timeout?: number; wallets?: Array; }; @@ -2720,12 +3012,12 @@ let props: { let returnType: UseQueryResult; ``` - whether the auto connect was successful. +whether the auto connect was successful. --- ## useConnect - A hook to set a wallet as active wallet +A hook to set a wallet as active wallet ### Example @@ -2780,6 +3072,7 @@ let options: { accountAbstraction?: SmartWalletOptions; client: ThirdwebClient; onConnect?: (wallet: Wallet) => void; + setWalletAsActive?: boolean; }; ``` @@ -2795,12 +3088,12 @@ let returnType: { }; ``` - A function that lets you connect a wallet. +A function that lets you connect a wallet. --- ## useConnectedWallets - A hook that returns all connected wallets +A hook that returns all connected wallets ### Example @@ -2820,12 +3113,12 @@ function useConnectedWallets(): Array; let returnType: Array; ``` - An array of all connected wallets +An array of all connected wallets --- ## useConnectModal - hook that allows you to open the Connect UI in a Modal to prompt the user to connect wallet. +hook that allows you to open the Connect UI in a Modal to prompt the user to connect wallet. ### Example @@ -2849,7 +3142,7 @@ function Example() { } ``` - The returned `connect` method takes an object of type [ UseConnectModalOptions](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps)as an argument to customize the Connect Modal UI. Refer to [ UseConnectModalOptions](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available options. +The returned `connect` method takes an object of type [UseConnectModalOptions](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps)as an argument to customize the Connect Modal UI. Refer to [UseConnectModalOptions](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available options. ```ts function useConnectModal(): { @@ -2870,7 +3163,7 @@ let returnType: { ## useDisconnect - Disconnect from given account +Disconnect from given account ### Example @@ -2897,12 +3190,12 @@ function useDisconnect(): { disconnect: (wallet: Wallet) => void }; let returnType: { disconnect: (wallet: Wallet) => void }; ``` - An object with a function to disconnect an account +An object with a function to disconnect an account --- ## useIsAutoConnecting - A hook to check if the auto connect is in progress. +A hook to check if the auto connect is in progress. ### Example @@ -2924,12 +3217,12 @@ function useIsAutoConnecting(): boolean; let returnType: boolean; ``` - A boolean indicating if the auto connect is in progress. +A boolean indicating if the auto connect is in progress. --- ## useSetActiveWallet - A hook that lets you set the active wallet. +A hook that lets you set the active wallet. ### Example @@ -2954,12 +3247,12 @@ function useSetActiveWallet(): ( let returnType: (activeWallet: Wallet) => Promise; ``` - A function that lets you set the active wallet. +A function that lets you set the active wallet. --- ## useSwitchActiveWalletChain - Switch to blockchain with given chain id in the active wallet. +Switch to blockchain with given chain id in the active wallet. ### Example @@ -2975,40 +3268,38 @@ const switchChain = useSwitchActiveWalletChain(); ```ts function useSwitchActiveWalletChain(): ( - chain: Readonly, + chain: Readonly, ) => Promise; ``` ### Returns ```ts -let returnType: ( - chain: Readonly, -) => Promise; +let returnType: (chain: Readonly) => Promise; ``` - A function to switch to blockchain with given chain id in the active wallet. +A function to switch to blockchain with given chain id in the active wallet. --- # Chain --- ## useChainMetadata - Retrieves metadata for a chain such as name, icon, available faucets, block explorers, etc. +Retrieves metadata for a chain such as name, icon, available faucets, block explorers, etc. ### Example -`import { useChainMetadata } from "thirdweb/react"; - -const { data: chainMetadata } = useChainMetadata(defineChain(11155111)); - +```javascript +import { useChainMetadata } from "thirdweb/react"; + +const { data: chainMetadata } = useChainMetadata( + defineChain(11155111), +); + console.log("Name:", chainMetadata.name); // Sepolia - console.log("Faucets:", chainMetadata.faucets); // ["https://thirdweb.com/sepolia/faucet"] - console.log("Explorers:", chainMetadata.explorers); // ["https://sepolia.etherscan.io/"] - -` +``` ```ts function useChainMetadata( @@ -3018,7 +3309,7 @@ function useChainMetadata( ### Parameters - Chain to retrieve metadata for, see [ defineChain](https://portal.thirdweb.com/references/typescript/v5/defineChain) for how to create a chain from a chain ID. +Chain to retrieve metadata for, see [defineChain](https://portal.thirdweb.com/references/typescript/v5/defineChain) for how to create a chain from a chain ID. #### Type @@ -3032,20 +3323,20 @@ let chain: Readonly; let returnType: UseQueryResult; ``` - A React Query result containing the chain metadata +A React Query result containing the chain metadata --- # Contract --- ## useContractEvents - Watches contract events and returns the parsed logs. +Watches contract events and returns the parsed logs. ### Example -#### Using event extensions +#### Using event extensions - The `thirdweb/extesions` export contains event definitions for many popular contracts. You can use these event definitions to watch for specific events with a type-safe API. +The `thirdweb/extesions` export contains event definitions for many popular contracts. You can use these event definitions to watch for specific events with a type-safe API. ```jsx import { useContractEvents } from "thirdweb/react"; @@ -3058,9 +3349,9 @@ const contractEvents = useContractEvents({ }); ``` -#### Using custom events +#### Using custom events - You can also watch for custom events by passing an array of [ prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent) . +You can also watch for custom events by passing an array of [prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent). ```jsx import { useContractEvents } from "thirdweb/react"; @@ -3084,7 +3375,7 @@ function useContractEvents( ### Parameters - The options for watching contract events. +The options for watching contract events. #### Type @@ -3101,16 +3392,16 @@ let returnType: UseQueryResult< >; ``` - The contract events of the watched contract events. +The contract events of the watched contract events. --- ## useReadContract ### Signature#1 - A hook to read state from a contract that automatically updates when the contract changes. +A hook to read state from a contract that automatically updates when the contract changes. - You can use raw read calls or read [ extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract. +You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract. #### Example @@ -3138,13 +3429,15 @@ function useReadContract( ReadContractOptions >, ): UseQueryResult< - ReadContractResult>[2]> + ReadContractResult< + ParseMethod>["outputs"] + > >; ``` #### Parameters - The options for reading from a contract +The options for reading from a contract ##### Type @@ -3158,19 +3451,21 @@ let options: WithPickedOnceQueryOptions< ```ts let returnType: UseQueryResult< - ReadContractResult>[2]> + ReadContractResult< + ParseMethod>["outputs"] + > >; ``` - a UseQueryResult object. +a UseQueryResult object. ### Signature#2 - A hook to read state from a contract that automatically updates when the contract changes. You can use raw read calls or read [ extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract. +A hook to read state from a contract that automatically updates when the contract changes. You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract. #### Example - Read a contract extension let you do complex contract queries with less code. +Read a contract extension let you do complex contract queries with less code. ```jsx import { useReadContract } from "thirdweb/react"; @@ -3190,7 +3485,7 @@ function useReadContract( #### Parameters - An extension to call. +An extension to call. ##### Type @@ -3198,7 +3493,7 @@ function useReadContract( let extension: Extension; ``` - The read extension params. +The read extension params. ##### Type @@ -3214,14 +3509,14 @@ let options: WithPickedOnceQueryOptions< let returnType: UseQueryResult; ``` - a UseQueryResult object. +a UseQueryResult object. --- # Transactions --- ## useEstimateGas - A hook to estimate the gas for a given transaction. +A hook to estimate the gas for a given transaction. ### Example @@ -3235,7 +3530,7 @@ const estimatedGas = await estimateGas(tx); ```ts function useEstimateGas(): UseMutationResult< - EstimateGasResult, + bigint, Error, PreparedTransaction >; @@ -3244,19 +3539,15 @@ function useEstimateGas(): UseMutationResult< ### Returns ```ts -let returnType: UseMutationResult< - EstimateGasResult, - Error, - PreparedTransaction ->; +let returnType: UseMutationResult; ``` - A mutation object to estimate gas. +A mutation object to estimate gas. --- ## useEstimateGasCost - A hook to estimate the gas cost in ether and wei for a given transaction. +A hook to estimate the gas cost in ether and wei for a given transaction. ### Example @@ -3288,12 +3579,12 @@ let returnType: UseMutationResult< >; ``` - A mutation object to estimate gas cost. +A mutation object to estimate gas cost. --- ## useSendAndConfirmTransaction - A hook to send a transaction. +A hook to send a transaction. ### Example @@ -3306,7 +3597,7 @@ const { mutate: sendAndConfirmTx, data: transactionReceipt } = sendAndConfirmTx(tx); ``` -#### Gasless usage with [ thirdweb Engine](https://portal.thirdweb.com/engine) +#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine) ```tsx import { useSendAndConfirmTransaction } from "thirdweb/react"; @@ -3320,7 +3611,7 @@ const mutation = useSendAndConfirmTransaction({ }); ``` -#### Gasless usage with OpenZeppelin +#### Gasless usage with OpenZeppelin ```tsx import { useSendAndConfirmTransaction } from "thirdweb/react"; @@ -3357,12 +3648,12 @@ let returnType: UseMutationResult< >; ``` - A mutation object to send a transaction. +A mutation object to send a transaction. --- ## useSendBatchTransaction - A hook to send a transaction. +A hook to send a transaction. ### Example @@ -3377,7 +3668,12 @@ sendBatch([tx1, tx2]); ```ts function useSendBatchTransaction(): UseMutationResult< - WaitForReceiptOptions, + { + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; + }, Error, Array >; @@ -3387,24 +3683,29 @@ function useSendBatchTransaction(): UseMutationResult< ```ts let returnType: UseMutationResult< - WaitForReceiptOptions, + { + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; + }, Error, Array >; ``` - A mutation object to send a transaction. +A mutation object to send a transaction. --- ## useSendTransaction - A hook to send a transaction with from the user's connected wallet. +A hook to send a transaction with from the user's connected wallet. - You can send a transaction with a [ prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall) , a [ prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction) , or using a write [ Extension](https://portal.thirdweb.com/react/v5/extensions) . +You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/react/v5/extensions). ### Example -#### Sending a prepared contract call +#### Sending a prepared contract call ```tsx import { useSendTransaction } from "thirdweb/react"; @@ -3430,7 +3731,7 @@ const onClick = () => { }; ``` -#### Using a write extension +#### Using a write extension ```tsx import { useSendTransaction } from "thirdweb/react"; @@ -3453,7 +3754,7 @@ const onClick = () => { }; ``` -#### Sending a prepared transaction +#### Sending a prepared transaction ```tsx import { useSendTransaction } from "thirdweb/react"; @@ -3480,7 +3781,7 @@ function useSendTransaction( config: SendTransactionConfig, ): UseMutationResult< { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; @@ -3492,7 +3793,7 @@ function useSendTransaction( ### Parameters - Configuration for the `useSendTransaction` hook. Refer to [SendTransactionConfig](https://portal.thirdweb.com/references/typescript/v5/SendTransactionConfig) for more details. +Configuration for the `useSendTransaction` hook. Refer to [SendTransactionConfig](https://portal.thirdweb.com/references/typescript/v5/SendTransactionConfig) for more details. #### Type @@ -3508,7 +3809,7 @@ let config: { ```ts let returnType: UseMutationResult< { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; @@ -3518,12 +3819,12 @@ let returnType: UseMutationResult< >; ``` - A UseMutationResult object to send a transaction. +A UseMutationResult object to send a transaction. --- ## useSimulateTransaction - A hook to simulate a transaction. +A hook to simulate a transaction. ### Example @@ -3537,7 +3838,7 @@ const result = await simulateTx(tx); ```ts function useSimulateTransaction(): UseMutationResult< - Awaited>, + any, Error, SimulateOptions >; @@ -3547,18 +3848,18 @@ function useSimulateTransaction(): UseMutationResult< ```ts let returnType: UseMutationResult< - Awaited>, + any, Error, SimulateOptions >; ``` - A mutation object to simulate a transaction. +A mutation object to simulate a transaction. --- ## useWaitForReceipt - A hook to wait for a transaction receipt. +A hook to wait for a transaction receipt. ### Example @@ -3575,30 +3876,30 @@ const { data: receipt, isLoading } = useWaitForReceipt({ function useWaitForReceipt( options: | undefined - | { - chain: Readonly; + | ({ + chain: Readonly; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; - }, + } & { queryOptions?: { enabled?: boolean } }), ): UseQueryResult; ``` ### Parameters - The options for waiting for a transaction receipt. +The options for waiting for a transaction receipt. #### Type ```ts let options: | undefined - | { - chain: Readonly; + | ({ + chain: Readonly; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; - }; + } & { queryOptions?: { enabled?: boolean } }); ``` ### Returns @@ -3607,14 +3908,14 @@ let options: let returnType: UseQueryResult; ``` - a query object. +a query object. --- # Social API --- ## useSocialProfiles - Fetches the wallet's available social profiles. +Fetches the wallet's available social profiles. ### Example @@ -3635,7 +3936,7 @@ function useSocialProfiles(options: { ### Parameters - The options to use when fetching the social profiles. +The options to use when fetching the social profiles. #### Type @@ -3649,16 +3950,16 @@ let options: { address: undefined | string; client: ThirdwebClient }; let returnType: UseQueryResult, Error>; ``` - A React Query result containing the social profiles. +A React Query result containing the social profiles. --- # Buy Crypto --- ## useBuyHistory - Hook to get the history of Buy transactions for a given wallet - This includes both "buy with crypto" and "buy with fiat" transactions. +Hook to get the history of Buy transactions for a given wallet - This includes both "buy with crypto" and "buy with fiat" transactions. - This hook is a React Query wrapper of the [getBuyHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyHistory) function. You can also use that function directly +This hook is a React Query wrapper of the [getBuyHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyHistory) function. You can also use that function directly ### Example @@ -3680,7 +3981,7 @@ function useBuyHistory( ### Parameters - object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams) +object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams) #### Type @@ -3693,7 +3994,7 @@ let params: { }; ``` - options to configure the react query +options to configure the react query #### Type @@ -3707,14 +4008,16 @@ let queryParams: BuyHistoryQueryOptions; let returnType: UseQueryResult; ``` - A React Query object which contains the data of type [BuyHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryData) +A React Query object which contains the data of type [BuyHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryData) --- ## useBuyWithCryptoHistory - Hook to get the "Buy with crypto" transaction history for a given wallet address. +Deprecated - This hook is a React Query wrapper of the [getBuyWithCryptoHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoHistory) function. You can also use that function directly +Hook to get the "Buy with crypto" transaction history for a given wallet address. + +This hook is a React Query wrapper of the [getBuyWithCryptoHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoHistory) function. You can also use that function directly ### Example @@ -3736,7 +4039,7 @@ function useBuyWithCryptoHistory( ### Parameters - object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams) +object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams) #### Type @@ -3749,7 +4052,7 @@ let params: { }; ``` - options to configure the react query +options to configure the react query #### Type @@ -3763,18 +4066,20 @@ let queryParams: BuyWithCryptoHistoryQueryOptions; let returnType: UseQueryResult; ``` - A React Query object which contains the data of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData) +A React Query object which contains the data of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData) --- ## 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. +Deprecated + +Hook to get a price quote for performing a "Buy with crypto" transaction that allows users to buy a token with another token - aka a swap. - The price quote is an object of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) . This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc. +The price quote is an object of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote). This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc. - This hook is a React Query wrapper of the [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote) function. You can also use that function directly +This hook is a React Query wrapper of the [getBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoQuote) function. You can also use that function directly - Once you have the quote, you can use the [useSendTransaction](https://portal.thirdweb.com/references/typescript/v5/useSendTransaction) function to send the purchase and [useBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoStatus) function to get the status of the swap transaction. +Once you have the quote, you can use the [useSendTransaction](https://portal.thirdweb.com/references/typescript/v5/useSendTransaction) function to send the purchase and [useBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoStatus) function to get the status of the swap transaction. ### Example @@ -3838,7 +4143,7 @@ function useBuyWithCryptoQuote( ### Parameters - object of type [BuyWithCryptoQuoteQueryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuoteQueryParams) +object of type [BuyWithCryptoQuoteQueryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuoteQueryParams) #### Type @@ -3850,6 +4155,7 @@ let params: { fromTokenAddress: string; intentId?: string; maxSlippageBPS?: number; + paymentLinkId?: string; purchaseData?: object; toAddress: string; toChainId: number; @@ -3860,7 +4166,7 @@ let params: { ); ``` - options to configure the react query +options to configure the react query #### Type @@ -3874,14 +4180,16 @@ let queryParams: BuyWithCryptoQuoteQueryOptions; let returnType: UseQueryResult; ``` - A React Query object which contains the data of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) +A React Query object which contains the data of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) --- ## useBuyWithCryptoStatus - A hook to get a status of a "Buy with crypto" transaction to determine if the transaction is completed, failed or pending. +Deprecated + +A hook to get a status of a "Buy with crypto" transaction to determine if the transaction is completed, failed or pending. - This hook is a React Query wrapper of the [getBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus) function. You can also use that function directly. +This hook is a React Query wrapper of the [getBuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus) function. You can also use that function directly. ### Example @@ -3944,12 +4252,16 @@ function useBuyWithCryptoStatus( ### Parameters - object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) +object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) #### Type ```ts -let params: { client: ThirdwebClient; transactionHash: string }; +let params: { + chainId: number; + client: ThirdwebClient; + transactionHash: string; +}; ``` ### Returns @@ -3958,14 +4270,16 @@ let params: { client: ThirdwebClient; transactionHash: string }; let returnType: UseQueryResult; ``` - A react query object which contains the data of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) +A react query object which contains the data of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) --- ## useBuyWithFiatHistory - Hook to get the "Buy with Fiat" transaction history for a given wallet address. +Deprecated + +Hook to get the "Buy with Fiat" transaction history for a given wallet address. - This hook is a React Query wrapper of the [getBuyWithFiatHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatHistory) function. You can also use that function directly +This hook is a React Query wrapper of the [getBuyWithFiatHistory](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatHistory) function. You can also use that function directly ### Example @@ -3987,7 +4301,7 @@ function useBuyWithFiatHistory( ### Parameters - object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams) +object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams) #### Type @@ -4000,7 +4314,7 @@ let params: { }; ``` - options to configure the react query +options to configure the react query #### Type @@ -4014,18 +4328,20 @@ let queryParams: BuyWithFiatHistoryQueryOptions; let returnType: UseQueryResult; ``` - A React Query object which contains the data of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData) +A React Query object which contains the data of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData) --- ## useBuyWithFiatQuote - Hook to get a price quote for performing a "Buy with Fiat" transaction that allows users to buy a token with fiat currency. +Deprecated - The price quote is an object of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) . This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc. +Hook to get a price quote for performing a "Buy with Fiat" transaction that allows users to buy a token with fiat currency. - This hook is a React Query wrapper of the [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function. You can also use that function directly +The price quote is an object of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote). This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc. - Once you have the `quote` , you can open a new window with `quote.onRampLink` to allow the user to buy the token with fiat currency. and [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus) function to start polling for the status of this transaction. +This hook is a React Query wrapper of the [getBuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function. You can also use that function directly + +Once you have the `quote`, you can open a new window with `quote.onRampLink` to allow the user to buy the token with fiat currency. and [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus) function to start polling for the status of this transaction. ### Example @@ -4066,7 +4382,7 @@ function useBuyWithFiatQuote( ### Parameters - object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams) +object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams) #### Type @@ -4075,9 +4391,10 @@ let params: { client: ThirdwebClient; fromAddress: string; fromAmount?: string; - fromCurrencySymbol: "USD" | "CAD" | "GBP" | "EUR" | "JPY"; + fromCurrencySymbol: CurrencyMeta["shorthand"]; isTestMode?: boolean; maxSlippageBPS?: number; + paymentLinkId?: string; preferredProvider?: FiatProvider; purchaseData?: object; toAddress: string; @@ -4100,14 +4417,16 @@ let queryOptions: BuyWithFiatQuoteQueryOptions; let returnType: UseQueryResult; ``` - A React Query object which contains the data of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) +A React Query object which contains the data of type [BuyWithFiatQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatQuote) --- ## useBuyWithFiatStatus - A hook to get a status of a "Buy with Fiat" transaction to determine if the transaction is completed, failed or pending. +Deprecated + +A hook to get a status of a "Buy with Fiat" transaction to determine if the transaction is completed, failed or pending. - This hook is a React Query wrapper of the [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus) function. You can also use that function directly. +This hook is a React Query wrapper of the [getBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/getBuyWithCryptoStatus) function. You can also use that function directly. `useBuyWithFiatStatus` refetches the status using `getBuyWithFiatStatus` every 5 seconds. @@ -4131,18 +4450,18 @@ function Example() { ```ts function useBuyWithFiatStatus( - params?: GetBuyWithFiatStatusParams, + params?: WithPickedOnceQueryOptions, ): UseQueryResult; ``` ### Parameters - object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) +object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) #### Type ```ts -let params: { client: ThirdwebClient; intentId: string }; +let params: WithPickedOnceQueryOptions; ``` ### Returns @@ -4151,20 +4470,20 @@ let params: { client: ThirdwebClient; intentId: string }; let returnType: UseQueryResult; ``` - A react query object which contains the data of type [BuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) +A react query object which contains the data of type [BuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) --- ## 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. +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. +If the on-ramp provider does not support buying the destination token directly, user can be sent an intermediate token with fiat currency from the on-ramp provider which can be swapped to destination token onchain. `usePostOnRampQuote` hook is used to get the quote for swapping the on-ramp token to destination token. - When you get a "Buy with Fiat" status of type `"CRYPTO_SWAP_REQUIRED"` from the [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus) hook, you can use `usePostOnRampQuote` hook to get the quote of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) for swapping the on-ramp token to destination token to complete the step-2 of the process. +When you get a "Buy with Fiat" status of type `"CRYPTO_SWAP_REQUIRED"` from the [useBuyWithFiatStatus](https://portal.thirdweb.com/references/typescript/v5/useBuyWithFiatStatus) hook, you can use `usePostOnRampQuote` hook to get the quote of type [BuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) for swapping the on-ramp token to destination token to complete the step-2 of the process. - Once you have the quote, you can start the Swap process by following the same steps as mentioned in the [useBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoQuote) documentation. +Once you have the quote, you can start the Swap process by following the same steps as mentioned in the [useBuyWithCryptoQuote](https://portal.thirdweb.com/references/typescript/v5/useBuyWithCryptoQuote) documentation. ```ts function usePostOnRampQuote( @@ -4175,7 +4494,7 @@ function usePostOnRampQuote( ### Parameters - object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams) +object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams) #### Type @@ -4183,6 +4502,7 @@ function usePostOnRampQuote( let params: { buyWithFiatStatus: BuyWithFiatStatus; client: ThirdwebClient; + paymentLinkId?: string; }; ``` @@ -4198,14 +4518,14 @@ let queryOptions: PostOnRampQuoteQueryOptions; 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. +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. +Hook that watches for changes in the block number on a given chain. ### Example @@ -4222,7 +4542,7 @@ function useBlockNumber( ### Parameters - The options for the hook. +The options for the hook. #### Type @@ -4241,7 +4561,7 @@ let options: { let returnType: undefined | bigint; ``` - The latest block number. +The latest block number. --- **Core Functions** --- @@ -4250,11 +4570,11 @@ let returnType: undefined | bigint; ## EIP1193 --- -## fromProvider +## EIP1193.fromProvider - Creates a Thirdweb wallet from an EIP-1193 compatible provider. +Creates a Thirdweb wallet from an EIP-1193 compatible provider. - This adapter allows you to use any EIP-1193 provider (like MetaMask, WalletConnect, etc.) as a Thirdweb wallet. It handles all the necessary conversions between the EIP-1193 interface and Thirdweb's wallet interface. +This adapter allows you to use any EIP-1193 provider (like MetaMask, WalletConnect, etc.) as a Thirdweb wallet. It handles all the necessary conversions between the EIP-1193 interface and Thirdweb's wallet interface. ### Example @@ -4288,13 +4608,15 @@ function fromProvider(options: FromEip1193AdapterOptions): Wallet; ### Parameters - Configuration options for creating the wallet adapter +Configuration options for creating the wallet adapter #### Type ```ts let options: { - provider: EIP1193Provider | (() => Promise); + provider: + | EIP1193Provider + | ((params?: { chainId?: number }) => Promise); walletId?: WalletId; }; ``` @@ -4304,6 +4626,7 @@ let options: { ```ts let returnType: { getAdminAccount?: () => Account | undefined; + getAuthToken?: () => string | null; getConfig: () => CreateWalletArgs[1]; id: TWalletId; onConnectRequested?: () => Promise; @@ -4319,20 +4642,18 @@ let returnType: { getChain: () => | undefined | Readonly; - switchChain: ( - chain: Readonly, - ) => Promise; + switchChain: (chain: Readonly) => Promise; }; ``` - A Thirdweb wallet instance that wraps the EIP-1193 provider +A Thirdweb wallet instance that wraps the EIP-1193 provider --- -## toProvider +## EIP1193.toProvider - Converts a Thirdweb wallet into an EIP-1193 compatible provider. +Converts a Thirdweb wallet into an EIP-1193 compatible provider. - This adapter allows you to use a Thirdweb wallet with any library or dApp that expects an EIP-1193 provider. The provider implements the standard EIP-1193 interface including request handling and event subscription. +This adapter allows you to use a Thirdweb wallet with any library or dApp that expects an EIP-1193 provider. The provider implements the standard EIP-1193 interface including request handling and event subscription. ### Example @@ -4365,7 +4686,7 @@ function toProvider( ### Parameters - Configuration options for creating the provider +Configuration options for creating the provider #### Type @@ -4391,14 +4712,14 @@ let returnType: { }; ``` - An EIP-1193 compatible provider that wraps the Thirdweb wallet +An EIP-1193 compatible provider that wraps the Thirdweb wallet --- ## DEPLOY --- -## prepareDirectDeployTransaction +## DEPLOY.prepareDirectDeployTransaction - Prepares a direct deploy transaction with ABI. +Prepares a direct deploy transaction with ABI. ### Example @@ -4421,15 +4742,16 @@ const tx = prepareDirectDeployTransaction({ function prepareDirectDeployTransaction(options: { abi: Abi; bytecode: `0x${string}`; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; + extraDataWithUri?: string; }): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; ``` ### Parameters - The options for preparing the transaction. +The options for preparing the transaction. #### Type @@ -4437,9 +4759,10 @@ function prepareDirectDeployTransaction(options: { let options: { abi: Abi; bytecode: `0x${string}`; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; + extraDataWithUri?: string; }; ``` @@ -4456,9 +4779,9 @@ let returnType: PreparedTransaction< * The prepared transaction. --- -## computePublishedContractAddress +## DEPLOY.computePublishedContractAddress - Predicts the implementation address of any published contract +Predicts the implementation address of any published contract ### Example @@ -4475,7 +4798,7 @@ const address = await computePublishedContractAddress({ ```ts function computePublishedContractAddress(args: { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; contractId: string; @@ -4487,13 +4810,13 @@ function computePublishedContractAddress(args: { ### Parameters - The arguments for predicting the address of a published contract. +The arguments for predicting the address of a published contract. #### Type ```ts let args: { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; contractId: string; @@ -4509,19 +4832,19 @@ let args: { let returnType: Promise; ``` - A promise that resolves to the predicted address of the contract. +A promise that resolves to the predicted address of the contract. --- -## deployContract +## DEPLOY.deployContract - Deploy a contract on a given chain +Deploy a contract on a given chain ### Example -### Deploying a regular contract from ABI and bytecode +### Deploying a regular contract from ABI and bytecode ```ts -import { deployContract } from "thirdweb/deployContract"; +import { deployContract } from "thirdweb/deploys"; const address = await deployContract({ client, @@ -4536,10 +4859,10 @@ const address = await deployContract({ }); ``` -### Deploying a contract deterministically +### Deploying a contract deterministically ```ts -import { deployContract } from "thirdweb/deployContract"; +import { deployContract } from "thirdweb/deploys"; const address = await deployContract({ client, @@ -4559,16 +4882,22 @@ function deployContract( options: { abi: Abi; bytecode: `0x${string}`; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; - } & { account: Account; salt?: string }, + extraDataWithUri?: string; + } & { + account: Account; + extraDataWithUri?: `0x${string}`; + isStylus?: boolean; + salt?: string; + }, ): Promise; ``` ### Parameters - the deploy options +the deploy options #### Type @@ -4576,10 +4905,16 @@ function deployContract( let options: { abi: Abi; bytecode: `0x${string}`; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; -} & { account: Account; salt?: string }; + extraDataWithUri?: string; +} & { + account: Account; + extraDataWithUri?: `0x${string}`; + isStylus?: boolean; + salt?: string; +}; ``` ### Returns @@ -4591,9 +4926,9 @@ let returnType: Promise; * a promise that resolves to the deployed contract address --- -## deployERC1155Contract +## DEPLOY.deployERC1155Contract - Deploys an thirdweb ERC1155 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +Deploys an thirdweb ERC1155 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. ### Example @@ -4614,7 +4949,7 @@ const contractAddress = await deployERC1155Contract({ ```ts function deployERC1155Contract(options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: ERC1155ContractParams; type: ERC1155ContractType; @@ -4623,14 +4958,14 @@ function deployERC1155Contract(options: { ### Parameters - The deployment options. +The deployment options. #### Type ```ts let options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: ERC1155ContractParams; type: ERC1155ContractType; @@ -4643,12 +4978,12 @@ let options: { let returnType: Promise; ``` - The deployed contract address. +The deployed contract address. --- -## deployERC20Contract +## DEPLOY.deployERC20Contract - Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. ### Example @@ -4669,7 +5004,7 @@ const contractAddress = await deployERC20Contract({ ```ts function deployERC20Contract(options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: ERC20ContractParams; publisher?: string; @@ -4679,14 +5014,14 @@ function deployERC20Contract(options: { ### Parameters - The deployment options. +The deployment options. #### Type ```ts let options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: ERC20ContractParams; publisher?: string; @@ -4700,12 +5035,12 @@ let options: { let returnType: Promise; ``` - The deployed contract address. +The deployed contract address. --- -## deployERC721Contract +## DEPLOY.deployERC721Contract - Deploys an thirdweb ERC721 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +Deploys an thirdweb ERC721 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. ### Example @@ -4726,7 +5061,7 @@ const contractAddress = await deployERC721Contract({ ```ts function deployERC721Contract(options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: ERC721ContractParams; type: ERC721ContractType; @@ -4735,14 +5070,14 @@ function deployERC721Contract(options: { ### Parameters - The deployment options. +The deployment options. #### Type ```ts let options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: ERC721ContractParams; type: ERC721ContractType; @@ -4755,12 +5090,16 @@ let options: { let returnType: Promise; ``` - The deployed contract address. +The deployed contract address. --- -## deployPackContract +## DEPLOY.deployPackContract - Deploy a thirdweb Pack contract +Deprecated + +\[Pack contract is incompatible with Pectra update. Support for this contract is being removed in next release.\] + +Deploy a thirdweb Pack contract ### Example @@ -4781,7 +5120,7 @@ const packAddress = await deployPackContract({ ```ts function deployPackContract(options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: PackContractParams; }): Promise; @@ -4789,14 +5128,14 @@ function deployPackContract(options: { ### Parameters - params for deploying [Pack contract](https://thirdweb.com/thirdweb.eth/Pack) +params for deploying [Pack contract](https://thirdweb.com/thirdweb.eth/Pack) #### Type ```ts let options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: PackContractParams; }; @@ -4809,13 +5148,13 @@ let returnType: Promise; ``` --- -## deployPublishedContract +## DEPLOY.deployPublishedContract - Deploy an instance of a published contract on a given chain +Deploy an instance of a published contract on a given chain ### Example -### Deploying a published contract +### Deploying a published contract ```ts import { deployPublishedContract } from "thirdweb/deploys"; @@ -4833,7 +5172,7 @@ const address = await deployPublishedContract({ }); ``` -### Deploying a published contract deterministically +### Deploying a published contract deterministically ```ts import { deployPublishedContract } from "thirdweb/deploys"; @@ -4860,7 +5199,7 @@ function deployPublishedContract( ### Parameters - the deploy options +the deploy options #### Type @@ -4884,12 +5223,12 @@ let options: { let returnType: Promise; ``` - a promise that resolves to the deployed contract address +a promise that resolves to the deployed contract address --- -## deploySplitContract +## DEPLOY.deploySplitContract - Deploys a thirdweb [Split contract](https://thirdweb.com/thirdweb.eth/Split)On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +Deploys a thirdweb [Split contract](https://thirdweb.com/thirdweb.eth/Split)On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. ### Example @@ -4910,7 +5249,7 @@ const contractAddress = await deploySplitContract({ ```ts function deploySplitContract(options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: SplitContractParams; }): Promise; @@ -4918,14 +5257,14 @@ function deploySplitContract(options: { ### Parameters - The deployment options. +The deployment options. #### Type ```ts let options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; params: SplitContractParams; }; @@ -4937,12 +5276,12 @@ let options: { let returnType: Promise; ``` - The deployed contract address. +The deployed contract address. --- -## prepareDeterministicDeployTransaction +## DEPLOY.prepareDeterministicDeployTransaction - Deploy a contract deterministically - will maintain the same address across chains. This is meant to be used with published contracts configured with the 'direct deploy' method. Under the hood, this uses a keyless transaction with a common create2 factory. +Deploy a contract deterministically - will maintain the same address across chains. This is meant to be used with published contracts configured with the 'direct deploy' method. Under the hood, this uses a keyless transaction with a common create2 factory. ### Example @@ -4960,7 +5299,7 @@ const tx = prepareDeterministicDeployTransaction({ ```ts function prepareDeterministicDeployTransaction(options: { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; contractId: string; @@ -4972,13 +5311,13 @@ function prepareDeterministicDeployTransaction(options: { ### Parameters - the options to deploy the contract +the options to deploy the contract #### Type ```ts let options: { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; constructorParams?: Record; contractId: string; @@ -5000,112 +5339,192 @@ let returnType: PreparedTransaction< * the transaction to deploy the contract --- -## AIRDROP +## MARKETPLACE --- -## airdropERC1155 +## MARKETPLACE.deployMarketplaceContract - Prepares a transaction to call the "airdropERC1155" function on the contract. +Deploys a marketplace contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { airdropERC1155 } from "thirdweb/extensions/airdrop"; +import { deployMarketplaceContract } from "thirdweb/deploys"; -const transaction = airdropERC1155({ - contract, - tokenAddress: ..., - contents: ..., - overrides: { - ... - } +const address = await deployMarketplaceContract({ + client, + chain, + account, + params: { + name: "MarketplaceV3", + description: "MarketplaceV3 deployed using thirdweb SDK", + platformFeeRecipient: + "0x21d514c90ee4E4e4Cd16Ce9185BF01F0F1eE4A04", + platformFeeBps: 1000, + }, }); +``` + +```ts +function deployMarketplaceContract(options: { + account: Account; + chain: Readonly; + client: ThirdwebClient; + params: MarketplaceContractParams; + version?: string; +}): Promise; +``` + +### Parameters + +The options for deploying the marketplace contract. + +#### Type + +```ts +let options: { + account: Account; + chain: Readonly; + client: ThirdwebClient; + params: MarketplaceContractParams; + version?: string; +}; +``` + +### Returns + +```ts +let returnType: Promise; +``` +--- + +## MARKETPLACE.acceptedOfferEvent + +Creates an event object for the AcceptedOffer event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { acceptedOfferEvent } from "thirdweb/extensions/marketplace"; -// Send the transaction -await sendTransaction({ transaction, account }); +const events = await getContractEvents({ +contract, +events: [ + acceptedOfferEvent({ + offeror: ..., + offerId: ..., + assetContract: ..., +}) +], +}); ``` ```ts -function airdropERC1155( - options: BaseTransactionOptions< - | AirdropERC1155Params - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function acceptedOfferEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "offeror"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "offerId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "seller"; readonly type: "address" }, + { readonly name: "quantityBought"; readonly type: "uint256" }, + { readonly name: "totalPricePaid"; readonly type: "uint256" }, + ]; + readonly name: "AcceptedOffer"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the "airdropERC1155" function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions< - | AirdropERC1155Params - | { asyncParams: () => Promise } ->; +let filters: Partial; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "offeror"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "offerId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "seller"; readonly type: "address" }, + { readonly name: "quantityBought"; readonly type: "uint256" }, + { readonly name: "totalPricePaid"; readonly type: "uint256" }, + ]; + readonly name: "AcceptedOffer"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## airdropERC1155WithSignature +## MARKETPLACE.acceptOffer - Prepares a transaction to call the "airdropERC1155WithSignature" function on the contract. +Accepts an offer after performing necessary checks and validations. Throws an error if the offer is not active, the offeror's balance is insufficient, or the offeror's allowance is insufficient. ### Example ```ts +import { acceptOffer } from "thirdweb/extensions/marketplace"; import { sendTransaction } from "thirdweb"; -import { airdropERC1155WithSignature } from "thirdweb/extensions/airdrop"; -const transaction = airdropERC1155WithSignature({ - contract, - req: ..., - signature: ..., - overrides: { - ... - } +const acceptOfferTx = acceptOffer({ + contract, + offerId: 1n, }); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function airdropERC1155WithSignature( - options: BaseTransactionOptions< - | AirdropERC1155WithSignatureParams - | { - asyncParams: () => Promise; - } - >, +function acceptOffer( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "airdropERC1155WithSignature" function. +The options for accepting the offer. #### Type ```ts -let options: BaseTransactionOptions< - | AirdropERC1155WithSignatureParams - | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns @@ -5118,23 +5537,24 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A transaction object that can be sent to accept the offer. --- -## airdropERC20 +## MARKETPLACE.approveBuyerForListing - Prepares a transaction to call the "airdropERC20" function on the contract. +Prepares a transaction to call the "approveBuyerForListing" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { airdropERC20 } from "thirdweb/extensions/airdrop"; +import { approveBuyerForListing } from "thirdweb/extensions/marketplace"; -const transaction = airdropERC20({ +const transaction = approveBuyerForListing({ contract, - tokenAddress: ..., - contents: ..., + listingId: ..., + buyer: ..., + toApprove: ..., overrides: { ... } @@ -5145,24 +5565,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function airdropERC20( +function approveBuyerForListing( options: BaseTransactionOptions< - | AirdropERC20Params - | { asyncParams: () => Promise } + | ApproveBuyerForListingParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "airdropERC20" function. +The options for the "approveBuyerForListing" function. #### Type ```ts let options: BaseTransactionOptions< - | AirdropERC20Params - | { asyncParams: () => Promise } + | ApproveBuyerForListingParams + | { asyncParams: () => Promise } >; ``` @@ -5176,23 +5596,24 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## airdropERC20WithSignature +## MARKETPLACE.approveCurrencyForListing - Prepares a transaction to call the "airdropERC20WithSignature" function on the contract. +Prepares a transaction to call the "approveCurrencyForListing" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { airdropERC20WithSignature } from "thirdweb/extensions/airdrop"; +import { approveCurrencyForListing } from "thirdweb/extensions/marketplace"; -const transaction = airdropERC20WithSignature({ +const transaction = approveCurrencyForListing({ contract, - req: ..., - signature: ..., + listingId: ..., + currency: ..., + pricePerTokenInCurrency: ..., overrides: { ... } @@ -5203,24 +5624,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function airdropERC20WithSignature( +function approveCurrencyForListing( options: BaseTransactionOptions< - | AirdropERC20WithSignatureParams - | { asyncParams: () => Promise } + | ApproveCurrencyForListingParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "airdropERC20WithSignature" function. +The options for the "approveCurrencyForListing" function. #### Type ```ts let options: BaseTransactionOptions< - | AirdropERC20WithSignatureParams - | { asyncParams: () => Promise } + | ApproveCurrencyForListingParams + | { asyncParams: () => Promise } >; ``` @@ -5234,110 +5655,135 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## airdropERC721 +## MARKETPLACE.auctionClosedEvent - Prepares a transaction to call the "airdropERC721" function on the contract. +Creates an event object for the AuctionClosed event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { airdropERC721 } from "thirdweb/extensions/airdrop"; +import { getContractEvents } from "thirdweb"; +import { auctionClosedEvent } from "thirdweb/extensions/marketplace"; -const transaction = airdropERC721({ - contract, - tokenAddress: ..., - contents: ..., - overrides: { - ... - } +const events = await getContractEvents({ +contract, +events: [ + auctionClosedEvent({ + auctionId: ..., + assetContract: ..., + closer: ..., +}) +], }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function airdropERC721( - options: BaseTransactionOptions< - | AirdropERC721Params - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function auctionClosedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "closer"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "auctionCreator"; readonly type: "address" }, + { readonly name: "winningBidder"; readonly type: "address" }, + ]; + readonly name: "AuctionClosed"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the "airdropERC721" function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions< - | AirdropERC721Params - | { asyncParams: () => Promise } ->; +let filters: Partial; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "closer"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "auctionCreator"; readonly type: "address" }, + { readonly name: "winningBidder"; readonly type: "address" }, + ]; + readonly name: "AuctionClosed"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## airdropERC721WithSignature +## MARKETPLACE.bidInAuction - Prepares a transaction to call the "airdropERC721WithSignature" function on the contract. +Places a bid in an English auction. ### Example ```ts +import { bidInAuction } from "thirdweb/extensions/marketplace"; import { sendTransaction } from "thirdweb"; -import { airdropERC721WithSignature } from "thirdweb/extensions/airdrop"; -const transaction = airdropERC721WithSignature({ - contract, - req: ..., - signature: ..., - overrides: { - ... - } +const transaction = bidInAuction({ + contract, + auctionId: 0n, + bidAmount: "100", }); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function airdropERC721WithSignature( - options: BaseTransactionOptions< - | AirdropERC721WithSignatureParams - | { asyncParams: () => Promise } - >, +function bidInAuction( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "airdropERC721WithSignature" function. +The options for placing the bid. #### Type ```ts -let options: BaseTransactionOptions< - | AirdropERC721WithSignatureParams - | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns @@ -5350,102 +5796,123 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A transaction that can be sent to place the bid. --- -## airdropNativeToken +## MARKETPLACE.buyerApprovedForListingEvent - Prepares a transaction to call the "airdropNativeToken" function on the contract. +Creates an event object for the BuyerApprovedForListing event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { airdropNativeToken } from "thirdweb/extensions/airdrop"; +import { getContractEvents } from "thirdweb"; +import { buyerApprovedForListingEvent } from "thirdweb/extensions/marketplace"; -const transaction = airdropNativeToken({ - contract, - contents: ..., - overrides: { - ... - } +const events = await getContractEvents({ +contract, +events: [ + buyerApprovedForListingEvent({ + listingId: ..., + buyer: ..., +}) +], }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function airdropNativeToken( - options: BaseTransactionOptions< - | AirdropNativeTokenParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function buyerApprovedForListingEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "buyer"; + readonly type: "address"; + }, + { readonly name: "approved"; readonly type: "bool" }, + ]; + readonly name: "BuyerApprovedForListing"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the "airdropNativeToken" function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions< - | AirdropNativeTokenParams - | { asyncParams: () => Promise } ->; +let filters: Partial; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "buyer"; + readonly type: "address"; + }, + { readonly name: "approved"; readonly type: "bool" }, + ]; + readonly name: "BuyerApprovedForListing"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## claimERC1155 +## MARKETPLACE.buyFromListing - Claim airdrop of ERC1155 tokens for allowlisted addresses. (Pull based airdrop) +Buys a listing from the marketplace. ### Example ```ts -import { claimERC1155 } from "thirdweb/extensions/airdrop"; +import { buyFromListing } from "thirdweb/extensions/marketplace"; import { sendTransaction } from "thirdweb"; -const tokenAddress = "0x..."; // Address of airdropped tokens to claim -const recipient = "0x..."; // Address of the allowlisted recipient - -const claimTransaction = claimERC1155({ +const transaction = buyFromListing({ contract, - tokenAddress, - recipient, + listingId: 1n, + quantity: 1n, + recipient: "0x...", }); -await sendTransaction({ claimTransaction, account }); +await sendTransaction({ transaction, account }); ``` +When using `buyFromListing` with Pay, the `erc20Value` will be automatically set to the listing currency. + ```ts -function claimERC1155( - options: BaseTransactionOptions, +function buyFromListing( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for buying from a listing. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -5458,45 +5925,41 @@ let returnType: PreparedTransaction< >; ``` - A promise that resolves to the transaction result. +A promise that resolves to the transaction result. --- -## claimERC20 +## MARKETPLACE.buyoutAuction - Claim airdrop of ERC20 tokens for allowlisted addresses. (Pull based airdrop) +Buys out an English auction. ### Example ```ts -import { claimERC20 } from "thirdweb/extensions/airdrop"; +import { buyoutAuction } from "thirdweb/extensions/marketplace"; import { sendTransaction } from "thirdweb"; -const tokenAddress = "0x..."; // Address of airdropped tokens to claim -const recipient = "0x..."; // Address of the allowlisted recipient - -const claimTransaction = claimERC20({ +const transaction = buyoutAuction({ contract, - tokenAddress, - recipient, + auctionId: 0n, }); -await sendTransaction({ claimTransaction, account }); +await sendTransaction({ transaction, account }); ``` ```ts -function claimERC20( - options: BaseTransactionOptions, +function buyoutAuction( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for buying out the auction. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -5509,45 +5972,41 @@ let returnType: PreparedTransaction< >; ``` - A promise that resolves to the transaction result. +A transaction that can be sent to buy out the auction. --- -## claimERC721 +## MARKETPLACE.cancelAuction - Claim airdrop of ERC721 tokens for allowlisted addresses. (Pull based airdrop) +Cancels an auction by providing the necessary options. ### Example ```ts -import { claimERC721 } from "thirdweb/extensions/airdrop"; +import { cancelAuction } from "thirdweb/extensions/marketplace"; import { sendTransaction } from "thirdweb"; -const tokenAddress = "0x..."; // Address of airdropped tokens to claim -const recipient = "0x..."; // Address of the allowlisted recipient - -const claimTransaction = claimERC721({ +const transaction = cancelAuction({ contract, - tokenAddress, - recipient, + auctionId: 0n, }); -await sendTransaction({ claimTransaction, account }); +await sendTransaction({ transaction, account }); ``` ```ts -function claimERC721( - options: BaseTransactionOptions, +function cancelAuction( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for canceling the auction. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -5560,695 +6019,708 @@ let returnType: PreparedTransaction< >; ``` - A promise that resolves to the transaction result. +A transaction that can be sent to cancel the auction. --- -## fetchProofsERC1155 +## MARKETPLACE.cancelledAuctionEvent - Retrieves the claim merkle proof for the provided address. +Creates an event object for the CancelledAuction event. ### Example ```ts -import { fetchProofsERCC1155 } from "thirdweb/extensions/airdrop"; -import { getContract, defineChain } from "thirdweb"; - -const TOKEN = getContracct({ - client, - chain: defineChain(1), - address: "0x...", -}); - -const merkleRoot = await tokenMerkleRoot({ - contract: TOKEN, - tokenAddress: TOKEN.address, -}); +import { getContractEvents } from "thirdweb"; +import { cancelledAuctionEvent } from "thirdweb/extensions/marketplace"; -const proof = await fetchProofsERC1155({ - contract: TOKEN, - recipient: "0x...", - merkleRoot, +const events = await getContractEvents({ +contract, +events: [ + cancelledAuctionEvent({ + auctionCreator: ..., + auctionId: ..., +}) +], }); ``` ```ts -function fetchProofsERC1155(options: { - contract: Readonly>; - merkleRoot: string; - recipient: string; -}): Promise; +function cancelledAuctionEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "auctionCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + ]; + readonly name: "CancelledAuction"; + readonly type: "event"; +}>; ``` ### Parameters +Optional filters to apply to the event. + #### Type ```ts -let options: { - contract: Readonly>; - merkleRoot: string; - recipient: string; -}; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "auctionCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + ]; + readonly name: "CancelledAuction"; + readonly type: "event"; +}>; ``` - A promise that resolves to the proof or null if the recipient is not in the allowlist +The prepared event object. --- -## fetchProofsERC20 +## MARKETPLACE.cancelledListingEvent - Retrieves the claim merkle proof for the provided address. +Creates an event object for the CancelledListing event. ### Example ```ts -import { fetchProofsERCC20 } from "thirdweb/extensions/airdrop"; -import { getContract, defineChain } from "thirdweb"; - -const TOKEN = getContracct({ - client, - chain: defineChain(1), - address: "0x...", -}); - -const merkleRoot = await tokenMerkleRoot({ - contract: TOKEN, - tokenAddress: TOKEN.address, -}); +import { getContractEvents } from "thirdweb"; +import { cancelledListingEvent } from "thirdweb/extensions/marketplace"; -const proof = await fetchProofsERC20({ - contract: TOKEN, - recipient: "0x...", - merkleRoot, +const events = await getContractEvents({ +contract, +events: [ + cancelledListingEvent({ + listingCreator: ..., + listingId: ..., +}) +], }); ``` ```ts -function fetchProofsERC20(options: { - contract: Readonly>; - merkleRoot: string; - recipient: string; - tokenDecimals: number; -}): Promise; +function cancelledListingEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + ]; + readonly name: "CancelledListing"; + readonly type: "event"; +}>; ``` ### Parameters +Optional filters to apply to the event. + #### Type ```ts -let options: { - contract: Readonly>; - merkleRoot: string; - recipient: string; - tokenDecimals: number; -}; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + ]; + readonly name: "CancelledListing"; + readonly type: "event"; +}>; ``` - A promise that resolves to the proof or null if the recipient is not in the allowlist +The prepared event object. --- -## fetchProofsERC721 +## MARKETPLACE.cancelledOfferEvent - Retrieves the claim merkle proof for the provided address. +Creates an event object for the CancelledOffer event. ### Example ```ts -import { fetchProofsERC721 } from "thirdweb/extensions/airdrop"; -import { getContract, defineChain } from "thirdweb"; - -const NFT = getContracct({ - client, - chain: defineChain(1), - address: "0x...", -}); - -const merkleRoot = await tokenMerkleRoot({ - contract: NFT, - tokenAddress: NFT.address, -}); +import { getContractEvents } from "thirdweb"; +import { cancelledOfferEvent } from "thirdweb/extensions/marketplace"; -const proof = await fetchProofsERC721({ - contract: NFT, - recipient: "0x...", - merkleRoot, +const events = await getContractEvents({ +contract, +events: [ + cancelledOfferEvent({ + offeror: ..., + offerId: ..., +}) +], }); ``` ```ts -function fetchProofsERC721(options: { - contract: Readonly>; - merkleRoot: string; - recipient: string; -}): Promise; +function cancelledOfferEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "offeror"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "offerId"; + readonly type: "uint256"; + }, + ]; + readonly name: "CancelledOffer"; + readonly type: "event"; +}>; ``` ### Parameters +Optional filters to apply to the event. + #### Type ```ts -let options: { - contract: Readonly>; - merkleRoot: string; - recipient: string; -}; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "offeror"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "offerId"; + readonly type: "uint256"; + }, + ]; + readonly name: "CancelledOffer"; + readonly type: "event"; +}>; ``` - A promise that resolves to the proof or null if the recipient is not in the allowlist +The prepared event object. --- -## generateAirdropSignatureERC1155 +## MARKETPLACE.cancelListing - Generates the req and signature for sending ERC1155 airdrop. +Prepares a transaction to call the "cancelListing" function on the contract. ### Example ```ts -import { - airdropERC1155WithSignature, - generateAirdropSignatureERC1155, -} from "thirdweb/extensions/airdrop"; - -// list of recipients, tokenIds and amounts to airdrop for each recipient -const contents = [ - { recipient: "0x...", tokenId: 0, amount: 10n }, - { recipient: "0x...", tokenId: 0, amount: 15n }, - { recipient: "0x...", tokenId: 0, amount: 20n }, -]; +import { sendTransaction } from "thirdweb"; +import { cancelListing } from "thirdweb/extensions/marketplace"; -const { req, signature } = await generateAirdropSignatureERC1155({ - account, - contract, - airdropRequest: { - tokenAddress: "0x...", // address of the ERC1155 token to airdrop - contents, - }, +const transaction = cancelListing({ + contract, + listingId: ..., + overrides: { + ... + } }); -const transaction = airdropERC1155WithSignature({ - contract, - req, - signature, -}); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function generateAirdropSignatureERC1155(options: GenerateAirdropERC1155SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> +function cancelListing( + options: BaseTransactionOptions< + | CancelListingParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the airdrop. +The options for the "cancelListing" function. #### Type ```ts -let options: { - account: Account; - airdropRequest: GenerateReqInput; - contract: ThirdwebContract; -}; -``` - +let options: BaseTransactionOptions< + | CancelListingParams + | { asyncParams: () => Promise } +>; +``` + ### Returns ```ts -let returnType: Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the req and signature. +A prepared transaction object. --- -## generateAirdropSignatureERC20 +## MARKETPLACE.cancelOffer - Generates the req and signature for sending ERC20 airdrop. +Prepares a transaction to call the "cancelOffer" function on the contract. ### Example ```ts -import { - airdropERC20WithSignature, - generateAirdropSignatureERC20, -} from "thirdweb/extensions/airdrop"; - -// list of recipients and amounts to airdrop for each recipient -const contents = [ - { recipient: "0x...", amount: 10n }, // amount in wei - { recipient: "0x...", amount: 15n }, // amount in wei - { recipient: "0x...", amount: 20n }, // amount in wei -]; +import { sendTransaction } from "thirdweb"; +import { cancelOffer } from "thirdweb/extensions/marketplace"; -const { req, signature } = await generateAirdropSignatureERC20({ - account, - contract, - airdropRequest: { - tokenAddress: "0x...", // address of the ERC20 token to airdrop - contents, - }, +const transaction = cancelOffer({ + contract, + offerId: ..., + overrides: { + ... + } }); -const transaction = airdropERC20WithSignature({ - contract, - req, - signature, -}); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function generateAirdropSignatureERC20(options: GenerateAirdropERC20SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> +function cancelOffer( + options: BaseTransactionOptions< + | CancelOfferParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the airdrop. +The options for the "cancelOffer" function. #### Type ```ts -let options: { - account: Account; - airdropRequest: GenerateReqInput; - contract: ThirdwebContract; -}; +let options: BaseTransactionOptions< + | CancelOfferParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the req and signature. +A prepared transaction object. --- -## generateAirdropSignatureERC721 +## MARKETPLACE.collectAuctionPayout - Generates the req and signature for sending ERC721 airdrop. +Prepares a transaction to call the "collectAuctionPayout" function on the contract. ### Example ```ts -import { - airdropERC721WithSignature, - generateAirdropSignatureERC721, -} from "thirdweb/extensions/airdrop"; - -// list of recipients and tokenIds to airdrop for each recipient -const contents = [ - { recipient: "0x...", tokenId: 0 }, - { recipient: "0x...", tokenId: 1 }, - { recipient: "0x...", tokenId: 2 }, -]; +import { sendTransaction } from "thirdweb"; +import { collectAuctionPayout } from "thirdweb/extensions/marketplace"; -const { req, signature } = await generateAirdropSignatureERC721({ - account, - contract, - airdropRequest: { - tokenAddress: "0x...", // address of the ERC721 token to airdrop - contents, - }, +const transaction = collectAuctionPayout({ + contract, + auctionId: ..., + overrides: { + ... + } }); -const transaction = airdropERC721WithSignature({ - contract, - req, - signature, -}); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function generateAirdropSignatureERC721(options: GenerateAirdropERC721SignatureOptions) : Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> +function collectAuctionPayout( + options: BaseTransactionOptions< + | CollectAuctionPayoutParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the airdrop. +The options for the "collectAuctionPayout" function. #### Type ```ts -let options: { - account: Account; - airdropRequest: GenerateReqInput; - contract: ThirdwebContract; -}; +let options: BaseTransactionOptions< + | CollectAuctionPayoutParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the req and signature. +A prepared transaction object. --- -## generateMerkleTreeInfoERC1155 +## MARKETPLACE.collectAuctionTokens - Generate merkle tree for a given snapshot. +Prepares a transaction to call the "collectAuctionTokens" function on the contract. ### Example ```ts -import { generateMerkleTreeInfoERC1155 } from "thirdweb/extensions/airdrop"; - -// snapshot / allowlist of airdrop recipients and amounts -const snapshot = [ - { recipient: "0x...", tokenId: 0, amount: 10 }, - { recipient: "0x...", tokenId: 1, amount: 12 }, - { recipient: "0x...", tokenId: 2, amount: 15 }, -]; - -const tokenAddress = "0x..."; // Address of ERC1155 airdrop token +import { sendTransaction } from "thirdweb"; +import { collectAuctionTokens } from "thirdweb/extensions/marketplace"; -const { merkleRoot, snapshotUri } = - await generateMerkleTreeInfoERC1155({ - contract, - tokenAddress, - snapshot, - }); +const transaction = collectAuctionTokens({ + contract, + auctionId: ..., + overrides: { + ... + } +}); -// Optional next steps {See: saveSnapshot and setMerkleRoot functions} -// - Save snapshot on-chain (on the airdrop contract uri) -// - Set merkle root on the contract to enable claiming +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function generateMerkleTreeInfoERC1155( - options: BaseTransactionOptions, -): Promise<{ merkleRoot: string; snapshotUri: string }>; +function collectAuctionTokens( + options: BaseTransactionOptions< + | CollectAuctionTokensParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for the "collectAuctionTokens" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | CollectAuctionTokensParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the merkle-root and snapshot-uri. +A prepared transaction object. --- -## generateMerkleTreeInfoERC20 +## MARKETPLACE.createAuction - Generate merkle tree for a given snapshot. +Creates an auction. ### Example -```ts -import { generateMerkleTreeInfoERC20 } from "thirdweb/extensions/airdrop"; - -// snapshot / allowlist of airdrop recipients and amounts -const snapshot = [ - { recipient: "0x...", amount: 10 }, - { recipient: "0x...", amount: 15 }, - { recipient: "0x...", amount: 20 }, -]; - -const tokenAddress = "0x..."; // Address of ERC20 airdrop token +```typescript +import { createAuction } from "thirdweb/extensions/marketplace"; +import { sendTransaction } from "thirdweb"; -const { merkleRoot, snapshotUri } = await generateMerkleTreeInfoERC20( - { - contract, - tokenAddress, - snapshot, - }, -); +const transaction = createAuction({...}); -// Optional next steps {See: saveSnapshot and setMerkleRoot functions} -// - Save snapshot on-chain (on the airdrop contract uri) -// - Set merkle root on the contract to enable claiming +await sendTransaction({ transaction, account }); ``` ```ts -function generateMerkleTreeInfoERC20( - options: BaseTransactionOptions, -): Promise<{ merkleRoot: string; snapshotUri: string }>; +function createAuction( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for creating the auction. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the merkle-root and snapshot-uri. +The result of creating the auction. --- -## generateMerkleTreeInfoERC721 +## MARKETPLACE.createListing - Generate merkle tree for a given snapshot. +Creates a direct listing. ### Example -```ts -import { generateMerkleTreeInfoERC721 } from "thirdweb/extensions/airdrop"; - -// snapshot / allowlist of airdrop recipients and amounts -const snapshot = [ - { recipient: "0x...", tokenId: 0 }, - { recipient: "0x...", tokenId: 1 }, - { recipient: "0x...", tokenId: 2 }, -]; - -const tokenAddress = "0x..."; // Address of ERC721 airdrop token +```typescript +import { createListing } from "thirdweb/extensions/marketplace"; +import { sendTransaction } from "thirdweb"; -const { merkleRoot, snapshotUri } = - await generateMerkleTreeInfoERC721({ - contract, - tokenAddress, - snapshot, - }); +const transaction = createListing({ + assetContractAddress: "0x...", // the NFT contract address that you want to sell + tokenId={0n}, // the token id you want to sell + pricePerToken="0.1" // sell for 0.1 +}); -// Optional next steps {See: saveSnapshot and setMerkleRoot functions} -// - Save snapshot on-chain (on the airdrop contract uri) -// - Set merkle root on the contract to enable claiming +await sendTransaction({ transaction, account }); ``` ```ts -function generateMerkleTreeInfoERC721( - options: BaseTransactionOptions, -): Promise<{ merkleRoot: string; snapshotUri: string }>; +function createListing( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for creating the direct listing. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the merkle-root and snapshot-uri. +The result of creating the direct listing. --- -## isClaimed +## MARKETPLACE.currencyApprovedForListingEvent - Calls the "isClaimed" function on the contract. +Creates an event object for the CurrencyApprovedForListing event. ### Example ```ts -import { isClaimed } from "thirdweb/extensions/airdrop"; +import { getContractEvents } from "thirdweb"; +import { currencyApprovedForListingEvent } from "thirdweb/extensions/marketplace"; -const result = await isClaimed({ - contract, - receiver: ..., - token: ..., - tokenId: ..., +const events = await getContractEvents({ +contract, +events: [ + currencyApprovedForListingEvent({ + listingId: ..., + currency: ..., +}) +], }); ``` ```ts -function isClaimed( - options: BaseTransactionOptions, -): Promise; +function currencyApprovedForListingEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "currency"; + readonly type: "address"; + }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + ]; + readonly name: "CurrencyApprovedForListing"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the isClaimed function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "currency"; + readonly type: "address"; + }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + ]; + readonly name: "CurrencyApprovedForListing"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## saveSnapshot +## MARKETPLACE.currencyPriceForListing - Generate merkle tree for a given snapshot and save the info on-chain. +Retrieves the currency price for a listing. ### Example ```ts -// This is ERC20 example. Should import and use other ERC variants as needed - -import { generateMerkleTreeInfoERC20, saveSnapshot, setMerkleRoot } from "thirdweb/extensions/airdrop"; - -// snapshot / allowlist of airdrop recipients and amounts -const snapshot = [ - { recipient: "0x...", amount: 10 }, - { recipient: "0x...", amount: 15 }, - { recipient: "0x...", amount: 20 }, -]; - -const tokenAddress = "0x..." // Address of airdrop token - -const { merkleRoot, snapshotUri } = await generateMerkleTreeInfoERC20({ - contract, - tokenAddress, - snapshot -}); - -const saveSnapshotTransaction = saveSnapshot({ - contract, - merkleRoot, - snapshotUri, -}); -await sendTransaction({ saveSnapshotTransaction, account }); +import { currencyPriceForListing } from "thirdweb/extensions/marketplace"; -const setMerkleRootTransaction = setMerkleRoot({ +const price = await currencyPriceForListing({ contract, - token, - tokenMerkleRoot: merkleRoot as `0x${string}`, - resetClaimStatus: false // toggle as needed - signature, + listingId: 1n, + currency: "0x...", }); -await sendTransaction({ setMerkleRootTransaction, account }); ``` ```ts -function saveSnapshot( - options: BaseTransactionOptions, -): PreparedTransaction; +function currencyPriceForListing( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The transaction options. +The options for retrieving the currency price. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +A promise that resolves to the currency price as a bigint. --- -## setMerkleRoot +## MARKETPLACE.executeSale - Prepares a transaction to call the "setMerkleRoot" function on the contract. +Executes a sale for an English auction. ### Example ```ts +import { executeSale } from "thirdweb/extensions/marketplace"; import { sendTransaction } from "thirdweb"; -import { setMerkleRoot } from "thirdweb/extensions/airdrop"; -const transaction = setMerkleRoot({ - contract, - token: ..., - tokenMerkleRoot: ..., - resetClaimStatus: ..., - overrides: { - ... - } +const transaction = executeSale({ + contract, + auctionId: 0n, }); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function setMerkleRoot( - options: BaseTransactionOptions< - | SetMerkleRootParams - | { asyncParams: () => Promise } - >, +function executeSale( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "setMerkleRoot" function. +The options for executing the sale. #### Type ```ts -let options: BaseTransactionOptions< - | SetMerkleRootParams - | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns @@ -6261,449 +6733,578 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A transaction that can be sent to execute the sale. --- -## tokenConditionId +## MARKETPLACE.getAllAuctions - Calls the "tokenConditionId" function on the contract. +Retrieves all auctions based on the provided options. ### Example ```ts -import { tokenConditionId } from "thirdweb/extensions/airdrop"; +import { getAllAuctions } from "thirdweb/extensions/marketplace"; -const result = await tokenConditionId({ - contract, - tokenAddress: ..., +const listings = await getAllAuctions({ + contract, + start: 0, + count: 10, }); ``` ```ts -function tokenConditionId( - options: BaseTransactionOptions, -): Promise; +function getAllAuctions( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the tokenConditionId function. +The options for retrieving the auctions. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + asset: NFT; + assetContractAddress: Address; + bidBufferBps: bigint; + buyoutBidAmount: bigint; + buyoutCurrencyValue: GetBalanceResult; + creatorAddress: Address; + currencyContractAddress: Address; + endTimeInSeconds: bigint; + id: bigint; + minimumBidAmount: bigint; + minimumBidCurrencyValue: GetBalanceResult; + quantity: bigint; + startTimeInSeconds: bigint; + status: ListingStatus; + timeBufferInSeconds: bigint; + tokenId: bigint; + type: "english-auction"; +}; ``` - The parsed result of the function call. +A promise that resolves to the auctions array. --- -## tokenMerkleRoot +## MARKETPLACE.getAllListings - Calls the "tokenMerkleRoot" function on the contract. +Retrieves all direct listings based on the provided options. ### Example ```ts -import { tokenMerkleRoot } from "thirdweb/extensions/airdrop"; +import { getAllListings } from "thirdweb/extensions/marketplace"; -const result = await tokenMerkleRoot({ - contract, - tokenAddress: ..., +const listings = await getAllListings({ + contract, + start: 0, + count: 10, }); ``` ```ts -function tokenMerkleRoot( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function getAllListings( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the tokenMerkleRoot function. +The options for retrieving the listing. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: { + asset: NFT; + assetContractAddress: Address; + creatorAddress: Address; + currencyContractAddress: Address; + currencyValuePerToken: GetBalanceResult; + endTimeInSeconds: bigint; + id: bigint; + isReservedListing: boolean; + pricePerToken: bigint; + quantity: bigint; + startTimeInSeconds: bigint; + status: ListingStatus; + tokenId: bigint; + type: "direct-listing"; +}; ``` - The parsed result of the function call. ---- -## COMMON +A promise that resolves to the direct listings array. --- -## contractURI +## MARKETPLACE.getAllOffers - Calls the "contractURI" function on the contract. +Retrieves all offers based on the provided options. ### Example ```ts -import { contractURI } from "thirdweb/extensions/common"; +import { getAllOffers } from "thirdweb/extensions/marketplace"; -const result = await contractURI({ +const listings = await getAllOffers({ contract, + start: 0, + count: 10, }); ``` ```ts -function contractURI( - options: BaseTransactionOptions, -): Promise; +function getAllOffers( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the contractURI function. +The options for retrieving the offers. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + asset: NFT; + assetContractAddress: Address; + currencyContractAddress: Address; + currencyValue: GetBalanceResult; + endTimeInSeconds: bigint; + id: bigint; + offerorAddress: Address; + quantity: bigint; + status: ListingStatus; + tokenId: bigint; + totalPrice: bigint; +}; ``` - The parsed result of the function call. +A promise that resolves to the offers array. --- -## getContractMetadata +## MARKETPLACE.getAllValidAuctions - Retrieves the contract metadata including name and symbol. +Retrieves all valid auctions based on the provided options. ### Example ```ts -import { getContractMetadata } from "thirdweb/extensions/common"; -const metadata = await getContractMetadata({ contract }); +import { getAllValidAuctions } from "thirdweb/extensions/marketplace"; + +const validAuctions = await getAllValidAuctions({ + contract, + start: 0, + count: 10, +}); ``` ```ts -function getContractMetadata( - options: BaseTransactionOptions, -): Promise<{ name: string; symbol: string }>; +function getAllValidAuctions( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The transaction options. +The options for retrieving the listing. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<{ name: string; symbol: string }>; -``` - - A promise that resolves to an object containing the resolved metadata, name, and symbol. ---- - -## getDefaultRoyaltyInfo - - Calls the "getDefaultRoyaltyInfo" function on the contract. - -### Example - -```ts -import { getDefaultRoyaltyInfo } from "thirdweb/extensions/common"; - -const result = await getDefaultRoyaltyInfo({ - contract, -}); -``` - -```ts -function getDefaultRoyaltyInfo( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the getDefaultRoyaltyInfo function. - -#### Type - -```ts -let options: { contract: ThirdwebContract } & T; -``` - -### Returns - -```ts -let returnType: Promise; +let returnType: { + asset: NFT; + assetContractAddress: Address; + bidBufferBps: bigint; + buyoutBidAmount: bigint; + buyoutCurrencyValue: GetBalanceResult; + creatorAddress: Address; + currencyContractAddress: Address; + endTimeInSeconds: bigint; + id: bigint; + minimumBidAmount: bigint; + minimumBidCurrencyValue: GetBalanceResult; + quantity: bigint; + startTimeInSeconds: bigint; + status: ListingStatus; + timeBufferInSeconds: bigint; + tokenId: bigint; + type: "english-auction"; +}; ``` - The parsed result of the function call. +A promise that resolves to the valid auctions array. --- -## getPlatformFeeInfo +## MARKETPLACE.getAllValidListings - Calls the "getPlatformFeeInfo" function on the contract. +Retrieves all valid direct listings based on the provided options. ### Example ```ts -import { getPlatformFeeInfo } from "thirdweb/extensions/common"; +import { getAllValidListings } from "thirdweb/extensions/marketplace"; -const result = await getPlatformFeeInfo({ +const validListings = await getAllValidListings({ contract, + start: 0, + count: 10, }); ``` ```ts -function getPlatformFeeInfo( - options: BaseTransactionOptions, -): Promise; +function getAllValidListings( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the getPlatformFeeInfo function. +The options for retrieving the valid listing. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + asset: NFT; + assetContractAddress: Address; + creatorAddress: Address; + currencyContractAddress: Address; + currencyValuePerToken: GetBalanceResult; + endTimeInSeconds: bigint; + id: bigint; + isReservedListing: boolean; + pricePerToken: bigint; + quantity: bigint; + startTimeInSeconds: bigint; + status: ListingStatus; + tokenId: bigint; + type: "direct-listing"; +}; ``` - The parsed result of the function call. +A promise that resolves to the direct listings array. --- -## getRoyaltyInfoForToken +## MARKETPLACE.getAllValidOffers - Calls the "getRoyaltyInfoForToken" function on the contract. +Retrieves all valid offers based on the provided options. ### Example ```ts -import { getRoyaltyInfoForToken } from "thirdweb/extensions/common"; +import { getAllValidOffers } from "thirdweb/extensions/marketplace"; -const result = await getRoyaltyInfoForToken({ - contract, - tokenId: ..., +const validOffers = await getAllValidOffers({ + contract, + start: 0, + count: 10, }); ``` ```ts -function getRoyaltyInfoForToken( - options: BaseTransactionOptions, -): Promise; +function getAllValidOffers( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the getRoyaltyInfoForToken function. +The options for retrieving the valid offers. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + asset: NFT; + assetContractAddress: Address; + currencyContractAddress: Address; + currencyValue: GetBalanceResult; + endTimeInSeconds: bigint; + id: bigint; + offerorAddress: Address; + quantity: bigint; + status: ListingStatus; + tokenId: bigint; + totalPrice: bigint; +}; ``` - The parsed result of the function call. +A promise that resolves to the offers array. --- -## isGetContractMetadataSupported +## MARKETPLACE.getAuction - Checks if the `contractURI` method is supported by the given contract. +Retrieves an auction listing based on the provided options. ### Example ```ts -import { isContractURISupported } from "thirdweb/extensions/common"; -const supported = isContractURISupported(["0x..."]); +import { getListing } from "thirdweb/extensions/marketplace"; + +const listing = await getListing({ contract, listingId: 1n }); ``` ```ts -function isGetContractMetadataSupported( - availableSelectors: Array, -): boolean; +function getAuction( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for retrieving the listing. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: { + asset: NFT; + assetContractAddress: Address; + bidBufferBps: bigint; + buyoutBidAmount: bigint; + buyoutCurrencyValue: GetBalanceResult; + creatorAddress: Address; + currencyContractAddress: Address; + endTimeInSeconds: bigint; + id: bigint; + minimumBidAmount: bigint; + minimumBidCurrencyValue: GetBalanceResult; + quantity: bigint; + startTimeInSeconds: bigint; + status: ListingStatus; + timeBufferInSeconds: bigint; + tokenId: bigint; + type: "english-auction"; +}; ``` - A boolean indicating if the `contractURI` method is supported. +A promise that resolves to the direct listing. --- -## isGetDefaultRoyaltyInfoSupported +## MARKETPLACE.getListing - Checks if the `getDefaultRoyaltyInfo` method is supported by the given contract. +Retrieves a direct listing based on the provided options. ### Example ```ts -import { isGetDefaultRoyaltyInfoSupported } from "thirdweb/extensions/common"; -const supported = isGetDefaultRoyaltyInfoSupported(["0x..."]); +import { getListing } from "thirdweb/extensions/marketplace"; + +const listing = await getListing({ contract, listingId: 1n }); ``` ```ts -function isGetDefaultRoyaltyInfoSupported( - availableSelectors: Array, -): boolean; +function getListing( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for retrieving the listing. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: { + asset: NFT; + assetContractAddress: Address; + creatorAddress: Address; + currencyContractAddress: Address; + currencyValuePerToken: GetBalanceResult; + endTimeInSeconds: bigint; + id: bigint; + isReservedListing: boolean; + pricePerToken: bigint; + quantity: bigint; + startTimeInSeconds: bigint; + status: ListingStatus; + tokenId: bigint; + type: "direct-listing"; +}; ``` - A boolean indicating if the `getDefaultRoyaltyInfo` method is supported. +A promise that resolves to the direct listing. --- -## isGetPlatformFeeInfoSupported +## MARKETPLACE.getOffer - Checks if the `getPlatformFeeInfo` method is supported by the given contract. +Retrieves an offer based on the provided options. ### Example ```ts -import { isGetPlatformFeeInfoSupported } from "thirdweb/extensions/common"; -const supported = isGetPlatformFeeInfoSupported(["0x..."]); +import { getOffer } from "thirdweb/extensions/marketplace"; + +const listing = await getOffer({ contract, listingId: 1n }); ``` ```ts -function isGetPlatformFeeInfoSupported( - availableSelectors: Array, -): boolean; +function getOffer( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for retrieving the offer. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: { + asset: NFT; + assetContractAddress: Address; + currencyContractAddress: Address; + currencyValue: GetBalanceResult; + endTimeInSeconds: bigint; + id: bigint; + offerorAddress: Address; + quantity: bigint; + status: ListingStatus; + tokenId: bigint; + totalPrice: bigint; +}; ``` - A boolean indicating if the `getPlatformFeeInfo` method is supported. +A promise that resolves to the offer. --- -## isGetRoyaltyInfoForTokenSupported +## MARKETPLACE.getWinningBid - Checks if the `getRoyaltyInfoForToken` method is supported by the given contract. +Retrieves the winning bid information for a given auction. ### Example ```ts -import { isGetRoyaltyInfoForTokenSupported } from "thirdweb/extensions/common"; -const supported = isGetRoyaltyInfoForTokenSupported(["0x..."]); +import { getWinningBid } from "thirdweb/extensions/marketplace"; + +const winningBid = await getWinningBid({ + contract, + auctionId: 0n, +}); ``` ```ts -function isGetRoyaltyInfoForTokenSupported( - availableSelectors: Array, -): boolean; +function getWinningBid( + options: BaseTransactionOptions, +): Promise< + | undefined + | { + bidAmountWei: bigint; + bidderAddress: string; + currencyAddress: string; + currencyValue: CurrencyValue; + } +>; ``` ### 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. +The options for retrieving the winning bid. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise< + | undefined + | { + bidAmountWei: bigint; + bidderAddress: string; + currencyAddress: string; + currencyValue: CurrencyValue; + } +>; ``` - A boolean indicating if the `getRoyaltyInfoForToken` method is supported. +The winning bid information, or undefined if there is no winning bid. --- -## isMulticallSupported +## MARKETPLACE.isBidInAuctionSupported - Checks if the `multicall` method is supported by the given contract. +Checks if the `bidInAuction` method is supported by the given contract. ### Example ```ts -import { isMulticallSupported } from "thirdweb/extensions/common"; +import { isBidInAuctionSupported } from "thirdweb/extensions/marketplace"; -const supported = isMulticallSupported(["0x..."]); +const supported = isBidInAuctionSupported(["0x..."]); ``` ```ts -function isMulticallSupported( +function isBidInAuctionSupported( 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. +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 @@ -6717,61 +7318,71 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `multicall` method is supported. +A boolean indicating if the `bidInAuction` method is supported. --- -## isNameSupported +## MARKETPLACE.isBuyerApprovedForListing - Checks if the `name` method is supported by the given contract. +Checks if the buyer is approved for a listing. ### Example ```ts -import { isNameSupported } from "thirdweb/extensions/common"; -const supported = isNameSupported(["0x..."]); +import { isBuyerApprovedForListing } from "thirdweb/extensions/marketplace"; + +const isApproved = await isBuyerApprovedForListing({ + contract, + listingId: 1n, + buyer: "0x...", +}); ``` ```ts -function isNameSupported(availableSelectors: Array): boolean; +function isBuyerApprovedForListing( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for checking buyer approval. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `name` method is supported. +A promise that resolves to a boolean indicating whether the buyer is approved for the listing. --- -## isOwnerSupported +## MARKETPLACE.isBuyFromListingSupported - Checks if the `owner` method is supported by the given contract. +Checks if the `buyFromListing` method is supported by the given contract. ### Example ```ts -import { isOwnerSupported } from "thirdweb/extensions/common"; -const supported = isOwnerSupported(["0x..."]); +import { isBuyFromListingSupported } from "thirdweb/extensions/marketplace"; + +const supported = isBuyFromListingSupported(["0x..."]); ``` ```ts -function isOwnerSupported(availableSelectors: Array): boolean; +function isBuyFromListingSupported( + 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. +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 @@ -6785,29 +7396,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `owner` method is supported. +A boolean indicating if the `buyFromListing` method is supported. --- -## isPrimarySaleRecipientSupported +## MARKETPLACE.isCancelAuctionSupported - Checks if the `primarySaleRecipient` method is supported by the given contract. +Checks if the `cancelAuction` method is supported by the given contract. ### Example ```ts -import { isPrimarySaleRecipientSupported } from "thirdweb/extensions/common"; -const supported = isPrimarySaleRecipientSupported(["0x..."]); +import { isCancelAuctionSupported } from "thirdweb/extensions/marketplace"; + +const supported = isCancelAuctionSupported(["0x..."]); ``` ```ts -function isPrimarySaleRecipientSupported( +function isCancelAuctionSupported( 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. +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 @@ -6821,30 +7433,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `primarySaleRecipient` method is supported. +A boolean indicating if the `cancelAuction` method is supported. --- -## isSetContractURISupported +## MARKETPLACE.isCancelListingSupported - Checks if the `setContractURI` method is supported by the given contract. +Checks if the `cancelListing` method is supported by the given contract. ### Example ```ts -import { isSetContractURISupported } from "thirdweb/extensions/common"; +import { isCancelListingSupported } from "thirdweb/extensions/marketplace"; -const supported = isSetContractURISupported(["0x..."]); +const supported = isCancelListingSupported(["0x..."]); ``` ```ts -function isSetContractURISupported( +function isCancelListingSupported( 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. +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 @@ -6858,30 +7470,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `setContractURI` method is supported. +A boolean indicating if the `cancelListing` method is supported. --- -## isSetDefaultRoyaltyInfoSupported +## MARKETPLACE.isCreateAuctionSupported - Checks if the `setDefaultRoyaltyInfo` method is supported by the given contract. +Checks if the `createAuction` method is supported by the given contract. ### Example ```ts -import { isSetDefaultRoyaltyInfoSupported } from "thirdweb/extensions/common"; +import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace"; -const supported = isSetDefaultRoyaltyInfoSupported(["0x..."]); +const supported = isCreateAuctionSupported(["0x..."]); ``` ```ts -function isSetDefaultRoyaltyInfoSupported( +function isCreateAuctionSupported( 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. +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 @@ -6895,30 +7507,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `setDefaultRoyaltyInfo` method is supported. +A boolean indicating if the `createAuction` method is supported. --- -## isSetPlatformFeeInfoSupported +## MARKETPLACE.isCreateListingSupported - Checks if the `setPlatformFeeInfo` method is supported by the given contract. +Checks if the `createListing` method is supported by the given contract. ### Example ```ts -import { isSetPlatformFeeInfoSupported } from "thirdweb/extensions/common"; +import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace"; -const supported = isSetPlatformFeeInfoSupported(["0x..."]); +const supported = isCreateAuctionSupported(["0x..."]); ``` ```ts -function isSetPlatformFeeInfoSupported( +function isCreateListingSupported( 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. +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 @@ -6932,67 +7544,71 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `setPlatformFeeInfo` method is supported. +A boolean indicating if the `createListing` method is supported. --- -## isSetPrimarySaleRecipientSupported +## MARKETPLACE.isCurrencyApprovedForListing - Checks if the `setPrimarySaleRecipient` method is supported by the given contract. +Calls the "isCurrencyApprovedForListing" function on the contract. ### Example ```ts -import { isSetPrimarySaleRecipientSupported } from "thirdweb/extensions/common"; +import { isCurrencyApprovedForListing } from "thirdweb/extensions/marketplace"; -const supported = isSetPrimarySaleRecipientSupported(["0x..."]); +const result = await isCurrencyApprovedForListing({ + contract, + listingId: ..., + currency: ..., +}); ``` ```ts -function isSetPrimarySaleRecipientSupported( - availableSelectors: Array, -): boolean; +function isCurrencyApprovedForListing( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the isCurrencyApprovedForListing function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `setPrimarySaleRecipient` method is supported. +The parsed result of the function call. --- -## isSetRoyaltyInfoForTokenSupported +## MARKETPLACE.isGetAuctionSupported - Checks if the `setRoyaltyInfoForToken` method is supported by the given contract. +Checks if the `getAuction` method is supported by the given contract. ### Example ```ts -import { isSetRoyaltyInfoForTokenSupported } from "thirdweb/extensions/common"; +import { isGetAuctionSupported } from "thirdweb/extensions/marketplace"; -const supported = isSetRoyaltyInfoForTokenSupported(["0x..."]); +const supported = isGetAuctionSupported(["0x..."]); ``` ```ts -function isSetRoyaltyInfoForTokenSupported( +function isGetAuctionSupported( 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. +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 @@ -7006,29 +7622,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `setRoyaltyInfoForToken` method is supported. +A boolean indicating if the `getAuction` method is supported. --- -## isSymbolSupported +## MARKETPLACE.isGetListingSupported - Checks if the `symbol` method is supported by the given contract. +Checks if the `isGetListingSupported` method is supported by the given contract. ### Example ```ts -import { isSymbolSupported } from "thirdweb/extensions/common"; -const supported = isSymbolSupported(["0x..."]); +import { isGetListingSupported } from "thirdweb/extensions/marketplace"; + +const supported = isGetListingSupported(["0x..."]); ``` ```ts -function isSymbolSupported( +function isGetListingSupported( 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. +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 @@ -7042,186 +7659,224 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `symbol` method is supported. +A boolean indicating if the `isGetListingSupported` method is supported. --- -## multicall +## MARKETPLACE.isGetWinningBidSupported - Prepares a transaction to call the "multicall" function on the contract. +Checks if the `getWinningBid` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { multicall } from "thirdweb/extensions/common"; - -const transaction = multicall({ - contract, - data: ..., - overrides: { - ... - } -}); +import { isGetWinningBidSupported } from "thirdweb/extensions/marketplace"; -// Send the transaction -await sendTransaction({ transaction, account }); +const supported = isGetWinningBidSupported(["0x..."]); ``` ```ts -function multicall( - options: BaseTransactionOptions< - MulticallParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isGetWinningBidSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "multicall" function. +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 options: BaseTransactionOptions< - MulticallParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `getWinningBid` method is supported. --- -## name +## MARKETPLACE.isNewWinningBid - Retrieves the name associated with the given contract. +Calls the "isNewWinningBid" function on the contract. ### Example ```ts -import { name } from "thirdweb/extensions/common"; +import { isNewWinningBid } from "thirdweb/extensions/marketplace"; -const contractName = await name({ contract }); +const result = await isNewWinningBid({ + contract, + auctionId: ..., + bidAmount: ..., +}); ``` ```ts -function name(options: BaseTransactionOptions): Promise; +function isNewWinningBid( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the transaction. +The options for the isNewWinningBid function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - A promise that resolves to the name associated with the contract. +The parsed result of the function call. --- -## owner +## MARKETPLACE.makeOffer - Calls the "owner" function on the contract. +Makes an offer for any asset (ERC721 or ERC1155). ### Example ```ts -import { owner } from "thirdweb/extensions/common"; +import { makeOffer } from "thirdweb/extensions/marketplace"; +import { sendTransaction } from "thirdweb"; -const result = await owner({ +const offerTx = makeOffer({ contract, + assetContractAddress: "0x1234567890123456789012345678901234567890", + tokenId: 1n, + currencyContractAddress: + "0x1234567890123456789012345678901234567890", + offerExpiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24), + totalOffer: "1.0", }); + +await sendTransaction({ transaction, account }); ``` ```ts -function owner(options: BaseTransactionOptions): Promise; +function makeOffer( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the owner function. +The options for making the offer. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A transaction object that can be sent to make the offer. --- -## ownerUpdatedEvent +## MARKETPLACE.newAuctionEvent - Creates an event object for the OwnerUpdated event. +Creates an event object for the NewAuction event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { ownerUpdatedEvent } from "thirdweb/extensions/common"; +import { newAuctionEvent } from "thirdweb/extensions/marketplace"; const events = await getContractEvents({ contract, events: [ - ownerUpdatedEvent({ - prevOwner: ..., - newOwner: ..., + newAuctionEvent({ + auctionCreator: ..., + auctionId: ..., + assetContract: ..., }) ], }); ``` ```ts -function ownerUpdatedEvent( - filters: Partial<{ newOwner: string; prevOwner: string }>, +function newAuctionEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "prevOwner"; + readonly name: "auctionCreator"; readonly type: "address"; }, { readonly indexed: true; - readonly name: "newOwner"; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; readonly type: "address"; }, + { + readonly components: readonly [ + { readonly name: "auctionId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { + readonly name: "minimumBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "buyoutBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "timeBufferInSeconds"; + readonly type: "uint64"; + }, + { readonly name: "bidBufferBps"; readonly type: "uint64" }, + { readonly name: "startTimestamp"; readonly type: "uint64" }, + { readonly name: "endTimestamp"; readonly type: "uint64" }, + { readonly name: "auctionCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + ]; + readonly name: "auction"; + readonly type: "tuple"; + }, ]; - readonly name: "OwnerUpdated"; + readonly name: "NewAuction"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ newOwner: string; prevOwner: string }>; +let filters: Partial; ``` ### Returns @@ -7231,99 +7886,936 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "prevOwner"; + readonly name: "auctionCreator"; readonly type: "address"; }, { readonly indexed: true; - readonly name: "newOwner"; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; readonly type: "address"; }, + { + readonly components: readonly [ + { readonly name: "auctionId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { + readonly name: "minimumBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "buyoutBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "timeBufferInSeconds"; + readonly type: "uint64"; + }, + { readonly name: "bidBufferBps"; readonly type: "uint64" }, + { readonly name: "startTimestamp"; readonly type: "uint64" }, + { readonly name: "endTimestamp"; readonly type: "uint64" }, + { readonly name: "auctionCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + ]; + readonly name: "auction"; + readonly type: "tuple"; + }, ]; - readonly name: "OwnerUpdated"; + readonly name: "NewAuction"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## primarySaleRecipient +## MARKETPLACE.newBidEvent - Calls the "primarySaleRecipient" function on the contract. +Creates an event object for the NewBid event. ### Example ```ts -import { primarySaleRecipient } from "thirdweb/extensions/common"; +import { getContractEvents } from "thirdweb"; +import { newBidEvent } from "thirdweb/extensions/marketplace"; -const result = await primarySaleRecipient({ - contract, +const events = await getContractEvents({ +contract, +events: [ + newBidEvent({ + auctionId: ..., + bidder: ..., + assetContract: ..., +}) +], }); ``` ```ts -function primarySaleRecipient( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the primarySaleRecipient function. - -#### Type - -```ts -let options: { contract: ThirdwebContract } & T; -``` - -### Returns +function newBidEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "bidder"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { readonly name: "bidAmount"; readonly type: "uint256" }, + { + readonly components: readonly [ + { readonly name: "auctionId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { + readonly name: "minimumBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "buyoutBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "timeBufferInSeconds"; + readonly type: "uint64"; + }, + { readonly name: "bidBufferBps"; readonly type: "uint64" }, + { readonly name: "startTimestamp"; readonly type: "uint64" }, + { readonly name: "endTimestamp"; readonly type: "uint64" }, + { readonly name: "auctionCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + ]; + readonly name: "auction"; + readonly type: "tuple"; + }, + ]; + readonly name: "NewBid"; + readonly type: "event"; +}>; +``` + +### Parameters + +Optional filters to apply to the event. + +#### Type + +```ts +let filters: Partial; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "auctionId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "bidder"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { readonly name: "bidAmount"; readonly type: "uint256" }, + { + readonly components: readonly [ + { readonly name: "auctionId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { + readonly name: "minimumBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "buyoutBidAmount"; + readonly type: "uint256"; + }, + { + readonly name: "timeBufferInSeconds"; + readonly type: "uint64"; + }, + { readonly name: "bidBufferBps"; readonly type: "uint64" }, + { readonly name: "startTimestamp"; readonly type: "uint64" }, + { readonly name: "endTimestamp"; readonly type: "uint64" }, + { readonly name: "auctionCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + ]; + readonly name: "auction"; + readonly type: "tuple"; + }, + ]; + readonly name: "NewBid"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## MARKETPLACE.newListingEvent + +Creates an event object for the NewListing event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { newListingEvent } from "thirdweb/extensions/marketplace"; + +const events = await getContractEvents({ +contract, +events: [ + newListingEvent({ + listingCreator: ..., + listingId: ..., + assetContract: ..., +}) +], +}); +``` + +```ts +function newListingEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "listingId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "startTimestamp"; readonly type: "uint128" }, + { readonly name: "endTimestamp"; readonly type: "uint128" }, + { readonly name: "listingCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + { readonly name: "reserved"; readonly type: "bool" }, + ]; + readonly name: "listing"; + readonly type: "tuple"; + }, + ]; + readonly name: "NewListing"; + readonly type: "event"; +}>; +``` + +### Parameters + +Optional filters to apply to the event. + +#### Type + +```ts +let filters: Partial; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "listingId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "startTimestamp"; readonly type: "uint128" }, + { readonly name: "endTimestamp"; readonly type: "uint128" }, + { readonly name: "listingCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + { readonly name: "reserved"; readonly type: "bool" }, + ]; + readonly name: "listing"; + readonly type: "tuple"; + }, + ]; + readonly name: "NewListing"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## MARKETPLACE.newOfferEvent + +Creates an event object for the NewOffer event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { newOfferEvent } from "thirdweb/extensions/marketplace"; + +const events = await getContractEvents({ +contract, +events: [ + newOfferEvent({ + offeror: ..., + offerId: ..., + assetContract: ..., +}) +], +}); +``` + +```ts +function newOfferEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "offeror"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "offerId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "offerId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "totalPrice"; readonly type: "uint256" }, + { + readonly name: "expirationTimestamp"; + readonly type: "uint256"; + }, + { readonly name: "offeror"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + ]; + readonly name: "offer"; + readonly type: "tuple"; + }, + ]; + readonly name: "NewOffer"; + readonly type: "event"; +}>; +``` + +### Parameters + +Optional filters to apply to the event. + +#### Type + +```ts +let filters: Partial; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "offeror"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "offerId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "offerId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "totalPrice"; readonly type: "uint256" }, + { + readonly name: "expirationTimestamp"; + readonly type: "uint256"; + }, + { readonly name: "offeror"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + ]; + readonly name: "offer"; + readonly type: "tuple"; + }, + ]; + readonly name: "NewOffer"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## MARKETPLACE.newSaleEvent + +Creates an event object for the NewSale event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { newSaleEvent } from "thirdweb/extensions/marketplace"; + +const events = await getContractEvents({ +contract, +events: [ + newSaleEvent({ + listingCreator: ..., + listingId: ..., + assetContract: ..., +}) +], +}); +``` + +```ts +function newSaleEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "buyer"; readonly type: "address" }, + { readonly name: "quantityBought"; readonly type: "uint256" }, + { readonly name: "totalPricePaid"; readonly type: "uint256" }, + ]; + readonly name: "NewSale"; + readonly type: "event"; +}>; +``` + +### Parameters + +Optional filters to apply to the event. + +#### Type + +```ts +let filters: Partial; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "buyer"; readonly type: "address" }, + { readonly name: "quantityBought"; readonly type: "uint256" }, + { readonly name: "totalPricePaid"; readonly type: "uint256" }, + ]; + readonly name: "NewSale"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## MARKETPLACE.totalAuctions + +Calls the "totalAuctions" function on the contract. + +### Example + +```ts +import { totalAuctions } from "thirdweb/extensions/marketplace"; + +const result = await totalAuctions({ + contract, +}); +``` + +```ts +function totalAuctions( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the totalAuctions function. + +#### Type + +```ts +let options: { contract: ThirdwebContract } & T; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +The parsed result of the function call. +--- + +## MARKETPLACE.totalListings + +Calls the "totalListings" function on the contract. + +### Example + +```ts +import { totalListings } from "thirdweb/extensions/marketplace"; + +const result = await totalListings({ + contract, +}); +``` + +```ts +function totalListings( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the totalListings function. + +#### Type + +```ts +let options: { contract: ThirdwebContract } & T; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +The parsed result of the function call. +--- + +## MARKETPLACE.totalOffers + +Calls the "totalOffers" function on the contract. + +### Example + +```ts +import { totalOffers } from "thirdweb/extensions/marketplace"; + +const result = await totalOffers({ + contract, +}); +``` + +```ts +function totalOffers( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the totalOffers function. + +#### Type + +```ts +let options: { contract: ThirdwebContract } & T; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +The parsed result of the function call. +--- + +## MARKETPLACE.updatedListingEvent + +Creates an event object for the UpdatedListing event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { updatedListingEvent } from "thirdweb/extensions/marketplace"; + +const events = await getContractEvents({ +contract, +events: [ + updatedListingEvent({ + listingCreator: ..., + listingId: ..., + assetContract: ..., +}) +], +}); +``` + +```ts +function updatedListingEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "listingId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "startTimestamp"; readonly type: "uint128" }, + { readonly name: "endTimestamp"; readonly type: "uint128" }, + { readonly name: "listingCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + { readonly name: "reserved"; readonly type: "bool" }, + ]; + readonly name: "listing"; + readonly type: "tuple"; + }, + ]; + readonly name: "UpdatedListing"; + readonly type: "event"; +}>; +``` + +### Parameters + +Optional filters to apply to the event. + +#### Type + +```ts +let filters: Partial; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "listingCreator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "listingId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "assetContract"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "listingId"; readonly type: "uint256" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "startTimestamp"; readonly type: "uint128" }, + { readonly name: "endTimestamp"; readonly type: "uint128" }, + { readonly name: "listingCreator"; readonly type: "address" }, + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "status"; readonly type: "uint8" }, + { readonly name: "reserved"; readonly type: "bool" }, + ]; + readonly name: "listing"; + readonly type: "tuple"; + }, + ]; + readonly name: "UpdatedListing"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## MARKETPLACE.updateListing + +Updates an existing direct listing. + +### Example + +```typescript +import { updateListing } from "thirdweb/extensions/marketplace"; +import { sendTransaction } from "thirdweb"; + +const transaction = updateListing({...}); + +await sendTransaction({ transaction, account }); +``` ```ts -let returnType: Promise; +function updateListing( + options: BaseTransactionOptions, +): PreparedTransaction; +``` + +### Parameters + +The options for updating the direct listing. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +The result of updating the direct listing. +--- +## AIRDROP --- -## setContractMetadata +## AIRDROP.airdropERC1155 - Sets the metadata for a contract. +Prepares a transaction to call the "airdropERC1155" function on the contract. ### Example ```ts -import { setContractMetadata } from "@thirdweb/extensions/common"; import { sendTransaction } from "thirdweb"; +import { airdropERC1155 } from "thirdweb/extensions/airdrop"; -const transaction = setContractMetadata({ - contract, - name: "My NFT", - symbol: "NFT", +const transaction = airdropERC1155({ + contract, + tokenAddress: ..., + contents: ..., + overrides: { + ... + } }); // Send the transaction -await sendTransaction({ - transaction, - account, +await sendTransaction({ transaction, account }); +``` + +```ts +function airdropERC1155( + options: BaseTransactionOptions< + | AirdropERC1155Params + | { asyncParams: () => Promise } + >, +): PreparedTransaction; +``` + +### Parameters + +The options for the "airdropERC1155" function. + +#### Type + +```ts +let options: BaseTransactionOptions< + | AirdropERC1155Params + | { asyncParams: () => Promise } +>; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +A prepared transaction object. +--- + +## AIRDROP.airdropERC1155WithSignature + +Prepares a transaction to call the "airdropERC1155WithSignature" function on the contract. + +### Example + +```ts +import { sendTransaction } from "thirdweb"; +import { airdropERC1155WithSignature } from "thirdweb/extensions/airdrop"; + +const transaction = airdropERC1155WithSignature({ + contract, + req: ..., + signature: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function setContractMetadata( - options: BaseTransactionOptions, +function airdropERC1155WithSignature( + options: BaseTransactionOptions< + | AirdropERC1155WithSignatureParams + | { + asyncParams: () => Promise; + } + >, ): PreparedTransaction; ``` ### Parameters - The options for setting the contract metadata. +The options for the "airdropERC1155WithSignature" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | AirdropERC1155WithSignatureParams + | { asyncParams: () => Promise } +>; ``` ### Returns @@ -7336,22 +8828,23 @@ let returnType: PreparedTransaction< >; ``` -* The prepared transaction to set the contract metadata. +A prepared transaction object. --- -## setContractURI +## AIRDROP.airdropERC20 - Prepares a transaction to call the "setContractURI" function on the contract. +Prepares a transaction to call the "airdropERC20" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { setContractURI } from "thirdweb/extensions/common"; +import { airdropERC20 } from "thirdweb/extensions/airdrop"; -const transaction = setContractURI({ +const transaction = airdropERC20({ contract, - uri: ..., + tokenAddress: ..., + contents: ..., overrides: { ... } @@ -7362,24 +8855,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function setContractURI( +function airdropERC20( options: BaseTransactionOptions< - | SetContractURIParams - | { asyncParams: () => Promise } + | AirdropERC20Params + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "setContractURI" function. +The options for the "airdropERC20" function. #### Type ```ts let options: BaseTransactionOptions< - | SetContractURIParams - | { asyncParams: () => Promise } + | AirdropERC20Params + | { asyncParams: () => Promise } >; ``` @@ -7393,23 +8886,23 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setDefaultRoyaltyInfo +## AIRDROP.airdropERC20WithSignature - Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. +Prepares a transaction to call the "airdropERC20WithSignature" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { setDefaultRoyaltyInfo } from "thirdweb/extensions/common"; +import { airdropERC20WithSignature } from "thirdweb/extensions/airdrop"; -const transaction = setDefaultRoyaltyInfo({ +const transaction = airdropERC20WithSignature({ contract, - royaltyRecipient: ..., - royaltyBps: ..., + req: ..., + signature: ..., overrides: { ... } @@ -7420,24 +8913,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function setDefaultRoyaltyInfo( +function airdropERC20WithSignature( options: BaseTransactionOptions< - | SetDefaultRoyaltyInfoParams - | { asyncParams: () => Promise } + | AirdropERC20WithSignatureParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "setDefaultRoyaltyInfo" function. +The options for the "airdropERC20WithSignature" function. #### Type ```ts let options: BaseTransactionOptions< - | SetDefaultRoyaltyInfoParams - | { asyncParams: () => Promise } + | AirdropERC20WithSignatureParams + | { asyncParams: () => Promise } >; ``` @@ -7451,22 +8944,23 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setOwner +## AIRDROP.airdropERC721 - Prepares a transaction to call the "setOwner" function on the contract. +Prepares a transaction to call the "airdropERC721" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { setOwner } from "thirdweb/extensions/common"; +import { airdropERC721 } from "thirdweb/extensions/airdrop"; -const transaction = setOwner({ +const transaction = airdropERC721({ contract, - newOwner: ..., + tokenAddress: ..., + contents: ..., overrides: { ... } @@ -7477,22 +8971,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function setOwner( +function airdropERC721( options: BaseTransactionOptions< - SetOwnerParams | { asyncParams: () => Promise } + | AirdropERC721Params + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "setOwner" function. +The options for the "airdropERC721" function. #### Type ```ts let options: BaseTransactionOptions< - SetOwnerParams | { asyncParams: () => Promise } + | AirdropERC721Params + | { asyncParams: () => Promise } >; ``` @@ -7506,23 +9002,23 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setPlatformFeeInfo +## AIRDROP.airdropERC721WithSignature - Prepares a transaction to call the "setPlatformFeeInfo" function on the contract. +Prepares a transaction to call the "airdropERC721WithSignature" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { setPlatformFeeInfo } from "thirdweb/extensions/common"; +import { airdropERC721WithSignature } from "thirdweb/extensions/airdrop"; -const transaction = setPlatformFeeInfo({ +const transaction = airdropERC721WithSignature({ contract, - platformFeeRecipient: ..., - platformFeeBps: ..., + req: ..., + signature: ..., overrides: { ... } @@ -7533,24 +9029,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function setPlatformFeeInfo( +function airdropERC721WithSignature( options: BaseTransactionOptions< - | SetPlatformFeeInfoParams - | { asyncParams: () => Promise } + | AirdropERC721WithSignatureParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "setPlatformFeeInfo" function. +The options for the "airdropERC721WithSignature" function. #### Type ```ts let options: BaseTransactionOptions< - | SetPlatformFeeInfoParams - | { asyncParams: () => Promise } + | AirdropERC721WithSignatureParams + | { asyncParams: () => Promise } >; ``` @@ -7564,22 +9060,22 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setPrimarySaleRecipient +## AIRDROP.airdropNativeToken - Prepares a transaction to call the "setPrimarySaleRecipient" function on the contract. +Prepares a transaction to call the "airdropNativeToken" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { setPrimarySaleRecipient } from "thirdweb/extensions/common"; +import { airdropNativeToken } from "thirdweb/extensions/airdrop"; -const transaction = setPrimarySaleRecipient({ +const transaction = airdropNativeToken({ contract, - saleRecipient: ..., + contents: ..., overrides: { ... } @@ -7590,24 +9086,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function setPrimarySaleRecipient( +function airdropNativeToken( options: BaseTransactionOptions< - | SetPrimarySaleRecipientParams - | { asyncParams: () => Promise } + | AirdropNativeTokenParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "setPrimarySaleRecipient" function. +The options for the "airdropNativeToken" function. #### Type ```ts let options: BaseTransactionOptions< - | SetPrimarySaleRecipientParams - | { asyncParams: () => Promise } + | AirdropNativeTokenParams + | { asyncParams: () => Promise } >; ``` @@ -7621,1495 +9117,1592 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setRoyaltyInfoForToken +## AIRDROP.claimERC1155 - Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. +Claim airdrop of ERC1155 tokens for allowlisted addresses. (Pull based airdrop) ### Example ```ts +import { claimERC1155 } from "thirdweb/extensions/airdrop"; import { sendTransaction } from "thirdweb"; -import { setRoyaltyInfoForToken } from "thirdweb/extensions/common"; -const transaction = setRoyaltyInfoForToken({ - contract, - tokenId: ..., - recipient: ..., - bps: ..., - overrides: { - ... - } +const tokenAddress = "0x..."; // Address of airdropped tokens to claim +const recipient = "0x..."; // Address of the allowlisted recipient + +const claimTransaction = claimERC1155({ + contract, + tokenAddress, + recipient, +}); + +await sendTransaction({ claimTransaction, account }); +``` + +```ts +function claimERC1155( + options: BaseTransactionOptions, +): PreparedTransaction; +``` + +### Parameters + +The transaction options. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +A promise that resolves to the transaction result. +--- + +## AIRDROP.claimERC20 + +Claim airdrop of ERC20 tokens for allowlisted addresses. (Pull based airdrop) + +### Example + +```ts +import { claimERC20 } from "thirdweb/extensions/airdrop"; +import { sendTransaction } from "thirdweb"; + +const tokenAddress = "0x..."; // Address of airdropped tokens to claim +const recipient = "0x..."; // Address of the allowlisted recipient + +const claimTransaction = claimERC20({ + contract, + tokenAddress, + recipient, +}); + +await sendTransaction({ claimTransaction, account }); +``` + +```ts +function claimERC20( + options: BaseTransactionOptions, +): PreparedTransaction; +``` + +### Parameters + +The transaction options. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +A promise that resolves to the transaction result. +--- + +## AIRDROP.claimERC721 + +Claim airdrop of ERC721 tokens for allowlisted addresses. (Pull based airdrop) + +### Example + +```ts +import { claimERC721 } from "thirdweb/extensions/airdrop"; +import { sendTransaction } from "thirdweb"; + +const tokenAddress = "0x..."; // Address of airdropped tokens to claim +const recipient = "0x..."; // Address of the allowlisted recipient + +const claimTransaction = claimERC721({ + contract, + tokenAddress, + recipient, +}); + +await sendTransaction({ claimTransaction, account }); +``` + +```ts +function claimERC721( + options: BaseTransactionOptions, +): PreparedTransaction; +``` + +### Parameters + +The transaction options. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +A promise that resolves to the transaction result. +--- + +## AIRDROP.fetchProofsERC1155 + +Retrieves the claim merkle proof for the provided address. + +### Example + +```ts +import { fetchProofsERCC1155 } from "thirdweb/extensions/airdrop"; +import { getContract, defineChain } from "thirdweb"; + +const TOKEN = getContracct({ + client, + chain: defineChain(1), + address: "0x...", +}); + +const merkleRoot = await tokenMerkleRoot({ + contract: TOKEN, + tokenAddress: TOKEN.address, +}); + +const proof = await fetchProofsERC1155({ + contract: TOKEN, + recipient: "0x...", + merkleRoot, +}); +``` + +```ts +function fetchProofsERC1155(options: { + contract: Readonly; + merkleRoot: string; + recipient: string; +}): Promise; +``` + +### Parameters + +#### Type + +```ts +let options: { + contract: Readonly; + merkleRoot: string; + recipient: string; +}; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the proof or null if the recipient is not in the allowlist +--- + +## AIRDROP.fetchProofsERC20 + +Retrieves the claim merkle proof for the provided address. + +### Example + +```ts +import { fetchProofsERCC20 } from "thirdweb/extensions/airdrop"; +import { getContract, defineChain } from "thirdweb"; + +const TOKEN = getContracct({ + client, + chain: defineChain(1), + address: "0x...", +}); + +const merkleRoot = await tokenMerkleRoot({ + contract: TOKEN, + tokenAddress: TOKEN.address, +}); + +const proof = await fetchProofsERC20({ + contract: TOKEN, + recipient: "0x...", + merkleRoot, +}); +``` + +```ts +function fetchProofsERC20(options: { + contract: Readonly; + merkleRoot: string; + recipient: string; + tokenDecimals: number; +}): Promise; +``` + +### Parameters + +#### Type + +```ts +let options: { + contract: Readonly; + merkleRoot: string; + recipient: string; + tokenDecimals: number; +}; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the proof or null if the recipient is not in the allowlist +--- + +## AIRDROP.fetchProofsERC721 + +Retrieves the claim merkle proof for the provided address. + +### Example + +```ts +import { fetchProofsERC721 } from "thirdweb/extensions/airdrop"; +import { getContract, defineChain } from "thirdweb"; + +const NFT = getContracct({ + client, + chain: defineChain(1), + address: "0x...", +}); + +const merkleRoot = await tokenMerkleRoot({ + contract: NFT, + tokenAddress: NFT.address, +}); + +const proof = await fetchProofsERC721({ + contract: NFT, + recipient: "0x...", + merkleRoot, +}); +``` + +```ts +function fetchProofsERC721(options: { + contract: Readonly; + merkleRoot: string; + recipient: string; +}): Promise; +``` + +### Parameters + +#### Type + +```ts +let options: { + contract: Readonly; + merkleRoot: string; + recipient: string; +}; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the proof or null if the recipient is not in the allowlist +--- + +## AIRDROP.generateAirdropSignatureERC1155 + +Generates the req and signature for sending ERC1155 airdrop. + +### Example + +```ts +import { + airdropERC1155WithSignature, + generateAirdropSignatureERC1155, +} from "thirdweb/extensions/airdrop"; + +// list of recipients, tokenIds and amounts to airdrop for each recipient +const contents = [ + { recipient: "0x...", tokenId: 0, amount: 10n }, + { recipient: "0x...", tokenId: 0, amount: 15n }, + { recipient: "0x...", tokenId: 0, amount: 20n }, +]; + +const { req, signature } = await generateAirdropSignatureERC1155({ + account, + contract, + airdropRequest: { + tokenAddress: "0x...", // address of the ERC1155 token to airdrop + contents, + }, }); -// Send the transaction +const transaction = airdropERC1155WithSignature({ + contract, + req, + signature, +}); await sendTransaction({ transaction, account }); ``` ```ts -function setRoyaltyInfoForToken( - options: BaseTransactionOptions< - | SetRoyaltyInfoForTokenParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function generateAirdropSignatureERC1155(options: GenerateAirdropERC1155SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> ``` ### Parameters - The options for the "setRoyaltyInfoForToken" function. +The options for the airdrop. #### Type ```ts -let options: BaseTransactionOptions< - | SetRoyaltyInfoForTokenParams - | { asyncParams: () => Promise } ->; +let options: { + account: Account; + airdropRequest: GenerateReqInput; + contract: ThirdwebContract; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> ``` - A prepared transaction object. +A promise that resolves to the req and signature. --- -## symbol +## AIRDROP.generateAirdropSignatureERC20 - Retrieves the name associated with the given contract. +Generates the req and signature for sending ERC20 airdrop. ### Example ```ts -import { symbol } from "thirdweb/extensions/common"; +import { + airdropERC20WithSignature, + generateAirdropSignatureERC20, +} from "thirdweb/extensions/airdrop"; -const contractSymbol = await symbol({ contract }); +// list of recipients and amounts to airdrop for each recipient +const contents = [ + { recipient: "0x...", amount: 10n }, // amount in wei + { recipient: "0x...", amount: 15n }, // amount in wei + { recipient: "0x...", amount: 20n }, // amount in wei +]; + +const { req, signature } = await generateAirdropSignatureERC20({ + account, + contract, + airdropRequest: { + tokenAddress: "0x...", // address of the ERC20 token to airdrop + contents, + }, +}); + +const transaction = airdropERC20WithSignature({ + contract, + req, + signature, +}); +await sendTransaction({ transaction, account }); ``` ```ts -function symbol(options: BaseTransactionOptions): Promise; +function generateAirdropSignatureERC20(options: GenerateAirdropERC20SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> ``` ### Parameters - The options for the transaction. +The options for the airdrop. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + account: Account; + airdropRequest: GenerateReqInput; + contract: ThirdwebContract; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> ``` - A promise that resolves to the name associated with the contract. ---- -## ENS +A promise that resolves to the req and signature. --- -## parseNftUri +## AIRDROP.generateAirdropSignatureERC721 - Parses an NFT URI. +Generates the req and signature for sending ERC721 airdrop. ### Example ```ts -import { parseNftUri } from "thirdweb/utils/ens"; -const nftUri = await parseNftUri({ - client, - uri: "eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063", +import { + airdropERC721WithSignature, + generateAirdropSignatureERC721, +} from "thirdweb/extensions/airdrop"; + +// list of recipients and tokenIds to airdrop for each recipient +const contents = [ + { recipient: "0x...", tokenId: 0 }, + { recipient: "0x...", tokenId: 1 }, + { recipient: "0x...", tokenId: 2 }, +]; + +const { req, signature } = await generateAirdropSignatureERC721({ + account, + contract, + airdropRequest: { + tokenAddress: "0x...", // address of the ERC721 token to airdrop + contents, + }, }); -console.log(nftUri); // ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/ +const transaction = airdropERC721WithSignature({ + contract, + req, + signature, +}); +await sendTransaction({ transaction, account }); ``` ```ts -function parseNftUri(options: { - client: ThirdwebClient; - uri: string; -}): Promise; +function generateAirdropSignatureERC721(options: GenerateAirdropERC721SignatureOptions) : Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> ``` ### Parameters - The options for parsing an NFT URI. +The options for the airdrop. #### Type ```ts -let options: { client: ThirdwebClient; uri: string }; +let options: { + account: Account; + airdropRequest: GenerateReqInput; + contract: ThirdwebContract; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }> ``` - A promise that resolves to the NFT URI, or null if the URI could not be parsed. +A promise that resolves to the req and signature. --- -## parseAvatarRecord +## AIRDROP.generateMerkleTreeInfoERC1155 - Parses an ENS or similar avatar record. Supports NFT URIs, IPFS scheme, and HTTPS URIs. +Generate merkle tree for a given snapshot. ### Example ```ts -import { parseAvatarRecord } from "thirdweb/utils/ens"; -const avatarUrl = await parseAvatarRecord({ - client, - uri: "ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/", -}); +import { generateMerkleTreeInfoERC1155 } from "thirdweb/extensions/airdrop"; -console.log(avatarUrl); // "https://ipfs.io/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/" +// snapshot / allowlist of airdrop recipients and amounts +const snapshot = [ + { recipient: "0x...", tokenId: 0, amount: 10 }, + { recipient: "0x...", tokenId: 1, amount: 12 }, + { recipient: "0x...", tokenId: 2, amount: 15 }, +]; -const avatarUrl2 = await parseAvatarRecord({ - client, - uri: "eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063", -}); +const tokenAddress = "0x..."; // Address of ERC1155 airdrop token -console.log(avatarUrl2); // "https://opensea.io/assets/0xb32979486938aa9694bfc898f35dbed459f44424/10063" +const { merkleRoot, snapshotUri } = + await generateMerkleTreeInfoERC1155({ + contract, + tokenAddress, + snapshot, + }); + +// Optional next steps {See: saveSnapshot and setMerkleRoot functions} +// - Save snapshot on-chain (on the airdrop contract uri) +// - Set merkle root on the contract to enable claiming ``` ```ts -function parseAvatarRecord( - options: ParseAvatarOptions, -): Promise; +function generateMerkleTreeInfoERC1155( + options: BaseTransactionOptions, +): Promise<{ merkleRoot: string; snapshotUri: string }>; ``` ### Parameters - The options for parsing an ENS avatar record. +The transaction options. #### Type ```ts -let options: { client: ThirdwebClient; uri: string }; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>; ``` - A promise that resolves to the avatar URL, or null if the URI could not be parsed. +A promise that resolves to the merkle-root and snapshot-uri. --- -## resolveAddress +## AIRDROP.generateMerkleTreeInfoERC20 - Resolves an ENS name to an Ethereum address. +Generate merkle tree for a given snapshot. ### Example ```ts -import { resolveAddress } from "thirdweb/extensions/ens"; -const address = await resolveAddress({ - client, - name: "vitalik.eth", -}); -``` - - Resolve an address to a Basename. - -```ts -import { - resolveAddress, - BASENAME_RESOLVER_ADDRESS, -} from "thirdweb/extensions/ens"; -import { base } from "thirdweb/chains"; -const address = await resolveAddress({ - client, - name: "myk.base.eth", - resolverAddress: BASENAME_RESOLVER_ADDRESS, - resolverChain: base, -}); +import { generateMerkleTreeInfoERC20 } from "thirdweb/extensions/airdrop"; + +// snapshot / allowlist of airdrop recipients and amounts +const snapshot = [ + { recipient: "0x...", amount: 10 }, + { recipient: "0x...", amount: 15 }, + { recipient: "0x...", amount: 20 }, +]; + +const tokenAddress = "0x..."; // Address of ERC20 airdrop token + +const { merkleRoot, snapshotUri } = await generateMerkleTreeInfoERC20( + { + contract, + tokenAddress, + snapshot, + }, +); + +// Optional next steps {See: saveSnapshot and setMerkleRoot functions} +// - Save snapshot on-chain (on the airdrop contract uri) +// - Set merkle root on the contract to enable claiming ``` ```ts -function resolveAddress( - options: ResolveAddressOptions, -): Promise<`0x${string}`>; +function generateMerkleTreeInfoERC20( + options: BaseTransactionOptions, +): Promise<{ merkleRoot: string; snapshotUri: string }>; ``` ### Parameters - The options for resolving an ENS address. +The transaction options. #### Type ```ts -let options: { - client: ThirdwebClient; - name: string; - resolverAddress?: string; - resolverChain?: Chain; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>; ``` - A promise that resolves to the Ethereum address. +A promise that resolves to the merkle-root and snapshot-uri. --- -## resolveAvatar +## AIRDROP.generateMerkleTreeInfoERC721 - Resolves an ENS name to the avatar URL. +Generate merkle tree for a given snapshot. ### Example ```ts -import { resolveAvatar } from "thirdweb/extensions/ens"; -const address = await resolveAvatar({ - client, - name: "vitalik.eth", -}); +import { generateMerkleTreeInfoERC721 } from "thirdweb/extensions/airdrop"; + +// snapshot / allowlist of airdrop recipients and amounts +const snapshot = [ + { recipient: "0x...", tokenId: 0 }, + { recipient: "0x...", tokenId: 1 }, + { recipient: "0x...", tokenId: 2 }, +]; + +const tokenAddress = "0x..."; // Address of ERC721 airdrop token + +const { merkleRoot, snapshotUri } = + await generateMerkleTreeInfoERC721({ + contract, + tokenAddress, + snapshot, + }); + +// Optional next steps {See: saveSnapshot and setMerkleRoot functions} +// - Save snapshot on-chain (on the airdrop contract uri) +// - Set merkle root on the contract to enable claiming ``` ```ts -function resolveAvatar( - options: ResolveAvatarOptions, -): Promise; +function generateMerkleTreeInfoERC721( + options: BaseTransactionOptions, +): Promise<{ merkleRoot: string; snapshotUri: string }>; ``` ### Parameters - The options for resolving an ENS address. +The transaction options. #### Type ```ts -let options: { - client: ThirdwebClient; - name: string; - resolverAddress?: string; - resolverChain?: Chain; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<{ merkleRoot: string; snapshotUri: string }>; ``` - A promise that resolves to the avatar url, or null if not set. +A promise that resolves to the merkle-root and snapshot-uri. --- -## resolveL2Name +## AIRDROP.isClaimed - Resolves the L2 name for a specified address. +Calls the "isClaimed" function on the contract. ### Example ```ts -import { resolveL2Name } from "thirdweb/extensions/ens"; -const name = await resolveL2Name({ - client, - address: "0x1234...", - resolverAddress: "0x...", - resolverChain: base, -}); -``` - - Resolve a Basename. - -```ts -import { - resolveL2Name, - BASENAME_RESOLVER_ADDRESS, -} from "thirdweb/extensions/ens"; -import { base } from "thirdweb/chains"; -const name = await resolveL2Name({ - client, - address: "0x1234...", - resolverAddress: BASENAME_RESOLVER_ADDRESS, - resolverChain: base, +import { isClaimed } from "thirdweb/extensions/airdrop"; + +const result = await isClaimed({ + contract, + receiver: ..., + token: ..., + tokenId: ..., }); ``` ```ts -function resolveL2Name( - options: ResolveL2NameOptions, -): Promise; +function isClaimed( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for resolving an L2 ENS address. +The options for the isClaimed function. #### Type ```ts -let options: { - address: Address; - client: ThirdwebClient; - resolverAddress: string; - resolverChain: Chain; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - A promise that resolves to the Ethereum address. +The parsed result of the function call. --- -## resolveName +## AIRDROP.saveSnapshot - Resolves the primary name for a specified address. +Generate merkle tree for a given snapshot and save the info on-chain. ### Example ```ts -import { resolveName } from "thirdweb/extensions/ens"; -const name = await resolveName({ - client, - address: "0x1234...", +// This is ERC20 example. Should import and use other ERC variants as needed + +import { generateMerkleTreeInfoERC20, saveSnapshot, setMerkleRoot } from "thirdweb/extensions/airdrop"; + +// snapshot / allowlist of airdrop recipients and amounts +const snapshot = [ + { recipient: "0x...", amount: 10 }, + { recipient: "0x...", amount: 15 }, + { recipient: "0x...", amount: 20 }, +]; + +const tokenAddress = "0x..." // Address of airdrop token + +const { merkleRoot, snapshotUri } = await generateMerkleTreeInfoERC20({ + contract, + tokenAddress, + snapshot +}); + +const saveSnapshotTransaction = saveSnapshot({ + contract, + merkleRoot, + snapshotUri, +}); +await sendTransaction({ saveSnapshotTransaction, account }); + +const setMerkleRootTransaction = setMerkleRoot({ + contract, + token, + tokenMerkleRoot: merkleRoot as `0x${string}`, + resetClaimStatus: false // toggle as needed + signature, }); +await sendTransaction({ setMerkleRootTransaction, account }); ``` ```ts -function resolveName( - options: ResolveNameOptions, -): Promise; +function saveSnapshot( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for resolving an ENS address. +The transaction options. #### Type ```ts -let options: { - address: Address; - client: ThirdwebClient; - resolverAddress?: string; - resolverChain?: Chain; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the Ethereum address. +A promise that resolves to the transaction result. --- -## resolveText +## AIRDROP.setMerkleRoot - Resolves an ENS name and key to the specified record. +Prepares a transaction to call the "setMerkleRoot" function on the contract. ### Example ```ts -import { resolveText } from "thirdweb/extensions/ens"; -const twitterUsername = await resolveText({ - client, - name: "vitalik.eth", - key: "com.twitter", +import { sendTransaction } from "thirdweb"; +import { setMerkleRoot } from "thirdweb/extensions/airdrop"; + +const transaction = setMerkleRoot({ + contract, + token: ..., + tokenMerkleRoot: ..., + resetClaimStatus: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function resolveText( - options: ResolveTextOptions, -): Promise; +function setMerkleRoot( + options: BaseTransactionOptions< + | SetMerkleRootParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for resolving an ENS address. +The options for the "setMerkleRoot" function. #### Type ```ts -let options: { - client: ThirdwebClient; - key: string; - name: string; - resolverAddress?: string; - resolverChain?: Chain; -}; +let options: BaseTransactionOptions< + | SetMerkleRootParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the text record. ---- -## ERC1155 +A prepared transaction object. --- -## approvalForAllEvent +## AIRDROP.tokenConditionId - Creates an event object for the ApprovalForAll event. +Calls the "tokenConditionId" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { approvalForAllEvent } from "thirdweb/extensions/erc1155"; +import { tokenConditionId } from "thirdweb/extensions/airdrop"; -const events = await getContractEvents({ -contract, -events: [ - approvalForAllEvent({ - _owner: ..., - _operator: ..., -}) -], +const result = await tokenConditionId({ + contract, + tokenAddress: ..., }); ``` ```ts -function approvalForAllEvent( - filters: Partial<{ _operator: string; _owner: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "_owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_operator"; - readonly type: "address"; - }, - { readonly name: "_approved"; readonly type: "bool" }, - ]; - readonly name: "ApprovalForAll"; - readonly type: "event"; -}>; +function tokenConditionId( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the tokenConditionId function. #### Type ```ts -let filters: Partial<{ _operator: string; _owner: string }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "_owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_operator"; - readonly type: "address"; - }, - { readonly name: "_approved"; readonly type: "bool" }, - ]; - readonly name: "ApprovalForAll"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## balanceOf +## AIRDROP.tokenMerkleRoot - Calls the "balanceOf" function on the contract. +Calls the "tokenMerkleRoot" function on the contract. ### Example ```ts -import { balanceOf } from "thirdweb/extensions/erc1155"; +import { tokenMerkleRoot } from "thirdweb/extensions/airdrop"; -const result = await balanceOf({ +const result = await tokenMerkleRoot({ contract, - owner: ..., - tokenId: ..., + tokenAddress: ..., }); ``` ```ts -function balanceOf( - options: BaseTransactionOptions, -): Promise; +function tokenMerkleRoot( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the balanceOf function. +The options for the tokenMerkleRoot function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. +--- +## COMMON --- -## balanceOfBatch +## COMMON.contractURI - Calls the "balanceOfBatch" function on the contract. +Calls the "contractURI" function on the contract. ### Example ```ts -import { balanceOfBatch } from "thirdweb/extensions/erc1155"; +import { contractURI } from "thirdweb/extensions/common"; -const result = await balanceOfBatch({ - contract, - owners: ..., - tokenIds: ..., +const result = await contractURI({ + contract, }); ``` ```ts -function balanceOfBatch(options: BaseTransactionOptions) : Promise> +function contractURI( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the balanceOfBatch function. +The options for the contractURI function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise> +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## batchMetadataUpdateEvent +## COMMON.getContractMetadata - Creates an event object for the BatchMetadataUpdate event. +Retrieves the contract metadata including name and symbol. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { batchMetadataUpdateEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ - contract, - events: [batchMetadataUpdateEvent()], -}); +import { getContractMetadata } from "thirdweb/extensions/common"; +const metadata = await getContractMetadata({ contract }); +``` + +```ts +function getContractMetadata( + options: BaseTransactionOptions, +): Promise<{ name: string; symbol: string }>; ``` +### Parameters + +The transaction options. + +#### Type + ```ts -function batchMetadataUpdateEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "_fromTokenId"; readonly type: "uint256" }, - { readonly name: "_toTokenId"; readonly type: "uint256" }, - ]; - readonly name: "BatchMetadataUpdate"; - readonly type: "event"; -}>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "_fromTokenId"; readonly type: "uint256" }, - { readonly name: "_toTokenId"; readonly type: "uint256" }, - ]; - readonly name: "BatchMetadataUpdate"; - readonly type: "event"; -}>; +let returnType: Promise<{ name: string; symbol: string }>; ``` - The prepared event object. +A promise that resolves to an object containing the resolved metadata, name, and symbol. --- -## burn +## COMMON.getDefaultRoyaltyInfo - Prepares a transaction to call the "burn" function on the contract. +Calls the "getDefaultRoyaltyInfo" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { burn } from "thirdweb/extensions/erc1155"; +import { getDefaultRoyaltyInfo } from "thirdweb/extensions/common"; -const transaction = burn({ - contract, - account: ..., - id: ..., - value: ..., - overrides: { - ... - } +const result = await getDefaultRoyaltyInfo({ + contract, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function burn( - options: BaseTransactionOptions< - BurnParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getDefaultRoyaltyInfo( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "burn" function. +The options for the getDefaultRoyaltyInfo function. #### Type ```ts -let options: BaseTransactionOptions< - BurnParams | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +The parsed result of the function call. --- -## burnBatch +## COMMON.getPlatformFeeInfo - Prepares a transaction to call the "burnBatch" function on the contract. +Calls the "getPlatformFeeInfo" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { burnBatch } from "thirdweb/extensions/erc1155"; +import { getPlatformFeeInfo } from "thirdweb/extensions/common"; -const transaction = burnBatch({ - contract, - account: ..., - ids: ..., - values: ..., - overrides: { - ... - } +const result = await getPlatformFeeInfo({ + contract, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function burnBatch( - options: BaseTransactionOptions< - BurnBatchParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getPlatformFeeInfo( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "burnBatch" function. +The options for the getPlatformFeeInfo function. #### Type ```ts -let options: BaseTransactionOptions< - BurnBatchParams | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +The parsed result of the function call. --- -## claimTo +## COMMON.getRoyaltyInfoForToken - Claim ERC1155 NFTs to a specified address +Calls the "getRoyaltyInfoForToken" function on the contract. ### Example -#### Basic usage - ```ts -import { claimTo } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; - -const transaction = claimTo({ - contract, - to: "0x...", - tokenId: 0n, - quantity: 1n, -}); +import { getRoyaltyInfoForToken } from "thirdweb/extensions/common"; -await sendTransaction({ transaction, account }); -``` - -#### For Drops with allowlists - - You need to specify the claimer address as the `from` param to avoid any issue with the allowlist - -```ts -const transaction = claimTo({ - contract, - to: "0x...", - tokenId: 0n, - quantity: 1n, - from: "0x...", // address of the one claiming +const result = await getRoyaltyInfoForToken({ + contract, + tokenId: ..., }); ``` ```ts -function claimTo( - options: BaseTransactionOptions, -): PreparedTransaction; +function getRoyaltyInfoForToken( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the transaction +The options for the getRoyaltyInfoForToken function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - The prepared transaction +The parsed result of the function call. --- -## createPack +## COMMON.isGetContractMetadataSupported - Prepares a transaction to call the "createPack" function on the contract. +Checks if the `contractURI` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { createPack } from "thirdweb/extensions/erc1155"; - -const transaction = createPack({ - contract, - contents: ..., - numOfRewardUnits: ..., - packUri: ..., - openStartTimestamp: ..., - amountDistributedPerOpen: ..., - recipient: ..., - overrides: { - ... - } -}); - -// Send the transaction -await sendTransaction({ transaction, account }); +import { isContractURISupported } from "thirdweb/extensions/common"; +const supported = isContractURISupported(["0x..."]); ``` ```ts -function createPack( - options: BaseTransactionOptions< - | CreatePackParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isGetContractMetadataSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "createPack" function. +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 options: BaseTransactionOptions< - CreatePackParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `contractURI` method is supported. --- -## encodeSafeTransferFrom +## COMMON.isGetDefaultRoyaltyInfoSupported - Encodes the "safeTransferFrom" function into a Hex string with its parameters. +Checks if the `getDefaultRoyaltyInfo` method is supported by the given contract. ### Example ```ts -import { encodeSafeTransferFrom } from "thirdweb/extensions/erc1155"; -const result = encodeSafeTransferFrom({ - from: ..., - to: ..., - tokenId: ..., - value: ..., - data: ..., -}); +import { isGetDefaultRoyaltyInfoSupported } from "thirdweb/extensions/common"; +const supported = isGetDefaultRoyaltyInfoSupported(["0x..."]); ``` ```ts -function encodeSafeTransferFrom( - options: SafeTransferFromParams, -): `0xf242432a${string}`; +function isGetDefaultRoyaltyInfoSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the safeTransferFrom function. +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 options: WithOverrides<{ - data: AbiParameterToPrimitiveType<{ name: "_data"; type: "bytes" }>; - from: AbiParameterToPrimitiveType<{ - name: "_from"; - type: "address"; - }>; - to: AbiParameterToPrimitiveType<{ name: "_to"; type: "address" }>; - tokenId: AbiParameterToPrimitiveType<{ - name: "tokenId"; - type: "uint256"; - }>; - value: AbiParameterToPrimitiveType<{ - name: "_value"; - type: "uint256"; - }>; -}>; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: `0xf242432a${string}`; +let returnType: boolean; ``` - The encoded hexadecimal string. +A boolean indicating if the `getDefaultRoyaltyInfo` method is supported. --- -## freezeMetadata +## COMMON.isGetPlatformFeeInfoSupported - Prepares a transaction to call the "freezeMetadata" function on the contract. +Checks if the `getPlatformFeeInfo` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { freezeMetadata } from "thirdweb/extensions/erc1155"; - -const transaction = freezeMetadata(); - -// Send the transaction -await sendTransaction({ transaction, account }); +import { isGetPlatformFeeInfoSupported } from "thirdweb/extensions/common"; +const supported = isGetPlatformFeeInfoSupported(["0x..."]); ``` ```ts -function freezeMetadata( - options: BaseTransactionOptions, -): PreparedTransaction; +function isGetPlatformFeeInfoSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "freezeMetadata" function. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `getPlatformFeeInfo` method is supported. --- -## generateMintSignature +## COMMON.isGetRoyaltyInfoForTokenSupported - Generates the payload and signature for minting an ERC1155 token. +Checks if the `getRoyaltyInfoForToken` method is supported by the given contract. ### Example ```ts -import { - mintWithSignature, - generateMintSignature, -} from "thirdweb/extensions/erc1155"; - -const { payload, signature } = await generateMintSignature({ - account, - contract, - mintRequest: { - to: "0x...", - quantity: 10n, - metadata: { - name: "My NFT", - description: "This is my NFT", - image: "https://example.com/image.png", - }, - }, -}); - -const transaction = mintWithSignature({ - contract, - payload, - signature, -}); -await sendTransaction({ transaction, account }); +import { isGetRoyaltyInfoForTokenSupported } from "thirdweb/extensions/common"; +const supported = isGetRoyaltyInfoForTokenSupported(["0x..."]); ``` ```ts -function generateMintSignature( - options: GenerateMintSignatureOptions, -): Promise<{ - payload: { - currency: string; - pricePerToken: bigint; - primarySaleRecipient: string; - quantity: bigint; - royaltyBps: bigint; - royaltyRecipient: string; - to: string; - tokenId: bigint; - uid: `0x${string}`; - uri: string; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; -}>; +function isGetRoyaltyInfoForTokenSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the minting process. +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 options: { - account: Account; - contract: ThirdwebContract; - contractType?: "TokenERC1155" | "SignatureMintERC1155"; - mintRequest: GeneratePayloadInput; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise<{ - payload: { - currency: string; - pricePerToken: bigint; - primarySaleRecipient: string; - quantity: bigint; - royaltyBps: bigint; - royaltyRecipient: string; - to: string; - tokenId: bigint; - uid: `0x${string}`; - uri: string; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; -}>; +let returnType: boolean; ``` - A promise that resolves to the payload and signature. +A boolean indicating if the `getRoyaltyInfoForToken` method is supported. --- -## getActiveClaimCondition +## COMMON.isMulticallSupported - Retrieves the active claim condition. +Checks if the `multicall` method is supported by the given contract. ### Example ```ts -import { getActiveClaimCondition } from "thirdweb/extensions/erc1155"; -const activeClaimCondition = await getActiveClaimCondition({ - contract, - tokenId, -}); +import { isMulticallSupported } from "thirdweb/extensions/common"; + +const supported = isMulticallSupported(["0x..."]); ``` ```ts -function getActiveClaimCondition( - options: BaseTransactionOptions, -): Promise; +function isMulticallSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the active claim condition. +A boolean indicating if the `multicall` method is supported. --- -## getClaimConditionById +## COMMON.isNameSupported - Calls the "getClaimConditionById" function on the contract. +Checks if the `name` method is supported by the given contract. ### Example ```ts -import { getClaimConditionById } from "thirdweb/extensions/erc1155"; - -const result = await getClaimConditionById({ - contract, - tokenId: ..., - conditionId: ..., -}); +import { isNameSupported } from "thirdweb/extensions/common"; +const supported = isNameSupported(["0x..."]); ``` ```ts -function getClaimConditionById( - options: BaseTransactionOptions, -): Promise<{ - currency: string; - maxClaimableSupply: bigint; - merkleRoot: `0x${string}`; - metadata: string; - pricePerToken: bigint; - quantityLimitPerWallet: bigint; - startTimestamp: bigint; - supplyClaimed: bigint; -}>; +function isNameSupported(availableSelectors: Array): boolean; ``` ### Parameters - The options for the getClaimConditionById function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise<{ - currency: string; - maxClaimableSupply: bigint; - merkleRoot: `0x${string}`; - metadata: string; - pricePerToken: bigint; - quantityLimitPerWallet: bigint; - startTimestamp: bigint; - supplyClaimed: bigint; -}>; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `name` method is supported. --- -## getClaimConditions +## COMMON.isOwnerSupported - Retrieves all claim conditions. +Checks if the `owner` method is supported by the given contract. ### Example ```ts -import { getClaimConditions } from "thirdweb/extensions/erc1155"; -const conditions = await getClaimConditions({ - contract, - tokenId: 1n, -}); +import { isOwnerSupported } from "thirdweb/extensions/common"; +const supported = isOwnerSupported(["0x..."]); ``` ```ts -function getClaimConditions( - options: BaseTransactionOptions, -): Promise>; +function isOwnerSupported(availableSelectors: Array): boolean; ``` ### Parameters - The transaction options. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: boolean; ``` - A promise that resolves to all claim conditions. +A boolean indicating if the `owner` method is supported. --- -## getNFT +## COMMON.isPrimarySaleRecipientSupported - Retrieves information about a specific ERC1155 non-fungible token (NFT). +Checks if the `primarySaleRecipient` method is supported by the given contract. ### Example ```ts -import { getNFT } from "thirdweb/extensions/erc1155"; -const nft = await getNFT({ - contract, - tokenId: 1n, -}); +import { isPrimarySaleRecipientSupported } from "thirdweb/extensions/common"; +const supported = isPrimarySaleRecipientSupported(["0x..."]); ``` ```ts -function getNFT( - options: BaseTransactionOptions, -): Promise; +function isPrimarySaleRecipientSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for retrieving the NFT. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - tokenURI: string; - type: "ERC721"; - } - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - supply: bigint; - tokenURI: string; - type: "ERC1155"; - }; +let returnType: boolean; ``` - A promise that resolves to the NFT object. +A boolean indicating if the `primarySaleRecipient` method is supported. --- -## getNFTs +## COMMON.isSetContractURISupported - Retrieves an array of NFTs ("ERC1155") based on the provided options. +Checks if the `setContractURI` method is supported by the given contract. ### Example ```ts -import { getNFTs } from "thirdweb/extensions/erc1155"; -const nfts = await getNFTs({ - contract, - start: 0, - count: 10, -}); +import { isSetContractURISupported } from "thirdweb/extensions/common"; + +const supported = isSetContractURISupported(["0x..."]); ``` ```ts -function getNFTs( - options: BaseTransactionOptions, -): Promise>; +function isSetContractURISupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for retrieving the NFTs. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - tokenURI: string; - type: "ERC721"; - } - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - supply: bigint; - tokenURI: string; - type: "ERC1155"; - }; +let returnType: boolean; ``` - A promise that resolves to an array of NFTs. +A boolean indicating if the `setContractURI` method is supported. --- -## getOwnedNFTs +## COMMON.isSetDefaultRoyaltyInfoSupported - Retrieves the owned ERC1155 NFTs for a given wallet address. +Checks if the `setDefaultRoyaltyInfo` method is supported by the given contract. ### Example ```ts -import { getOwnedNFTs } from "thirdweb/extensions/erc1155"; -const nfts = await getOwnedNFTs({ - contract, - start: 0, - count: 10, - address: "0x123...", -}); +import { isSetDefaultRoyaltyInfoSupported } from "thirdweb/extensions/common"; + +const supported = isSetDefaultRoyaltyInfoSupported(["0x..."]); ``` ```ts -function getOwnedNFTs( - options: BaseTransactionOptions, -): Promise>; +function isSetDefaultRoyaltyInfoSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options and 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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - tokenURI: string; - type: "ERC721"; - } - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - supply: bigint; - tokenURI: string; - type: "ERC1155"; - }; +let returnType: boolean; ``` - A promise that resolves to an array of ERC1155 NFTs owned by the wallet address, along with the quantity owned. +A boolean indicating if the `setDefaultRoyaltyInfo` method is supported. --- -## getOwnedTokenIds +## COMMON.isSetPlatformFeeInfoSupported - Retrieves the owned ERC1155 tokenIds & the owned balance of each tokenId for a given wallet address. +Checks if the `setPlatformFeeInfo` method is supported by the given contract. ### Example ```ts -import { getOwnedNFTs } from "thirdweb/extensions/erc1155"; -const ownedTokenIds = await getOwnedTokenIds({ - contract, - start: 0, - count: 10, - address: "0x123...", -}); +import { isSetPlatformFeeInfoSupported } from "thirdweb/extensions/common"; + +const supported = isSetPlatformFeeInfoSupported(["0x..."]); ``` ```ts -function getOwnedTokenIds( - options: BaseTransactionOptions, -): Promise>; +function isSetPlatformFeeInfoSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options and 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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: boolean; ``` - A promise that resolves to an array of ERC1155 NFTs owned by the wallet address, along with the quantity owned. +A boolean indicating if the `setPlatformFeeInfo` method is supported. --- -## isApprovedForAll +## COMMON.isSetPrimarySaleRecipientSupported - Calls the "isApprovedForAll" function on the contract. +Checks if the `setPrimarySaleRecipient` method is supported by the given contract. ### Example ```ts -import { isApprovedForAll } from "thirdweb/extensions/erc1155"; +import { isSetPrimarySaleRecipientSupported } from "thirdweb/extensions/common"; -const result = await isApprovedForAll({ - contract, - owner: ..., - operator: ..., -}); +const supported = isSetPrimarySaleRecipientSupported(["0x..."]); ``` ```ts -function isApprovedForAll( - options: BaseTransactionOptions, -): Promise; +function isSetPrimarySaleRecipientSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the isApprovedForAll function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `setPrimarySaleRecipient` method is supported. --- -## isBurnSupported +## COMMON.isSetRoyaltyInfoForTokenSupported - Checks if the `burn` method is supported by the given contract. +Checks if the `setRoyaltyInfoForToken` method is supported by the given contract. ### Example ```ts -import { isBurnSupported } from "thirdweb/extensions/erc1155"; +import { isSetRoyaltyInfoForTokenSupported } from "thirdweb/extensions/common"; -const supported = isBurnSupported(["0x..."]); +const supported = isSetRoyaltyInfoForTokenSupported(["0x..."]); ``` ```ts -function isBurnSupported(availableSelectors: Array): boolean; +function isSetRoyaltyInfoForTokenSupported( + 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. +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 @@ -9123,30 +10716,29 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `burn` method is supported. +A boolean indicating if the `setRoyaltyInfoForToken` method is supported. --- -## isClaimToSupported +## COMMON.isSymbolSupported - Checks if the `claimTo` method is supported by the given contract. +Checks if the `symbol` method is supported by the given contract. ### Example ```ts -import { isClaimToSupported } from "thirdweb/extensions/erc1155"; - -const supported = isClaimToSupported(["0x..."]); +import { isSymbolSupported } from "thirdweb/extensions/common"; +const supported = isSymbolSupported(["0x..."]); ``` ```ts -function isClaimToSupported( +function isSymbolSupported( 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. +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 @@ -9160,942 +10752,1140 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `claimTo` method is supported. +A boolean indicating if the `symbol` method is supported. --- -## isERC1155 +## COMMON.multicall - Check if a contract supports the ERC1155 interface. +Prepares a transaction to call the "multicall" function on the contract. ### Example ```ts -import { isERC1155 } from "thirdweb/extensions/erc1155"; -const result = await isERC1155({ contract }); +import { sendTransaction } from "thirdweb"; +import { multicall } from "thirdweb/extensions/common"; + +const transaction = multicall({ + contract, + data: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isERC1155(options: BaseTransactionOptions): Promise; +function multicall( + options: BaseTransactionOptions< + MulticallParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for the "multicall" function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions< + MulticallParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating whether the contract supports the ERC1155 interface. +A prepared transaction object. --- -## isGetActiveClaimConditionSupported +## COMMON.name - Checks if the `getActiveClaimCondition` method is supported by the given contract. +Retrieves the name associated with the given contract. ### Example ```ts -import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc1155"; +import { name } from "thirdweb/extensions/common"; -const supported = isGetActiveClaimConditionSupported(["0x..."]); +const contractName = await name({ contract }); ``` ```ts -function isGetActiveClaimConditionSupported( - availableSelectors: Array, -): boolean; +function name(options: BaseTransactionOptions): Promise; ``` ### 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. +The options for the transaction. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getActiveClaimCondition` method is supported. +A promise that resolves to the name associated with the contract. --- -## isGetClaimConditionByIdSupported +## COMMON.owner - Checks if the `getClaimConditionById` method is supported by the given contract. +Calls the "owner" function on the contract. ### Example ```ts -import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc1155"; -const supported = isGetClaimConditionByIdSupported(["0x..."]); +import { owner } from "thirdweb/extensions/common"; + +const result = await owner({ + contract, +}); ``` ```ts -function isGetClaimConditionByIdSupported( - availableSelectors: Array, -): boolean; +function owner(options: BaseTransactionOptions): Promise; ``` ### 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. +The options for the owner function. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getClaimConditionById` method is supported. +The parsed result of the function call. --- -## isGetClaimConditionsSupported +## COMMON.ownerUpdatedEvent - Checks if the `getClaimConditions` method is supported by the given contract. +Creates an event object for the OwnerUpdated event. ### Example ```ts -import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc1155"; +import { getContractEvents } from "thirdweb"; +import { ownerUpdatedEvent } from "thirdweb/extensions/common"; -const supported = isGetClaimConditionsSupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + ownerUpdatedEvent({ + prevOwner: ..., + newOwner: ..., +}) +], +}); ``` ```ts -function isGetClaimConditionsSupported( - availableSelectors: Array, -): boolean; +function ownerUpdatedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "prevOwner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "newOwner"; + readonly type: "address"; + }, + ]; + readonly name: "OwnerUpdated"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "prevOwner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "newOwner"; + readonly type: "address"; + }, + ]; + readonly name: "OwnerUpdated"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `getClaimConditions` method is supported. +The prepared event object. --- -## isGetNFTsSupported +## COMMON.primarySaleRecipient - Checks if the `getNFTs` method is supported by the given contract. +Calls the "primarySaleRecipient" function on the contract. ### Example ```ts -import { isGetNFTsSupported } from "thirdweb/extensions/erc721"; +import { primarySaleRecipient } from "thirdweb/extensions/common"; -const supported = isGetNFTsSupported(["0x..."]); +const result = await primarySaleRecipient({ + contract, +}); ``` ```ts -function isGetNFTsSupported( - availableSelectors: Array, -): boolean; +function primarySaleRecipient( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the primarySaleRecipient function. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getNFTs` method is supported. +The parsed result of the function call. --- -## isGetNFTSupported +## COMMON.setContractMetadata - Checks if the `uri` method is supported by the given contract. +Sets the metadata for a contract. ### Example ```ts -import { isUriSupported } from "thirdweb/extensions/erc1155"; -const supported = isUriSupported(["0x..."]); +import { setContractMetadata } from "@thirdweb/extensions/common"; +import { sendTransaction } from "thirdweb"; + +const transaction = setContractMetadata({ + contract, + name: "My NFT", + symbol: "NFT", +}); + +// Send the transaction +await sendTransaction({ + transaction, + account, +}); ``` ```ts -function isGetNFTSupported( - availableSelectors: Array, -): boolean; +function setContractMetadata( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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. +The options for setting the contract metadata. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `uri` method is supported. +* The prepared transaction to set the contract metadata. --- -## isLazyMintSupported +## COMMON.setContractURI - Checks if the `lazyMint` method is supported by the given contract. +Prepares a transaction to call the "setContractURI" function on the contract. ### Example ```ts -import { isLazyMintSupported } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; +import { setContractURI } from "thirdweb/extensions/common"; -const supported = isLazyMintSupported(["0x..."]); +const transaction = setContractURI({ + contract, + uri: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isLazyMintSupported( - availableSelectors: Array, -): boolean; +function setContractURI( + options: BaseTransactionOptions< + | SetContractURIParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setContractURI" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetContractURIParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `lazyMint` method is supported. +A prepared transaction object. --- -## isMintAdditionalSupplyToSupported +## COMMON.setDefaultRoyaltyInfo - Checks if the `mintAdditionalSupplyTo` method is supported by the given contract. +Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. ### Example ```ts -import { isMintAdditionalSupplyToSupported } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; +import { setDefaultRoyaltyInfo } from "thirdweb/extensions/common"; -const supported = isMintAdditionalSupplyToSupported(["0x..."]); +const transaction = setDefaultRoyaltyInfo({ + contract, + royaltyRecipient: ..., + royaltyBps: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isMintAdditionalSupplyToSupported( - availableSelectors: Array, -): boolean; +function setDefaultRoyaltyInfo( + options: BaseTransactionOptions< + | SetDefaultRoyaltyInfoParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setDefaultRoyaltyInfo" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetDefaultRoyaltyInfoParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `mintAdditionalSupplyTo` method is supported. +A prepared transaction object. --- -## isMintToSupported +## COMMON.setOwner - Checks if the `mintTo` method is supported by the given contract. +Prepares a transaction to call the "setOwner" function on the contract. ### Example ```ts -import { isMintToSupported } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; +import { setOwner } from "thirdweb/extensions/common"; -const supported = isMintToSupported(["0x..."]); +const transaction = setOwner({ + contract, + newOwner: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isMintToSupported( - availableSelectors: Array, -): boolean; +function setOwner( + options: BaseTransactionOptions< + SetOwnerParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setOwner" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + SetOwnerParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `mintTo` method is supported. +A prepared transaction object. --- -## isNextTokenIdToMintSupported +## COMMON.setPlatformFeeInfo - Checks if the `nextTokenIdToMint` method is supported by the given contract. +Prepares a transaction to call the "setPlatformFeeInfo" function on the contract. ### Example ```ts -import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc1155"; -const supported = isNextTokenIdToMintSupported(["0x..."]); +import { sendTransaction } from "thirdweb"; +import { setPlatformFeeInfo } from "thirdweb/extensions/common"; + +const transaction = setPlatformFeeInfo({ + contract, + platformFeeRecipient: ..., + platformFeeBps: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isNextTokenIdToMintSupported( - availableSelectors: Array, -): boolean; +function setPlatformFeeInfo( + options: BaseTransactionOptions< + | SetPlatformFeeInfoParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setPlatformFeeInfo" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetPlatformFeeInfoParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `nextTokenIdToMint` method is supported. +A prepared transaction object. --- -## isResetClaimEligibilitySupported +## COMMON.setPrimarySaleRecipient - Checks if the `resetClaimEligibility` method is supported by the given contract. +Prepares a transaction to call the "setPrimarySaleRecipient" function on the contract. ### Example ```ts -import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; +import { setPrimarySaleRecipient } from "thirdweb/extensions/common"; -const supported = isResetClaimEligibilitySupported(["0x..."]); +const transaction = setPrimarySaleRecipient({ + contract, + saleRecipient: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isResetClaimEligibilitySupported( - availableSelectors: Array, -): boolean; +function setPrimarySaleRecipient( + options: BaseTransactionOptions< + | SetPrimarySaleRecipientParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setPrimarySaleRecipient" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetPrimarySaleRecipientParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `resetClaimEligibility` method is supported. +A prepared transaction object. --- -## isSetClaimConditionsSupported +## COMMON.setRoyaltyInfoForToken - Checks if the `setClaimConditions` method is supported by the given contract. +Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. ### Example ```ts -import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; +import { setRoyaltyInfoForToken } from "thirdweb/extensions/common"; -const supported = isSetClaimConditionsSupported(["0x..."]); +const transaction = setRoyaltyInfoForToken({ + contract, + tokenId: ..., + recipient: ..., + bps: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isSetClaimConditionsSupported( - availableSelectors: Array, -): boolean; +function setRoyaltyInfoForToken( + options: BaseTransactionOptions< + | SetRoyaltyInfoForTokenParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setRoyaltyInfoForToken" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetRoyaltyInfoForTokenParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `setClaimConditions` method is supported. +A prepared transaction object. --- -## isTotalSupplySupported +## COMMON.symbol - Checks if the `totalSupply` method is supported by the given contract. +Retrieves the name associated with the given contract. ### Example ```ts -import { isTotalSupplySupported } from "thirdweb/extensions/erc1155"; -const supported = isTotalSupplySupported(["0x..."]); +import { symbol } from "thirdweb/extensions/common"; + +const contractSymbol = await symbol({ contract }); ``` ```ts -function isTotalSupplySupported( - availableSelectors: Array, -): boolean; +function symbol(options: BaseTransactionOptions): Promise; ``` ### 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. +The options for the transaction. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `totalSupply` method is supported. +A promise that resolves to the name associated with the contract. +--- +## ENS --- -## isUpdateTokenURISupported +## ENS.parseNftUri - Checks if the `setTokenURI` method is supported by the given contract. +Parses an NFT URI. ### Example ```ts -import { isSetTokenURISupported } from "thirdweb/extensions/erc1155"; +import { parseNftUri } from "thirdweb/utils/ens"; +const nftUri = await parseNftUri({ + client, + uri: "eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063", +}); -const supported = isSetTokenURISupported(["0x..."]); +console.log(nftUri); // ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/ ``` ```ts -function isUpdateTokenURISupported( - availableSelectors: Array, -): boolean; +function parseNftUri(options: { + client: ThirdwebClient; + uri: string; +}): Promise; ``` ### 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. +The options for parsing an NFT URI. #### Type ```ts -let availableSelectors: Array; +let options: { client: ThirdwebClient; uri: string }; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `setTokenURI` method is supported. +A promise that resolves to the NFT URI, or null if the URI could not be parsed. --- -## lazyMint +## ENS.parseAvatarRecord - Lazily mints ERC1155 tokens. +Parses an ENS or similar avatar record. Supports NFT URIs, IPFS scheme, and HTTPS URIs. ### Example ```ts -import { lazyMint } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; +import { parseAvatarRecord } from "thirdweb/utils/ens"; +const avatarUrl = await parseAvatarRecord({ + client, + uri: "ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/", +}); -const transaction = lazyMint({ - contract, - nfts: [ - { - name: "My NFT", - description: "This is my NFT", - image: "https://example.com/image.png", - }, - ], +console.log(avatarUrl); // "https://ipfs.io/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/" + +const avatarUrl2 = await parseAvatarRecord({ + client, + uri: "eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063", }); -await sendTransaction({ transaction, account }); +console.log(avatarUrl2); // "https://opensea.io/assets/0xb32979486938aa9694bfc898f35dbed459f44424/10063" ``` ```ts -function lazyMint( - options: BaseTransactionOptions, -): PreparedTransaction; +function parseAvatarRecord( + options: ParseAvatarOptions, +): Promise; ``` ### Parameters - The options for the lazy minting process. +The options for parsing an ENS avatar record. #### Type ```ts -let options: BaseTransactionOptions; +let options: { client: ThirdwebClient; uri: string }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the prepared contract call. +A promise that resolves to the avatar URL, or null if the URI could not be parsed. --- -## metadataFrozenEvent +## ENS.resolveAddress - Creates an event object for the MetadataFrozen event. +Resolves an ENS name to an Ethereum address. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { metadataFrozenEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ - contract, - events: [metadataFrozenEvent()], +import { resolveAddress } from "thirdweb/extensions/ens"; +const address = await resolveAddress({ + client, + name: "vitalik.eth", }); ``` +Resolve an address to a Basename. + ```ts -function metadataFrozenEvent(): PreparedEvent<{ - readonly inputs: readonly []; - readonly name: "MetadataFrozen"; - readonly type: "event"; -}>; +import { + resolveAddress, + BASENAME_RESOLVER_ADDRESS, +} from "thirdweb/extensions/ens"; +import { base } from "thirdweb/chains"; +const address = await resolveAddress({ + client, + name: "myk.base.eth", + resolverAddress: BASENAME_RESOLVER_ADDRESS, + resolverChain: base, +}); ``` -### Returns - ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly []; - readonly name: "MetadataFrozen"; - readonly type: "event"; -}>; +function resolveAddress( + options: ResolveAddressOptions, +): Promise<`0x${string}`>; ``` - The prepared event object. ---- - -## metadataUpdateEvent - - Creates an event object for the MetadataUpdate event. +### Parameters -### Example +The options for resolving an ENS address. -```ts -import { getContractEvents } from "thirdweb"; -import { metadataUpdateEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ - contract, - events: [metadataUpdateEvent()], -}); -``` +#### Type ```ts -function metadataUpdateEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "_tokenId"; readonly type: "uint256" }, - ]; - readonly name: "MetadataUpdate"; - readonly type: "event"; -}>; +let options: { + client: ThirdwebClient; + name: string; + resolverAddress?: string; + resolverChain?: Chain; +}; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "_tokenId"; readonly type: "uint256" }, - ]; - readonly name: "MetadataUpdate"; - readonly type: "event"; -}>; +let returnType: Promise<`0x${string}`>; ``` - The prepared event object. +A promise that resolves to the Ethereum address. --- -## mintAdditionalSupplyTo +## ENS.resolveAvatar - Mints a "supply" number of additional ERC1155 tokens to the specified "to" address. +Resolves an ENS name to the avatar URL. ### Example ```ts -import { mintAdditionalSupplyTo } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; - -const transaction = mintAdditionalSupplyTo({ - contract, - to: "0x...", - tokenId: 1n, - supply: 10n, +import { resolveAvatar } from "thirdweb/extensions/ens"; +const address = await resolveAvatar({ + client, + name: "vitalik.eth", }); - -await sendTransaction({ transaction, account }); ``` ```ts -function mintAdditionalSupplyTo( - options: BaseTransactionOptions, -): PreparedTransaction; +function resolveAvatar( + options: ResolveAvatarOptions, +): Promise; ``` ### Parameters - The transaction options. +The options for resolving an ENS address. #### Type ```ts -let options: BaseTransactionOptions; +let options: { + client: ThirdwebClient; + name: string; + resolverAddress?: string; + resolverChain?: Chain; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +A promise that resolves to the avatar url, or null if not set. --- -## mintAdditionalSupplyToBatch +## ENS.resolveL2Name - This extension batches multiple `mintAdditionalSupplyToBatch` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. - - You are recommended to experiment with the number to figure out the best number for your chain of choice. +Resolves the L2 name for a specified address. ### Example ```ts -import { mintAdditionalSupplyToBatch } from "thirdweb/extensions/erc1155"; - -const transaction = mintAdditionalSupplyToBatch({ - contract, - nfts: [ - { tokenId: 0n, supply: 99n, to: account.address }, - { tokenId: 1n, supply: 98n, to: account.address }, - { tokenId: 2n, supply: 97n, to: account.address }, - ], +import { resolveL2Name } from "thirdweb/extensions/ens"; +const name = await resolveL2Name({ + client, + address: "0x1234...", + resolverAddress: "0x...", + resolverChain: base, }); ``` +Resolve a Basename. + ```ts -function mintAdditionalSupplyToBatch( - options: BaseTransactionOptions, -): PreparedTransaction; +import { + resolveL2Name, + BASENAME_RESOLVER_ADDRESS, +} from "thirdweb/extensions/ens"; +import { base } from "thirdweb/chains"; +const name = await resolveL2Name({ + client, + address: "0x1234...", + resolverAddress: BASENAME_RESOLVER_ADDRESS, + resolverChain: base, +}); +``` + +```ts +function resolveL2Name( + options: ResolveL2NameOptions, +): Promise; ``` ### Parameters +The options for resolving an L2 ENS address. + #### Type ```ts -let options: BaseTransactionOptions; +let options: { + address: Address; + client: ThirdwebClient; + resolverAddress: string; + resolverChain: Chain; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` + +A promise that resolves to the Ethereum address. --- -## mintTo +## ENS.resolveName - Mints a "supply" number of new ERC1155 tokens to the specified "to" address. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. +Resolves the primary name for a specified address. ### Example ```ts -import { mintTo } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; - -const transaction = mintTo({ - contract, - to: "0x...", - supply: 10n, - nft: { - name: "My NFT", - description: "This is my NFT", - image: "https://example.com/image.png", - }, +import { resolveName } from "thirdweb/extensions/ens"; +const name = await resolveName({ + client, + address: "0x1234...", }); - -await sendTransaction({ transaction, account }); ``` ```ts -function mintTo( - options: BaseTransactionOptions, -): PreparedTransaction; +function resolveName( + options: ResolveNameOptions, +): Promise; ``` ### Parameters - The transaction options. +The options for resolving an ENS address. #### Type ```ts -let options: BaseTransactionOptions; +let options: { + address: Address; + client: ThirdwebClient; + resolverAddress?: string; + resolverChain?: Chain; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +A promise that resolves to the Ethereum address. --- -## mintToBatch - - This extension batches multiple `mintTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. +## ENS.resolveText - You are recommended to experiment with the number to figure out the best number for your chain of choice. +Resolves an ENS name and key to the specified record. ### Example ```ts -import { mintBatchTo } from "thirdweb/extension/erc1155"; - -const transaction = mintToBatch({ - contract: editionContract, - to: "0x...", - nfts: [ - { - metadata: { - name: "Token #0", - image: "...", - attributes: [], - }, - supply: 100n, - }, - { - metadata: { - name: "Token #1", - image: "...", - attributes: [], - }, - supply: 111n, - }, - ], +import { resolveText } from "thirdweb/extensions/ens"; +const twitterUsername = await resolveText({ + client, + name: "vitalik.eth", + key: "com.twitter", }); - -await sendTransaction({ transaction, account }); ``` ```ts -function mintToBatch( - options: BaseTransactionOptions, -): PreparedTransaction; +function resolveText( + options: ResolveTextOptions, +): Promise; ``` ### Parameters - the transaction options +The options for resolving an ENS address. #### Type ```ts -let options: BaseTransactionOptions; +let options: { + client: ThirdwebClient; + key: string; + name: string; + resolverAddress?: string; + resolverChain?: Chain; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +A promise that resolves to the text record. +--- +## ERC1155 --- -## mintWithSignature +## ERC1155.approvalForAllEvent - Mints a new ERC1155 token with the given minter signature +Creates an event object for the ApprovalForAll event. ### Example ```ts -import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; - -const { payload, signature } = await generateMintSignature(...) +import { getContractEvents } from "thirdweb"; +import { approvalForAllEvent } from "thirdweb/extensions/erc1155"; -const transaction = mintWithSignature({ - contract, - payload, - signature, +const events = await getContractEvents({ +contract, +events: [ + approvalForAllEvent({ + _owner: ..., + _operator: ..., +}) +], }); -await sendTransaction({ transaction, account }); ``` ```ts -function mintWithSignature( - options: BaseTransactionOptions, -): PreparedTransaction; +function approvalForAllEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "_owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_operator"; + readonly type: "address"; + }, + { readonly name: "_approved"; readonly type: "bool" }, + ]; + readonly name: "ApprovalForAll"; + readonly type: "event"; +}>; ``` ### Parameters - The transaction options. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "_owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_operator"; + readonly type: "address"; + }, + { readonly name: "_approved"; readonly type: "bool" }, + ]; + readonly name: "ApprovalForAll"; + readonly type: "event"; +}>; ``` - A promise that resolves to the transaction result. +The prepared event object. --- -## nextTokenId +## ERC1155.balanceOf - Calls the "nextTokenId" function on the contract. +Calls the "balanceOf" function on the contract. ### Example ```ts -import { nextTokenId } from "thirdweb/extensions/erc1155"; +import { balanceOf } from "thirdweb/extensions/erc1155"; -const result = await nextTokenId({ - contract, +const result = await balanceOf({ + contract, + owner: ..., + tokenId: ..., }); ``` ```ts -function nextTokenId( - options: BaseTransactionOptions, +function balanceOf( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the nextTokenId function. +The options for the balanceOf function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -10104,62 +11894,106 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## nextTokenIdToMint +## ERC1155.balanceOfBatch - Calls the "nextTokenIdToMint" function on the contract. +Calls the "balanceOfBatch" function on the contract. ### Example ```ts -import { nextTokenIdToMint } from "thirdweb/extensions/erc1155"; +import { balanceOfBatch } from "thirdweb/extensions/erc1155"; -const result = await nextTokenIdToMint({ - contract, +const result = await balanceOfBatch({ + contract, + owners: ..., + tokenIds: ..., }); ``` ```ts -function nextTokenIdToMint( - options: BaseTransactionOptions, -): Promise; +function balanceOfBatch(options: BaseTransactionOptions) : Promise> ``` ### Parameters - The options for the nextTokenIdToMint function. +The options for the balanceOfBatch function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise> +``` + +The parsed result of the function call. +--- + +## ERC1155.batchMetadataUpdateEvent + +Creates an event object for the BatchMetadataUpdate event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { batchMetadataUpdateEvent } from "thirdweb/extensions/erc1155"; + +const events = await getContractEvents({ + contract, + events: [batchMetadataUpdateEvent()], +}); +``` + +```ts +function batchMetadataUpdateEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "_fromTokenId"; readonly type: "uint256" }, + { readonly name: "_toTokenId"; readonly type: "uint256" }, + ]; + readonly name: "BatchMetadataUpdate"; + readonly type: "event"; +}>; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "_fromTokenId"; readonly type: "uint256" }, + { readonly name: "_toTokenId"; readonly type: "uint256" }, + ]; + readonly name: "BatchMetadataUpdate"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## openPack +## ERC1155.burn - Prepares a transaction to call the "openPack" function on the contract. +Prepares a transaction to call the "burn" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { openPack } from "thirdweb/extensions/erc1155"; +import { burn } from "thirdweb/extensions/erc1155"; -const transaction = openPack({ +const transaction = burn({ contract, - packId: ..., - amountToOpen: ..., + account: ..., + id: ..., + value: ..., overrides: { ... } @@ -10170,22 +12004,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function openPack( +function burn( options: BaseTransactionOptions< - OpenPackParams | { asyncParams: () => Promise } + BurnParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "openPack" function. +The options for the "burn" function. #### Type ```ts let options: BaseTransactionOptions< - OpenPackParams | { asyncParams: () => Promise } + BurnParams | { asyncParams: () => Promise } >; ``` @@ -10199,274 +12033,218 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## packCreatedEvent +## ERC1155.burnBatch - Creates an event object for the PackCreated event. +Prepares a transaction to call the "burnBatch" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { packCreatedEvent } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; +import { burnBatch } from "thirdweb/extensions/erc1155"; -const events = await getContractEvents({ -contract, -events: [ - packCreatedEvent({ - packId: ..., -}) -], +const transaction = burnBatch({ + contract, + account: ..., + ids: ..., + values: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function packCreatedEvent( - filters: Partial<{ packId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "packId"; - readonly type: "uint256"; - }, - { readonly name: "recipient"; readonly type: "address" }, - { readonly name: "totalPacksCreated"; readonly type: "uint256" }, - ]; - readonly name: "PackCreated"; - readonly type: "event"; -}>; +function burnBatch( + options: BaseTransactionOptions< + BurnBatchParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - Optional filters to apply to the event. +The options for the "burnBatch" function. #### Type ```ts -let filters: Partial<{ packId: bigint }>; +let options: BaseTransactionOptions< + BurnBatchParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "packId"; - readonly type: "uint256"; - }, - { readonly name: "recipient"; readonly type: "address" }, - { readonly name: "totalPacksCreated"; readonly type: "uint256" }, - ]; - readonly name: "PackCreated"; - readonly type: "event"; -}>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The prepared event object. +A prepared transaction object. --- -## packOpenedEvent +## ERC1155.canClaim - Creates an event object for the PackOpened event. +Check if a user can claim a drop. This method is only available on the `DropERC1155` contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { packOpenedEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ -contract, -events: [ - packOpenedEvent({ - packId: ..., - opener: ..., -}) -], +const claimResult = await canClaim({ + contract: contract, + claimer: "0x1234567890123456789012345678901234567890", + quantity: "1", + tokenId: 0n, }); ``` ```ts -function packOpenedEvent( - filters: Partial<{ opener: string; packId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "packId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "opener"; - readonly type: "address"; - }, - { readonly name: "numOfPacksOpened"; readonly type: "uint256" }, - { - readonly components: readonly [ - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "totalAmount"; readonly type: "uint256" }, - ]; - readonly name: "rewardUnitsDistributed"; - readonly type: "tuple[]"; - }, - ]; - readonly name: "PackOpened"; - readonly type: "event"; -}>; +function canClaim( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the transaction. #### Type ```ts -let filters: Partial<{ opener: string; packId: bigint }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "packId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "opener"; - readonly type: "address"; - }, - { readonly name: "numOfPacksOpened"; readonly type: "uint256" }, - { - readonly components: readonly [ - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "totalAmount"; readonly type: "uint256" }, - ]; - readonly name: "rewardUnitsDistributed"; - readonly type: "tuple[]"; - }, - ]; - readonly name: "PackOpened"; - readonly type: "event"; -}>; +let returnType: { reason?: string; result: boolean }; ``` - The prepared event object. +Whether the user can claim the drop. --- -## packUpdatedEvent +## ERC1155.claimCondition - Creates an event object for the PackUpdated event. +Calls the "claimCondition" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { packUpdatedEvent } from "thirdweb/extensions/erc1155"; +import { claimCondition } from "thirdweb/extensions/erc1155"; -const events = await getContractEvents({ -contract, -events: [ - packUpdatedEvent({ - packId: ..., -}) -], +const result = await claimCondition({ + contract, + tokenId: ..., }); ``` ```ts -function packUpdatedEvent( - filters: Partial<{ packId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "packId"; - readonly type: "uint256"; - }, - { readonly name: "recipient"; readonly type: "address" }, - { readonly name: "totalPacksCreated"; readonly type: "uint256" }, - ]; - readonly name: "PackUpdated"; - readonly type: "event"; -}>; +function claimCondition( + options: BaseTransactionOptions, +): Promise< + readonly [ + bigint, + bigint, + bigint, + bigint, + `0x${string}`, + bigint, + string, + string, + ] +>; ``` ### Parameters - Optional filters to apply to the event. +The options for the claimCondition function. #### Type - -```ts -let filters: Partial<{ packId: bigint }>; -``` - -### Returns - -```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "packId"; - readonly type: "uint256"; - }, - { readonly name: "recipient"; readonly type: "address" }, - { readonly name: "totalPacksCreated"; readonly type: "uint256" }, - ]; - readonly name: "PackUpdated"; - readonly type: "event"; -}>; + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: Promise< + readonly [ + bigint, + bigint, + bigint, + bigint, + `0x${string}`, + bigint, + string, + string, + ] +>; ``` - The prepared event object. +The parsed result of the function call. --- -## resetClaimEligibility +## ERC1155.claimTo - Reset the claim eligibility for all users. +Claim ERC1155 NFTs to a specified address This method is only available on the `DropERC1155` contract. ### Example +#### Basic usage + ```ts -import { resetClaimEligibility } from "thirdweb/extensions/erc1155"; +import { claimTo } from "thirdweb/extensions/erc1155"; import { sendTransaction } from "thirdweb"; -const transaction = resetClaimEligibility({ +const transaction = claimTo({ contract, + to: "0x...", + tokenId: 0n, + quantity: 1n, }); await sendTransaction({ transaction, account }); ``` +#### For Drops with allowlists + +You need to specify the claimer address as the `from` param to avoid any issue with the allowlist + ```ts -function resetClaimEligibility( - options: BaseTransactionOptions, +const transaction = claimTo({ + contract, + to: "0x...", + tokenId: 0n, + quantity: 1n, + from: "0x...", // address of the one claiming +}); +``` + +```ts +function claimTo( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters +The options for the transaction + #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -10479,26 +12257,27 @@ let returnType: PreparedTransaction< >; ``` - the prepared transaction +The prepared transaction --- -## safeBatchTransferFrom +## ERC1155.createPack - Prepares a transaction to call the "safeBatchTransferFrom" function on the contract. +Prepares a transaction to call the "createPack" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { safeBatchTransferFrom } from "thirdweb/extensions/erc1155"; +import { createPack } from "thirdweb/extensions/erc1155"; -const transaction = safeBatchTransferFrom({ +const transaction = createPack({ contract, - from: ..., - to: ..., - tokenIds: ..., - values: ..., - data: ..., + contents: ..., + numOfRewardUnits: ..., + packUri: ..., + openStartTimestamp: ..., + amountDistributedPerOpen: ..., + recipient: ..., overrides: { ... } @@ -10509,24 +12288,23 @@ await sendTransaction({ transaction, account }); ``` ```ts -function safeBatchTransferFrom( +function createPack( options: BaseTransactionOptions< - | SafeBatchTransferFromParams - | { asyncParams: () => Promise } + | CreatePackParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "safeBatchTransferFrom" function. +The options for the "createPack" function. #### Type ```ts let options: BaseTransactionOptions< - | SafeBatchTransferFromParams - | { asyncParams: () => Promise } + CreatePackParams | { asyncParams: () => Promise } >; ``` @@ -10540,113 +12318,96 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## safeTransferFrom +## ERC1155.encodeSafeTransferFrom - Prepares a transaction to call the "safeTransferFrom" function on the contract. +Encodes the "safeTransferFrom" function into a Hex string with its parameters. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { safeTransferFrom } from "thirdweb/extensions/erc1155"; - -const transaction = safeTransferFrom({ - contract, +import { encodeSafeTransferFrom } from "thirdweb/extensions/erc1155"; +const result = encodeSafeTransferFrom({ from: ..., to: ..., tokenId: ..., value: ..., data: ..., - overrides: { - ... - } }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function safeTransferFrom( - options: BaseTransactionOptions< - | SafeTransferFromParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function encodeSafeTransferFrom( + options: SafeTransferFromParams, +): `0xf242432a${string}`; ``` ### Parameters - The options for the "safeTransferFrom" function. +The options for the safeTransferFrom function. #### Type ```ts -let options: BaseTransactionOptions< - | SafeTransferFromParams - | { asyncParams: () => Promise } ->; +let options: WithOverrides<{ + data: AbiParameterToPrimitiveType<{ name: "_data"; type: "bytes" }>; + from: AbiParameterToPrimitiveType<{ + name: "_from"; + type: "address"; + }>; + to: AbiParameterToPrimitiveType<{ name: "_to"; type: "address" }>; + tokenId: AbiParameterToPrimitiveType<{ + name: "tokenId"; + type: "uint256"; + }>; + value: AbiParameterToPrimitiveType<{ + name: "_value"; + type: "uint256"; + }>; +}>; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: `0xf242432a${string}`; ``` - A prepared transaction object. +The encoded hexadecimal string. --- -## setApprovalForAll +## ERC1155.freezeMetadata - Prepares a transaction to call the "setApprovalForAll" function on the contract. +Prepares a transaction to call the "freezeMetadata" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { setApprovalForAll } from "thirdweb/extensions/erc1155"; +import { freezeMetadata } from "thirdweb/extensions/erc1155"; -const transaction = setApprovalForAll({ - contract, - operator: ..., - approved: ..., - overrides: { - ... - } -}); +const transaction = freezeMetadata(); // Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function setApprovalForAll( - options: BaseTransactionOptions< - | SetApprovalForAllParams - | { asyncParams: () => Promise } - >, +function freezeMetadata( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "setApprovalForAll" function. +The options for the "freezeMetadata" function. #### Type ```ts -let options: BaseTransactionOptions< - | SetApprovalForAllParams - | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns @@ -10659,876 +12420,632 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setClaimConditions +## ERC1155.generateMintSignature - Set the claim conditions for a ERC1155 drop +Generates the payload and signature for minting an ERC1155 token. ### Example ```ts -import { setClaimConditions } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; +import { + mintWithSignature, + generateMintSignature, +} from "thirdweb/extensions/erc1155"; -const transaction = setClaimConditions({ +const { payload, signature } = await generateMintSignature({ + account, contract, - tokenId: 0n, - phases: [ - { - maxClaimableSupply: 100n, - maxClaimablePerWallet: 1n, - currencyAddress: "0x...", - price: 0.1, - startTime: new Date(), + mintRequest: { + to: "0x...", + quantity: 10n, + metadata: { + name: "My NFT", + description: "This is my NFT", + image: "https://example.com/image.png", }, - ], + }, }); +const transaction = mintWithSignature({ + contract, + payload, + signature, +}); await sendTransaction({ transaction, account }); ``` ```ts -function setClaimConditions( - options: BaseTransactionOptions, -): PreparedTransaction; +function generateMintSignature( + options: GenerateMintSignatureOptions, +): Promise<{ + payload: { + currency: string; + pricePerToken: bigint; + primarySaleRecipient: string; + quantity: bigint; + royaltyBps: bigint; + royaltyRecipient: string; + to: string; + tokenId: bigint; + uid: `0x${string}`; + uri: string; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; +}>; ``` ### Parameters +The options for the minting process. + #### Type ```ts -let options: BaseTransactionOptions; +let options: { + account: Account; + contract: ThirdwebContract; + contractType?: "TokenERC1155" | "SignatureMintERC1155"; + mintRequest: GeneratePayloadInput; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise<{ + payload: { + currency: string; + pricePerToken: bigint; + primarySaleRecipient: string; + quantity: bigint; + royaltyBps: bigint; + royaltyRecipient: string; + to: string; + tokenId: bigint; + uid: `0x${string}`; + uri: string; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; +}>; ``` - the prepared transaction +A promise that resolves to the payload and signature. --- -## setTokenURI +## ERC1155.getActiveClaimCondition - Prepares a transaction to call the "setTokenURI" function on the contract. +Retrieves the active claim condition. This method is only available on the `DropERC1155` contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { setTokenURI } from "thirdweb/extensions/erc1155"; - -const transaction = setTokenURI({ - contract, - tokenId: ..., - uri: ..., - overrides: { - ... - } +import { getActiveClaimCondition } from "thirdweb/extensions/erc1155"; +const activeClaimCondition = await getActiveClaimCondition({ + contract, + tokenId, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function setTokenURI( - options: BaseTransactionOptions< - | SetTokenURIParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getActiveClaimCondition( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "setTokenURI" function. +The transaction options. #### Type ```ts -let options: BaseTransactionOptions< - | SetTokenURIParams - | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +A promise that resolves to the active claim condition. --- -## tokensClaimedEvent +## ERC1155.getClaimConditionById - Creates an event object for the TokensClaimed event. +Calls the "getClaimConditionById" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokensClaimedEvent } from "thirdweb/extensions/erc1155"; +import { getClaimConditionById } from "thirdweb/extensions/erc1155"; -const events = await getContractEvents({ -contract, -events: [ - tokensClaimedEvent({ - claimConditionIndex: ..., - claimer: ..., - receiver: ..., -}) -], +const result = await getClaimConditionById({ + contract, + tokenId: ..., + conditionId: ..., }); ``` ```ts -function tokensClaimedEvent( - filters: Partial<{ - claimConditionIndex: bigint; - claimer: string; - receiver: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "claimConditionIndex"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "claimer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "receiver"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantityClaimed"; readonly type: "uint256" }, - ]; - readonly name: "TokensClaimed"; - readonly type: "event"; +function getClaimConditionById( + options: BaseTransactionOptions, +): Promise<{ + currency: string; + maxClaimableSupply: bigint; + merkleRoot: `0x${string}`; + metadata: string; + pricePerToken: bigint; + quantityLimitPerWallet: bigint; + startTimestamp: bigint; + supplyClaimed: bigint; }>; ``` ### Parameters - Optional filters to apply to the event. +The options for the getClaimConditionById function. #### Type ```ts -let filters: Partial<{ - claimConditionIndex: bigint; - claimer: string; - receiver: string; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "claimConditionIndex"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "claimer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "receiver"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantityClaimed"; readonly type: "uint256" }, - ]; - readonly name: "TokensClaimed"; - readonly type: "event"; +let returnType: Promise<{ + currency: string; + maxClaimableSupply: bigint; + merkleRoot: `0x${string}`; + metadata: string; + pricePerToken: bigint; + quantityLimitPerWallet: bigint; + startTimestamp: bigint; + supplyClaimed: bigint; }>; ``` - The prepared event object. +The parsed result of the function call. --- -## tokensLazyMintedEvent +## ERC1155.getClaimConditions - Creates an event object for the TokensLazyMinted event. +Retrieves all claim conditions. This method is only available on the `DropERC1155` contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokensLazyMintedEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ -contract, -events: [ - tokensLazyMintedEvent({ - startTokenId: ..., -}) -], +import { getClaimConditions } from "thirdweb/extensions/erc1155"; +const conditions = await getClaimConditions({ + contract, + tokenId: 1n, }); ``` ```ts -function tokensLazyMintedEvent( - filters: Partial<{ startTokenId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "startTokenId"; - readonly type: "uint256"; - }, - { readonly name: "endTokenId"; readonly type: "uint256" }, - { readonly name: "baseURI"; readonly type: "string" }, - { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, - ]; - readonly name: "TokensLazyMinted"; - readonly type: "event"; -}>; +function getClaimConditions( + options: { + contract: Readonly>; + } & GetClaimConditionsParams & { singlePhaseDrop?: boolean }, +): Promise>; ``` ### Parameters - Optional filters to apply to the event. +The transaction options. #### Type ```ts -let filters: Partial<{ startTokenId: bigint }>; +let options: { + contract: Readonly>; +} & GetClaimConditionsParams & { singlePhaseDrop?: boolean }; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "startTokenId"; - readonly type: "uint256"; - }, - { readonly name: "endTokenId"; readonly type: "uint256" }, - { readonly name: "baseURI"; readonly type: "string" }, - { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, - ]; - readonly name: "TokensLazyMinted"; - readonly type: "event"; -}>; +let returnType: Promise>; ``` - The prepared event object. +A promise that resolves to all claim conditions. --- -## tokensMintedWithSignatureEvent +## ERC1155.getNFT - Creates an event object for the TokensMintedWithSignature event. +Retrieves information about a specific ERC1155 non-fungible token (NFT). ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ -contract, -events: [ - tokensMintedWithSignatureEvent({ - signer: ..., - mintedTo: ..., - tokenIdMinted: ..., -}) -], +import { getNFT } from "thirdweb/extensions/erc1155"; +const nft = await getNFT({ + contract, + tokenId: 1n, }); ``` ```ts -function tokensMintedWithSignatureEvent( - filters: Partial<{ - mintedTo: string; - signer: string; - tokenIdMinted: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "signer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "mintedTo"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenIdMinted"; - readonly type: "uint256"; - }, - { - readonly components: readonly [ - { readonly name: "to"; readonly type: "address" }, - { - readonly name: "royaltyRecipient"; - readonly type: "address"; - }, - { readonly name: "royaltyBps"; readonly type: "uint256" }, - { - readonly name: "primarySaleRecipient"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "uri"; readonly type: "string" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { - readonly name: "validityStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "validityEndTimestamp"; - readonly type: "uint128"; - }, - { readonly name: "uid"; readonly type: "bytes32" }, - ]; - readonly name: "mintRequest"; - readonly type: "tuple"; - }, - ]; - readonly name: "TokensMintedWithSignature"; - readonly type: "event"; -}>; +function getNFT( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for retrieving the NFT. #### Type ```ts -let filters: Partial<{ - mintedTo: string; - signer: string; - tokenIdMinted: bigint; -}>; -``` - -### Returns - -```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "signer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "mintedTo"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenIdMinted"; - readonly type: "uint256"; - }, - { - readonly components: readonly [ - { readonly name: "to"; readonly type: "address" }, - { - readonly name: "royaltyRecipient"; - readonly type: "address"; - }, - { readonly name: "royaltyBps"; readonly type: "uint256" }, - { - readonly name: "primarySaleRecipient"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "uri"; readonly type: "string" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { - readonly name: "validityStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "validityEndTimestamp"; - readonly type: "uint128"; - }, - { readonly name: "uid"; readonly type: "bytes32" }, - ]; - readonly name: "mintRequest"; - readonly type: "tuple"; - }, - ]; - readonly name: "TokensMintedWithSignature"; - readonly type: "event"; -}>; +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - The prepared event object. +A promise that resolves to the NFT object. --- -## totalSupply +## ERC1155.getNFTs - Calls the "totalSupply" function on the contract. +Retrieves an array of NFTs ("ERC1155") based on the provided options. ### Example ```ts -import { totalSupply } from "thirdweb/extensions/erc1155"; - -const result = await totalSupply({ - contract, - id: ..., +import { getNFTs } from "thirdweb/extensions/erc1155"; +const nfts = await getNFTs({ + contract, + start: 0, + count: 10, }); ``` ```ts -function totalSupply( - options: BaseTransactionOptions, -): Promise; +function getNFTs( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the totalSupply function. +The options for retrieving the NFTs. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - The parsed result of the function call. +A promise that resolves to an array of NFTs. --- -## transferBatchEvent +## ERC1155.getOwnedNFTs - Creates an event object for the TransferBatch event. +Retrieves the owned ERC1155 NFTs for a given wallet address. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { transferBatchEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ -contract, -events: [ - transferBatchEvent({ - _operator: ..., - _from: ..., - _to: ..., -}) -], +import { getOwnedNFTs } from "thirdweb/extensions/erc1155"; +const nfts = await getOwnedNFTs({ + contract, + start: 0, + count: 10, + address: "0x123...", }); ``` ```ts -function transferBatchEvent( - filters: Partial<{ _from: string; _operator: string; _to: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "_operator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_to"; - readonly type: "address"; - }, - { readonly name: "tokenIds"; readonly type: "uint256[]" }, - { readonly name: "_values"; readonly type: "uint256[]" }, - ]; - readonly name: "TransferBatch"; - readonly type: "event"; -}>; +function getOwnedNFTs( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - Optional filters to apply to the event. +The transaction options and parameters. #### Type ```ts -let filters: Partial<{ - _from: string; - _operator: string; - _to: string; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "_operator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_to"; - readonly type: "address"; - }, - { readonly name: "tokenIds"; readonly type: "uint256[]" }, - { readonly name: "_values"; readonly type: "uint256[]" }, - ]; - readonly name: "TransferBatch"; - readonly type: "event"; -}>; +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - The prepared event object. +A promise that resolves to an array of ERC1155 NFTs owned by the wallet address, along with the quantity owned. --- -## transferSingleEvent +## ERC1155.getOwnedTokenIds - Creates an event object for the TransferSingle event. +Retrieves the owned ERC1155 tokenIds & the owned balance of each tokenId for a given wallet address. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { transferSingleEvent } from "thirdweb/extensions/erc1155"; - -const events = await getContractEvents({ -contract, -events: [ - transferSingleEvent({ - _operator: ..., - _from: ..., - _to: ..., -}) -], +import { getOwnedNFTs } from "thirdweb/extensions/erc1155"; +const ownedTokenIds = await getOwnedTokenIds({ + contract, + start: 0, + count: 10, + address: "0x123...", }); ``` ```ts -function transferSingleEvent( - filters: Partial<{ _from: string; _operator: string; _to: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "_operator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_to"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "_value"; readonly type: "uint256" }, - ]; - readonly name: "TransferSingle"; - readonly type: "event"; -}>; +function getOwnedTokenIds( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - Optional filters to apply to the event. +The transaction options and parameters. #### Type ```ts -let filters: Partial<{ - _from: string; - _operator: string; - _to: string; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "_operator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "_to"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "_value"; readonly type: "uint256" }, - ]; - readonly name: "TransferSingle"; - readonly type: "event"; -}>; +let returnType: Promise>; ``` - The prepared event object. +A promise that resolves to an array of ERC1155 NFTs owned by the wallet address, along with the quantity owned. --- -## updateMetadata +## ERC1155.isApprovedForAll - Update the metadata of the single token in an Edition Drop (DropERC1155) collection For Edition contracts, use `setTokenURI` +Calls the "isApprovedForAll" function on the contract. ### Example ```ts -import { updateMetadata } from "thirdweb/extensions/erc1155"; -import { sendTransaction } from "thirdweb"; +import { isApprovedForAll } from "thirdweb/extensions/erc1155"; -const transaction = updateMetadata({ - contract, - targetTokenId: 0n, - client: thirdwebClient, - newMetadata: { - name: "this is the new nft name", - description: "...", - image: "new image uri", - // ... - }, +const result = await isApprovedForAll({ + contract, + owner: ..., + operator: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function updateMetadata( - options: BaseTransactionOptions, -): PreparedTransaction; +function isApprovedForAll( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters +The options for the isApprovedForAll function. + #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - the prepared transaction +The parsed result of the function call. --- -## updateTokenURI +## ERC1155.isBurnSupported - This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI) , which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput) , upload that content to IPFS and pass the IPFS URI (of said `NFTInput` ) to the underlying `setTokenURI` method. - - This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update. +Checks if the `burn` method is supported by the given contract. ### Example ```ts -import { updateTokenURI } from "thirdweb/extensions/erc1155"; +import { isBurnSupported } from "thirdweb/extensions/erc1155"; -const transaction = updateTokenURI({ - tokenId: 0n, - nft: { - name: "new name", - description: "new description", - image: "https://image-host.com/new-image.png", - }, -}); +const supported = isBurnSupported(["0x..."]); ``` ```ts -function updateTokenURI( - options: BaseTransactionOptions, -): PreparedTransaction; +function isBurnSupported(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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - the prepared transaction from `setTokenURI` +A boolean indicating if the `burn` method is supported. --- -## uri +## ERC1155.isClaimToSupported - Calls the "uri" function on the contract. +Checks if the `claimTo` method is supported by the given contract. ### Example ```ts -import { uri } from "thirdweb/extensions/erc1155"; +import { isClaimToSupported } from "thirdweb/extensions/erc1155"; -const result = await uri({ - contract, - tokenId: ..., -}); +const supported = isClaimToSupported(["0x..."]); ``` ```ts -function uri( - options: BaseTransactionOptions, -): Promise; +function isClaimToSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the uri function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. ---- -## ERC721 +A boolean indicating if the `claimTo` method is supported. --- -## isUpdateMetadataSupported +## ERC1155.isERC1155 - Checks if the `updateMetadata` method is supported by the given contract. +Check if a contract supports the ERC1155 interface. ### Example ```ts -import { isUpdateMetadataSupported } from "thirdweb/extensions/erc721"; - -const supported = isUpdateMetadataSupported(["0x..."]); +import { isERC1155 } from "thirdweb/extensions/erc1155"; +const result = await isERC1155({ contract }); ``` ```ts -function isUpdateMetadataSupported( - availableSelectors: Array, -): boolean; +function isERC1155(options: BaseTransactionOptions): Promise; ``` ### 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. +The transaction options. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `updateMetadata` method is supported. +A boolean indicating whether the contract supports the ERC1155 interface. --- -## isGetClaimConditionsSupported +## ERC1155.isGetActiveClaimConditionSupported - Checks if the `getClaimConditions` method is supported by the given contract. +Checks if the `getActiveClaimCondition` method is supported by the given contract. ### Example ```ts -import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc721"; +import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc1155"; -const supported = isGetClaimConditionsSupported(["0x..."]); +const supported = isGetActiveClaimConditionSupported(["0x..."]); ``` ```ts -function isGetClaimConditionsSupported( +function isGetActiveClaimConditionSupported( 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. +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 @@ -11542,1141 +13059,866 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getClaimConditions` method is supported. +A boolean indicating if the `getActiveClaimCondition` method is supported. --- -## approvalEvent +## ERC1155.isGetClaimConditionByIdSupported - Creates an event object for the Approval event. +Checks if the `getClaimConditionById` method is supported by the given contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { approvalEvent } from "thirdweb/extensions/erc721"; - -const events = await getContractEvents({ -contract, -events: [ - approvalEvent({ - owner: ..., - approved: ..., - tokenId: ..., -}) -], -}); +import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc1155"; +const supported = isGetClaimConditionByIdSupported(["0x..."]); ``` ```ts -function approvalEvent( - filters: Partial<{ - approved: string; - owner: string; - tokenId: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "approved"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenId"; - readonly type: "uint256"; - }, - ]; - readonly name: "Approval"; - readonly type: "event"; -}>; +function isGetClaimConditionByIdSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - Optional filters to apply to the event. +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 filters: Partial<{ - approved: string; - owner: string; - tokenId: bigint; -}>; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "approved"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenId"; - readonly type: "uint256"; - }, - ]; - readonly name: "Approval"; - readonly type: "event"; -}>; +let returnType: boolean; ``` - The prepared event object. +A boolean indicating if the `getClaimConditionById` method is supported. --- -## approvalForAllEvent +## ERC1155.isGetClaimConditionsSupported - Creates an event object for the ApprovalForAll event. +Checks if the `getClaimConditions` method is supported by the given contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { approvalForAllEvent } from "thirdweb/extensions/erc721"; +import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc1155"; -const events = await getContractEvents({ -contract, -events: [ - approvalForAllEvent({ - owner: ..., - operator: ..., -}) -], -}); +const supported = isGetClaimConditionsSupported(["0x..."]); ``` ```ts -function approvalForAllEvent( - filters: Partial<{ operator: string; owner: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "operator"; - readonly type: "address"; - }, - { readonly name: "approved"; readonly type: "bool" }, - ]; - readonly name: "ApprovalForAll"; - readonly type: "event"; -}>; +function isGetClaimConditionsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - Optional filters to apply to the event. +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 filters: Partial<{ operator: string; owner: string }>; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "operator"; - readonly type: "address"; - }, - { readonly name: "approved"; readonly type: "bool" }, - ]; - readonly name: "ApprovalForAll"; - readonly type: "event"; -}>; +let returnType: boolean; ``` - The prepared event object. +A boolean indicating if the `getClaimConditions` method is supported. --- -## approve +## ERC1155.isGetNFTsSupported - Prepares a transaction to call the "approve" function on the contract. +Checks if the `getNFTs` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { approve } from "thirdweb/extensions/erc721"; - -const transaction = approve({ - contract, - to: ..., - tokenId: ..., - overrides: { - ... - } -}); +import { isGetNFTsSupported } from "thirdweb/extensions/erc721"; -// Send the transaction -await sendTransaction({ transaction, account }); +const supported = isGetNFTsSupported(["0x..."]); ``` ```ts -function approve( - options: BaseTransactionOptions< - ApproveParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isGetNFTsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "approve" function. +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 options: BaseTransactionOptions< - ApproveParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `getNFTs` method is supported. --- -## balanceOf +## ERC1155.isGetNFTSupported - Calls the "balanceOf" function on the contract. +Checks if the `uri` method is supported by the given contract. ### Example ```ts -import { balanceOf } from "thirdweb/extensions/erc721"; - -const result = await balanceOf({ - contract, - owner: ..., -}); +import { isUriSupported } from "thirdweb/extensions/erc1155"; +const supported = isUriSupported(["0x..."]); ``` ```ts -function balanceOf( - options: BaseTransactionOptions, -): Promise; +function isGetNFTSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the balanceOf function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `uri` method is supported. --- -## burn +## ERC1155.isLazyMintSupported - Prepares a transaction to call the "burn" function on the contract. +Checks if the `lazyMint` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { burn } from "thirdweb/extensions/erc721"; - -const transaction = burn({ - contract, - tokenId: ..., - overrides: { - ... - } -}); +import { isLazyMintSupported } from "thirdweb/extensions/erc1155"; -// Send the transaction -await sendTransaction({ transaction, account }); +const supported = isLazyMintSupported(["0x..."]); ``` ```ts -function burn( - options: BaseTransactionOptions< - BurnParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isLazyMintSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "burn" function. +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 options: BaseTransactionOptions< - BurnParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `lazyMint` method is supported. --- -## claimConditionsUpdatedEvent +## ERC1155.isMintAdditionalSupplyToSupported - Creates an event object for the ClaimConditionsUpdated event. +Checks if the `mintAdditionalSupplyTo` method is supported by the given contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { claimConditionsUpdatedEvent } from "thirdweb/extensions/erc721"; +import { isMintAdditionalSupplyToSupported } from "thirdweb/extensions/erc1155"; -const events = await getContractEvents({ - contract, - events: [claimConditionsUpdatedEvent()], -}); +const supported = isMintAdditionalSupplyToSupported(["0x..."]); ``` ```ts -function claimConditionsUpdatedEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly components: readonly [ - { readonly name: "startTimestamp"; readonly type: "uint256" }, - { - readonly name: "maxClaimableSupply"; - readonly type: "uint256"; - }, - { readonly name: "supplyClaimed"; readonly type: "uint256" }, - { - readonly name: "quantityLimitPerWallet"; - readonly type: "uint256"; - }, - { readonly name: "merkleRoot"; readonly type: "bytes32" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "metadata"; readonly type: "string" }, - ]; - readonly name: "claimConditions"; - readonly type: "tuple[]"; - }, - { readonly name: "resetEligibility"; readonly type: "bool" }, - ]; - readonly name: "ClaimConditionsUpdated"; - readonly type: "event"; -}>; +function isMintAdditionalSupplyToSupported( + 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: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly components: readonly [ - { readonly name: "startTimestamp"; readonly type: "uint256" }, - { - readonly name: "maxClaimableSupply"; - readonly type: "uint256"; - }, - { readonly name: "supplyClaimed"; readonly type: "uint256" }, - { - readonly name: "quantityLimitPerWallet"; - readonly type: "uint256"; - }, - { readonly name: "merkleRoot"; readonly type: "bytes32" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "metadata"; readonly type: "string" }, - ]; - readonly name: "claimConditions"; - readonly type: "tuple[]"; - }, - { readonly name: "resetEligibility"; readonly type: "bool" }, - ]; - readonly name: "ClaimConditionsUpdated"; - readonly type: "event"; -}>; +let returnType: boolean; ``` - The prepared event object. +A boolean indicating if the `mintAdditionalSupplyTo` method is supported. --- -## claimTo +## ERC1155.isMintToSupported - Claim ERC721 NFTs to a specified address +Checks if the `mintTo` method is supported by the given contract. ### Example -#### Basic usage - ```ts -import { claimTo } from "thirdweb/extensions/erc721"; -import { sendTransaction } from "thirdweb"; - -const transaction = claimTo({ - contract, - to: "0x...", - quantity: 1n, -}); +import { isMintToSupported } from "thirdweb/extensions/erc1155"; -await sendTransaction({ transaction, account }); -``` - -#### For Drops with allowlists - - You need to specify the claimer address as the `from` param to avoid any issue with the allowlist - -```ts -const transaction = claimTo({ - contract, - to: "0x...", - quantity: 1n, - from: "0x...", // address of the one claiming -}); +const supported = isMintToSupported(["0x..."]); ``` ```ts -function claimTo( - options: BaseTransactionOptions, -): PreparedTransaction; +function isMintToSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the transaction +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A promise that resolves with the submitted transaction hash. +A boolean indicating if the `mintTo` method is supported. --- -## claimToBatch +## ERC1155.isNextTokenIdToMintSupported - This extension batches multiple `claimTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can claim per transaction. This limit varies depends on the network that you are transacting on. - - You are recommended to experiment with the number to figure out the best number for your chain of choice. +Checks if the `nextTokenIdToMint` method is supported by the given contract. ### Example ```ts -import { claimToBatch } from "thirdweb/extensions/erc721"; - -const transaction = claimToBatch({ - contract: nftDropContract, - from: claimer.address, // address of the one calling this transaction - content: [ - { to: "0x...1", quantity: 1n }, - { to: "0x...2", quantity: 12n }, - { to: "0x...3", quantity: 2n }, - ], -}); +import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc1155"; +const supported = isNextTokenIdToMintSupported(["0x..."]); ``` ```ts -function claimToBatch( - options: BaseTransactionOptions, -): PreparedTransaction; +function isNextTokenIdToMintSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - the transaction options +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A promise that resolves to the transaction result. +A boolean indicating if the `nextTokenIdToMint` method is supported. --- -## createDelayedRevealBatch +## ERC1155.isResetClaimEligibilitySupported - Creates a batch of encrypted NFTs that can be revealed at a later time. +Checks if the `resetClaimEligibility` method is supported by the given contract. ### Example ```ts -import { createDelayedRevealBatch } from "thirdweb/extensions/erc721"; - -const placeholderNFT = { - name: "Hidden NFT", - description: "Will be revealed next week!" -}; - -const realNFTs = [{ - name: "Common NFT #1", - description: "Common NFT, one of many.", - image: ipfs://..., -}, { - name: "Super Rare NFT #2", - description: "You got a Super Rare NFT!", - image: ipfs://..., -}]; - -const transaction = createDelayedRevealBatch({ - contract, - placeholderMetadata: placeholderNFT, - metadata: realNFTs, - password: "password123", -}); +import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc1155"; -const { transactionHash } = await sendTransaction({ transaction, account }); +const supported = isResetClaimEligibilitySupported(["0x..."]); ``` ```ts -function createDelayedRevealBatch( - options: BaseTransactionOptions, -): PreparedTransaction; +function isResetClaimEligibilitySupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - {CreateDelayedRevealBatchParams} - The delayed reveal options. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - The prepared transaction to send. +A boolean indicating if the `resetClaimEligibility` method is supported. --- -## generateMintSignature +## ERC1155.isSetClaimConditionsSupported - Generates the payload and signature for minting an ERC721 token. +Checks if the `setClaimConditions` method is supported by the given contract. ### Example ```ts -import { - mintWithSignature, - generateMintSignature, -} from "thirdweb/extensions/erc721"; - -const { payload, signature } = await generateMintSignature({ - account, - contract, - mintRequest: { - to: "0x...", - metadata: { - name: "My NFT", - description: "This is my NFT", - image: "https://example.com/image.png", - }, - }, -}); +import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc1155"; -const transaction = mintWithSignature({ - contract, - payload, - signature, -}); -await sendTransaction({ transaction, account }); +const supported = isSetClaimConditionsSupported(["0x..."]); ``` ```ts -function generateMintSignature( - options: GenerateMintSignatureOptions, -): Promise>; +function isSetClaimConditionsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the minting process. +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 options: GenerateMintSignatureOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: boolean; ``` - A promise that resolves to the payload and signature. +A boolean indicating if the `setClaimConditions` method is supported. --- -## getActiveClaimCondition +## ERC1155.isTotalSupplySupported - Retrieves the active claim condition. +Checks if the `totalSupply` method is supported by the given contract. ### Example ```ts -import { getActiveClaimCondition } from "thirdweb/extensions/erc721"; -const activeClaimCondition = await getActiveClaimCondition({ - contract, -}); +import { isTotalSupplySupported } from "thirdweb/extensions/erc1155"; +const supported = isTotalSupplySupported(["0x..."]); ``` ```ts -function getActiveClaimCondition( - options: BaseTransactionOptions, -): Promise; +function isTotalSupplySupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the active claim condition. +A boolean indicating if the `totalSupply` method is supported. --- -## getActiveClaimConditionId +## ERC1155.isUpdateTokenURISupported - Calls the "getActiveClaimConditionId" function on the contract. +Checks if the `setTokenURI` method is supported by the given contract. ### Example ```ts -import { getActiveClaimConditionId } from "thirdweb/extensions/erc721"; +import { isSetTokenURISupported } from "thirdweb/extensions/erc1155"; -const result = await getActiveClaimConditionId({ - contract, -}); +const supported = isSetTokenURISupported(["0x..."]); ``` ```ts -function getActiveClaimConditionId( - options: BaseTransactionOptions, -): Promise; +function isUpdateTokenURISupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the getActiveClaimConditionId function. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `setTokenURI` method is supported. --- -## getAllOwners +## ERC1155.lazyMint - Retrieves the owners of all ERC721 tokens within a specified range. +Lazily mints ERC1155 tokens. This method is only available on the `DropERC1155` contract. ### Example ```ts -import { getAllOwners } from "thirdweb/extensions/erc721"; -const owners = await getAllOwners({ +import { lazyMint } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; + +const transaction = lazyMint({ contract, - start: 0, - count: 10, + nfts: [ + { + name: "My NFT", + description: "This is my NFT", + image: "https://example.com/image.png", + }, + ], }); + +await sendTransaction({ transaction, account }); ``` ```ts -function getAllOwners( - options: BaseTransactionOptions, -): Promise>; +function lazyMint( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for retrieving the owners. +The options for the lazy minting process. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to an array of objects containing the token ID and owner address. +A promise that resolves to the prepared contract call. --- -## getBatchesToReveal +## ERC1155.metadataFrozenEvent - Retrieves the batches available to reveal in an NFT contract. +Creates an event object for the MetadataFrozen event. ### Example ```ts -import { getBatchesToReveal } from "thirdweb/extensions/erc721"; - -const batches = await getBatchesToReveal({ contract: contract }); +import { getContractEvents } from "thirdweb"; +import { metadataFrozenEvent } from "thirdweb/extensions/erc1155"; -const { transactionHash } = await sendTransaction({ - transaction, - account, +const events = await getContractEvents({ + contract, + events: [metadataFrozenEvent()], }); ``` ```ts -function getBatchesToReveal( - options: BaseTransactionOptions, -): Promise>; -``` - -### Parameters - - {BaseTransactionOptions} - The transaction options. - -#### Type - -```ts -let options: { contract: ThirdwebContract } & T; +function metadataFrozenEvent(): PreparedEvent<{ + readonly inputs: readonly []; + readonly name: "MetadataFrozen"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: { - batchId: bigint; - batchUri: string; - placeholderMetadata: undefined | NFTMetadata; -}; +let returnType: PreparedEvent<{ + readonly inputs: readonly []; + readonly name: "MetadataFrozen"; + readonly type: "event"; +}>; ``` - A promise resolving to an array of unrevealed batches. - - Use the `batchId` and corresponding password for each batch to reveal it with `reveal` . reveal +The prepared event object. --- -## getClaimConditionById +## ERC1155.metadataUpdateEvent - Calls the "getClaimConditionById" function on the contract. +Creates an event object for the MetadataUpdate event. ### Example ```ts -import { getClaimConditionById } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { metadataUpdateEvent } from "thirdweb/extensions/erc1155"; -const result = await getClaimConditionById({ - contract, - conditionId: ..., +const events = await getContractEvents({ + contract, + events: [metadataUpdateEvent()], }); ``` ```ts -function getClaimConditionById( - options: BaseTransactionOptions, -): Promise<{ - currency: string; - maxClaimableSupply: bigint; - merkleRoot: `0x${string}`; - metadata: string; - pricePerToken: bigint; - quantityLimitPerWallet: bigint; - startTimestamp: bigint; - supplyClaimed: bigint; +function metadataUpdateEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "_tokenId"; readonly type: "uint256" }, + ]; + readonly name: "MetadataUpdate"; + readonly type: "event"; }>; ``` -### Parameters - - The options for the getClaimConditionById function. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - ### Returns ```ts -let returnType: Promise<{ - currency: string; - maxClaimableSupply: bigint; - merkleRoot: `0x${string}`; - metadata: string; - pricePerToken: bigint; - quantityLimitPerWallet: bigint; - startTimestamp: bigint; - supplyClaimed: bigint; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "_tokenId"; readonly type: "uint256" }, + ]; + readonly name: "MetadataUpdate"; + readonly type: "event"; }>; ``` - The parsed result of the function call. +The prepared event object. --- -## getClaimConditions +## ERC1155.mintAdditionalSupplyTo - Retrieves all claim conditions. +Mints a "supply" number of additional ERC1155 tokens to the specified "to" address. This method is only available on the `TokenERC1155` contract. ### Example ```ts -import { getClaimConditions } from "thirdweb/extensions/erc721"; -const conditions = await getClaimConditions({ contract }); +import { mintAdditionalSupplyTo } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; + +const transaction = mintAdditionalSupplyTo({ + contract, + to: "0x...", + tokenId: 1n, + supply: 10n, +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function getClaimConditions( - options: BaseTransactionOptions, -): Promise>; +function mintAdditionalSupplyTo( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The transaction options. +The transaction options. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to all claim conditions. +A promise that resolves to the transaction result. --- -## getNFT +## ERC1155.mintAdditionalSupplyToBatch + +This extension batches multiple `mintAdditionalSupplyToBatch` extensions into one single multicall. This method is only available on the `TokenERC1155` contract. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. - Retrieves information about a specific ERC721 non-fungible token (NFT). +You are recommended to experiment with the number to figure out the best number for your chain of choice. ### Example ```ts -import { getNFT } from "thirdweb/extensions/erc721"; -const nft = await getNFT({ +import { mintAdditionalSupplyToBatch } from "thirdweb/extensions/erc1155"; + +const transaction = mintAdditionalSupplyToBatch({ contract, - tokenId: 1n, + nfts: [ + { tokenId: 0n, supply: 99n, to: account.address }, + { tokenId: 1n, supply: 98n, to: account.address }, + { tokenId: 2n, supply: 97n, to: account.address }, + ], }); ``` ```ts -function getNFT( - options: BaseTransactionOptions<{ - includeOwner?: boolean; - tokenId: bigint; - }>, -): Promise; +function mintAdditionalSupplyToBatch( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for retrieving the NFT. - #### Type ```ts -let options: BaseTransactionOptions<{ - includeOwner?: boolean; - tokenId: bigint; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - tokenURI: string; - type: "ERC721"; - } - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - supply: bigint; - tokenURI: string; - type: "ERC1155"; - }; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - - A promise that resolves to the NFT object. --- -## getNFTs +## ERC1155.mintTo - Retrieves an array of NFTs ("ERC721") based on the provided options. +Mints a "supply" number of new ERC1155 tokens to the specified "to" address. This method is only available on the `TokenERC1155` contract. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. ### Example ```ts -import { getNFTs } from "thirdweb/extensions/erc721"; -const nfts = await getNFTs({ +import { mintTo } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; + +const transaction = mintTo({ contract, - start: 0, - count: 10, + to: "0x...", + supply: 10n, + nft: { + name: "My NFT", + description: "This is my NFT", + image: "https://example.com/image.png", + }, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function getNFTs( - options: BaseTransactionOptions, -): Promise>; +function mintTo( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for retrieving the NFTs. +The transaction options. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - tokenURI: string; - type: "ERC721"; - } - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - supply: bigint; - tokenURI: string; - type: "ERC1155"; - }; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to an array of NFTs. +A promise that resolves to the transaction result. --- -## getOwnedNFTs +## ERC1155.mintToBatch + +This extension batches multiple `mintTo` extensions into one single multicall. This method is only available on the `TokenERC1155` contract. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. - Retrieves the owned NFTs for a given owner. This extension only works with ERC721 contracts that support the [tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method +You are recommended to experiment with the number to figure out the best number for your chain of choice. ### Example ```ts -import { getOwnedNFTs } from "thirdweb/extensions/erc721"; +import { mintBatchTo } from "thirdweb/extension/erc1155"; -const ownedNFTs = await getOwnedNFTs({ - contract, - owner: "0x1234...", +const transaction = mintToBatch({ + contract: editionContract, + to: "0x...", + nfts: [ + { + metadata: { + name: "Token #0", + image: "...", + attributes: [], + }, + supply: 100n, + }, + { + metadata: { + name: "Token #1", + image: "...", + attributes: [], + }, + supply: 111n, + }, + ], }); + +await sendTransaction({ transaction, account }); ``` ```ts -function getOwnedNFTs( - options: BaseTransactionOptions, -): Promise>; +function mintToBatch( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for retrieving the owned NFTs. +the transaction options #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - tokenURI: string; - type: "ERC721"; - } - | { - id: bigint; - metadata: NFTMetadata; - owner: string | null; - supply: bigint; - tokenURI: string; - type: "ERC1155"; - }; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to an array of NFTs owned by the specified owner. +A promise that resolves to the transaction result. --- -## getOwnedTokenIds +## ERC1155.mintWithSignature - Retrieves the token IDs owned by a specific address. +Mints a new ERC1155 token with the given minter signature This method is only available on the `TokenERC1155` contract. ### Example ```ts -import { getOwnedTokenIds } from "thirdweb/extensions/erc721"; +import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; -const ownedTokenIds = await getOwnedTokenIds({ +const { payload, signature } = await generateMintSignature(...) + +const transaction = mintWithSignature({ contract, - owner: "0x1234...", + payload, + signature, }); +await sendTransaction({ transaction, account }); ``` ```ts -function getOwnedTokenIds( - options: BaseTransactionOptions, -): Promise>; +function mintWithSignature( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for retrieving the owned token IDs. +The transaction options. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to an array of bigint representing the owned token IDs. +A promise that resolves to the transaction result. --- -## getTotalClaimedSupply +## ERC1155.nextTokenId - Retrieves the total claimed supply of ERC721 tokens. +Calls the "nextTokenId" function on the contract. ### Example ```ts -import { getTotalClaimedSupply } from "thirdweb/extensions/erc721"; +import { nextTokenId } from "thirdweb/extensions/erc1155"; -const totalClaimedSupply = await getTotalClaimedSupply({ +const result = await nextTokenId({ contract, }); ``` ```ts -function getTotalClaimedSupply( +function nextTokenId( options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The base transaction options. +The options for the nextTokenId function. #### Type @@ -12690,32 +13932,32 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - A promise that resolves to the total claimed supply as a bigint. +The parsed result of the function call. --- -## getTotalUnclaimedSupply +## ERC1155.nextTokenIdToMint - Retrieves the total unclaimed supply of ERC721 tokens. +Calls the "nextTokenIdToMint" function on the contract. ### Example ```ts -import { getTotalUnclaimedSupply } from "thirdweb/extensions/erc721"; +import { nextTokenIdToMint } from "thirdweb/extensions/erc1155"; -const totalUnclaimedSupply = await getTotalUnclaimedSupply({ +const result = await nextTokenIdToMint({ contract, }); ``` ```ts -function getTotalUnclaimedSupply( +function nextTokenIdToMint( options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The base transaction options. +The options for the nextTokenIdToMint function. #### Type @@ -12729,726 +13971,1335 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - A promise that resolves to the total unclaimed supply as a bigint. +The parsed result of the function call. --- -## isApprovedForAll +## ERC1155.openPack - Calls the "isApprovedForAll" function on the contract. +Prepares a transaction to call the "openPack" function on the contract. ### Example ```ts -import { isApprovedForAll } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; +import { openPack } from "thirdweb/extensions/erc1155"; -const result = await isApprovedForAll({ +const transaction = openPack({ contract, - owner: ..., - operator: ..., + packId: ..., + amountToOpen: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isApprovedForAll( - options: BaseTransactionOptions, -): Promise; +function openPack( + options: BaseTransactionOptions< + OpenPackParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the isApprovedForAll function. +The options for the "openPack" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + OpenPackParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## isBurnSupported +## ERC1155.packCreatedEvent - Checks if the `burn` method is supported by the given contract. +Creates an event object for the PackCreated event. ### Example ```ts -import { isBurnSupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { packCreatedEvent } from "thirdweb/extensions/erc1155"; -const supported = isBurnSupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + packCreatedEvent({ + packId: ..., +}) +], +}); ``` ```ts -function isBurnSupported(availableSelectors: Array): boolean; +function packCreatedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "packId"; + readonly type: "uint256"; + }, + { readonly name: "recipient"; readonly type: "address" }, + { readonly name: "totalPacksCreated"; readonly type: "uint256" }, + ]; + readonly name: "PackCreated"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "packId"; + readonly type: "uint256"; + }, + { readonly name: "recipient"; readonly type: "address" }, + { readonly name: "totalPacksCreated"; readonly type: "uint256" }, + ]; + readonly name: "PackCreated"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `burn` method is supported. +The prepared event object. --- -## isClaimToSupported +## ERC1155.packOpenedEvent - Checks if the `claimTo` method is supported by the given contract. +Creates an event object for the PackOpened event. ### Example ```ts -import { isClaimToSupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { packOpenedEvent } from "thirdweb/extensions/erc1155"; -const supported = isClaimToSupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + packOpenedEvent({ + packId: ..., + opener: ..., +}) +], +}); ``` ```ts -function isClaimToSupported( - availableSelectors: Array, -): boolean; +function packOpenedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "packId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "opener"; + readonly type: "address"; + }, + { readonly name: "numOfPacksOpened"; readonly type: "uint256" }, + { + readonly components: readonly [ + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "totalAmount"; readonly type: "uint256" }, + ]; + readonly name: "rewardUnitsDistributed"; + readonly type: "tuple[]"; + }, + ]; + readonly name: "PackOpened"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "packId"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "opener"; + readonly type: "address"; + }, + { readonly name: "numOfPacksOpened"; readonly type: "uint256" }, + { + readonly components: readonly [ + { readonly name: "assetContract"; readonly type: "address" }, + { readonly name: "tokenType"; readonly type: "uint8" }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "totalAmount"; readonly type: "uint256" }, + ]; + readonly name: "rewardUnitsDistributed"; + readonly type: "tuple[]"; + }, + ]; + readonly name: "PackOpened"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `claimTo` method is supported. +The prepared event object. --- -## isCreateDelayedRevealBatchSupported +## ERC1155.packUpdatedEvent - Checks if the `createDelayedRevealBatch` method is supported by the given contract. +Creates an event object for the PackUpdated event. ### Example ```ts -import { isCreateDelayedRevealBatchSupported } from "thirdweb/extensions/erc721"; -const supported = isCreateDelayedRevealBatchSupported(["0x..."]); +import { getContractEvents } from "thirdweb"; +import { packUpdatedEvent } from "thirdweb/extensions/erc1155"; + +const events = await getContractEvents({ +contract, +events: [ + packUpdatedEvent({ + packId: ..., +}) +], +}); ``` ```ts -function isCreateDelayedRevealBatchSupported( - availableSelectors: Array, -): boolean; +function packUpdatedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "packId"; + readonly type: "uint256"; + }, + { readonly name: "recipient"; readonly type: "address" }, + { readonly name: "totalPacksCreated"; readonly type: "uint256" }, + ]; + readonly name: "PackUpdated"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "packId"; + readonly type: "uint256"; + }, + { readonly name: "recipient"; readonly type: "address" }, + { readonly name: "totalPacksCreated"; readonly type: "uint256" }, + ]; + readonly name: "PackUpdated"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `createDelayedRevealBatch` method is supported. +The prepared event object. --- -## isERC721 +## ERC1155.resetClaimEligibility - Check if a contract supports the ERC721 interface. +Reset the claim eligibility for all users. This method is only available on the `DropERC1155` contract. ### Example ```ts -import { isERC721 } from "thirdweb/extensions/erc721"; -const result = await isERC721({ contract }); +import { resetClaimEligibility } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; + +const transaction = resetClaimEligibility({ + contract, +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function isERC721(options: BaseTransactionOptions): Promise; +function resetClaimEligibility( + options: { + contract: Readonly>; + } & GetClaimConditionsParams & { singlePhaseDrop?: boolean }, +): PreparedTransaction; ``` ### Parameters - The transaction options. - #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + contract: Readonly>; +} & GetClaimConditionsParams & { singlePhaseDrop?: boolean }; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating whether the contract supports the ERC721 interface. +the prepared transaction --- -## isGetActiveClaimConditionIdSupported +## ERC1155.safeBatchTransferFrom - Checks if the `getActiveClaimConditionId` method is supported by the given contract. +Prepares a transaction to call the "safeBatchTransferFrom" function on the contract. ### Example ```ts -import { isGetActiveClaimConditionIdSupported } from "thirdweb/extensions/erc721"; -const supported = isGetActiveClaimConditionIdSupported(["0x..."]); +import { sendTransaction } from "thirdweb"; +import { safeBatchTransferFrom } from "thirdweb/extensions/erc1155"; + +const transaction = safeBatchTransferFrom({ + contract, + from: ..., + to: ..., + tokenIds: ..., + values: ..., + data: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isGetActiveClaimConditionIdSupported( - availableSelectors: Array, -): boolean; +function safeBatchTransferFrom( + options: BaseTransactionOptions< + | SafeBatchTransferFromParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "safeBatchTransferFrom" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SafeBatchTransferFromParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getActiveClaimConditionId` method is supported. +A prepared transaction object. --- -## isGetActiveClaimConditionSupported +## ERC1155.safeTransferFrom - Checks if the `getActiveClaimCondition` method is supported by the given contract. +Prepares a transaction to call the "safeTransferFrom" function on the contract. ### Example ```ts -import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; +import { safeTransferFrom } from "thirdweb/extensions/erc1155"; -const supported = isGetActiveClaimConditionSupported(["0x..."]); +const transaction = safeTransferFrom({ + contract, + from: ..., + to: ..., + tokenId: ..., + value: ..., + data: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isGetActiveClaimConditionSupported( - availableSelectors: Array, -): boolean; +function safeTransferFrom( + options: BaseTransactionOptions< + | SafeTransferFromParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "safeTransferFrom" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SafeTransferFromParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getActiveClaimCondition` method is supported. +A prepared transaction object. --- -## isGetBatchesToRevealSupported +## ERC1155.setApprovalForAll - Checks if the `getBatchesToReveal` method is supported by the given contract. +Prepares a transaction to call the "setApprovalForAll" function on the contract. ### Example ```ts -import { isGetBatchesToRevealSupported } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; +import { setApprovalForAll } from "thirdweb/extensions/erc1155"; -const supported = isGetBatchesToRevealSupported(["0x..."]); +const transaction = setApprovalForAll({ + contract, + operator: ..., + approved: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isGetBatchesToRevealSupported( - availableSelectors: Array, -): boolean; +function setApprovalForAll( + options: BaseTransactionOptions< + | SetApprovalForAllParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setApprovalForAll" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetApprovalForAllParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getBatchesToReveal` method is supported. +A prepared transaction object. --- -## isGetClaimConditionByIdSupported +## ERC1155.setClaimConditions - Checks if the `getClaimConditionById` method is supported by the given contract. +Set the claim conditions for a ERC1155 drop This method is only available on the `DropERC1155` contract. ### Example ```ts -import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc721"; -const supported = isGetClaimConditionByIdSupported(["0x..."]); +import { setClaimConditions } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; + +const transaction = setClaimConditions({ + contract, + tokenId: 0n, + phases: [ + { + maxClaimableSupply: 100n, + maxClaimablePerWallet: 1n, + currencyAddress: "0x...", + price: 0.1, + startTime: new Date(), + }, + ], +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function isGetClaimConditionByIdSupported( - availableSelectors: Array, -): boolean; +function setClaimConditions( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getClaimConditionById` method is supported. +the prepared transaction --- -## isGetClaimConditionsSupported +## ERC1155.setTokenURI - Checks if the `getClaimConditions` method is supported by the given contract. +Prepares a transaction to call the "setTokenURI" function on the contract. ### Example ```ts -import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; +import { setTokenURI } from "thirdweb/extensions/erc1155"; -const supported = isGetClaimConditionsSupported(["0x..."]); +const transaction = setTokenURI({ + contract, + tokenId: ..., + uri: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isGetClaimConditionsSupported( - availableSelectors: Array, -): boolean; +function setTokenURI( + options: BaseTransactionOptions< + | SetTokenURIParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setTokenURI" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetTokenURIParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getClaimConditions` method is supported. +A prepared transaction object. --- -## isGetNFTsSupported +## ERC1155.tokensClaimedEvent - Checks if the `getNFTs` method is supported by the given contract. +Creates an event object for the TokensClaimed event. ### Example ```ts -import { isGetNFTsSupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { tokensClaimedEvent } from "thirdweb/extensions/erc1155"; -const supported = isGetNFTsSupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + tokensClaimedEvent({ + claimConditionIndex: ..., + claimer: ..., + receiver: ..., +}) +], +}); ``` ```ts -function isGetNFTsSupported( - availableSelectors: Array, -): boolean; +function tokensClaimedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "claimConditionIndex"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "claimer"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "receiver"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantityClaimed"; readonly type: "uint256" }, + ]; + readonly name: "TokensClaimed"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "claimConditionIndex"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "claimer"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "receiver"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "quantityClaimed"; readonly type: "uint256" }, + ]; + readonly name: "TokensClaimed"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `getNFTs` method is supported. +The prepared event object. --- -## isGetNFTSupported +## ERC1155.tokensLazyMintedEvent - Checks if the `tokenURI` method is supported by the given contract. +Creates an event object for the TokensLazyMinted event. ### Example ```ts -import { isTokenURISupported } from "thirdweb/extensions/erc721"; -const supported = isTokenURISupported(["0x..."]); +import { getContractEvents } from "thirdweb"; +import { tokensLazyMintedEvent } from "thirdweb/extensions/erc1155"; + +const events = await getContractEvents({ +contract, +events: [ + tokensLazyMintedEvent({ + startTokenId: ..., +}) +], +}); ``` ```ts -function isGetNFTSupported( - availableSelectors: Array, -): boolean; +function tokensLazyMintedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "startTokenId"; + readonly type: "uint256"; + }, + { readonly name: "endTokenId"; readonly type: "uint256" }, + { readonly name: "baseURI"; readonly type: "string" }, + { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, + ]; + readonly name: "TokensLazyMinted"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "startTokenId"; + readonly type: "uint256"; + }, + { readonly name: "endTokenId"; readonly type: "uint256" }, + { readonly name: "baseURI"; readonly type: "string" }, + { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, + ]; + readonly name: "TokensLazyMinted"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `tokenURI` method is supported. +The prepared event object. --- -## isLazyMintSupported +## ERC1155.tokensMintedWithSignatureEvent - Checks if the `lazyMint` method is supported by the given contract. +Creates an event object for the TokensMintedWithSignature event. ### Example ```ts -import { isLazyMintSupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc1155"; -const supported = isLazyMintSupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + tokensMintedWithSignatureEvent({ + signer: ..., + mintedTo: ..., + tokenIdMinted: ..., +}) +], +}); ``` ```ts -function isLazyMintSupported( - availableSelectors: Array, -): boolean; +function tokensMintedWithSignatureEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "signer"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "mintedTo"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "tokenIdMinted"; + readonly type: "uint256"; + }, + { + readonly components: readonly [ + { readonly name: "to"; readonly type: "address" }, + { + readonly name: "royaltyRecipient"; + readonly type: "address"; + }, + { readonly name: "royaltyBps"; readonly type: "uint256" }, + { + readonly name: "primarySaleRecipient"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "uri"; readonly type: "string" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { + readonly name: "validityStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "validityEndTimestamp"; + readonly type: "uint128"; + }, + { readonly name: "uid"; readonly type: "bytes32" }, + ]; + readonly name: "mintRequest"; + readonly type: "tuple"; + }, + ]; + readonly name: "TokensMintedWithSignature"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "signer"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "mintedTo"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "tokenIdMinted"; + readonly type: "uint256"; + }, + { + readonly components: readonly [ + { readonly name: "to"; readonly type: "address" }, + { + readonly name: "royaltyRecipient"; + readonly type: "address"; + }, + { readonly name: "royaltyBps"; readonly type: "uint256" }, + { + readonly name: "primarySaleRecipient"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "uri"; readonly type: "string" }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { + readonly name: "validityStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "validityEndTimestamp"; + readonly type: "uint128"; + }, + { readonly name: "uid"; readonly type: "bytes32" }, + ]; + readonly name: "mintRequest"; + readonly type: "tuple"; + }, + ]; + readonly name: "TokensMintedWithSignature"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `lazyMint` method is supported. +The prepared event object. --- -## isMintToSupported +## ERC1155.totalSupply - Checks if the `mintTo` method is supported by the given contract. +Calls the "totalSupply" function on the contract. ### Example ```ts -import { isMintToSupported } from "thirdweb/extensions/erc721"; +import { totalSupply } from "thirdweb/extensions/erc1155"; -const supported = isMintToSupported(["0x..."]); +const result = await totalSupply({ + contract, + id: ..., +}); ``` ```ts -function isMintToSupported( - availableSelectors: Array, -): boolean; +function totalSupply( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the totalSupply function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `mintTo` method is supported. +The parsed result of the function call. --- -## isNextTokenIdToMintSupported +## ERC1155.transferBatchEvent - Checks if the `nextTokenIdToMint` method is supported by the given contract. +Creates an event object for the TransferBatch event. ### Example ```ts -import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc721"; -const supported = isNextTokenIdToMintSupported(["0x..."]); +import { getContractEvents } from "thirdweb"; +import { transferBatchEvent } from "thirdweb/extensions/erc1155"; + +const events = await getContractEvents({ +contract, +events: [ + transferBatchEvent({ + _operator: ..., + _from: ..., + _to: ..., +}) +], +}); ``` ```ts -function isNextTokenIdToMintSupported( - availableSelectors: Array, -): boolean; +function transferBatchEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "_operator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_to"; + readonly type: "address"; + }, + { readonly name: "tokenIds"; readonly type: "uint256[]" }, + { readonly name: "_values"; readonly type: "uint256[]" }, + ]; + readonly name: "TransferBatch"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "_operator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_to"; + readonly type: "address"; + }, + { readonly name: "tokenIds"; readonly type: "uint256[]" }, + { readonly name: "_values"; readonly type: "uint256[]" }, + ]; + readonly name: "TransferBatch"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `nextTokenIdToMint` method is supported. +The prepared event object. --- -## isResetClaimEligibilitySupported +## ERC1155.transferSingleEvent - Checks if the `resetClaimEligibility` method is supported by the given contract. +Creates an event object for the TransferSingle event. ### Example ```ts -import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { transferSingleEvent } from "thirdweb/extensions/erc1155"; -const supported = isResetClaimEligibilitySupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + transferSingleEvent({ + _operator: ..., + _from: ..., + _to: ..., +}) +], +}); ``` ```ts -function isResetClaimEligibilitySupported( - availableSelectors: Array, -): boolean; +function transferSingleEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "_operator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_to"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "_value"; readonly type: "uint256" }, + ]; + readonly name: "TransferSingle"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "_operator"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "_to"; + readonly type: "address"; + }, + { readonly name: "tokenId"; readonly type: "uint256" }, + { readonly name: "_value"; readonly type: "uint256" }, + ]; + readonly name: "TransferSingle"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `resetClaimEligibility` method is supported. +The prepared event object. --- -## isRevealSupported +## ERC1155.updateMetadata - Checks if the `reveal` method is supported by the given contract. +Update the metadata of the single token in an Edition Drop (DropERC1155) collection For Edition contracts, use `setTokenURI` ### Example ```ts -import { isRevealSupported } from "thirdweb/extensions/erc721"; +import { updateMetadata } from "thirdweb/extensions/erc1155"; +import { sendTransaction } from "thirdweb"; -const supported = isRevealSupported(["0x..."]); +const transaction = updateMetadata({ + contract, + targetTokenId: 0n, + client: thirdwebClient, + newMetadata: { + name: "this is the new nft name", + description: "...", + image: "new image uri", + // ... + }, +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function isRevealSupported( - availableSelectors: Array, -): boolean; +function updateMetadata( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `reveal` method is supported. +the prepared transaction --- -## isSetClaimConditionsSupported +## ERC1155.updateTokenURI + +This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI), which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput), upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method. This method is only available on the `TokenERC1155` contract. - Checks if the `setClaimConditions` method is supported by the given contract. +This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update. ### Example ```ts -import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc721"; +import { updateTokenURI } from "thirdweb/extensions/erc1155"; -const supported = isSetClaimConditionsSupported(["0x..."]); +const transaction = updateTokenURI({ + tokenId: 0n, + nft: { + name: "new name", + description: "new description", + image: "https://image-host.com/new-image.png", + }, +}); ``` ```ts -function isSetClaimConditionsSupported( - availableSelectors: Array, -): boolean; +function updateTokenURI( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `setClaimConditions` method is supported. +the prepared transaction from `setTokenURI` --- -## isSetSharedMetadataSupported +## ERC1155.uri - Checks if the `setSharedMetadata` method is supported by the given contract. +Calls the "uri" function on the contract. ### Example ```ts -import { isSetSharedMetadataSupported } from "thirdweb/extensions/erc721"; +import { uri } from "thirdweb/extensions/erc1155"; -const supported = isSetSharedMetadataSupported(["0x..."]); +const result = await uri({ + contract, + tokenId: ..., +}); ``` ```ts -function isSetSharedMetadataSupported( - availableSelectors: Array, -): boolean; +function uri( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the uri function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `setSharedMetadata` method is supported. +The parsed result of the function call. +--- +## ERC721 --- -## isSharedMetadataSupported +## ERC721.isUpdateMetadataSupported - Checks if the `sharedMetadata` method is supported by the given contract. +Checks if the `updateMetadata` method is supported by the given contract. ### Example ```ts -import { isSharedMetadataSupported } from "thirdweb/extensions/erc721"; -const supported = isSharedMetadataSupported(["0x..."]); +import { isUpdateMetadataSupported } from "thirdweb/extensions/erc721"; + +const supported = isUpdateMetadataSupported(["0x..."]); ``` ```ts -function isSharedMetadataSupported( +function isUpdateMetadataSupported( 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. +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 @@ -13462,29 +15313,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `sharedMetadata` method is supported. +A boolean indicating if the `updateMetadata` method is supported. --- -## isTotalSupplySupported +## ERC721.isGetClaimConditionsSupported - Checks if the `totalSupply` method is supported by the given contract. +Checks if the `getClaimConditions` method is supported by the given contract. ### Example ```ts -import { isTotalSupplySupported } from "thirdweb/extensions/erc721"; -const supported = isTotalSupplySupported(["0x..."]); +import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc721"; + +const supported = isGetClaimConditionsSupported(["0x..."]); ``` ```ts -function isTotalSupplySupported( +function isGetClaimConditionsSupported( 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. +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 @@ -13498,121 +15350,215 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `totalSupply` method is supported. +A boolean indicating if the `getClaimConditions` method is supported. --- -## isUpdateMetadataSupported +## ERC721.approvalEvent - Checks if the `updateMetadata` method is supported by the given contract. +Creates an event object for the Approval event. ### Example ```ts -import { isUpdateMetadataSupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { approvalEvent } from "thirdweb/extensions/erc721"; -const supported = isUpdateMetadataSupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + approvalEvent({ + owner: ..., + approved: ..., + tokenId: ..., +}) +], +}); ``` ```ts -function isUpdateMetadataSupported( - availableSelectors: Array, -): boolean; +function approvalEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "approved"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "tokenId"; + readonly type: "uint256"; + }, + ]; + readonly name: "Approval"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "approved"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "tokenId"; + readonly type: "uint256"; + }, + ]; + readonly name: "Approval"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `updateMetadata` method is supported. +The prepared event object. --- -## isUpdateTokenURISupported +## ERC721.approvalForAllEvent - Checks if the `setTokenURI` method is supported by the given contract. +Creates an event object for the ApprovalForAll event. ### Example ```ts -import { isSetTokenURISupported } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { approvalForAllEvent } from "thirdweb/extensions/erc721"; -const supported = isSetTokenURISupported(["0x..."]); +const events = await getContractEvents({ +contract, +events: [ + approvalForAllEvent({ + owner: ..., + operator: ..., +}) +], +}); ``` ```ts -function isUpdateTokenURISupported( - availableSelectors: Array, -): boolean; +function approvalForAllEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "operator"; + readonly type: "address"; + }, + { readonly name: "approved"; readonly type: "bool" }, + ]; + readonly name: "ApprovalForAll"; + readonly type: "event"; +}>; ``` ### Parameters - 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. +Optional filters to apply to the event. #### Type ```ts -let availableSelectors: Array; +let filters: Partial; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "operator"; + readonly type: "address"; + }, + { readonly name: "approved"; readonly type: "bool" }, + ]; + readonly name: "ApprovalForAll"; + readonly type: "event"; +}>; ``` - A boolean indicating if the `setTokenURI` method is supported. +The prepared event object. --- -## lazyMint +## ERC721.approve - Lazily mints ERC721 tokens. +Prepares a transaction to call the "approve" function on the contract. ### Example ```ts -import { lazyMint } from "thirdweb/extensions/erc721"; import { sendTransaction } from "thirdweb"; +import { approve } from "thirdweb/extensions/erc721"; -const transaction = lazyMint({ - contract, - nfts: [ - { - name: "My NFT", - description: "This is my NFT", - image: "https://example.com/image.png", - }, - ], +const transaction = approve({ + contract, + to: ..., + tokenId: ..., + overrides: { + ... + } }); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function lazyMint( - options: BaseTransactionOptions, +function approve( + options: BaseTransactionOptions< + ApproveParams | { asyncParams: () => Promise } + >, ): PreparedTransaction; ``` ### Parameters - The options for the lazy minting process. +The options for the "approve" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + ApproveParams | { asyncParams: () => Promise } +>; ``` ### Returns @@ -13625,159 +15571,88 @@ let returnType: PreparedTransaction< >; ``` - A promise that resolves to the prepared contract call. +A prepared transaction object. --- -## mintTo +## ERC721.balanceOf - Mints a new ERC721 token and assigns it to the specified address. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. +Calls the "balanceOf" function on the contract. ### Example ```ts -import { mintTo } from "thirdweb/extensions/erc721"; -import { sendTransaction } from "thirdweb"; +import { balanceOf } from "thirdweb/extensions/erc721"; -const transaction = mintTo({ - contract, - to: "0x...", - nft: { - name: "My NFT", - description: "This is my NFT", - image: "https://example.com/image.png", - }, +const result = await balanceOf({ + contract, + owner: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function mintTo( - options: BaseTransactionOptions, -): PreparedTransaction; +function balanceOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The transaction options. +The options for the balanceOf function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +The parsed result of the function call. --- -## mintWithSignature +## ERC721.burn - Mints a new ERC721 token with the given minter signature +Prepares a transaction to call the "burn" function on the contract. ### Example ```ts -import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc721"; import { sendTransaction } from "thirdweb"; +import { burn } from "thirdweb/extensions/erc721"; -const { payload, signature } = await generateMintSignature(...) - -const transaction = mintWithSignature({ - contract, - payload, - signature, +const transaction = burn({ + contract, + tokenId: ..., + overrides: { + ... + } }); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function mintWithSignature( +function burn( options: BaseTransactionOptions< - | { - payload: { - currency: string; - pricePerToken: bigint; - primarySaleRecipient: string; - quantity: bigint; - royaltyBps: bigint; - royaltyRecipient: string; - to: string; - uid: `0x${string}`; - uri: string; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; - } - | { - payload: { - currency: string; - price: bigint; - primarySaleRecipient: string; - royaltyBps: bigint; - royaltyRecipient: string; - to: string; - uid: `0x${string}`; - uri: string; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; - } + BurnParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for the "burn" function. #### Type ```ts let options: BaseTransactionOptions< - | { - payload: { - currency: string; - pricePerToken: bigint; - primarySaleRecipient: string; - quantity: bigint; - royaltyBps: bigint; - royaltyRecipient: string; - to: string; - uid: `0x${string}`; - uri: string; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; - } - | { - payload: { - currency: string; - price: bigint; - primarySaleRecipient: string; - royaltyBps: bigint; - royaltyRecipient: string; - to: string; - uid: `0x${string}`; - uri: string; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; - } + BurnParams | { asyncParams: () => Promise } >; ``` @@ -13791,117 +15666,179 @@ let returnType: PreparedTransaction< >; ``` - A promise that resolves to the transaction result. +A prepared transaction object. --- -## nextTokenIdToMint +## ERC721.canClaim - Calls the "nextTokenIdToMint" function on the contract. +Check if a user can claim a drop. + +This method is only available on the `DropERC721` contract. ### Example ```ts -import { nextTokenIdToMint } from "thirdweb/extensions/erc721"; - -const result = await nextTokenIdToMint({ - contract, +const claimResult = await canClaim({ + contract: contract, + claimer: "0x1234567890123456789012345678901234567890", + quantity: "1", }); ``` ```ts -function nextTokenIdToMint( - options: BaseTransactionOptions, -): Promise; +function canClaim( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the nextTokenIdToMint function. +The options for the transaction. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { reason?: string; result: boolean }; ``` - The parsed result of the function call. +Whether the user can claim the drop. --- -## ownerOf +## ERC721.claimConditionsUpdatedEvent - Calls the "ownerOf" function on the contract. +Creates an event object for the ClaimConditionsUpdated event. ### Example ```ts -import { ownerOf } from "thirdweb/extensions/erc721"; +import { getContractEvents } from "thirdweb"; +import { claimConditionsUpdatedEvent } from "thirdweb/extensions/erc721"; -const result = await ownerOf({ - contract, - tokenId: ..., +const events = await getContractEvents({ + contract, + events: [claimConditionsUpdatedEvent()], }); ``` ```ts -function ownerOf( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the ownerOf function. - -#### Type - -```ts -let options: BaseTransactionOptions; +function claimConditionsUpdatedEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly components: readonly [ + { readonly name: "startTimestamp"; readonly type: "uint256" }, + { + readonly name: "maxClaimableSupply"; + readonly type: "uint256"; + }, + { readonly name: "supplyClaimed"; readonly type: "uint256" }, + { + readonly name: "quantityLimitPerWallet"; + readonly type: "uint256"; + }, + { readonly name: "merkleRoot"; readonly type: "bytes32" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "metadata"; readonly type: "string" }, + ]; + readonly name: "claimConditions"; + readonly type: "tuple[]"; + }, + { readonly name: "resetEligibility"; readonly type: "bool" }, + ]; + readonly name: "ClaimConditionsUpdated"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly components: readonly [ + { readonly name: "startTimestamp"; readonly type: "uint256" }, + { + readonly name: "maxClaimableSupply"; + readonly type: "uint256"; + }, + { readonly name: "supplyClaimed"; readonly type: "uint256" }, + { + readonly name: "quantityLimitPerWallet"; + readonly type: "uint256"; + }, + { readonly name: "merkleRoot"; readonly type: "bytes32" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "metadata"; readonly type: "string" }, + ]; + readonly name: "claimConditions"; + readonly type: "tuple[]"; + }, + { readonly name: "resetEligibility"; readonly type: "bool" }, + ]; + readonly name: "ClaimConditionsUpdated"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## resetClaimEligibility +## ERC721.claimTo - Reset the claim eligibility for all users. +Claim ERC721 NFTs to a specified address This method is only available on the `DropERC721` contract. ### Example +#### Basic usage + ```ts -import { resetClaimEligibility } from "thirdweb/extensions/erc721"; +import { claimTo } from "thirdweb/extensions/erc721"; import { sendTransaction } from "thirdweb"; -const transaction = resetClaimEligibility({ +const transaction = claimTo({ contract, + to: "0x...", + quantity: 1n, }); await sendTransaction({ transaction, account }); ``` +#### For Drops with allowlists + +You need to specify the claimer address as the `from` param to avoid any issue with the allowlist + +```ts +const transaction = claimTo({ + contract, + to: "0x...", + quantity: 1n, + from: "0x...", // address of the one claiming +}); +``` + ```ts -function resetClaimEligibility( - options: BaseTransactionOptions, +function claimTo( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters +The options for the transaction + #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -13914,44 +15851,45 @@ let returnType: PreparedTransaction< >; ``` - the prepared transaction +A promise that resolves with the submitted transaction hash. --- -## reveal +## ERC721.claimToBatch - Reveals a previously lazy minted batch of NFTs. +This extension batches multiple `claimTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can claim per transaction. This limit varies depends on the network that you are transacting on. This method is only available on the `DropERC721` contract. + +You are recommended to experiment with the number to figure out the best number for your chain of choice. ### Example ```ts -import { reveal } from "thirdweb/extensions/erc721"; - -const transaction = await reveal({ - contract: contract, - batchId: 0, - password: "password", -}); +import { claimToBatch } from "thirdweb/extensions/erc721"; -const { transactionHash } = await sendTransaction({ - transaction, - account, +const transaction = claimToBatch({ + contract: nftDropContract, + from: claimer.address, // address of the one calling this transaction + content: [ + { to: "0x...1", quantity: 1n }, + { to: "0x...2", quantity: 12n }, + { to: "0x...3", quantity: 2n }, + ], }); ``` ```ts -function reveal( - options: BaseTransactionOptions, +function claimToBatch( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - {RevealParams} - The reveal parameters. +the transaction options #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -13964,52 +15902,57 @@ let returnType: PreparedTransaction< >; ``` - The prepared transaction to send. +A promise that resolves to the transaction result. --- -## setApprovalForAll +## ERC721.createDelayedRevealBatch - Prepares a transaction to call the "setApprovalForAll" function on the contract. +Creates a batch of encrypted NFTs that can be revealed at a later time. This method is only available on the `DropERC721` contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { setApprovalForAll } from "thirdweb/extensions/erc721"; +import { createDelayedRevealBatch } from "thirdweb/extensions/erc721"; -const transaction = setApprovalForAll({ +const placeholderNFT = { + name: "Hidden NFT", + description: "Will be revealed next week!" +}; + +const realNFTs = [{ + name: "Common NFT #1", + description: "Common NFT, one of many.", + image: ipfs://..., +}, { + name: "Super Rare NFT #2", + description: "You got a Super Rare NFT!", + image: ipfs://..., +}]; + +const transaction = createDelayedRevealBatch({ contract, - operator: ..., - approved: ..., - overrides: { - ... - } + placeholderMetadata: placeholderNFT, + metadata: realNFTs, + password: "password123", }); -// Send the transaction -await sendTransaction({ transaction, account }); +const { transactionHash } = await sendTransaction({ transaction, account }); ``` ```ts -function setApprovalForAll( - options: BaseTransactionOptions< - | SetApprovalForAllParams - | { asyncParams: () => Promise } - >, +function createDelayedRevealBatch( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "setApprovalForAll" function. +{CreateDelayedRevealBatchParams} - The delayed reveal options. #### Type ```ts -let options: BaseTransactionOptions< - | SetApprovalForAllParams - | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns @@ -14022,262 +15965,250 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +The prepared transaction to send. --- -## setClaimConditions +## ERC721.generateMintSignature - Set the claim conditions for a ERC721 drop +Generates the payload and signature for minting an ERC721 token. ### Example ```ts -import { setClaimConditions } from "thirdweb/extensions/erc721"; -import { sendTransaction } from "thirdweb"; +import { + mintWithSignature, + generateMintSignature, +} from "thirdweb/extensions/erc721"; -const transaction = setClaimConditions({ +const { payload, signature } = await generateMintSignature({ + account, contract, - phases: [ - { - maxClaimableSupply: 100n, - maxClaimablePerWallet: 1n, - currencyAddress: "0x...", - price: 0.1, - startTime: new Date(), + mintRequest: { + to: "0x...", + metadata: { + name: "My NFT", + description: "This is my NFT", + image: "https://example.com/image.png", }, - ], + }, }); +const transaction = mintWithSignature({ + contract, + payload, + signature, +}); await sendTransaction({ transaction, account }); ``` ```ts -function setClaimConditions( - options: BaseTransactionOptions, -): PreparedTransaction; +function generateMintSignature( + options: GenerateMintSignatureOptions, +): Promise>; ``` ### Parameters +The options for the minting process. + #### Type ```ts -let options: BaseTransactionOptions; +let options: GenerateMintSignatureOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise>; ``` - the prepared transaction +A promise that resolves to the payload and signature. --- -## setSharedMetadata +## ERC721.getActiveClaimCondition + +Retrieves the active claim condition. This method is only available on the `DropERC721` contract. - Sets the shared metadata for a OpenEdition contract. +### Example ```ts -function setSharedMetadata( - options: BaseTransactionOptions, -): PreparedTransaction; +import { getActiveClaimCondition } from "thirdweb/extensions/erc721"; +const activeClaimCondition = await getActiveClaimCondition({ + contract, +}); +``` + +```ts +function getActiveClaimCondition( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the transaction. +The transaction options. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - The prepared transaction. +A promise that resolves to the active claim condition. --- -## setTokenURI +## ERC721.getActiveClaimConditionId - Prepares a transaction to call the "setTokenURI" function on the contract. +Calls the "getActiveClaimConditionId" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { setTokenURI } from "thirdweb/extensions/erc721"; +import { getActiveClaimConditionId } from "thirdweb/extensions/erc721"; -const transaction = setTokenURI({ - contract, - tokenId: ..., - uri: ..., - overrides: { - ... - } +const result = await getActiveClaimConditionId({ + contract, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function setTokenURI( - options: BaseTransactionOptions< - | SetTokenURIParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getActiveClaimConditionId( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "setTokenURI" function. +The options for the getActiveClaimConditionId function. #### Type ```ts -let options: BaseTransactionOptions< - | SetTokenURIParams - | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +The parsed result of the function call. --- -## sharedMetadata +## ERC721.getAllOwners - Calls the "sharedMetadata" function on the contract. +Retrieves the owners of all ERC721 tokens within a specified range. ### Example ```ts -import { sharedMetadata } from "thirdweb/extensions/erc721"; - -const result = await sharedMetadata({ +import { getAllOwners } from "thirdweb/extensions/erc721"; +const owners = await getAllOwners({ contract, + start: 0, + count: 10, }); ``` ```ts -function sharedMetadata( - options: BaseTransactionOptions, -): Promise; +function getAllOwners( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the sharedMetadata function. +The options for retrieving the owners. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise>; ``` - The parsed result of the function call. +A promise that resolves to an array of objects containing the token ID and owner address. --- -## sharedMetadataUpdatedEvent +## ERC721.getApproved - Creates an event object for the SharedMetadataUpdated event. +Calls the "getApproved" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { sharedMetadataUpdatedEvent } from "thirdweb/extensions/erc721"; +import { getApproved } from "thirdweb/extensions/erc721"; -const events = await getContractEvents({ - contract, - events: [sharedMetadataUpdatedEvent()], +const result = await getApproved({ + contract, + tokenId: ..., }); ``` ```ts -function sharedMetadataUpdatedEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "name"; readonly type: "string" }, - { readonly name: "description"; readonly type: "string" }, - { readonly name: "imageURI"; readonly type: "string" }, - { readonly name: "animationURI"; readonly type: "string" }, - ]; - readonly name: "SharedMetadataUpdated"; - readonly type: "event"; -}>; +function getApproved( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the getApproved function. + +#### Type + +```ts +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "name"; readonly type: "string" }, - { readonly name: "description"; readonly type: "string" }, - { readonly name: "imageURI"; readonly type: "string" }, - { readonly name: "animationURI"; readonly type: "string" }, - ]; - readonly name: "SharedMetadataUpdated"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## startTokenId +## ERC721.getBatchesToReveal - Calls the "startTokenId" function on the contract. +Retrieves the batches available to reveal in an NFT contract. ### Example ```ts -import { startTokenId } from "thirdweb/extensions/erc721"; +import { getBatchesToReveal } from "thirdweb/extensions/erc721"; -const result = await startTokenId({ - contract, +const batches = await getBatchesToReveal({ contract: contract }); + +const { transactionHash } = await sendTransaction({ + transaction, + account, }); ``` ```ts -function startTokenId( +function getBatchesToReveal( options: BaseTransactionOptions, -): Promise; +): Promise>; ``` ### Parameters - The options for the startTokenId function. +{BaseTransactionOptions} - The transaction options. #### Type @@ -14288,542 +16219,402 @@ let options: { contract: ThirdwebContract } & T; ### Returns ```ts -let returnType: Promise; +let returnType: { + batchId: bigint; + batchUri: string; + placeholderMetadata: undefined | NFTMetadata; +}; ``` - The parsed result of the function call. +A promise resolving to an array of unrevealed batches. + +Use the `batchId` and corresponding password for each batch to reveal it with `reveal`. reveal --- -## tokenOfOwnerByIndex +## ERC721.getClaimConditionById - Calls the "tokenOfOwnerByIndex" function on the contract. +Calls the "getClaimConditionById" function on the contract. ### Example ```ts -import { tokenOfOwnerByIndex } from "thirdweb/extensions/erc721"; +import { getClaimConditionById } from "thirdweb/extensions/erc721"; -const result = await tokenOfOwnerByIndex({ +const result = await getClaimConditionById({ contract, - owner: ..., - index: ..., + conditionId: ..., }); ``` ```ts -function tokenOfOwnerByIndex( - options: BaseTransactionOptions, -): Promise; +function getClaimConditionById( + options: BaseTransactionOptions, +): Promise<{ + currency: string; + maxClaimableSupply: bigint; + merkleRoot: `0x${string}`; + metadata: string; + pricePerToken: bigint; + quantityLimitPerWallet: bigint; + startTimestamp: bigint; + supplyClaimed: bigint; +}>; ``` ### Parameters - The options for the tokenOfOwnerByIndex function. +The options for the getClaimConditionById function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<{ + currency: string; + maxClaimableSupply: bigint; + merkleRoot: `0x${string}`; + metadata: string; + pricePerToken: bigint; + quantityLimitPerWallet: bigint; + startTimestamp: bigint; + supplyClaimed: bigint; +}>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## tokensClaimedEvent +## ERC721.getClaimConditions - Creates an event object for the TokensClaimed event. +Retrieves all claim conditions. + +This method is only available on the `DropERC721` contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokensClaimedEvent } from "thirdweb/extensions/erc721"; - -const events = await getContractEvents({ -contract, -events: [ - tokensClaimedEvent({ - claimConditionIndex: ..., - claimer: ..., - receiver: ..., -}) -], -}); +import { getClaimConditions } from "thirdweb/extensions/erc721"; +const conditions = await getClaimConditions({ contract }); ``` ```ts -function tokensClaimedEvent( - filters: Partial<{ - claimConditionIndex: bigint; - claimer: string; - receiver: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "claimConditionIndex"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "claimer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "receiver"; - readonly type: "address"; - }, - { readonly name: "startTokenId"; readonly type: "uint256" }, - { readonly name: "quantityClaimed"; readonly type: "uint256" }, - ]; - readonly name: "TokensClaimed"; - readonly type: "event"; -}>; +function getClaimConditions( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - Optional filters to apply to the event. +The transaction options. #### Type ```ts -let filters: Partial<{ - claimConditionIndex: bigint; - claimer: string; - receiver: string; -}>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "claimConditionIndex"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "claimer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "receiver"; - readonly type: "address"; - }, - { readonly name: "startTokenId"; readonly type: "uint256" }, - { readonly name: "quantityClaimed"; readonly type: "uint256" }, - ]; - readonly name: "TokensClaimed"; - readonly type: "event"; -}>; +let returnType: Promise>; ``` - The prepared event object. +A promise that resolves to all claim conditions. --- -## tokensLazyMintedEvent +## ERC721.getNFT - Creates an event object for the TokensLazyMinted event. +Retrieves information about a specific ERC721 non-fungible token (NFT). ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokensLazyMintedEvent } from "thirdweb/extensions/erc721"; - -const events = await getContractEvents({ -contract, -events: [ - tokensLazyMintedEvent({ - startTokenId: ..., -}) -], +import { getNFT } from "thirdweb/extensions/erc721"; +const nft = await getNFT({ + contract, + tokenId: 1n, }); ``` ```ts -function tokensLazyMintedEvent( - filters: Partial<{ startTokenId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "startTokenId"; - readonly type: "uint256"; - }, - { readonly name: "endTokenId"; readonly type: "uint256" }, - { readonly name: "baseURI"; readonly type: "string" }, - { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, - ]; - readonly name: "TokensLazyMinted"; - readonly type: "event"; -}>; +function getNFT( + options: BaseTransactionOptions<{ + includeOwner?: boolean; + tokenByIndex?: boolean; + tokenId: bigint; + useIndexer?: boolean; + }>, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for retrieving the NFT. #### Type ```ts -let filters: Partial<{ startTokenId: bigint }>; +let options: BaseTransactionOptions<{ + includeOwner?: boolean; + tokenByIndex?: boolean; + tokenId: bigint; + useIndexer?: boolean; +}>; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "startTokenId"; - readonly type: "uint256"; - }, - { readonly name: "endTokenId"; readonly type: "uint256" }, - { readonly name: "baseURI"; readonly type: "string" }, - { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, - ]; - readonly name: "TokensLazyMinted"; - readonly type: "event"; -}>; +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - The prepared event object. +A promise that resolves to the NFT object. --- -## tokensMintedWithSignatureEvent +## ERC721.getNFTs - Creates an event object for the TokensMintedWithSignature event. +Retrieves an array of NFTs ("ERC721") based on the provided options. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc721"; - -const events = await getContractEvents({ -contract, -events: [ - tokensMintedWithSignatureEvent({ - signer: ..., - mintedTo: ..., - tokenIdMinted: ..., -}) -], +import { getNFTs } from "thirdweb/extensions/erc721"; +const nfts = await getNFTs({ + contract, + start: 0, + count: 10, }); ``` ```ts -function tokensMintedWithSignatureEvent( - filters: Partial<{ - mintedTo: string; - signer: string; - tokenIdMinted: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "signer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "mintedTo"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenIdMinted"; - readonly type: "uint256"; - }, - { - readonly components: readonly [ - { readonly name: "to"; readonly type: "address" }, - { - readonly name: "royaltyRecipient"; - readonly type: "address"; - }, - { readonly name: "royaltyBps"; readonly type: "uint256" }, - { - readonly name: "primarySaleRecipient"; - readonly type: "address"; - }, - { readonly name: "uri"; readonly type: "string" }, - { readonly name: "price"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { - readonly name: "validityStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "validityEndTimestamp"; - readonly type: "uint128"; - }, - { readonly name: "uid"; readonly type: "bytes32" }, - ]; - readonly name: "mintpayload"; - readonly type: "tuple"; - }, - ]; - readonly name: "TokensMintedWithSignature"; - readonly type: "event"; -}>; +function getNFTs( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - Optional filters to apply to the event. +The options for retrieving the NFTs. #### Type ```ts -let filters: Partial<{ - mintedTo: string; - signer: string; - tokenIdMinted: bigint; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "signer"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "mintedTo"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenIdMinted"; - readonly type: "uint256"; - }, - { - readonly components: readonly [ - { readonly name: "to"; readonly type: "address" }, - { - readonly name: "royaltyRecipient"; - readonly type: "address"; - }, - { readonly name: "royaltyBps"; readonly type: "uint256" }, - { - readonly name: "primarySaleRecipient"; - readonly type: "address"; - }, - { readonly name: "uri"; readonly type: "string" }, - { readonly name: "price"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { - readonly name: "validityStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "validityEndTimestamp"; - readonly type: "uint128"; - }, - { readonly name: "uid"; readonly type: "bytes32" }, - ]; - readonly name: "mintpayload"; - readonly type: "tuple"; - }, - ]; - readonly name: "TokensMintedWithSignature"; - readonly type: "event"; -}>; +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - The prepared event object. +A promise that resolves to an array of NFTs. --- -## tokensOfOwner +## ERC721.getOwnedNFTs - Calls the "tokensOfOwner" function on the contract. +Retrieves the owned NFTs for a given owner. This extension only works with ERC721 contracts that support the [tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method ### Example ```ts -import { tokensOfOwner } from "thirdweb/extensions/erc721"; +import { getOwnedNFTs } from "thirdweb/extensions/erc721"; -const result = await tokensOfOwner({ - contract, - owner: ..., +const ownedNFTs = await getOwnedNFTs({ + contract, + owner: "0x1234...", }); ``` ```ts -function tokensOfOwner(options: BaseTransactionOptions) : Promise> +function getOwnedNFTs( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the tokensOfOwner function. +The options for retrieving the owned NFTs. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise> +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - The parsed result of the function call. +A promise that resolves to an array of NFTs owned by the specified owner. --- -## tokenURI +## ERC721.getOwnedTokenIds - Calls the "tokenURI" function on the contract. +Retrieves the token IDs owned by a specific address. ### Example ```ts -import { tokenURI } from "thirdweb/extensions/erc721"; +import { getOwnedTokenIds } from "thirdweb/extensions/erc721"; -const result = await tokenURI({ - contract, - tokenId: ..., +const ownedTokenIds = await getOwnedTokenIds({ + contract, + owner: "0x1234...", }); ``` ```ts -function tokenURI( - options: BaseTransactionOptions, -): Promise; +function getOwnedTokenIds( + options: BaseTransactionOptions, +): Promise>; ``` ### Parameters - The options for the tokenURI function. +The options for retrieving the owned token IDs. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise>; ``` - The parsed result of the function call. +A promise that resolves to an array of bigint representing the owned token IDs. --- -## tokenURIRevealedEvent +## ERC721.getTotalClaimedSupply - Creates an event object for the TokenURIRevealed event. +Retrieves the total claimed supply of ERC721 tokens. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { tokenURIRevealedEvent } from "thirdweb/extensions/erc721"; +import { getTotalClaimedSupply } from "thirdweb/extensions/erc721"; -const events = await getContractEvents({ -contract, -events: [ - tokenURIRevealedEvent({ - index: ..., -}) -], +const totalClaimedSupply = await getTotalClaimedSupply({ + contract, }); ``` ```ts -function tokenURIRevealedEvent( - filters: Partial<{ index: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "index"; - readonly type: "uint256"; - }, - { readonly name: "revealedURI"; readonly type: "string" }, - ]; - readonly name: "TokenURIRevealed"; - readonly type: "event"; -}>; +function getTotalClaimedSupply( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The base transaction options. #### Type ```ts -let filters: Partial<{ index: bigint }>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "index"; - readonly type: "uint256"; - }, - { readonly name: "revealedURI"; readonly type: "string" }, - ]; - readonly name: "TokenURIRevealed"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +A promise that resolves to the total claimed supply as a bigint. --- -## totalSupply +## ERC721.getTotalUnclaimedSupply - Calls the "totalSupply" function on the contract. +Retrieves the total unclaimed supply of ERC721 tokens. ### Example ```ts -import { totalSupply } from "thirdweb/extensions/erc721"; +import { getTotalUnclaimedSupply } from "thirdweb/extensions/erc721"; -const result = await totalSupply({ +const totalUnclaimedSupply = await getTotalUnclaimedSupply({ contract, }); ``` ```ts -function totalSupply( +function getTotalUnclaimedSupply( options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the totalSupply function. +The base transaction options. #### Type @@ -14837,1659 +16628,1505 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves to the total unclaimed supply as a bigint. --- -## transferEvent +## ERC721.isApprovedForAll - Creates an event object for the Transfer event. +Calls the "isApprovedForAll" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { transferEvent } from "thirdweb/extensions/erc721"; +import { isApprovedForAll } from "thirdweb/extensions/erc721"; -const events = await getContractEvents({ -contract, -events: [ - transferEvent({ - from: ..., - to: ..., - tokenId: ..., -}) -], +const result = await isApprovedForAll({ + contract, + owner: ..., + operator: ..., }); ``` ```ts -function transferEvent( - filters: Partial<{ from: string; to: string; tokenId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenId"; - readonly type: "uint256"; - }, - ]; - readonly name: "Transfer"; - readonly type: "event"; -}>; +function isApprovedForAll( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the isApprovedForAll function. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +The parsed result of the function call. +--- + +## ERC721.isBurnSupported + +Checks if the `burn` method is supported by the given contract. + +### Example + +```ts +import { isBurnSupported } from "thirdweb/extensions/erc721"; + +const supported = isBurnSupported(["0x..."]); +``` + +```ts +function isBurnSupported(availableSelectors: Array): boolean; ``` ### Parameters - Optional filters to apply to the event. +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 filters: Partial<{ from: string; to: string; tokenId: bigint }>; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "tokenId"; - readonly type: "uint256"; - }, - ]; - readonly name: "Transfer"; - readonly type: "event"; -}>; +let returnType: boolean; ``` - The prepared event object. +A boolean indicating if the `burn` method is supported. --- -## transferFrom +## ERC721.isClaimToSupported - Prepares a transaction to call the "transferFrom" function on the contract. +Checks if the `claimTo` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { transferFrom } from "thirdweb/extensions/erc721"; - -const transaction = transferFrom({ - contract, - from: ..., - to: ..., - tokenId: ..., - overrides: { - ... - } -}); +import { isClaimToSupported } from "thirdweb/extensions/erc721"; -// Send the transaction -await sendTransaction({ transaction, account }); +const supported = isClaimToSupported(["0x..."]); ``` ```ts -function transferFrom( - options: BaseTransactionOptions< - | TransferFromParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isClaimToSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "transferFrom" function. +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 options: BaseTransactionOptions< - | TransferFromParams - | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `claimTo` method is supported. --- -## updateMetadata +## ERC721.isCreateDelayedRevealBatchSupported - Update the metadata of the single token in an NFT Drop (DropERC721) collection For NFT Collection, please use `setTokenURI` +Checks if the `createDelayedRevealBatch` method is supported by the given contract. ### Example ```ts -import { updateMetadata } from "thirdweb/extensions/erc721"; - -const transaction = updateMetadata({ - contract, - targetTokenId: 0n, - client: thirdwebClient, - newMetadata: { - name: "this is the new nft name", - description: "...", - image: "new image uri", - // ... - }, -}); +import { isCreateDelayedRevealBatchSupported } from "thirdweb/extensions/erc721"; +const supported = isCreateDelayedRevealBatchSupported(["0x..."]); ``` ```ts -function updateMetadata( - options: BaseTransactionOptions, -): PreparedTransaction; +function isCreateDelayedRevealBatchSupported( + 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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - the prepared transaction +A boolean indicating if the `createDelayedRevealBatch` method is supported. --- -## updateTokenURI +## ERC721.isERC721 - This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI) , which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput) , upload that content to IPFS and pass the IPFS URI (of said `NFTInput` ) to the underlying `setTokenURI` method. - - This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update. +Check if a contract supports the ERC721 interface. ### Example ```ts -import { updateTokenURI } from "thirdweb/extensions/erc721"; - -const transaction = updateTokenURI({ - tokenId: 0n, - nft: { - name: "new name", - description: "new description", - image: "https://image-host.com/new-image.png", - }, -}); +import { isERC721 } from "thirdweb/extensions/erc721"; +const result = await isERC721({ contract }); ``` ```ts -function updateTokenURI( - options: BaseTransactionOptions, -): PreparedTransaction; +function isERC721(options: BaseTransactionOptions): Promise; ``` ### Parameters +The transaction options. + #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - the prepared transaction from `setTokenURI` +A boolean indicating whether the contract supports the ERC721 interface. --- -## ERC1271 ---- - -## checkContractWalletSignature - -Deprecated - Use `verifySignature` instead +## ERC721.isGetActiveClaimConditionIdSupported - Checks if a contract wallet signature is valid. +Checks if the `getActiveClaimConditionId` method is supported by the given contract. ### Example ```ts -import { checkContractWalletSignature } from "thirdweb/extensions/erc1271"; -const isValid = await checkContractWalletSignature({ - contract: myContract, - message: "hello world", - signature: "0x...", -}); +import { isGetActiveClaimConditionIdSupported } from "thirdweb/extensions/erc721"; +const supported = isGetActiveClaimConditionIdSupported(["0x..."]); ``` ```ts -function checkContractWalletSignature( - options: CheckContractWalletSignatureOptions, -): Promise; +function isGetActiveClaimConditionIdSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the checkContractWalletSignature function. +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 options: { - contract: ThirdwebContract; - message: SignableMessage; - signature: string; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves with a boolean indicating if the signature is valid. +A boolean indicating if the `getActiveClaimConditionId` method is supported. --- -## checkContractWalletSignedTypedData - -Deprecated - - Use `verifyTypedData` instead +## ERC721.isGetActiveClaimConditionSupported - Checks if a contract wallet signature is valid. +Checks if the `getActiveClaimCondition` method is supported by the given contract. This method is only available on the `DropERC721` contract. ### Example ```ts -import { checkContractWalletSignedTypedData } from "thirdweb/extensions/erc1271"; -const isValid = await checkContractWalletSignedTypedData({ - contract: myContract, - data: { - primaryType: "EIP712Domain", - domain: { - name: "Example", - version: "1", - chainId: 1, - verifyingContract: myContract.address, - }, -}); +import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc721"; + +const supported = isGetActiveClaimConditionSupported(["0x..."]); ``` ```ts -function checkContractWalletSignedTypedData( - options: CheckContractWalletSignTypedDataOptions< - typedData, - primaryType - >, -): Promise; +function isGetActiveClaimConditionSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the checkContractWalletSignature function. +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 options: CheckContractWalletSignTypedDataOptions< - typedData, - primaryType ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves with a boolean indicating if the signature is valid. ---- -## ERC20 +A boolean indicating if the `getActiveClaimCondition` method is supported. --- -## allowance +## ERC721.isGetApprovedSupported - Calls the "allowance" function on the contract. +Checks if the `getApproved` method is supported by the given contract. ### Example ```ts -import { allowance } from "thirdweb/extensions/erc20"; - -const result = await allowance({ - contract, - owner: ..., - spender: ..., -}); +import { isGetApprovedSupported } from "thirdweb/extensions/erc721"; +const supported = isGetApprovedSupported(["0x..."]); ``` ```ts -function allowance( - options: BaseTransactionOptions, -): Promise; +function isGetApprovedSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the allowance function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `getApproved` method is supported. --- -## approvalEvent +## ERC721.isGetBatchesToRevealSupported - Creates an event object for the Approval event. +Checks if the `getBatchesToReveal` method is supported by the given contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { approvalEvent } from "thirdweb/extensions/erc20"; +import { isGetBatchesToRevealSupported } from "thirdweb/extensions/erc721"; -const events = await getContractEvents({ -contract, -events: [ - approvalEvent({ - owner: ..., - spender: ..., -}) -], -}); +const supported = isGetBatchesToRevealSupported(["0x..."]); ``` ```ts -function approvalEvent( - filters: Partial<{ owner: string; spender: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "spender"; - readonly type: "address"; - }, - { readonly name: "value"; readonly type: "uint256" }, - ]; - readonly name: "Approval"; - readonly type: "event"; -}>; +function isGetBatchesToRevealSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - Optional filters to apply to the event. +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 filters: Partial<{ owner: string; spender: string }>; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "spender"; - readonly type: "address"; - }, - { readonly name: "value"; readonly type: "uint256" }, - ]; - readonly name: "Approval"; - readonly type: "event"; -}>; +let returnType: boolean; ``` - The prepared event object. +A boolean indicating if the `getBatchesToReveal` method is supported. --- -## approve +## ERC721.isGetClaimConditionByIdSupported - Approves the spending of tokens by a specific address. +Checks if the `getClaimConditionById` method is supported by the given contract. ### Example ```ts -import { approve } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; - -const transaction = await approve({ - contract, - spender: "0x...", - amount: 100, -}); - -await sendTransaction({ transaction, account }); +import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc721"; +const supported = isGetClaimConditionByIdSupported(["0x..."]); ``` ```ts -function approve( - options: BaseTransactionOptions, -): PreparedTransaction; +function isGetClaimConditionByIdSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `getClaimConditionById` method is supported. --- -## balanceOf +## ERC721.isGetClaimConditionsSupported - Calls the "balanceOf" function on the contract. +Checks if the `getClaimConditions` method is supported by the given contract. ### Example ```ts -import { balanceOf } from "thirdweb/extensions/erc20"; +import { isGetClaimConditionsSupported } from "thirdweb/extensions/erc721"; -const result = await balanceOf({ - contract, - address: ..., -}); +const supported = isGetClaimConditionsSupported(["0x..."]); ``` ```ts -function balanceOf( - options: BaseTransactionOptions, -): Promise; +function isGetClaimConditionsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the balanceOf function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `getClaimConditions` method is supported. --- -## burn +## ERC721.isGetNFTsSupported - Prepares a transaction to call the "burn" function on the contract. +Checks if the `getNFTs` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { burn } from "thirdweb/extensions/erc20"; - -const transaction = burn({ - contract, - amount: ..., - overrides: { - ... - } -}); +import { isGetNFTsSupported } from "thirdweb/extensions/erc721"; -// Send the transaction -await sendTransaction({ transaction, account }); +const supported = isGetNFTsSupported(["0x..."]); ``` ```ts -function burn( - options: BaseTransactionOptions< - BurnParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isGetNFTsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "burn" function. +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 options: BaseTransactionOptions< - BurnParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `getNFTs` method is supported. --- -## burnFrom +## ERC721.isGetNFTSupported - Prepares a transaction to call the "burnFrom" function on the contract. +Checks if the `tokenURI` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { burnFrom } from "thirdweb/extensions/erc20"; - -const transaction = burnFrom({ - contract, - account: ..., - amount: ..., - overrides: { - ... - } -}); - -// Send the transaction -await sendTransaction({ transaction, account }); +import { isTokenURISupported } from "thirdweb/extensions/erc721"; +const supported = isTokenURISupported(["0x..."]); ``` ```ts -function burnFrom( - options: BaseTransactionOptions< - BurnFromParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isGetNFTSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "burnFrom" function. +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 options: BaseTransactionOptions< - BurnFromParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `tokenURI` method is supported. --- -## claimConditionsUpdatedEvent +## ERC721.isLazyMintSupported - Creates an event object for the ClaimConditionsUpdated event. +Checks if the `lazyMint` method is supported by the given contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { claimConditionsUpdatedEvent } from "thirdweb/extensions/erc20"; +import { isLazyMintSupported } from "thirdweb/extensions/erc721"; -const events = await getContractEvents({ - contract, - events: [claimConditionsUpdatedEvent()], -}); +const supported = isLazyMintSupported(["0x..."]); ``` ```ts -function claimConditionsUpdatedEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly components: readonly [ - { readonly name: "startTimestamp"; readonly type: "uint256" }, - { - readonly name: "maxClaimableSupply"; - readonly type: "uint256"; - }, - { readonly name: "supplyClaimed"; readonly type: "uint256" }, - { - readonly name: "quantityLimitPerWallet"; - readonly type: "uint256"; - }, - { readonly name: "merkleRoot"; readonly type: "bytes32" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "metadata"; readonly type: "string" }, - ]; - readonly name: "claimConditions"; - readonly type: "tuple[]"; - }, - { readonly name: "resetEligibility"; readonly type: "bool" }, - ]; - readonly name: "ClaimConditionsUpdated"; - readonly type: "event"; -}>; +function isLazyMintSupported( + 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: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly components: readonly [ - { readonly name: "startTimestamp"; readonly type: "uint256" }, - { - readonly name: "maxClaimableSupply"; - readonly type: "uint256"; - }, - { readonly name: "supplyClaimed"; readonly type: "uint256" }, - { - readonly name: "quantityLimitPerWallet"; - readonly type: "uint256"; - }, - { readonly name: "merkleRoot"; readonly type: "bytes32" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "metadata"; readonly type: "string" }, - ]; - readonly name: "claimConditions"; - readonly type: "tuple[]"; - }, - { readonly name: "resetEligibility"; readonly type: "bool" }, - ]; - readonly name: "ClaimConditionsUpdated"; - readonly type: "event"; -}>; +let returnType: boolean; ``` - The prepared event object. +A boolean indicating if the `lazyMint` method is supported. --- -## claimTo +## ERC721.isMintToSupported - Claim ERC20 NFTs to a specified address +Checks if the `mintTo` method is supported by the given contract. ### Example -#### Basic usage - ```ts -import { claimTo } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; - -const transaction = claimTo({ - contract, - to: "0x...", - quantity: 100n, -}); +import { isMintToSupported } from "thirdweb/extensions/erc721"; -await sendTransaction({ transaction, account }); +const supported = isMintToSupported(["0x..."]); +``` + +```ts +function isMintToSupported( + availableSelectors: Array, +): boolean; ``` -#### For Drops with allowlists +### 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. - You need to specify the claimer address as the `from` param to avoid any issue with the allowlist +#### Type ```ts -const transaction = claimTo({ - contract, - to: "0x...", - quantity: 100n, - from: "0x...", // address of the one claiming -}); +let availableSelectors: Array; ``` +### Returns + ```ts -function claimTo( - options: BaseTransactionOptions, -): PreparedTransaction; +let returnType: boolean; +``` + +A boolean indicating if the `mintTo` method is supported. +--- + +## ERC721.isNextTokenIdToMintSupported + +Checks if the `nextTokenIdToMint` method is supported by the given contract. + +### Example + +```ts +import { isNextTokenIdToMintSupported } from "thirdweb/extensions/erc721"; +const supported = isNextTokenIdToMintSupported(["0x..."]); +``` + +```ts +function isNextTokenIdToMintSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the transaction +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A promise that resolves with the submitted transaction hash. +A boolean indicating if the `nextTokenIdToMint` method is supported. --- -## decimals +## ERC721.isResetClaimEligibilitySupported - Retrieves the number of decimal places for a given ERC20 contract. +Checks if the `resetClaimEligibility` method is supported by the given contract. ### Example ```ts -import { decimals } from "thirdweb/extensions/erc20"; +import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc721"; -const tokenDecimals = await decimals({ contract }); +const supported = isResetClaimEligibilitySupported(["0x..."]); ``` ```ts -function decimals(options: BaseTransactionOptions): Promise; +function isResetClaimEligibilitySupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the transaction. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the number of decimal places. +A boolean indicating if the `resetClaimEligibility` method is supported. --- -## delegate +## ERC721.isRevealSupported - Prepares a transaction to call the "delegate" function on the contract. +Checks if the `reveal` method is supported by the given contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { delegate } from "thirdweb/extensions/erc20"; - -const transaction = delegate({ - contract, - delegatee: ..., - overrides: { - ... - } -}); +import { isRevealSupported } from "thirdweb/extensions/erc721"; -// Send the transaction -await sendTransaction({ transaction, account }); +const supported = isRevealSupported(["0x..."]); ``` ```ts -function delegate( - options: BaseTransactionOptions< - DelegateParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function isRevealSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "delegate" function. +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 options: BaseTransactionOptions< - DelegateParams | { asyncParams: () => Promise } ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `reveal` method is supported. --- -## delegates +## ERC721.isSetClaimConditionsSupported - Calls the "delegates" function on the contract. +Checks if the `setClaimConditions` method is supported by the given contract. ### Example ```ts -import { delegates } from "thirdweb/extensions/erc20"; +import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc721"; -const result = await delegates({ - contract, - account: ..., -}); +const supported = isSetClaimConditionsSupported(["0x..."]); ``` ```ts -function delegates( - options: BaseTransactionOptions, -): Promise; +function isSetClaimConditionsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the delegates function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `setClaimConditions` method is supported. --- -## deposit +## ERC721.isSetSharedMetadataSupported - Calls the "deposit" function on the contract (useful to wrap ETH). +Checks if the `setSharedMetadata` method is supported by the given contract. ### Example ```ts -import { deposit } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; - -const transaction = deposit({ contract, amount: "0.1" }); +import { isSetSharedMetadataSupported } from "thirdweb/extensions/erc721"; -await sendTransaction({ transaction, account }); +const supported = isSetSharedMetadataSupported(["0x..."]); ``` ```ts -function deposit( - options: BaseTransactionOptions, -): PreparedTransaction; +function isSetSharedMetadataSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the "deposit" function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object. +A boolean indicating if the `setSharedMetadata` method is supported. --- -## generateMintSignature +## ERC721.isSharedMetadataSupported - Generates the payload and signature for minting an ERC20 token. +Checks if the `sharedMetadata` method is supported by the given contract. ### Example ```ts -import { - mintWithSignature, - generateMintSignature, -} from "thirdweb/extensions/erc20"; - -const { payload, signature } = await generateMintSignature({ - account, - contract, - mintRequest: { - to: "0x...", - quantity: "10", - }, -}); - -const transaction = mintWithSignature({ - contract, - payload, - signature, -}); -await sendTransaction({ transaction, account }); +import { isSharedMetadataSupported } from "thirdweb/extensions/erc721"; +const supported = isSharedMetadataSupported(["0x..."]); ``` ```ts -function generateMintSignature( - options: GenerateMintSignatureOptions, -): Promise<{ - payload: { - currency: string; - price: bigint; - primarySaleRecipient: string; - quantity: bigint; - to: string; - uid: `0x${string}`; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; -}>; +function isSharedMetadataSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the minting process. +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 options: { - account: Account; - contract: ThirdwebContract; - contractType?: "TokenERC1155" | "SignatureMintERC1155"; - mintRequest: GeneratePayloadInput; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise<{ - payload: { - currency: string; - price: bigint; - primarySaleRecipient: string; - quantity: bigint; - to: string; - uid: `0x${string}`; - validityEndTimestamp: bigint; - validityStartTimestamp: bigint; - }; - signature: `0x${string}`; -}>; +let returnType: boolean; ``` - A promise that resolves to the payload and signature. +A boolean indicating if the `sharedMetadata` method is supported. --- -## getActiveClaimCondition +## ERC721.isTokenByIndexSupported - Retrieves the active claim condition. +Checks if the `tokenByIndex` method is supported by the given contract. ### Example ```ts -import { getActiveClaimCondition } from "thirdweb/extensions/erc20"; -const activeClaimCondition = await getActiveClaimCondition({ - contract, -}); +import { isTokenByIndexSupported } from "thirdweb/extensions/erc721"; +const supported = isTokenByIndexSupported(["0x..."]); ``` ```ts -function getActiveClaimCondition( - options: BaseTransactionOptions, -): Promise; +function isTokenByIndexSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the active claim condition. +A boolean indicating if the `tokenByIndex` method is supported. --- -## getActiveClaimConditionId +## ERC721.isTotalSupplySupported - Calls the "getActiveClaimConditionId" function on the contract. +Checks if the `totalSupply` method is supported by the given contract. ### Example ```ts -import { getActiveClaimConditionId } from "thirdweb/extensions/erc20"; - -const result = await getActiveClaimConditionId({ - contract, -}); +import { isTotalSupplySupported } from "thirdweb/extensions/erc721"; +const supported = isTotalSupplySupported(["0x..."]); ``` ```ts -function getActiveClaimConditionId( - options: BaseTransactionOptions, -): Promise; +function isTotalSupplySupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the getActiveClaimConditionId function. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `totalSupply` method is supported. --- -## getBalance +## ERC721.isUpdateMetadataSupported - Retrieves the balance of an ERC20 token for a specific address. +Checks if the `updateMetadata` method is supported by the given contract. ### Example ```ts -import { getBalance } from "thirdweb/extensions/erc20"; +import { isUpdateMetadataSupported } from "thirdweb/extensions/erc721"; -const balance = await getBalance({ contract, address: "0x..." }); +const supported = isUpdateMetadataSupported(["0x..."]); ``` ```ts -function getBalance( - options: BaseTransactionOptions, -): Promise; +function isUpdateMetadataSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The transaction options including the address. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: { - decimals: number; - displayValue: string; - name: string; - symbol: string; - value: bigint; -}; +let returnType: boolean; ``` - An object containing the balance value, display value, and symbol. +A boolean indicating if the `updateMetadata` method is supported. --- -## getClaimConditionById +## ERC721.isUpdateTokenURISupported - Calls the "getClaimConditionById" function on the contract. +Checks if the `setTokenURI` method is supported by the given contract. ### Example ```ts -import { getClaimConditionById } from "thirdweb/extensions/erc20"; +import { isSetTokenURISupported } from "thirdweb/extensions/erc721"; -const result = await getClaimConditionById({ - contract, - conditionId: ..., -}); +const supported = isSetTokenURISupported(["0x..."]); ``` ```ts -function getClaimConditionById( - options: BaseTransactionOptions, -): Promise<{ - currency: string; - maxClaimableSupply: bigint; - merkleRoot: `0x${string}`; - metadata: string; - pricePerToken: bigint; - quantityLimitPerWallet: bigint; - startTimestamp: bigint; - supplyClaimed: bigint; -}>; +function isUpdateTokenURISupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the getClaimConditionById function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise<{ - currency: string; - maxClaimableSupply: bigint; - merkleRoot: `0x${string}`; - metadata: string; - pricePerToken: bigint; - quantityLimitPerWallet: bigint; - startTimestamp: bigint; - supplyClaimed: bigint; -}>; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `setTokenURI` method is supported. --- -## getClaimConditions +## ERC721.lazyMint - Retrieves all claim conditions. +Lazily mints ERC721 tokens. This method is only available on the `DropERC721` contract. ### Example ```ts -import { getClaimConditions } from "thirdweb/extensions/erc20"; -const conditions = await getClaimConditions({ contract }); +import { lazyMint } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; + +const transaction = lazyMint({ + contract, + nfts: [ + { + name: "My NFT", + description: "This is my NFT", + image: "https://example.com/image.png", + }, + ], +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function getClaimConditions( - options: BaseTransactionOptions, -): Promise>; +function lazyMint( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The transaction options. +The options for the lazy minting process. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to all claim conditions. +A promise that resolves to the prepared contract call. --- -## getCurrencyMetadata +## ERC721.mintTo - Retrieves the metadata of a currency. +Mints a new ERC721 token and assigns it to the specified address. This method is only available on the `TokenERC721` contract. + +If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. ### Example ```ts -import { getCurrencyMetadata } from "thirdweb/extensions/erc20"; +import { mintTo } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; -const currencyMetadata = await getCurrencyMetadata({ contract }); +const transaction = mintTo({ + contract, + to: "0x...", + nft: { + name: "My NFT", + description: "This is my NFT", + image: "https://example.com/image.png", + }, +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function getCurrencyMetadata( - options: BaseTransactionOptions, -): Promise; +function mintTo( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the transaction. +The transaction options. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { decimals: number; name: string; symbol: string }; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to an object containing the currency metadata. +A promise that resolves to the transaction result. --- -## isClaimToSupported +## ERC721.mintWithSignature - Checks if the `claimTo` method is supported by the given contract. +Mints a new ERC721 token with the given minter signature This method is only available on the `TokenERC721` contract. ### Example ```ts -import { isClaimToSupported } from "thirdweb/extensions/erc20"; +import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; -const supported = isClaimToSupported(["0x..."]); +const { payload, signature } = await generateMintSignature(...) + +const transaction = mintWithSignature({ + contract, + payload, + signature, +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function isClaimToSupported( - availableSelectors: Array, -): boolean; +function mintWithSignature( + options: BaseTransactionOptions< + | { + payload: { + currency: string; + pricePerToken: bigint; + primarySaleRecipient: string; + quantity: bigint; + royaltyBps: bigint; + royaltyRecipient: string; + to: string; + uid: `0x${string}`; + uri: string; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; + } + | { + payload: { + currency: string; + price: bigint; + primarySaleRecipient: string; + royaltyBps: bigint; + royaltyRecipient: string; + to: string; + uid: `0x${string}`; + uri: string; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; + } + >, +): PreparedTransaction; ``` ### 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. +The transaction options. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | { + payload: { + currency: string; + pricePerToken: bigint; + primarySaleRecipient: string; + quantity: bigint; + royaltyBps: bigint; + royaltyRecipient: string; + to: string; + uid: `0x${string}`; + uri: string; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; + } + | { + payload: { + currency: string; + price: bigint; + primarySaleRecipient: string; + royaltyBps: bigint; + royaltyRecipient: string; + to: string; + uid: `0x${string}`; + uri: string; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; + } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `claimTo` method is supported. +A promise that resolves to the transaction result. --- -## isERC20 +## ERC721.nextTokenIdToMint - Check if a contract is an ERC20 token. +Calls the "nextTokenIdToMint" function on the contract. ### Example ```ts -import { isERC20 } from "thirdweb/extensions/erc20"; -import { resolveContractAbi } from "thirdweb/contract"; - -const abi = await resolveContractAbi(contract); -const selectors = abi - .filter((f) => f.type === "function") - .map((f) => toFunctionSelector(f)); +import { nextTokenIdToMint } from "thirdweb/extensions/erc721"; -const result = await isERC20(selectors); +const result = await nextTokenIdToMint({ + contract, +}); ``` ```ts -function isERC20(availableSelectors: Array): boolean; +function nextTokenIdToMint( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters +The options for the nextTokenIdToMint function. + #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating whether the contract is an ERC20 token. +The parsed result of the function call. --- -## isGetActiveClaimConditionIdSupported +## ERC721.ownerOf - Checks if the `getActiveClaimConditionId` method is supported by the given contract. +Calls the "ownerOf" function on the contract. ### Example ```ts -import { isGetActiveClaimConditionIdSupported } from "thirdweb/extensions/erc20"; -const supported = isGetActiveClaimConditionIdSupported(["0x..."]); +import { ownerOf } from "thirdweb/extensions/erc721"; + +const result = await ownerOf({ + contract, + tokenId: ..., +}); ``` ```ts -function isGetActiveClaimConditionIdSupported( - availableSelectors: Array, -): boolean; +function ownerOf( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the ownerOf function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getActiveClaimConditionId` method is supported. +The parsed result of the function call. --- -## isGetActiveClaimConditionSupported +## ERC721.resetClaimEligibility - Checks if the `getActiveClaimCondition` method is supported by the given contract. +Reset the claim eligibility for all users. This method is only available on the `DropERC721` contract. ### Example ```ts -import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc20"; +import { resetClaimEligibility } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; -const supported = isGetActiveClaimConditionSupported(["0x..."]); +const transaction = resetClaimEligibility({ + contract, +}); + +await sendTransaction({ transaction, account }); ``` ```ts -function isGetActiveClaimConditionSupported( - availableSelectors: Array, -): boolean; +function resetClaimEligibility( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getActiveClaimCondition` method is supported. +the prepared transaction --- -## isGetClaimConditionByIdSupported +## ERC721.reveal - Checks if the `getClaimConditionById` method is supported by the given contract. +Reveals a previously lazy minted batch of NFTs. This method is only available on the `DropERC721` contract. ### Example ```ts -import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc20"; -const supported = isGetClaimConditionByIdSupported(["0x..."]); +import { reveal } from "thirdweb/extensions/erc721"; + +const transaction = await reveal({ + contract: contract, + batchId: 0, + password: "password", +}); + +const { transactionHash } = await sendTransaction({ + transaction, + account, +}); ``` ```ts -function isGetClaimConditionByIdSupported( - availableSelectors: Array, -): boolean; +function reveal( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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. +{RevealParams} - The reveal parameters. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `getClaimConditionById` method is supported. +The prepared transaction to send. --- -## isMintToSupported +## ERC721.setApprovalForAll - Checks if the `mintTo` method is supported by the given contract. +Prepares a transaction to call the "setApprovalForAll" function on the contract. ### Example ```ts -import { isMintToSupported } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; +import { setApprovalForAll } from "thirdweb/extensions/erc721"; -const supported = isMintToSupported(["0x..."]); +const transaction = setApprovalForAll({ + contract, + operator: ..., + approved: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isMintToSupported( - availableSelectors: Array, -): boolean; +function setApprovalForAll( + options: BaseTransactionOptions< + | SetApprovalForAllParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "setApprovalForAll" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + | SetApprovalForAllParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `mintTo` method is supported. +A prepared transaction object. --- -## isResetClaimEligibilitySupported +## ERC721.setClaimConditions - Checks if the `resetClaimEligibility` method is supported by the given contract. +Set the claim conditions for a ERC721 drop This method is only available on the `DropERC721` contract. ### Example ```ts -import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc20"; +import { setClaimConditions } from "thirdweb/extensions/erc721"; +import { sendTransaction } from "thirdweb"; + +const transaction = setClaimConditions({ + contract, + phases: [ + { + maxClaimableSupply: 100n, + maxClaimablePerWallet: 1n, + currencyAddress: "0x...", + price: 0.1, + startTime: new Date(), + }, + ], +}); -const supported = isResetClaimEligibilitySupported(["0x..."]); +await sendTransaction({ transaction, account }); ``` ```ts -function isResetClaimEligibilitySupported( - availableSelectors: Array, -): boolean; +function setClaimConditions( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `resetClaimEligibility` method is supported. +the prepared transaction --- -## isSetClaimConditionsSupported - - Checks if the `setClaimConditions` method is supported by the given contract. - -### Example +## ERC721.setSharedMetadata -```ts -import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc20"; - -const supported = isSetClaimConditionsSupported(["0x..."]); -``` +Sets the shared metadata for a OpenEdition contract. ```ts -function isSetClaimConditionsSupported( - availableSelectors: Array, -): boolean; +function setSharedMetadata( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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. +The options for the transaction. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `setClaimConditions` method is supported. +The prepared transaction. --- -## mintTo +## ERC721.setTokenURI - Mints a specified amount of tokens to a given address. +Prepares a transaction to call the "setTokenURI" function on the contract. ### Example ```ts -import { mintTo } from "thirdweb/extensions/erc20"; import { sendTransaction } from "thirdweb"; +import { setTokenURI } from "thirdweb/extensions/erc721"; -const transaction = mintTo({ - contract, - to: "0x...", - amount: 100, +const transaction = setTokenURI({ + contract, + tokenId: ..., + uri: ..., + overrides: { + ... + } }); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function mintTo( - options: BaseTransactionOptions, +function setTokenURI( + options: BaseTransactionOptions< + | SetTokenURIParams + | { asyncParams: () => Promise } + >, ): PreparedTransaction; ``` ### Parameters - The options for minting tokens. +The options for the "setTokenURI" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | SetTokenURIParams + | { asyncParams: () => Promise } +>; ``` ### Returns @@ -16502,84 +18139,119 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## mintWithSignature +## ERC721.sharedMetadata - Mints a new ERC20 token with the given minter signature +Calls the "sharedMetadata" function on the contract. ### Example ```ts -import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; - -const { payload, signature } = await generateMintSignature(...) +import { sharedMetadata } from "thirdweb/extensions/erc721"; -const transaction = mintWithSignature({ +const result = await sharedMetadata({ contract, - payload, - signature, }); - -await sendTransaction({ transaction, account }); ``` ```ts -function mintWithSignature( - options: BaseTransactionOptions, -): PreparedTransaction; +function sharedMetadata( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The transaction options. +The options for the sharedMetadata function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +The parsed result of the function call. --- -## resetClaimEligibility +## ERC721.sharedMetadataUpdatedEvent - Reset the claim eligibility for all users. +Creates an event object for the SharedMetadataUpdated event. ### Example ```ts -import { resetClaimEligibility } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; +import { getContractEvents } from "thirdweb"; +import { sharedMetadataUpdatedEvent } from "thirdweb/extensions/erc721"; -const transaction = resetClaimEligibility({ +const events = await getContractEvents({ contract, + events: [sharedMetadataUpdatedEvent()], }); +``` + +```ts +function sharedMetadataUpdatedEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "name"; readonly type: "string" }, + { readonly name: "description"; readonly type: "string" }, + { readonly name: "imageURI"; readonly type: "string" }, + { readonly name: "animationURI"; readonly type: "string" }, + ]; + readonly name: "SharedMetadataUpdated"; + readonly type: "event"; +}>; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "name"; readonly type: "string" }, + { readonly name: "description"; readonly type: "string" }, + { readonly name: "imageURI"; readonly type: "string" }, + { readonly name: "animationURI"; readonly type: "string" }, + ]; + readonly name: "SharedMetadataUpdated"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## ERC721.startTokenId + +Calls the "startTokenId" function on the contract. + +### Example + +```ts +import { startTokenId } from "thirdweb/extensions/erc721"; -await sendTransaction({ transaction, account }); +const result = await startTokenId({ + contract, +}); ``` ```ts -function resetClaimEligibility( +function startTokenId( options: BaseTransactionOptions, -): PreparedTransaction; +): Promise; ``` ### Parameters +The options for the startTokenId function. + #### Type ```ts @@ -16589,78 +18261,62 @@ let options: { contract: ThirdwebContract } & T; ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - the prepared transaction +The parsed result of the function call. --- -## setClaimConditions +## ERC721.tokenOfOwnerByIndex - Set the claim conditions for a ERC20 drop +Calls the "tokenOfOwnerByIndex" function on the contract. ### Example ```ts -import { setClaimConditions } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; +import { tokenOfOwnerByIndex } from "thirdweb/extensions/erc721"; -const transaction = setClaimConditions({ - contract, - phases: [ - { - maxClaimableSupply: 100n, - maxClaimablePerWallet: 1n, - currencyAddress: "0x...", - price: 0.1, - startTime: new Date(), - }, - ], +const result = await tokenOfOwnerByIndex({ + contract, + owner: ..., + index: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function setClaimConditions( - options: BaseTransactionOptions, -): PreparedTransaction; +function tokenOfOwnerByIndex( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters +The options for the tokenOfOwnerByIndex function. + #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - the prepared transaction +The parsed result of the function call. --- -## tokensClaimedEvent +## ERC721.tokensClaimedEvent - Creates an event object for the TokensClaimed event. +Creates an event object for the TokensClaimed event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { tokensClaimedEvent } from "thirdweb/extensions/erc20"; +import { tokensClaimedEvent } from "thirdweb/extensions/erc721"; const events = await getContractEvents({ contract, @@ -16676,11 +18332,7 @@ events: [ ```ts function tokensClaimedEvent( - filters: Partial<{ - claimConditionIndex: bigint; - claimer: string; - receiver: string; - }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -16698,6 +18350,7 @@ function tokensClaimedEvent( readonly name: "receiver"; readonly type: "address"; }, + { readonly name: "startTokenId"; readonly type: "uint256" }, { readonly name: "quantityClaimed"; readonly type: "uint256" }, ]; readonly name: "TokensClaimed"; @@ -16707,16 +18360,12 @@ function tokensClaimedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - claimConditionIndex: bigint; - claimer: string; - receiver: string; -}>; +let filters: Partial; ``` ### Returns @@ -16739,6 +18388,7 @@ let returnType: PreparedEvent<{ readonly name: "receiver"; readonly type: "address"; }, + { readonly name: "startTokenId"; readonly type: "uint256" }, { readonly name: "quantityClaimed"; readonly type: "uint256" }, ]; readonly name: "TokensClaimed"; @@ -16746,54 +18396,56 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## tokensMintedEvent +## ERC721.tokensLazyMintedEvent - Creates an event object for the TokensMinted event. +Creates an event object for the TokensLazyMinted event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { tokensMintedEvent } from "thirdweb/extensions/erc20"; +import { tokensLazyMintedEvent } from "thirdweb/extensions/erc721"; const events = await getContractEvents({ contract, events: [ - tokensMintedEvent({ - mintedTo: ..., + tokensLazyMintedEvent({ + startTokenId: ..., }) ], }); ``` ```ts -function tokensMintedEvent( - filters: Partial<{ mintedTo: string }>, +function tokensLazyMintedEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "mintedTo"; - readonly type: "address"; + readonly name: "startTokenId"; + readonly type: "uint256"; }, - { readonly name: "quantityMinted"; readonly type: "uint256" }, + { readonly name: "endTokenId"; readonly type: "uint256" }, + { readonly name: "baseURI"; readonly type: "string" }, + { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, ]; - readonly name: "TokensMinted"; + readonly name: "TokensLazyMinted"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ mintedTo: string }>; +let filters: Partial; ``` ### Returns @@ -16803,28 +18455,30 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "mintedTo"; - readonly type: "address"; + readonly name: "startTokenId"; + readonly type: "uint256"; }, - { readonly name: "quantityMinted"; readonly type: "uint256" }, + { readonly name: "endTokenId"; readonly type: "uint256" }, + { readonly name: "baseURI"; readonly type: "string" }, + { readonly name: "encryptedBaseURI"; readonly type: "bytes" }, ]; - readonly name: "TokensMinted"; + readonly name: "TokensLazyMinted"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## tokensMintedWithSignatureEvent +## ERC721.tokensMintedWithSignatureEvent - Creates an event object for the TokensMintedWithSignature event. +Creates an event object for the TokensMintedWithSignature event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc20"; +import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc721"; const events = await getContractEvents({ contract, @@ -16832,6 +18486,7 @@ events: [ tokensMintedWithSignatureEvent({ signer: ..., mintedTo: ..., + tokenIdMinted: ..., }) ], }); @@ -16839,7 +18494,7 @@ events: [ ```ts function tokensMintedWithSignatureEvent( - filters: Partial<{ mintedTo: string; signer: string }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -16852,14 +18507,24 @@ function tokensMintedWithSignatureEvent( readonly name: "mintedTo"; readonly type: "address"; }, + { + readonly indexed: true; + readonly name: "tokenIdMinted"; + readonly type: "uint256"; + }, { readonly components: readonly [ { readonly name: "to"; readonly type: "address" }, + { + readonly name: "royaltyRecipient"; + readonly type: "address"; + }, + { readonly name: "royaltyBps"; readonly type: "uint256" }, { readonly name: "primarySaleRecipient"; readonly type: "address"; }, - { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "uri"; readonly type: "string" }, { readonly name: "price"; readonly type: "uint256" }, { readonly name: "currency"; readonly type: "address" }, { @@ -16872,7 +18537,7 @@ function tokensMintedWithSignatureEvent( }, { readonly name: "uid"; readonly type: "bytes32" }, ]; - readonly name: "mintRequest"; + readonly name: "mintpayload"; readonly type: "tuple"; }, ]; @@ -16883,12 +18548,12 @@ function tokensMintedWithSignatureEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ mintedTo: string; signer: string }>; +let filters: Partial; ``` ### Returns @@ -16906,14 +18571,24 @@ let returnType: PreparedEvent<{ readonly name: "mintedTo"; readonly type: "address"; }, + { + readonly indexed: true; + readonly name: "tokenIdMinted"; + readonly type: "uint256"; + }, { readonly components: readonly [ { readonly name: "to"; readonly type: "address" }, + { + readonly name: "royaltyRecipient"; + readonly type: "address"; + }, + { readonly name: "royaltyBps"; readonly type: "uint256" }, { readonly name: "primarySaleRecipient"; readonly type: "address"; }, - { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "uri"; readonly type: "string" }, { readonly name: "price"; readonly type: "uint256" }, { readonly name: "currency"; readonly type: "address" }, { @@ -16926,7 +18601,7 @@ let returnType: PreparedEvent<{ }, { readonly name: "uid"; readonly type: "bytes32" }, ]; - readonly name: "mintRequest"; + readonly name: "mintpayload"; readonly type: "tuple"; }, ]; @@ -16935,216 +18610,132 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## totalSupply +## ERC721.tokensOfOwner - Calls the "totalSupply" function on the contract. +Calls the "tokensOfOwner" function on the contract. ### Example ```ts -import { totalSupply } from "thirdweb/extensions/erc20"; - -const result = await totalSupply({ - contract, -}); -``` - -```ts -function totalSupply( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the totalSupply function. - -#### Type - -```ts -let options: { contract: ThirdwebContract } & T; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - The parsed result of the function call. ---- - -## transfer - - Transfers ERC20 tokens from the sender's address to the specified recipient address. - -### Example - -```ts -import { transfer } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; +import { tokensOfOwner } from "thirdweb/extensions/erc721"; -const transaction = transfer({ - contract, - to: "0x...", - amount: 100, +const result = await tokensOfOwner({ + contract, + owner: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function transfer( - options: BaseTransactionOptions, -): PreparedTransaction; +function tokensOfOwner(options: BaseTransactionOptions) : Promise> ``` ### Parameters - The options for the transfer transaction. +The options for the tokensOfOwner function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise> ``` - A promise that resolves to the prepared transaction. +The parsed result of the function call. --- -## transferBatch +## ERC721.tokenURI - Transfers a batch of ERC20 tokens from the sender's address to the specified recipient address. +Calls the "tokenURI" function on the contract. ### Example ```ts -import { transferBatch } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; +import { tokenURI } from "thirdweb/extensions/erc721"; -const transaction = transferBatch({ +const result = await tokenURI({ contract, - batch: [ - { - to: "0x...", - amount: 100, - }, - { - to: "0x...", - amount: "0.1", - }, -]); - -await sendTransaction({ transaction, account }); + tokenId: ..., +}); ``` ```ts -function transferBatch( - options: BaseTransactionOptions<{ - batch: Array< - { to: string } & ( - | { amount: string | number } - | { amountWei: bigint } - ) - >; - }>, -): PreparedTransaction; +function tokenURI( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the batch transfer transaction. +The options for the tokenURI function. #### Type ```ts -let options: BaseTransactionOptions<{ - batch: Array< - { to: string } & ( - | { amount: string | number } - | { amountWei: bigint } - ) - >; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the prepared transaction. +The parsed result of the function call. --- -## transferEvent +## ERC721.tokenURIRevealedEvent - Creates an event object for the Transfer event. +Creates an event object for the TokenURIRevealed event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { transferEvent } from "thirdweb/extensions/erc20"; +import { tokenURIRevealedEvent } from "thirdweb/extensions/erc721"; const events = await getContractEvents({ contract, events: [ - transferEvent({ - from: ..., - to: ..., + tokenURIRevealedEvent({ + index: ..., }) ], }); ``` ```ts -function transferEvent( - filters: Partial<{ from: string; to: string }>, +function tokenURIRevealedEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; + readonly name: "index"; + readonly type: "uint256"; }, - { readonly name: "value"; readonly type: "uint256" }, + { readonly name: "revealedURI"; readonly type: "string" }, ]; - readonly name: "Transfer"; + readonly name: "TokenURIRevealed"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ from: string; to: string }>; +let filters: Partial; ``` ### Returns @@ -17154,182 +18745,114 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; + readonly name: "index"; + readonly type: "uint256"; }, - { readonly name: "value"; readonly type: "uint256" }, + { readonly name: "revealedURI"; readonly type: "string" }, ]; - readonly name: "Transfer"; + readonly name: "TokenURIRevealed"; readonly type: "event"; }>; ``` - The prepared event object. ---- - -## transferFrom - - Transfers a specified amount of tokens from one address to another address on the ERC20 contract. - -### Example - -```ts -import { transferFrom } from "thirdweb/extensions/erc20"; -import { sendTransaction } from "thirdweb"; - -const transaction = transferFrom({ - contract: USDC_CONTRACT, - from: "0x1234...", - to: "0x5678...", - amount: 100, -}); - -await sendTransaction({ transaction, account }); -``` - -```ts -function transferFrom( - options: BaseTransactionOptions, -): PreparedTransaction; -``` - -### Parameters - - The transaction options including from, to, amount, and gas price. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; -``` - - A promise that resolves to the prepared transaction object. +The prepared event object. --- -## withdraw +## ERC721.totalSupply - Prepares a transaction to call the "withdraw" function on the contract. +Calls the "totalSupply" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { withdraw } from "thirdweb/extensions/erc20"; +import { totalSupply } from "thirdweb/extensions/erc721"; -const transaction = withdraw({ - contract, - amount: ..., - overrides: { - ... - } +const result = await totalSupply({ + contract, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function withdraw( - options: BaseTransactionOptions< - WithdrawParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function totalSupply( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "withdraw" function. +The options for the totalSupply function. #### Type ```ts -let options: BaseTransactionOptions< - WithdrawParams | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. ---- -## ERC4337 +The parsed result of the function call. --- -## accountDeployedEvent +## ERC721.transferEvent - Creates an event object for the AccountDeployed event. +Creates an event object for the Transfer event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { accountDeployedEvent } from "thirdweb/extensions/erc4337"; +import { transferEvent } from "thirdweb/extensions/erc721"; const events = await getContractEvents({ contract, events: [ - accountDeployedEvent({ - userOpHash: ..., - sender: ..., + transferEvent({ + from: ..., + to: ..., + tokenId: ..., }) ], }); ``` ```ts -function accountDeployedEvent( - filters: Partial<{ sender: string; userOpHash: `0x${string}` }>, +function transferEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "userOpHash"; - readonly type: "bytes32"; + readonly name: "from"; + readonly type: "address"; }, { readonly indexed: true; - readonly name: "sender"; + readonly name: "to"; readonly type: "address"; }, - { readonly name: "factory"; readonly type: "address" }, - { readonly name: "paymaster"; readonly type: "address" }, + { + readonly indexed: true; + readonly name: "tokenId"; + readonly type: "uint256"; + }, ]; - readonly name: "AccountDeployed"; + readonly name: "Transfer"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ sender: string; userOpHash: `0x${string}` }>; +let filters: Partial; ``` ### Returns @@ -17339,58 +18862,72 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "userOpHash"; - readonly type: "bytes32"; + readonly name: "from"; + readonly type: "address"; }, { readonly indexed: true; - readonly name: "sender"; + readonly name: "to"; readonly type: "address"; }, - { readonly name: "factory"; readonly type: "address" }, - { readonly name: "paymaster"; readonly type: "address" }, + { + readonly indexed: true; + readonly name: "tokenId"; + readonly type: "uint256"; + }, ]; - readonly name: "AccountDeployed"; + readonly name: "Transfer"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## addAdmin +## ERC721.transferFrom - Adds admin permissions for a specified address. +Prepares a transaction to call the "transferFrom" function on the contract. ### Example ```ts -import { addAdmin } from "thirdweb/extensions/erc4337"; import { sendTransaction } from "thirdweb"; +import { transferFrom } from "thirdweb/extensions/erc721"; -const transaction = addAdmin({ - contract, - account, - adminAddress: "0x...", +const transaction = transferFrom({ + contract, + from: ..., + to: ..., + tokenId: ..., + overrides: { + ... + } }); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function addAdmin( - options: BaseTransactionOptions, +function transferFrom( + options: BaseTransactionOptions< + | TransferFromParams + | { asyncParams: () => Promise } + >, ): PreparedTransaction; ``` ### Parameters - The options for the addAdmin function. +The options for the "transferFrom" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | TransferFromParams + | { asyncParams: () => Promise } +>; ``` ### Returns @@ -17403,50 +18940,43 @@ let returnType: PreparedTransaction< >; ``` - The transaction object to be sent. +A prepared transaction object. --- -## addSessionKey +## ERC721.updateMetadata - Adds session key permissions for a specified address. +Update the metadata of the single token in an NFT Drop (DropERC721) collection For NFT Collection, please use `setTokenURI` ### Example ```ts -import { addSessionKey } from "thirdweb/extensions/erc4337"; -import { sendTransaction } from "thirdweb"; +import { updateMetadata } from "thirdweb/extensions/erc721"; -const transaction = addSessionKey({ +const transaction = updateMetadata({ contract, - account, - sessionKeyAddress, - permissions: { - approvedTargets: ["0x..."], - nativeTokenLimitPerTransaction: 0.1, // in ETH - permissionStartTimestamp: new Date(), - permissionEndTimestamp: new Date( - Date.now() + 1000 * 60 * 60 * 24 * 365, - ), // 1 year from now + targetTokenId: 0n, + client: thirdwebClient, + newMetadata: { + name: "this is the new nft name", + description: "...", + image: "new image uri", + // ... }, }); - -await sendTransaction({ transaction, account }); ``` ```ts -function addSessionKey( - options: BaseTransactionOptions, +function updateMetadata( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the removeSessionKey function. - #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -17459,943 +18989,1197 @@ let returnType: PreparedTransaction< >; ``` - The transaction object to be sent. +the prepared transaction --- -## adminUpdatedEvent +## ERC721.updateTokenURI - Creates an event object for the AdminUpdated event. +This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI), which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput), upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method. + +This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update. This method is only available on the `TokenERC721` contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { adminUpdatedEvent } from "thirdweb/extensions/erc4337"; +import { updateTokenURI } from "thirdweb/extensions/erc721"; -const events = await getContractEvents({ -contract, -events: [ - adminUpdatedEvent({ - signer: ..., -}) -], +const transaction = updateTokenURI({ + tokenId: 0n, + nft: { + name: "new name", + description: "new description", + image: "https://image-host.com/new-image.png", + }, }); ``` ```ts -function adminUpdatedEvent( - filters: Partial<{ signer: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "signer"; - readonly type: "address"; - }, - { readonly name: "isAdmin"; readonly type: "bool" }, - ]; - readonly name: "AdminUpdated"; - readonly type: "event"; -}>; +function updateTokenURI( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - Optional filters to apply to the event. - #### Type ```ts -let filters: Partial<{ signer: string }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "signer"; - readonly type: "address"; - }, - { readonly name: "isAdmin"; readonly type: "bool" }, - ]; - readonly name: "AdminUpdated"; - readonly type: "event"; -}>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The prepared event object. +the prepared transaction from `setTokenURI` +--- +## ERC1271 --- -## createAccount +## ERC1271.checkContractWalletSignature + +Deprecated + +Use `verifySignature` instead - Prepares a transaction to call the "createAccount" function on the contract. +Checks if a contract wallet signature is valid. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { createAccount } from "thirdweb/extensions/erc4337"; - -const transaction = createAccount({ - contract, - admin: ..., - data: ..., - overrides: { - ... - } +import { checkContractWalletSignature } from "thirdweb/extensions/erc1271"; +const isValid = await checkContractWalletSignature({ + contract: myContract, + message: "hello world", + signature: "0x...", }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function createAccount( - options: BaseTransactionOptions< - | CreateAccountParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function checkContractWalletSignature( + options: CheckContractWalletSignatureOptions, +): Promise; ``` ### Parameters - The options for the "createAccount" function. +The options for the checkContractWalletSignature function. #### Type ```ts -let options: BaseTransactionOptions< - | CreateAccountParams - | { asyncParams: () => Promise } ->; +let options: { + contract: ThirdwebContract; + message: SignableMessage; + signature: string; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +A promise that resolves with a boolean indicating if the signature is valid. --- -## getAccounts +## ERC1271.checkContractWalletSignedTypedData + +Deprecated + +Use `verifyTypedData` instead - Calls the "getAccounts" function on the contract. +Checks if a contract wallet signature is valid. ### Example ```ts -import { getAccounts } from "thirdweb/extensions/erc4337"; - -const result = await getAccounts({ - contract, - start: ..., - end: ..., +import { checkContractWalletSignedTypedData } from "thirdweb/extensions/erc1271"; +const isValid = await checkContractWalletSignedTypedData({ + contract: myContract, + data: { + primaryType: "EIP712Domain", + domain: { + name: "Example", + version: "1", + chainId: 1, + verifyingContract: myContract.address, + }, }); ``` ```ts -function getAccounts(options: BaseTransactionOptions) : Promise> +function checkContractWalletSignedTypedData( + options: CheckContractWalletSignTypedDataOptions< + typedData, + primaryType + >, +): Promise; ``` ### Parameters - The options for the getAccounts function. +The options for the checkContractWalletSignature function. #### Type ```ts -let options: BaseTransactionOptions; +let options: CheckContractWalletSignTypedDataOptions< + typedData, + primaryType +>; ``` ### Returns ```ts -let returnType: Promise> +let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves with a boolean indicating if the signature is valid. +--- +## ERC20 --- -## getAccountsOfSigner +## ERC20.allowance - Calls the "getAccountsOfSigner" function on the contract. +Calls the "allowance" function on the contract. ### Example ```ts -import { getAccountsOfSigner } from "thirdweb/extensions/erc4337"; +import { allowance } from "thirdweb/extensions/erc20"; -const result = await getAccountsOfSigner({ +const result = await allowance({ contract, - signer: ..., + owner: ..., + spender: ..., }); ``` ```ts -function getAccountsOfSigner(options: BaseTransactionOptions) : Promise> +function allowance( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the getAccountsOfSigner function. +The options for the allowance function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise> +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getAllAccounts +## ERC20.approvalEvent - Calls the "getAllAccounts" function on the contract. +Creates an event object for the Approval event. ### Example ```ts -import { getAllAccounts } from "thirdweb/extensions/erc4337"; +import { getContractEvents } from "thirdweb"; +import { approvalEvent } from "thirdweb/extensions/erc20"; -const result = await getAllAccounts({ - contract, +const events = await getContractEvents({ +contract, +events: [ + approvalEvent({ + owner: ..., + spender: ..., +}) +], }); ``` ```ts -function getAllAccounts(options: BaseTransactionOptions) : Promise> +function approvalEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "spender"; + readonly type: "address"; + }, + { readonly name: "value"; readonly type: "uint256" }, + ]; + readonly name: "Approval"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the getAllAccounts function. +Optional filters to apply to the event. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise> +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "spender"; + readonly type: "address"; + }, + { readonly name: "value"; readonly type: "uint256" }, + ]; + readonly name: "Approval"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getAllActiveSigners +## ERC20.approve - Calls the "getAllActiveSigners" function on the contract. +Approves the spending of tokens by a specific address. ### Example ```ts -import { getAllActiveSigners } from "thirdweb/extensions/erc4337"; +import { approve } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; -const result = await getAllActiveSigners({ +const transaction = await approve({ contract, + spender: "0x...", + amount: 100, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function getAllActiveSigners(options: BaseTransactionOptions) : Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> +function approve( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the getAllActiveSigners function. +The transaction options. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getAllAdmins +## ERC20.balanceOf - Calls the "getAllAdmins" function on the contract. +Calls the "balanceOf" function on the contract. ### Example ```ts -import { getAllAdmins } from "thirdweb/extensions/erc4337"; +import { balanceOf } from "thirdweb/extensions/erc20"; -const result = await getAllAdmins({ - contract, +const result = await balanceOf({ + contract, + address: ..., }); ``` ```ts -function getAllAdmins(options: BaseTransactionOptions) : Promise> +function balanceOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the getAllAdmins function. +The options for the balanceOf function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise> +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getAllSigners +## ERC20.burn - Calls the "getAllSigners" function on the contract. +Prepares a transaction to call the "burn" function on the contract. ### Example ```ts -import { getAllSigners } from "thirdweb/extensions/erc4337"; +import { sendTransaction } from "thirdweb"; +import { burn } from "thirdweb/extensions/erc20"; -const result = await getAllSigners({ - contract, +const transaction = burn({ + contract, + amount: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getAllSigners(options: BaseTransactionOptions) : Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> +function burn( + options: BaseTransactionOptions< + BurnParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the getAllSigners function. +The options for the "burn" function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions< + BurnParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getPermissionsForSigner +## ERC20.burnFrom - Calls the "getPermissionsForSigner" function on the contract. +Prepares a transaction to call the "burnFrom" function on the contract. ### Example ```ts -import { getPermissionsForSigner } from "thirdweb/extensions/erc4337"; +import { sendTransaction } from "thirdweb"; +import { burnFrom } from "thirdweb/extensions/erc20"; -const result = await getPermissionsForSigner({ +const transaction = burnFrom({ contract, - signer: ..., + account: ..., + amount: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getPermissionsForSigner(options: BaseTransactionOptions) : Promise<{ approvedTargets: readonly Array; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }> +function burnFrom( + options: BaseTransactionOptions< + BurnFromParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the getPermissionsForSigner function. +The options for the "burnFrom" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + BurnFromParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise<{ approvedTargets: readonly Array; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }> +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getUserOpHash +## ERC20.canClaim - Calls the "getUserOpHash" function on the contract. +Check if a user can claim a drop. This method is only available on the `DropERC20` contract. ### Example ```ts -import { getUserOpHash } from "thirdweb/extensions/erc4337"; - -const result = await getUserOpHash({ - contract, - userOp: ..., +const claimResult = await canClaim({ + contract: contract, + claimer: "0x1234567890123456789012345678901234567890", + quantity: "1", }); ``` ```ts -function getUserOpHash( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function canClaim( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the getUserOpHash function. +The options for the transaction. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: { reason?: string; result: boolean }; ``` - The parsed result of the function call. +Whether the user can claim the drop. --- -## isAccountDeployed +## ERC20.claimConditionsUpdatedEvent - Adds admin permissions for a specified address. +Creates an event object for the ClaimConditionsUpdated event. ### Example ```ts -import { isAccountDeployed } from "thirdweb/extensions/erc4337"; +import { getContractEvents } from "thirdweb"; +import { claimConditionsUpdatedEvent } from "thirdweb/extensions/erc20"; -const transaction = addAdmin({ +const events = await getContractEvents({ contract, - account, - adminAddress: "0x...", + events: [claimConditionsUpdatedEvent()], }); - -await isAccountDeployed({ contract, adminSigner }); -``` - -```ts -function isAccountDeployed( - options: BaseTransactionOptions, -): Promise; ``` -### Parameters - - The options for the addAdmin function. - -#### Type - ```ts -let options: BaseTransactionOptions; +function claimConditionsUpdatedEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly components: readonly [ + { readonly name: "startTimestamp"; readonly type: "uint256" }, + { + readonly name: "maxClaimableSupply"; + readonly type: "uint256"; + }, + { readonly name: "supplyClaimed"; readonly type: "uint256" }, + { + readonly name: "quantityLimitPerWallet"; + readonly type: "uint256"; + }, + { readonly name: "merkleRoot"; readonly type: "bytes32" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "metadata"; readonly type: "string" }, + ]; + readonly name: "claimConditions"; + readonly type: "tuple[]"; + }, + { readonly name: "resetEligibility"; readonly type: "bool" }, + ]; + readonly name: "ClaimConditionsUpdated"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly components: readonly [ + { readonly name: "startTimestamp"; readonly type: "uint256" }, + { + readonly name: "maxClaimableSupply"; + readonly type: "uint256"; + }, + { readonly name: "supplyClaimed"; readonly type: "uint256" }, + { + readonly name: "quantityLimitPerWallet"; + readonly type: "uint256"; + }, + { readonly name: "merkleRoot"; readonly type: "bytes32" }, + { readonly name: "pricePerToken"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { readonly name: "metadata"; readonly type: "string" }, + ]; + readonly name: "claimConditions"; + readonly type: "tuple[]"; + }, + { readonly name: "resetEligibility"; readonly type: "bool" }, + ]; + readonly name: "ClaimConditionsUpdated"; + readonly type: "event"; +}>; ``` - The transaction object to be sent. +The prepared event object. --- -## isActiveSigner +## ERC20.claimTo - Calls the "isActiveSigner" function on the contract. +Claim ERC20 NFTs to a specified address This method is only available on the `DropERC20` contract. ### Example +#### Basic usage + ```ts -import { isActiveSigner } from "thirdweb/extensions/erc4337"; +import { claimTo } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; -const result = await isActiveSigner({ - contract, - signer: ..., +const transaction = claimTo({ + contract, + to: "0x...", + quantity: 100n, +}); + +await sendTransaction({ transaction, account }); +``` + +#### For Drops with allowlists + +You need to specify the claimer address as the `from` param to avoid any issue with the allowlist + +```ts +const transaction = claimTo({ + contract, + to: "0x...", + quantity: 100n, + from: "0x...", // address of the one claiming }); ``` ```ts -function isActiveSigner( - options: BaseTransactionOptions, -): Promise; +function claimTo( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the isActiveSigner function. +The options for the transaction #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A promise that resolves with the submitted transaction hash. --- -## isAddAdminSupported +## ERC20.decimals - Checks if the `isAddAdminSupported` method is supported by the given contract. +Retrieves the number of decimal places for a given ERC20 contract. ### Example ```ts -import { isAddAdminSupported } from "thirdweb/extensions/erc4337"; +import { decimals } from "thirdweb/extensions/erc20"; -const supported = isAddAdminSupported(["0x..."]); +const tokenDecimals = await decimals({ contract }); ``` ```ts -function isAddAdminSupported( - availableSelectors: Array, -): boolean; +function decimals(options: BaseTransactionOptions): Promise; ``` ### 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. +The options for the transaction. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `isAddAdminSupported` method is supported. +A promise that resolves to the number of decimal places. --- -## isAddSessionKeySupported +## ERC20.delegate - Checks if the `isAddSessionKeySupported` method is supported by the given contract. +Prepares a transaction to call the "delegate" function on the contract. ### Example ```ts -import { isAddSessionKeySupported } from "thirdweb/extensions/erc4337"; +import { sendTransaction } from "thirdweb"; +import { delegate } from "thirdweb/extensions/erc20"; -const supported = isAddSessionKeySupported(["0x..."]); +const transaction = delegate({ + contract, + delegatee: ..., + overrides: { + ... + } +}); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isAddSessionKeySupported( - availableSelectors: Array, -): boolean; +function delegate( + options: BaseTransactionOptions< + DelegateParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### 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. +The options for the "delegate" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions< + DelegateParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `isAddSessionKeySupported` method is supported. +A prepared transaction object. --- -## isAdmin +## ERC20.delegates - Calls the "isAdmin" function on the contract. +Calls the "delegates" function on the contract. ### Example ```ts -import { isAdmin } from "thirdweb/extensions/erc4337"; +import { delegates } from "thirdweb/extensions/erc20"; -const result = await isAdmin({ +const result = await delegates({ contract, - signer: ..., + account: ..., }); ``` ```ts -function isAdmin( - options: BaseTransactionOptions, -): Promise; +function delegates( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the isAdmin function. +The options for the delegates function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isCreateAccountSupported +## ERC20.deposit - Checks if the `createAccount` method is supported by the given contract. +Calls the "deposit" function on the contract (useful to wrap ETH). ### Example ```ts -import { isCreateAccountSupported } from "thirdweb/extensions/erc4337"; +import { deposit } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; -const supported = isCreateAccountSupported(["0x..."]); +const transaction = deposit({ contract, amount: "0.1" }); + +await sendTransaction({ transaction, account }); ``` ```ts -function isCreateAccountSupported( - availableSelectors: Array, -): boolean; +function deposit( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### 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. +The options for the "deposit" function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A boolean indicating if the `createAccount` method is supported. +A prepared transaction object. --- -## isGetAccountsOfSignerSupported +## ERC20.generateMintSignature - Checks if the `getAccountsOfSigner` method is supported by the given contract. +Generates the payload and signature for minting an ERC20 token. ### Example ```ts -import { isGetAccountsOfSignerSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAccountsOfSignerSupported(["0x..."]); +import { + mintWithSignature, + generateMintSignature, +} from "thirdweb/extensions/erc20"; + +const { payload, signature } = await generateMintSignature({ + account, + contract, + mintRequest: { + to: "0x...", + quantity: "10", + }, +}); + +const transaction = mintWithSignature({ + contract, + payload, + signature, +}); +await sendTransaction({ transaction, account }); ``` ```ts -function isGetAccountsOfSignerSupported( - availableSelectors: Array, -): boolean; +function generateMintSignature( + options: GenerateMintSignatureOptions, +): Promise<{ + payload: { + currency: string; + price: bigint; + primarySaleRecipient: string; + quantity: bigint; + to: string; + uid: `0x${string}`; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; +}>; ``` ### Parameters - 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. +The options for the minting process. #### Type ```ts -let availableSelectors: Array; +let options: { + account: Account; + contract: ThirdwebContract; + contractType?: "TokenERC1155" | "SignatureMintERC1155"; + mintRequest: GeneratePayloadInput; +}; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise<{ + payload: { + currency: string; + price: bigint; + primarySaleRecipient: string; + quantity: bigint; + to: string; + uid: `0x${string}`; + validityEndTimestamp: bigint; + validityStartTimestamp: bigint; + }; + signature: `0x${string}`; +}>; ``` - A boolean indicating if the `getAccountsOfSigner` method is supported. +A promise that resolves to the payload and signature. --- -## isGetAccountsSupported +## ERC20.getActiveClaimCondition - Checks if the `getAccounts` method is supported by the given contract. +Retrieves the active claim condition. This method is only available on the `DropERC20` contract. ### Example ```ts -import { isGetAccountsSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAccountsSupported(["0x..."]); +import { getActiveClaimCondition } from "thirdweb/extensions/erc20"; +const activeClaimCondition = await getActiveClaimCondition({ + contract, +}); ``` ```ts -function isGetAccountsSupported( - availableSelectors: Array, -): boolean; +function getActiveClaimCondition( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The transaction options. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getAccounts` method is supported. +A promise that resolves to the active claim condition. --- -## isGetAllAccountsSupported +## ERC20.getActiveClaimConditionId - Checks if the `getAllAccounts` method is supported by the given contract. +Calls the "getActiveClaimConditionId" function on the contract. ### Example ```ts -import { isGetAllAccountsSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAllAccountsSupported(["0x..."]); +import { getActiveClaimConditionId } from "thirdweb/extensions/erc20"; + +const result = await getActiveClaimConditionId({ + contract, +}); ``` ```ts -function isGetAllAccountsSupported( - availableSelectors: Array, -): boolean; +function getActiveClaimConditionId( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getActiveClaimConditionId function. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getAllAccounts` method is supported. +The parsed result of the function call. --- -## isGetAllActiveSignersSupported +## ERC20.getBalance - Checks if the `getAllActiveSigners` method is supported by the given contract. +Retrieves the balance of an ERC20 token for a specific address. ### Example ```ts -import { isGetAllActiveSignersSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAllActiveSignersSupported(["0x..."]); +import { getBalance } from "thirdweb/extensions/erc20"; + +const balance = await getBalance({ contract, address: "0x..." }); ``` ```ts -function isGetAllActiveSignersSupported( - availableSelectors: Array, -): boolean; +function getBalance( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The transaction options including the address. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: { + chainId: number; + decimals: number; + displayValue: string; + name: string; + symbol: string; + tokenAddress: string; + value: bigint; +}; ``` - A boolean indicating if the `getAllActiveSigners` method is supported. +An object containing the balance value, display value, and symbol. --- -## isGetAllAdminsSupported +## ERC20.getClaimConditionById - Checks if the `getAllAdmins` method is supported by the given contract. +Calls the "getClaimConditionById" function on the contract. ### Example ```ts -import { isGetAllAdminsSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAllAdminsSupported(["0x..."]); +import { getClaimConditionById } from "thirdweb/extensions/erc20"; + +const result = await getClaimConditionById({ + contract, + conditionId: ..., +}); ``` ```ts -function isGetAllAdminsSupported( - availableSelectors: Array, -): boolean; +function getClaimConditionById( + options: BaseTransactionOptions, +): Promise<{ + currency: string; + maxClaimableSupply: bigint; + merkleRoot: `0x${string}`; + metadata: string; + pricePerToken: bigint; + quantityLimitPerWallet: bigint; + startTimestamp: bigint; + supplyClaimed: bigint; +}>; ``` ### 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. +The options for the getClaimConditionById function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise<{ + currency: string; + maxClaimableSupply: bigint; + merkleRoot: `0x${string}`; + metadata: string; + pricePerToken: bigint; + quantityLimitPerWallet: bigint; + startTimestamp: bigint; + supplyClaimed: bigint; +}>; ``` - A boolean indicating if the `getAllAdmins` method is supported. +The parsed result of the function call. --- -## isGetAllSignersSupported +## ERC20.getClaimConditions - Checks if the `getAllSigners` method is supported by the given contract. +Retrieves all claim conditions. This method is only available on the `DropERC20` contract. ### Example ```ts -import { isGetAllSignersSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAllSignersSupported(["0x..."]); +import { getClaimConditions } from "thirdweb/extensions/erc20"; +const conditions = await getClaimConditions({ contract }); ``` ```ts -function isGetAllSignersSupported( - availableSelectors: Array, -): boolean; +function getClaimConditions( + options: BaseTransactionOptions, +): Promise>; ``` ### 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. +The transaction options. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise>; ``` - A boolean indicating if the `getAllSigners` method is supported. +A promise that resolves to all claim conditions. --- -## isIsAccountDeployedSupported +## ERC20.getCurrencyMetadata - Checks if the `getAddress` method is supported by the given contract. +Retrieves the metadata of a currency. ### Example ```ts -import { isGetAddressSupported } from "thirdweb/extensions/erc4337"; -const supported = isGetAddressSupported(["0x..."]); +import { getCurrencyMetadata } from "thirdweb/extensions/erc20"; + +const currencyMetadata = await getCurrencyMetadata({ contract }); ``` ```ts -function isIsAccountDeployedSupported( - availableSelectors: Array, -): boolean; +function getCurrencyMetadata( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the transaction. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: { decimals: number; name: string; symbol: string }; ``` - A boolean indicating if the `getAddress` method is supported. +A promise that resolves to an object containing the currency metadata. --- -## isIsActiveSignerSupported +## ERC20.isClaimToSupported - Checks if the `isActiveSigner` method is supported by the given contract. +Checks if the `claimTo` method is supported by the given contract. ### Example ```ts -import { isIsActiveSignerSupported } from "thirdweb/extensions/erc4337"; -const supported = isIsActiveSignerSupported(["0x..."]); +import { isClaimToSupported } from "thirdweb/extensions/erc20"; + +const supported = isClaimToSupported(["0x..."]); ``` ```ts -function isIsActiveSignerSupported( +function isClaimToSupported( 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. +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 @@ -18409,30 +20193,33 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `isActiveSigner` method is supported. +A boolean indicating if the `claimTo` method is supported. --- -## isIsAdminSupported +## ERC20.isERC20 - Checks if the `isAdmin` method is supported by the given contract. +Check if a contract is an ERC20 token. ### Example ```ts -import { isIsAdminSupported } from "thirdweb/extensions/erc4337"; -const supported = isIsAdminSupported(["0x..."]); +import { isERC20 } from "thirdweb/extensions/erc20"; +import { resolveContractAbi } from "thirdweb/contract"; + +const abi = await resolveContractAbi(contract); +const selectors = abi + .filter((f) => f.type === "function") + .map((f) => toFunctionSelector(f)); + +const result = await isERC20(selectors); ``` ```ts -function isIsAdminSupported( - availableSelectors: Array, -): boolean; +function isERC20(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 @@ -18445,70 +20232,66 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `isAdmin` method is supported. +A boolean indicating whether the contract is an ERC20 token. --- -## isRegistered +## ERC20.isGetActiveClaimConditionIdSupported - Calls the "isRegistered" function on the contract. +Checks if the `getActiveClaimConditionId` method is supported by the given contract. ### Example ```ts -import { isRegistered } from "thirdweb/extensions/erc4337"; - -const result = await isRegistered({ - contract, - account: ..., -}); +import { isGetActiveClaimConditionIdSupported } from "thirdweb/extensions/erc20"; +const supported = isGetActiveClaimConditionIdSupported(["0x..."]); ``` ```ts -function isRegistered( - options: BaseTransactionOptions, -): Promise; +function isGetActiveClaimConditionIdSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the isRegistered function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `getActiveClaimConditionId` method is supported. --- -## isRemoveAdminSupported +## ERC20.isGetActiveClaimConditionSupported - Checks if the `isRemoveAdminSupported` method is supported by the given contract. +Checks if the `getActiveClaimCondition` method is supported by the given contract. ### Example ```ts -import { isRemoveAdminSupported } from "thirdweb/extensions/erc4337"; +import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc20"; -const supported = isRemoveAdminSupported(["0x..."]); +const supported = isGetActiveClaimConditionSupported(["0x..."]); ``` ```ts -function isRemoveAdminSupported( +function isGetActiveClaimConditionSupported( 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. +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 @@ -18522,30 +20305,29 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `isRemoveAdminSupported` method is supported. +A boolean indicating if the `getActiveClaimCondition` method is supported. --- -## isRemoveSessionKeySupported +## ERC20.isGetClaimConditionByIdSupported - Checks if the `isRemoveSessionKeySupported` method is supported by the given contract. +Checks if the `getClaimConditionById` method is supported by the given contract. ### Example ```ts -import { isRemoveSessionKeySupported } from "thirdweb/extensions/erc4337"; - -const supported = isRemoveSessionKeySupported(["0x..."]); +import { isGetClaimConditionByIdSupported } from "thirdweb/extensions/erc20"; +const supported = isGetClaimConditionByIdSupported(["0x..."]); ``` ```ts -function isRemoveSessionKeySupported( +function isGetClaimConditionByIdSupported( 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. +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 @@ -18559,29 +20341,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `isRemoveSessionKeySupported` method is supported. +A boolean indicating if the `getClaimConditionById` method is supported. --- -## isTotalAccountsSupported +## ERC20.isMintToSupported - Checks if the `totalAccounts` method is supported by the given contract. +Checks if the `mintTo` method is supported by the given contract. ### Example ```ts -import { isTotalAccountsSupported } from "thirdweb/extensions/erc4337"; -const supported = isTotalAccountsSupported(["0x..."]); +import { isMintToSupported } from "thirdweb/extensions/erc20"; + +const supported = isMintToSupported(["0x..."]); ``` ```ts -function isTotalAccountsSupported( +function isMintToSupported( 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. +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 @@ -18595,30 +20378,30 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `totalAccounts` method is supported. +A boolean indicating if the `mintTo` method is supported. --- -## isValidateUserOpSupported +## ERC20.isResetClaimEligibilitySupported - Checks if the `validateUserOp` method is supported by the given contract. +Checks if the `resetClaimEligibility` method is supported by the given contract. ### Example ```ts -import { isValidateUserOpSupported } from "thirdweb/extensions/erc4337"; +import { isResetClaimEligibilitySupported } from "thirdweb/extensions/erc20"; -const supported = isValidateUserOpSupported(["0x..."]); +const supported = isResetClaimEligibilitySupported(["0x..."]); ``` ```ts -function isValidateUserOpSupported( +function isResetClaimEligibilitySupported( 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. +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 @@ -18632,83 +20415,79 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `validateUserOp` method is supported. +A boolean indicating if the `resetClaimEligibility` method is supported. --- -## predictAccountAddress +## ERC20.isSetClaimConditionsSupported - Calls the "getAddress" function on the contract. +Checks if the `setClaimConditions` method is supported by the given contract. ### Example ```ts -import { getAddress } from "thirdweb/extensions/erc4337"; +import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc20"; -const result = await getAddress({ - contract, - adminSigner: ..., - data: ..., -}); +const supported = isSetClaimConditionsSupported(["0x..."]); ``` ```ts -function predictAccountAddress( - options: BaseTransactionOptions, -): Promise; +function isSetClaimConditionsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the getAddress function. +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 options: BaseTransactionOptions; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `setClaimConditions` method is supported. --- -## removeAdmin +## ERC20.mintTo - Removes admin permissions for a specified address. +Mints a specified amount of tokens to a given address. This method is only available on the `TokenERC20` contract. ### Example ```ts -import { removeAdmin } from "thirdweb/extensions/erc4337"; +import { mintTo } from "thirdweb/extensions/erc20"; import { sendTransaction } from "thirdweb"; -const transaction = removeAdmin({ +const transaction = mintTo({ contract, - account, - adminAddress: "0x...", + to: "0x...", + amount: 100, }); await sendTransaction({ transaction, account }); ``` ```ts -function removeAdmin( - options: BaseTransactionOptions, +function mintTo( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the removeAdmin function. +The options for minting tokens. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -18721,42 +20500,44 @@ let returnType: PreparedTransaction< >; ``` - The transaction object to be sent. +A prepared transaction object. --- -## removeSessionKey +## ERC20.mintWithSignature - Removes session key permissions for a specified address. +Mints a new ERC20 token with the given minter signature This method is only available on the `TokenERC20` contract. ### Example ```ts -import { removeSessionKey } from "thirdweb/extensions/erc4337"; +import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc20"; import { sendTransaction } from "thirdweb"; -const transaction = removeSessionKey({ +const { payload, signature } = await generateMintSignature(...) + +const transaction = mintWithSignature({ contract, - account, - sessionKeyAddress, + payload, + signature, }); await sendTransaction({ transaction, account }); ``` ```ts -function removeSessionKey( - options: BaseTransactionOptions, +function mintWithSignature( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the removeSessionKey function. +The transaction options. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -18769,201 +20550,38 @@ let returnType: PreparedTransaction< >; ``` - The transaction object to be sent. ---- - -## signerPermissionsUpdatedEvent - - Creates an event object for the SignerPermissionsUpdated event. - -### Example - -```ts -import { getContractEvents } from "thirdweb"; -import { signerPermissionsUpdatedEvent } from "thirdweb/extensions/erc4337"; - -const events = await getContractEvents({ -contract, -events: [ - signerPermissionsUpdatedEvent({ - authorizingSigner: ..., - targetSigner: ..., -}) -], -}); -``` - -```ts -function signerPermissionsUpdatedEvent( - filters: Partial<{ - authorizingSigner: string; - targetSigner: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "authorizingSigner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "targetSigner"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "signer"; readonly type: "address" }, - { readonly name: "isAdmin"; readonly type: "uint8" }, - { - readonly name: "approvedTargets"; - readonly type: "address[]"; - }, - { - readonly name: "nativeTokenLimitPerTransaction"; - readonly type: "uint256"; - }, - { - readonly name: "permissionStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "permissionEndTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "reqValidityStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "reqValidityEndTimestamp"; - readonly type: "uint128"; - }, - { readonly name: "uid"; readonly type: "bytes32" }, - ]; - readonly name: "permissions"; - readonly type: "tuple"; - }, - ]; - readonly name: "SignerPermissionsUpdated"; - readonly type: "event"; -}>; -``` - -### Parameters - - Optional filters to apply to the event. - -#### Type - -```ts -let filters: Partial<{ - authorizingSigner: string; - targetSigner: string; -}>; -``` - -### Returns - -```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "authorizingSigner"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "targetSigner"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "signer"; readonly type: "address" }, - { readonly name: "isAdmin"; readonly type: "uint8" }, - { - readonly name: "approvedTargets"; - readonly type: "address[]"; - }, - { - readonly name: "nativeTokenLimitPerTransaction"; - readonly type: "uint256"; - }, - { - readonly name: "permissionStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "permissionEndTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "reqValidityStartTimestamp"; - readonly type: "uint128"; - }, - { - readonly name: "reqValidityEndTimestamp"; - readonly type: "uint128"; - }, - { readonly name: "uid"; readonly type: "bytes32" }, - ]; - readonly name: "permissions"; - readonly type: "tuple"; - }, - ]; - readonly name: "SignerPermissionsUpdated"; - readonly type: "event"; -}>; -``` - - The prepared event object. +A promise that resolves to the transaction result. --- -## simulateHandleOp +## ERC20.resetClaimEligibility - Prepares a transaction to call the "simulateHandleOp" function on the contract. +Reset the claim eligibility for all users. This method is only available on the `DropERC20` contract. ### Example ```ts +import { resetClaimEligibility } from "thirdweb/extensions/erc20"; import { sendTransaction } from "thirdweb"; -import { simulateHandleOp } from "thirdweb/extensions/erc4337"; -const transaction = simulateHandleOp({ - contract, - op: ..., - target: ..., - targetCallData: ..., - overrides: { - ... - } +const transaction = resetClaimEligibility({ + contract, }); -// Send the transaction await sendTransaction({ transaction, account }); -``` - -```ts -function simulateHandleOp( - options: BaseTransactionOptions< - | SimulateHandleOpParams - | { asyncParams: () => Promise } - >, +``` + +```ts +function resetClaimEligibility( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "simulateHandleOp" function. - #### Type ```ts -let options: BaseTransactionOptions< - | SimulateHandleOpParams - | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns @@ -18976,116 +20594,119 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +the prepared transaction --- -## totalAccounts +## ERC20.setClaimConditions - Calls the "totalAccounts" function on the contract. +Set the claim conditions for a ERC20 drop This method is only available on the `DropERC20` contract. ### Example ```ts -import { totalAccounts } from "thirdweb/extensions/erc4337"; +import { setClaimConditions } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; -const result = await totalAccounts({ +const transaction = setClaimConditions({ contract, + phases: [ + { + maxClaimableSupply: 100n, + maxClaimablePerWallet: 1n, + currencyAddress: "0x...", + price: 0.1, + startTime: new Date(), + }, + ], }); + +await sendTransaction({ transaction, account }); ``` ```ts -function totalAccounts( - options: BaseTransactionOptions, -): Promise; +function setClaimConditions( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the totalAccounts function. - #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +the prepared transaction --- -## userOperationEventEvent +## ERC20.tokensClaimedEvent - Creates an event object for the UserOperationEvent event. +Creates an event object for the TokensClaimed event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { userOperationEventEvent } from "thirdweb/extensions/erc4337"; +import { tokensClaimedEvent } from "thirdweb/extensions/erc20"; const events = await getContractEvents({ contract, events: [ - userOperationEventEvent({ - userOpHash: ..., - sender: ..., - paymaster: ..., + tokensClaimedEvent({ + claimConditionIndex: ..., + claimer: ..., + receiver: ..., }) ], }); ``` ```ts -function userOperationEventEvent( - filters: Partial<{ - paymaster: string; - sender: string; - userOpHash: `0x${string}`; - }>, +function tokensClaimedEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "userOpHash"; - readonly type: "bytes32"; + readonly name: "claimConditionIndex"; + readonly type: "uint256"; }, { readonly indexed: true; - readonly name: "sender"; + readonly name: "claimer"; readonly type: "address"; }, { readonly indexed: true; - readonly name: "paymaster"; + readonly name: "receiver"; readonly type: "address"; }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "success"; readonly type: "bool" }, - { readonly name: "actualGasCost"; readonly type: "uint256" }, - { readonly name: "actualGasUsed"; readonly type: "uint256" }, + { readonly name: "quantityClaimed"; readonly type: "uint256" }, ]; - readonly name: "UserOperationEvent"; + readonly name: "TokensClaimed"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - paymaster: string; - sender: string; - userOpHash: `0x${string}`; -}>; +let filters: Partial; ``` ### Returns @@ -19095,84 +20716,74 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "userOpHash"; - readonly type: "bytes32"; + readonly name: "claimConditionIndex"; + readonly type: "uint256"; }, { readonly indexed: true; - readonly name: "sender"; + readonly name: "claimer"; readonly type: "address"; }, { readonly indexed: true; - readonly name: "paymaster"; + readonly name: "receiver"; readonly type: "address"; }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "success"; readonly type: "bool" }, - { readonly name: "actualGasCost"; readonly type: "uint256" }, - { readonly name: "actualGasUsed"; readonly type: "uint256" }, + { readonly name: "quantityClaimed"; readonly type: "uint256" }, ]; - readonly name: "UserOperationEvent"; + readonly name: "TokensClaimed"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## userOperationRevertReasonEvent +## ERC20.tokensMintedEvent - Creates an event object for the UserOperationRevertReason event. +Creates an event object for the TokensMinted event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { userOperationRevertReasonEvent } from "thirdweb/extensions/erc4337"; +import { tokensMintedEvent } from "thirdweb/extensions/erc20"; const events = await getContractEvents({ contract, events: [ - userOperationRevertReasonEvent({ - userOpHash: ..., - sender: ..., + tokensMintedEvent({ + mintedTo: ..., }) ], }); ``` ```ts -function userOperationRevertReasonEvent( - filters: Partial<{ sender: string; userOpHash: `0x${string}` }>, +function tokensMintedEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "userOpHash"; - readonly type: "bytes32"; - }, - { - readonly indexed: true; - readonly name: "sender"; + readonly name: "mintedTo"; readonly type: "address"; }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "revertReason"; readonly type: "bytes" }, + { readonly name: "quantityMinted"; readonly type: "uint256" }, ]; - readonly name: "UserOperationRevertReason"; + readonly name: "TokensMinted"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ sender: string; userOpHash: `0x${string}` }>; +let filters: Partial; ``` ### Returns @@ -19182,93 +20793,169 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "userOpHash"; - readonly type: "bytes32"; - }, - { - readonly indexed: true; - readonly name: "sender"; + readonly name: "mintedTo"; readonly type: "address"; }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "revertReason"; readonly type: "bytes" }, + { readonly name: "quantityMinted"; readonly type: "uint256" }, ]; - readonly name: "UserOperationRevertReason"; + readonly name: "TokensMinted"; readonly type: "event"; }>; ``` - The prepared event object. ---- -## ERC4626 +The prepared event object. --- -## asset +## ERC20.tokensMintedWithSignatureEvent - Calls the "asset" function on the contract. +Creates an event object for the TokensMintedWithSignature event. ### Example ```ts -import { asset } from "thirdweb/extensions/erc4626"; +import { getContractEvents } from "thirdweb"; +import { tokensMintedWithSignatureEvent } from "thirdweb/extensions/erc20"; -const result = await asset({ - contract, +const events = await getContractEvents({ +contract, +events: [ + tokensMintedWithSignatureEvent({ + signer: ..., + mintedTo: ..., +}) +], }); ``` ```ts -function asset(options: BaseTransactionOptions): Promise; +function tokensMintedWithSignatureEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "signer"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "mintedTo"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "to"; readonly type: "address" }, + { + readonly name: "primarySaleRecipient"; + readonly type: "address"; + }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "price"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { + readonly name: "validityStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "validityEndTimestamp"; + readonly type: "uint128"; + }, + { readonly name: "uid"; readonly type: "bytes32" }, + ]; + readonly name: "mintRequest"; + readonly type: "tuple"; + }, + ]; + readonly name: "TokensMintedWithSignature"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the asset function. +Optional filters to apply to the event. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "signer"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "mintedTo"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "to"; readonly type: "address" }, + { + readonly name: "primarySaleRecipient"; + readonly type: "address"; + }, + { readonly name: "quantity"; readonly type: "uint256" }, + { readonly name: "price"; readonly type: "uint256" }, + { readonly name: "currency"; readonly type: "address" }, + { + readonly name: "validityStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "validityEndTimestamp"; + readonly type: "uint128"; + }, + { readonly name: "uid"; readonly type: "bytes32" }, + ]; + readonly name: "mintRequest"; + readonly type: "tuple"; + }, + ]; + readonly name: "TokensMintedWithSignature"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## convertToAssets +## ERC20.totalSupply - Calls the "convertToAssets" function on the contract. +Calls the "totalSupply" function on the contract. ### Example ```ts -import { convertToAssets } from "thirdweb/extensions/erc4626"; +import { totalSupply } from "thirdweb/extensions/erc20"; -const result = await convertToAssets({ - contract, - shares: ..., +const result = await totalSupply({ + contract, }); ``` ```ts -function convertToAssets( - options: BaseTransactionOptions, +function totalSupply( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the convertToAssets function. +The options for the totalSupply function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns @@ -19277,90 +20964,111 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## convertToShares +## ERC20.transfer - Calls the "convertToShares" function on the contract. +Transfers ERC20 tokens from the sender's address to the specified recipient address. ### Example ```ts -import { convertToShares } from "thirdweb/extensions/erc4626"; +import { transfer } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; -const result = await convertToShares({ - contract, - assets: ..., +const transaction = transfer({ + contract, + to: "0x...", + amount: 100, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function convertToShares( - options: BaseTransactionOptions, -): Promise; +function transfer( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the convertToShares function. +The options for the transfer transaction. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A promise that resolves to the prepared transaction. --- -## deposit +## ERC20.transferBatch - Prepares a transaction to call the "deposit" function on the contract. +Transfers a batch of ERC20 tokens from the sender's address to the specified recipient address. ### Example ```ts +import { transferBatch } from "thirdweb/extensions/erc20"; import { sendTransaction } from "thirdweb"; -import { deposit } from "thirdweb/extensions/erc4626"; -const transaction = deposit({ +const transaction = transferBatch({ contract, - assets: ..., - receiver: ..., - overrides: { - ... - } -}); + batch: [ + { + to: "0x...", + amount: 100, + }, + { + to: "0x...", + amount: "0.1", + }, +]); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function deposit( - options: BaseTransactionOptions< - DepositParams | { asyncParams: () => Promise } - >, +function transferBatch( + options: BaseTransactionOptions<{ + batch: Array< + { to: string } & ( + | { amount: string | number } + | { amountWei: bigint } + ) + >; + }>, ): PreparedTransaction; ``` ### Parameters - The options for the "deposit" function. +The options for the batch transfer transaction. #### Type ```ts -let options: BaseTransactionOptions< - DepositParams | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions<{ + batch: Array< + { to: string } & ( + | { amount: string | number } + | { amountWei: bigint } + ) + >; +}>; ``` ### Returns @@ -19373,61 +21081,60 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A promise that resolves to the prepared transaction. --- -## depositEvent +## ERC20.transferEvent - Creates an event object for the Deposit event. +Creates an event object for the Transfer event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { depositEvent } from "thirdweb/extensions/erc4626"; +import { transferEvent } from "thirdweb/extensions/erc20"; const events = await getContractEvents({ contract, events: [ - depositEvent({ - caller: ..., - owner: ..., + transferEvent({ + from: ..., + to: ..., }) ], }); ``` ```ts -function depositEvent( - filters: Partial<{ caller: string; owner: string }>, +function transferEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "caller"; + readonly name: "from"; readonly type: "address"; }, { readonly indexed: true; - readonly name: "owner"; + readonly name: "to"; readonly type: "address"; }, - { readonly name: "assets"; readonly type: "uint256" }, - { readonly name: "shares"; readonly type: "uint256" }, + { readonly name: "value"; readonly type: "uint256" }, ]; - readonly name: "Deposit"; + readonly name: "Transfer"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ caller: string; owner: string }>; +let filters: Partial; ``` ### Returns @@ -19437,199 +21144,86 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "caller"; + readonly name: "from"; readonly type: "address"; }, { readonly indexed: true; - readonly name: "owner"; + readonly name: "to"; readonly type: "address"; }, - { readonly name: "assets"; readonly type: "uint256" }, - { readonly name: "shares"; readonly type: "uint256" }, + { readonly name: "value"; readonly type: "uint256" }, ]; - readonly name: "Deposit"; + readonly name: "Transfer"; readonly type: "event"; }>; ``` - The prepared event object. ---- - -## maxDeposit - - Calls the "maxDeposit" function on the contract. - -### Example - -```ts -import { maxDeposit } from "thirdweb/extensions/erc4626"; - -const result = await maxDeposit({ - contract, - receiver: ..., -}); -``` - -```ts -function maxDeposit( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the maxDeposit function. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - The parsed result of the function call. ---- - -## maxMint - - Calls the "maxMint" function on the contract. - -### Example - -```ts -import { maxMint } from "thirdweb/extensions/erc4626"; - -const result = await maxMint({ - contract, - receiver: ..., -}); -``` - -```ts -function maxMint( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the maxMint function. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - The parsed result of the function call. +The prepared event object. --- -## maxRedeem +## ERC20.transferFrom - Calls the "maxRedeem" function on the contract. +Transfers a specified amount of tokens from one address to another address on the ERC20 contract. ### Example ```ts -import { maxRedeem } from "thirdweb/extensions/erc4626"; +import { transferFrom } from "thirdweb/extensions/erc20"; +import { sendTransaction } from "thirdweb"; -const result = await maxRedeem({ - contract, - owner: ..., +const transaction = transferFrom({ + contract: USDC_CONTRACT, + from: "0x1234...", + to: "0x5678...", + amount: 100, }); -``` - -```ts -function maxRedeem( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the maxRedeem function. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - The parsed result of the function call. ---- - -## maxWithdraw - - Calls the "maxWithdraw" function on the contract. - -### Example - -```ts -import { maxWithdraw } from "thirdweb/extensions/erc4626"; -const result = await maxWithdraw({ - contract, - owner: ..., -}); +await sendTransaction({ transaction, account }); ``` ```ts -function maxWithdraw( - options: BaseTransactionOptions, -): Promise; +function transferFrom( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the maxWithdraw function. +The transaction options including from, to, amount, and gas price. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A promise that resolves to the prepared transaction object. --- -## mint +## ERC20.withdraw - Prepares a transaction to call the "mint" function on the contract. +Prepares a transaction to call the "withdraw" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { mint } from "thirdweb/extensions/erc4626"; +import { withdraw } from "thirdweb/extensions/erc20"; -const transaction = mint({ +const transaction = withdraw({ contract, - shares: ..., - receiver: ..., + amount: ..., overrides: { ... } @@ -19640,22 +21234,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function mint( +function withdraw( options: BaseTransactionOptions< - MintParams | { asyncParams: () => Promise } + WithdrawParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "mint" function. +The options for the "withdraw" function. #### Type ```ts let options: BaseTransactionOptions< - MintParams | { asyncParams: () => Promise } + WithdrawParams | { asyncParams: () => Promise } >; ``` @@ -19669,184 +21263,276 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. +--- +## ERC4337 --- -## previewDeposit +## ERC4337.accountDeployedEvent - Calls the "previewDeposit" function on the contract. +Creates an event object for the AccountDeployed event. ### Example ```ts -import { previewDeposit } from "thirdweb/extensions/erc4626"; +import { getContractEvents } from "thirdweb"; +import { accountDeployedEvent } from "thirdweb/extensions/erc4337"; -const result = await previewDeposit({ - contract, - assets: ..., +const events = await getContractEvents({ +contract, +events: [ + accountDeployedEvent({ + userOpHash: ..., + sender: ..., +}) +], }); ``` ```ts -function previewDeposit( - options: BaseTransactionOptions, -): Promise; +function accountDeployedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "userOpHash"; + readonly type: "bytes32"; + }, + { + readonly indexed: true; + readonly name: "sender"; + readonly type: "address"; + }, + { readonly name: "factory"; readonly type: "address" }, + { readonly name: "paymaster"; readonly type: "address" }, + ]; + readonly name: "AccountDeployed"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the previewDeposit function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "userOpHash"; + readonly type: "bytes32"; + }, + { + readonly indexed: true; + readonly name: "sender"; + readonly type: "address"; + }, + { readonly name: "factory"; readonly type: "address" }, + { readonly name: "paymaster"; readonly type: "address" }, + ]; + readonly name: "AccountDeployed"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## previewMint +## ERC4337.addAdmin - Calls the "previewMint" function on the contract. +Adds admin permissions for a specified address. ### Example ```ts -import { previewMint } from "thirdweb/extensions/erc4626"; +import { addAdmin } from "thirdweb/extensions/erc4337"; +import { sendTransaction } from "thirdweb"; -const result = await previewMint({ - contract, - shares: ..., +const transaction = addAdmin({ + contract, + account, + adminAddress: "0x...", }); + +await sendTransaction({ transaction, account }); ``` ```ts -function previewMint( - options: BaseTransactionOptions, -): Promise; +function addAdmin( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the previewMint function. +The options for the addAdmin function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +The transaction object to be sent. --- -## previewRedeem +## ERC4337.addSessionKey - Calls the "previewRedeem" function on the contract. +Adds session key permissions for a specified address. ### Example ```ts -import { previewRedeem } from "thirdweb/extensions/erc4626"; +import { addSessionKey } from "thirdweb/extensions/erc4337"; +import { sendTransaction } from "thirdweb"; -const result = await previewRedeem({ - contract, - shares: ..., +const transaction = addSessionKey({ + contract, + account, + sessionKeyAddress, + permissions: { + approvedTargets: ["0x..."], + nativeTokenLimitPerTransaction: 0.1, // in ETH + permissionStartTimestamp: new Date(), + permissionEndTimestamp: new Date( + Date.now() + 1000 * 60 * 60 * 24 * 365, + ), // 1 year from now + }, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function previewRedeem( - options: BaseTransactionOptions, -): Promise; +function addSessionKey( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the previewRedeem function. +The options for the removeSessionKey function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +The transaction object to be sent. --- -## previewWithdraw +## ERC4337.adminUpdatedEvent - Calls the "previewWithdraw" function on the contract. +Creates an event object for the AdminUpdated event. ### Example ```ts -import { previewWithdraw } from "thirdweb/extensions/erc4626"; +import { getContractEvents } from "thirdweb"; +import { adminUpdatedEvent } from "thirdweb/extensions/erc4337"; -const result = await previewWithdraw({ - contract, - assets: ..., +const events = await getContractEvents({ +contract, +events: [ + adminUpdatedEvent({ + signer: ..., +}) +], }); ``` ```ts -function previewWithdraw( - options: BaseTransactionOptions, -): Promise; +function adminUpdatedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "signer"; + readonly type: "address"; + }, + { readonly name: "isAdmin"; readonly type: "bool" }, + ]; + readonly name: "AdminUpdated"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the previewWithdraw function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "signer"; + readonly type: "address"; + }, + { readonly name: "isAdmin"; readonly type: "bool" }, + ]; + readonly name: "AdminUpdated"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## redeem +## ERC4337.createAccount - Prepares a transaction to call the "redeem" function on the contract. +Prepares a transaction to call the "createAccount" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { redeem } from "thirdweb/extensions/erc4626"; +import { createAccount } from "thirdweb/extensions/erc4337"; -const transaction = redeem({ +const transaction = createAccount({ contract, - shares: ..., - receiver: ..., - owner: ..., + admin: ..., + data: ..., overrides: { ... } @@ -19857,22 +21543,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function redeem( +function createAccount( options: BaseTransactionOptions< - RedeemParams | { asyncParams: () => Promise } + | CreateAccountParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "redeem" function. +The options for the "createAccount" function. #### Type ```ts let options: BaseTransactionOptions< - RedeemParams | { asyncParams: () => Promise } + | CreateAccountParams + | { asyncParams: () => Promise } >; ``` @@ -19886,1502 +21574,1087 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## totalAssets +## ERC4337.getAccounts - Calls the "totalAssets" function on the contract. +Calls the "getAccounts" function on the contract. ### Example ```ts -import { totalAssets } from "thirdweb/extensions/erc4626"; +import { getAccounts } from "thirdweb/extensions/erc4337"; -const result = await totalAssets({ - contract, +const result = await getAccounts({ + contract, + start: ..., + end: ..., }); ``` ```ts -function totalAssets( - options: BaseTransactionOptions, -): Promise; +function getAccounts(options: BaseTransactionOptions) : Promise> ``` ### Parameters - The options for the totalAssets function. +The options for the getAccounts function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## withdraw +## ERC4337.getAccountsOfSigner - Prepares a transaction to call the "withdraw" function on the contract. +Calls the "getAccountsOfSigner" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { withdraw } from "thirdweb/extensions/erc4626"; +import { getAccountsOfSigner } from "thirdweb/extensions/erc4337"; -const transaction = withdraw({ +const result = await getAccountsOfSigner({ contract, - assets: ..., - receiver: ..., - owner: ..., - overrides: { - ... - } + signer: ..., }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function withdraw( - options: BaseTransactionOptions< - WithdrawParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getAccountsOfSigner(options: BaseTransactionOptions) : Promise> ``` ### Parameters - The options for the "withdraw" function. +The options for the getAccountsOfSigner function. #### Type ```ts -let options: BaseTransactionOptions< - WithdrawParams | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise> ``` - A prepared transaction object. +The parsed result of the function call. --- -## withdrawEvent +## ERC4337.getAllAccounts - Creates an event object for the Withdraw event. +Calls the "getAllAccounts" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { withdrawEvent } from "thirdweb/extensions/erc4626"; +import { getAllAccounts } from "thirdweb/extensions/erc4337"; -const events = await getContractEvents({ -contract, -events: [ - withdrawEvent({ - caller: ..., - receiver: ..., - owner: ..., -}) -], +const result = await getAllAccounts({ + contract, }); ``` ```ts -function withdrawEvent( - filters: Partial<{ - caller: string; - owner: string; - receiver: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "caller"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "receiver"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { readonly name: "assets"; readonly type: "uint256" }, - { readonly name: "shares"; readonly type: "uint256" }, - ]; - readonly name: "Withdraw"; - readonly type: "event"; -}>; +function getAllAccounts(options: BaseTransactionOptions) : Promise> ``` ### Parameters - Optional filters to apply to the event. +The options for the getAllAccounts function. #### Type ```ts -let filters: Partial<{ - caller: string; - owner: string; - receiver: string; -}>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "caller"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "receiver"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "owner"; - readonly type: "address"; - }, - { readonly name: "assets"; readonly type: "uint256" }, - { readonly name: "shares"; readonly type: "uint256" }, - ]; - readonly name: "Withdraw"; - readonly type: "event"; -}>; +let returnType: Promise> ``` - The prepared event object. ---- -## FARCASTER +The parsed result of the function call. --- -## addSigner +## ERC4337.getAllActiveSigners - Adds farcaster signer for the given account. +Calls the "getAllActiveSigners" function on the contract. ### Example ```ts -import { addSigner } from "thirdweb/extensions/farcaster"; -import { sendTransaction } from "thirdweb"; +import { getAllActiveSigners } from "thirdweb/extensions/erc4337"; -const transaction = addSigner({ - client, - appAccount, - signerPublicKey, +const result = await getAllActiveSigners({ + contract, }); - -await sendTransaction({ transaction, account }); ``` ```ts -function addSigner( - options: AddSignerParams, -): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; +function getAllActiveSigners(options: BaseTransactionOptions) : Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> ``` ### Parameters - The options for adding the signer. +The options for the getAllActiveSigners function. #### Type ```ts -let options: Prettify< - { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - signerPublicKey: Hex; - } & ( - | { appAccount: Account } - | { - appAccountAddress: Address; - deadline: bigint; - signedKeyRequestMetadata: Hex; - } - ) ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - [], - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> ``` - A prepared transaction object to add the signer to the account. +The parsed result of the function call. --- -## addSignerFor +## ERC4337.getAllAdmins - Adds farcaster signer for a given user. Helpful if you want to cover the gas fee for a user. +Calls the "getAllAdmins" function on the contract. ### Example ```ts -import { addSignerFor } from "thirdweb/extensions/farcaster"; -import { sendTransaction } from "thirdweb"; +import { getAllAdmins } from "thirdweb/extensions/erc4337"; -const transaction = addSignerFor({ - client, - appAccount, - userAccount, - signerPublicKey, +const result = await getAllAdmins({ + contract, }); - -await sendTransaction({ transaction, account }); ``` ```ts -function addSignerFor( - options: AddSignerForParams, -): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; +function getAllAdmins(options: BaseTransactionOptions) : Promise> ``` ### Parameters - The options for adding the signer. +The options for the getAllAdmins function. #### Type ```ts -let options: Prettify< - { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - signerPublicKey: Hex; - } & ( - | { appAccount: Account } - | { - appAccountAddress: Address; - deadline: bigint; - signedKeyRequestMetadata: Hex; - } - ) & - ( - | { userAccount: Account } - | { addSignature: Hex; deadline: bigint; userAddress: Address } - ) ->; -``` - -### Returns - -```ts -let returnType: PreparedTransaction< - [], - AbiFunction, - PrepareTransactionOptions ->; -``` - - A prepared transaction object to add the signer to the account. ---- - -## createEd25519Keypair - - Generates an Ed25519 keypair to be used as an account signer. - -### Example - -```ts -createSigner(); -``` - -```ts -function createEd25519Keypair(): Promise; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: { privateKey: Hex; publicKey: Hex }; +let returnType: Promise> ``` - A promise resolving to the generated keypair. +The parsed result of the function call. --- -## encodeSignedKeyRequestMetadata +## ERC4337.getAllSigners - Encodes the signed key request metadata into a hexadecimal string. This function takes in the request signer's address, the key request signature, the request Fid, and the deadline, and returns the encoded ABI parameters as a hexadecimal string. It's used to prepare the metadata for transactions involving signed key requests. +Calls the "getAllSigners" function on the contract. ### Example ```ts -const encodedMetadata = encodeSignedKeyRequestMetadata({ - requestSigner: "0x123...", - keyRequestSignature: "0xabcd...", - requestFid: 123456789n, - deadline: 1657758061n, +import { getAllSigners } from "thirdweb/extensions/erc4337"; + +const result = await getAllSigners({ + contract, }); ``` ```ts -function encodeSignedKeyRequestMetadata(options: { - deadline: bigint; - keyRequestSignature: `0x${string}`; - requestFid: bigint; - requestSigner: string; -}): Hex; +function getAllSigners(options: BaseTransactionOptions) : Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> ``` ### Parameters - The options for encoding the signed key request metadata. +The options for the getAllSigners function. #### Type ```ts -let options: { - deadline: bigint; - keyRequestSignature: `0x${string}`; - requestFid: bigint; - requestSigner: string; -}; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }>> ``` - The encoded ABI parameters as a hexadecimal string. +The parsed result of the function call. --- -## getAddData +## ERC4337.getPermissionsForSigner - Prepares the data required for signing an Add message according to EIP-712. +Calls the "getPermissionsForSigner" function on the contract. ### Example -```typescript -const message: AddMessage = { - owner: "0xYourAddress", - keyType: 1, - key: "0xYourPublicKey", - metadataType: 1, - metadata: "0xYourMetadata", - nonce: BigInt("YourNonce"), - deadline: BigInt("YourDeadline"), -}; +```ts +import { getPermissionsForSigner } from "thirdweb/extensions/erc4337"; -const data = getAddData(message); +const result = await getPermissionsForSigner({ + contract, + signer: ..., +}); ``` ```ts -function getAddData(message: AddMessage): { - domain: { - readonly chainId: 10; - readonly name: "Farcaster KeyGateway"; - readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; - readonly version: "1"; - }; - message: AddMessage; - primaryType: "Add"; - types: { - readonly Add: readonly [ - { readonly name: "owner"; readonly type: "address" }, - { readonly name: "keyType"; readonly type: "uint32" }, - { readonly name: "key"; readonly type: "bytes" }, - { readonly name: "metadataType"; readonly type: "uint8" }, - { readonly name: "metadata"; readonly type: "bytes" }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "deadline"; readonly type: "uint256" }, - ]; - }; -}; +function getPermissionsForSigner(options: BaseTransactionOptions) : Promise<{ approvedTargets: readonly Array; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }> ``` ### Parameters - The AddMessage object containing the message to be signed. +The options for the getPermissionsForSigner function. #### Type ```ts -let message: { - deadline: bigint; - key: Hex; - keyType: number; - metadata: Hex; - metadataType: number; - nonce: bigint; - owner: Address; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { - domain: { - readonly chainId: 10; - readonly name: "Farcaster KeyGateway"; - readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; - readonly version: "1"; - }; - message: AddMessage; - primaryType: "Add"; - types: { - readonly Add: readonly [ - { readonly name: "owner"; readonly type: "address" }, - { readonly name: "keyType"; readonly type: "uint32" }, - { readonly name: "key"; readonly type: "bytes" }, - { readonly name: "metadataType"; readonly type: "uint8" }, - { readonly name: "metadata"; readonly type: "bytes" }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "deadline"; readonly type: "uint256" }, - ]; - }; -}; +let returnType: Promise<{ approvedTargets: readonly Array; endTimestamp: bigint; nativeTokenLimitPerTransaction: bigint; signer: string; startTimestamp: bigint }> ``` - The data object structured according to EIP-712, ready for signing. +The parsed result of the function call. --- -## getBundler +## ERC4337.getUserOpHash - Retrieves the Bundler contract. +Calls the "getUserOpHash" function on the contract. ### Example ```ts -import { getBundler } from "thirdweb/extensions/farcaster"; +import { getUserOpHash } from "thirdweb/extensions/erc4337"; -const bundler = await getBundler({ - client, +const result = await getUserOpHash({ + contract, + userOp: ..., }); ``` ```ts -function getBundler( - options: FarcasterContractOptions, -): ThirdwebContract; +function getUserOpHash( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The thirdweb client and an optional custom chain. +The options for the getUserOpHash function. #### Type ```ts -let options: { chain?: Chain; client: ThirdwebClient }; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Readonly>; +let returnType: Promise<`0x${string}`>; ``` - The Bundler contract instance. +The parsed result of the function call. --- -## getFid +## ERC4337.isAccountDeployed - Retrieves the current fid for an account. +Adds admin permissions for a specified address. ### Example ```ts -import { getFid } from "thirdweb/extensions/farcaster"; +import { isAccountDeployed } from "thirdweb/extensions/erc4337"; -const price = await getFid({ - client, - address, +const isDeployed = await isAccountDeployed({ + contract, + account, + adminSigner: "0x...", }); + +await isAccountDeployed({ contract, adminSigner }); ``` ```ts -function getFid(options: GetFidParams): Promise; +function isAccountDeployed( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Parameters to pass to the function. +The options for the addAdmin function. #### Type ```ts -let options: { - address: Address; - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - A promise that resolves to the account's fid, if one exists, otherwise 0. +The transaction object to be sent. --- -## getIdGateway +## ERC4337.isActiveSigner - Retrieves the IdGateway contract. +Calls the "isActiveSigner" function on the contract. ### Example ```ts -import { getIdGatway } from "thirdweb/extensions/farcaster"; +import { isActiveSigner } from "thirdweb/extensions/erc4337"; -const idGateway = await getIdGateway({ - client, +const result = await isActiveSigner({ + contract, + signer: ..., }); ``` ```ts -function getIdGateway( - options: FarcasterContractOptions, -): ThirdwebContract; +function isActiveSigner( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The thirdweb client and an optional custom chain. +The options for the isActiveSigner function. #### Type ```ts -let options: { chain?: Chain; client: ThirdwebClient }; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Readonly>; +let returnType: Promise; ``` - The IdGateway contract instance. +The parsed result of the function call. --- -## getIdRegistry +## ERC4337.isAddAdminSupported - Retrieves the IdRegistry contract. +Checks if the `isAddAdminSupported` method is supported by the given contract. ### Example ```ts -import { getIdRegistry } from "thirdweb/extensions/farcaster"; +import { isAddAdminSupported } from "thirdweb/extensions/erc4337"; -const idRegistry = await getIdRegistry({ - client, -}); +const supported = isAddAdminSupported(["0x..."]); ``` ```ts -function getIdRegistry( - options: FarcasterContractOptions, -): ThirdwebContract; +function isAddAdminSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The thirdweb client and an optional custom chain. +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 options: { chain?: Chain; client: ThirdwebClient }; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Readonly>; +let returnType: boolean; ``` - The IdRegistry contract instance. +A boolean indicating if the `isAddAdminSupported` method is supported. --- -## getKeyGateway +## ERC4337.isAddSessionKeySupported - Retrieves the KeyGateway contract. +Checks if the `isAddSessionKeySupported` method is supported by the given contract. ### Example ```ts -import { getKeyGateway } from "thirdweb/extensions/farcaster"; +import { isAddSessionKeySupported } from "thirdweb/extensions/erc4337"; -const keyGateway = await getKeyGateway({ - client, -}); +const supported = isAddSessionKeySupported(["0x..."]); ``` ```ts -function getKeyGateway( - options: FarcasterContractOptions, -): ThirdwebContract; +function isAddSessionKeySupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The thirdweb client and an optional custom chain. +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 options: { chain?: Chain; client: ThirdwebClient }; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Readonly>; +let returnType: boolean; ``` - The KeyGateway contract instance. +A boolean indicating if the `isAddSessionKeySupported` method is supported. --- -## getKeyRequestData +## ERC4337.isAdmin - Prepares the data required for signing a key request using EIP-712 typed data signing. This includes the domain, types, primary type, and the message to be signed. +Calls the "isAdmin" function on the contract. ### Example ```ts -const message = { - requestFid: 123456789n, - key: "0x04bfc...", - deadline: 1657758061n, -}; -const eip712Data = getKeyRequestData(message); +import { isAdmin } from "thirdweb/extensions/erc4337"; + +const result = await isAdmin({ + contract, + signer: ..., +}); ``` ```ts -function getKeyRequestData(message: SignedKeyRequestMessage): { - domain: { - readonly chainId: 10; - readonly name: "Farcaster SignedKeyRequestValidator"; - readonly verifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553"; - readonly version: "1"; - }; - message: SignedKeyRequestMessage; - primaryType: "SignedKeyRequest"; - types: { - readonly SignedKeyRequest: Array<{ name: string; type: string }>; - }; -}; +function isAdmin( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The message to be signed, containing the request FID, key, and deadline. +The options for the isAdmin function. #### Type ```ts -let message: { deadline: bigint; key: Hex; requestFid: bigint }; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { - domain: { - readonly chainId: 10; - readonly name: "Farcaster SignedKeyRequestValidator"; - readonly verifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553"; - readonly version: "1"; - }; - message: SignedKeyRequestMessage; - primaryType: "SignedKeyRequest"; - types: { - readonly SignedKeyRequest: Array<{ name: string; type: string }>; - }; -}; +let returnType: Promise; ``` - An object containing the domain, types, primary type, and the message for EIP-712 signing. +The parsed result of the function call. --- -## getNonce +## ERC4337.isCreateAccountSupported - Retrieves the current key gateway nonce for an account. +Checks if the `createAccount` method is supported by the given contract. ### Example ```ts -import { getNonce } from "thirdweb/extensions/farcaster"; +import { isCreateAccountSupported } from "thirdweb/extensions/erc4337"; -const nonce = await getNonce({ - client, - address, -}); +const supported = isCreateAccountSupported(["0x..."]); ``` ```ts -function getNonce(options: GetNonceParams): Promise; +function isCreateAccountSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - Parameters to pass to the function. +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 options: { - address: Address; - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the current nonce. +A boolean indicating if the `createAccount` method is supported. --- -## getRegisterData +## ERC4337.isGetAccountsOfSignerSupported - Constructs the data required for signing a register message in the Farcaster ID Gateway. This includes the EIP-712 domain, types, and the message to be signed. +Checks if the `getAccountsOfSigner` method is supported by the given contract. ### Example ```ts -import { getRegisterData } from "thirdweb/extensions/farcaster"; - -const data = getRegisterData(message); +import { isGetAccountsOfSignerSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAccountsOfSignerSupported(["0x..."]); ``` ```ts -function getRegisterData(message: RegisterMessage): { - domain: { - readonly chainId: 10; - readonly name: "Farcaster IdGateway"; - readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69"; - readonly version: "1"; - }; - message: RegisterMessage; - primaryType: "Register"; - types: { - readonly Register: readonly [ - { readonly name: "to"; readonly type: "address" }, - { readonly name: "recovery"; readonly type: "address" }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "deadline"; readonly type: "uint256" }, - ]; - }; -}; +function isGetAccountsOfSignerSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The register message containing the necessary information for the signature. +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 message: { - deadline: bigint; - nonce: bigint; - recovery: Address; - to: Address; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: { - domain: { - readonly chainId: 10; - readonly name: "Farcaster IdGateway"; - readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69"; - readonly version: "1"; - }; - message: RegisterMessage; - primaryType: "Register"; - types: { - readonly Register: readonly [ - { readonly name: "to"; readonly type: "address" }, - { readonly name: "recovery"; readonly type: "address" }, - { readonly name: "nonce"; readonly type: "uint256" }, - { readonly name: "deadline"; readonly type: "uint256" }, - ]; - }; -}; +let returnType: boolean; ``` - An object containing the EIP-712 domain, types, and the message, ready to be signed. +A boolean indicating if the `getAccountsOfSigner` method is supported. --- -## getRegistrationPrice +## ERC4337.isGetAccountsSupported - Retrieves the current cost to register a Farcaster fid in wei. +Checks if the `getAccounts` method is supported by the given contract. ### Example ```ts -import { getRegistrationPrice } from "thirdweb/extensions/farcaster"; - -const price = await getRegistrationPrice({ - client, -}); +import { isGetAccountsSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAccountsSupported(["0x..."]); ``` ```ts -function getRegistrationPrice( - options: GetRegistrationPriceParams, -): Promise; +function isGetAccountsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. +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 options: { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - extraStorage?: bigint | number | string; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the current cost of a Farcaster fid in wei. +A boolean indicating if the `getAccounts` method is supported. --- -## getSignedKeyRequestMetadata +## ERC4337.isGetAllAccountsSupported - Generates the signed key request metadata to add a signer to an account. This function can either sign a new key request using an account object or use an existing key request signature. It prepares the metadata necessary for transactions involving signed key requests. +Checks if the `getAllAccounts` method is supported by the given contract. ### Example ```ts -import { getSignedKeyRequestMetadata } from "thirdweb/extensions/farcaster"; - -// Using an existing signature -const signedMetadata = await getSignedKeyRequestMetadata({ - keyRequestSignature: "0xabcd...", - accountAddress: "0x123...", - message: { - requestFid: 123456789n, - deadline: 1657758061n, - }, -}); - -// Signing a new key request -const signedMetadata = await getSignedKeyRequestMetadata({ - account, - message: { - requestFid: 123456789n, - deadline: 1657758061n, - }, -}); +import { isGetAllAccountsSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAllAccountsSupported(["0x..."]); ``` ```ts -function getSignedKeyRequestMetadata( - options: SignedKeyRequestMetadataOptions, -): Promise; +function isGetAllAccountsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for signing the key request or using an existing signature. +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 options: Prettify< - { message: SignedKeyRequestMessage } & ( - | { account: Account } - | { accountAddress: Address; keyRequestSignature: Hex } - ) ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: boolean; ``` - A promise that resolves to the hexadecimal string of the encoded ABI parameters. +A boolean indicating if the `getAllAccounts` method is supported. --- -## getStoragePrice +## ERC4337.isGetAllActiveSignersSupported - Retrieves the current cost to register a Farcaster fid in wei. +Checks if the `getAllActiveSigners` method is supported by the given contract. ### Example ```ts -import { getStoragePrice } from "thirdweb/extensions/farcaster"; - -const price = await getStoragePrice({ - client, -}); +import { isGetAllActiveSignersSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAllActiveSignersSupported(["0x..."]); ``` ```ts -function getStoragePrice( - options: GetStoragePriceParams, -): Promise; +function isGetAllActiveSignersSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. +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 options: { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - units?: bigint | number | string; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the current cost of a Farcaster fid in USD. +A boolean indicating if the `getAllActiveSigners` method is supported. --- -## getStorageRegistry +## ERC4337.isGetAllAdminsSupported - Retrieves the StorageRegistry contract. +Checks if the `getAllAdmins` method is supported by the given contract. ### Example ```ts -import { getStorageRegistry } from "thirdweb/extensions/farcaster"; - -const storageRegistry = await getStorageRegistry({ - client, -}); +import { isGetAllAdminsSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAllAdminsSupported(["0x..."]); ``` ```ts -function getStorageRegistry( - options: FarcasterContractOptions, -): ThirdwebContract; +function isGetAllAdminsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The thirdweb client and an optional custom chain. +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 options: { chain?: Chain; client: ThirdwebClient }; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Readonly>; +let returnType: boolean; ``` - The StorageRegistry contract instance. +A boolean indicating if the `getAllAdmins` method is supported. --- -## getUsdRegistrationPrice +## ERC4337.isGetAllSignersSupported - Retrieves the current cost to register a Farcaster fid in USD. +Checks if the `getAllSigners` method is supported by the given contract. ### Example ```ts -import { getUsdRegistrationPrice } from "thirdweb/extensions/farcaster"; - -const price = await getUsdRegistrationPrice({ - client, -}); +import { isGetAllSignersSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAllSignersSupported(["0x..."]); ``` ```ts -function getUsdRegistrationPrice( - options: GetUsdRegistrationPriceParams, -): Promise; +function isGetAllSignersSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. +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 options: { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - extraStorage?: bigint | number | string; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the current cost of a Farcaster fid in USD. +A boolean indicating if the `getAllSigners` method is supported. --- -## getUsdStoragePrice +## ERC4337.isIsAccountDeployedSupported - Retrieves the current cost to register a Farcaster fid in USD. +Checks if the `getAddress` method is supported by the given contract. ### Example ```ts -import { getUsdStoragePrice } from "thirdweb/extensions/farcaster"; - -const price = await getUsdStoragePrice({ - client, -}); +import { isGetAddressSupported } from "thirdweb/extensions/erc4337"; +const supported = isGetAddressSupported(["0x..."]); ``` ```ts -function getUsdStoragePrice( - options: GetUsdStoragePriceParams, -): Promise; +function isIsAccountDeployedSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. +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 options: { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - units?: bigint | number | string; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - A promise that resolves to the current cost of a Farcaster fid in USD. +A boolean indicating if the `getAddress` method is supported. --- -## registerFid +## ERC4337.isIsActiveSignerSupported - Registers a Farcaster fid for the given wallet. +Checks if the `isActiveSigner` method is supported by the given contract. ### Example ```ts -import { registerFid } from "thirdweb/extensions/farcaster"; -import { sendTransaction } from "thirdweb"; - -const transaction = registerFid({ - client, - recoveryAddress, -}); - -await sendTransaction({ transaction, account }); +import { isIsActiveSignerSupported } from "thirdweb/extensions/erc4337"; +const supported = isIsActiveSignerSupported(["0x..."]); ``` ```ts -function registerFid( - options: RegisterFidParams, -): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; +function isIsActiveSignerSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for registering an account. +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 options: { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - extraStorage?: bigint | string | number; - recoveryAddress: Address; -}; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - [], - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object to register the account. +A boolean indicating if the `isActiveSigner` method is supported. --- -## registerFidAndSigner +## ERC4337.isIsAdminSupported - Registers a Farcaster fid and signer for the given wallet using the provided app account. +Checks if the `isAdmin` method is supported by the given contract. ### Example ```ts -import { registerFidAndSigner } from "thirdweb/extensions/farcaster"; -import { sendTransaction } from "thirdweb"; - -const transaction = registerFidAndSigner({ - client, - userAccount, - appAccount, - recoveryAddress, - signerPublicKey, -}); - -await sendTransaction({ transaction, account }); +import { isIsAdminSupported } from "thirdweb/extensions/erc4337"; +const supported = isIsAdminSupported(["0x..."]); ``` ```ts -function registerFidAndSigner( - options: RegisterFidAndSignerParams, -): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; +function isIsAdminSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for registering an account. +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 options: Prettify< - { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - extraStorage?: bigint | number; - recoveryAddress: Address; - signerPublicKey: Hex; - } & ( - | { userAccount: Account } - | { - addSignature: Hex; - deadline: bigint; - registerSignature: Hex; - userAddress: Address; - } - ) & - ( - | { appAccount: Account } - | { - appAccountAddress: Address; - deadline: bigint; - signedKeyRequestMetadata: Hex; - } - ) ->; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: PreparedTransaction< - [], - AbiFunction, - PrepareTransactionOptions ->; +let returnType: boolean; ``` - A prepared transaction object to register the account. +A boolean indicating if the `isAdmin` method is supported. --- -## rentStorage +## ERC4337.isRegistered - Rent storage for the provided farcaster fid. +Calls the "isRegistered" function on the contract. ### Example ```ts -import { rentStorage } from "thirdweb/extensions/farcaster"; -import { sendTransaction } from "thirdweb"; +import { isRegistered } from "thirdweb/extensions/erc4337"; -const transaction = rentStorage({ - client, - fid, - units, +const result = await isRegistered({ + contract, + account: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function rentStorage( - options: RentStorageParams, -): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; +function isRegistered( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for calling the `rentStorage` function. +The options for the isRegistered function. #### Type ```ts -let options: { - chain?: Chain; - client: ThirdwebClient; - disableCache?: boolean; - fid: bigint | number | string; - units?: bigint | number | string; -}; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - [], - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object to rent the storage. +The parsed result of the function call. --- -## signAdd +## ERC4337.isRemoveAdminSupported - Signs an Add message using the account's signTypedData method. +Checks if the `isRemoveAdminSupported` method is supported by the given contract. ### Example -```typescript -const signedMessage = await signAdd({ - account: yourAccount, - message: yourAddMessage, -}); +```ts +import { isRemoveAdminSupported } from "thirdweb/extensions/erc4337"; + +const supported = isRemoveAdminSupported(["0x..."]); ``` ```ts -function signAdd(options: SignAddOptions): Promise; +function isRemoveAdminSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for signing the Add message. +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 options: { account: Account; message: AddMessage }; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: boolean; ``` - A promise that resolves to the signature of the Add message. +A boolean indicating if the `isRemoveAdminSupported` method is supported. --- -## signKeyRequest +## ERC4337.isRemoveSessionKeySupported - Signs a key request message using EIP-712 typed data signing. This function prepares the data for signing, signs it with the provided account, and returns the signature. +Checks if the `isRemoveSessionKeySupported` method is supported by the given contract. ### Example ```ts -const message = { - requestFid: 123456789n, - key: "0x04bfc...", - deadline: 1657758061n, -}; +import { isRemoveSessionKeySupported } from "thirdweb/extensions/erc4337"; -const signature = signKeyRequest({ account: signerAccount, message }); +const supported = isRemoveSessionKeySupported(["0x..."]); ``` ```ts -function signKeyRequest(options: SignKeyRequestOptions): Promise; +function isRemoveSessionKeySupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for signing the key request, including the account and the message. +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 options: { account: Account; message: SignedKeyRequestMessage }; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: boolean; ``` - A promise that resolves to the signature of the key request. +A boolean indicating if the `isRemoveSessionKeySupported` method is supported. --- -## signRegister +## ERC4337.isTotalAccountsSupported - Signs the register message for Farcaster ID Gateway. +Checks if the `totalAccounts` method is supported by the given contract. ### Example ```ts -const signature = await signRegister({ account, message }); +import { isTotalAccountsSupported } from "thirdweb/extensions/erc4337"; +const supported = isTotalAccountsSupported(["0x..."]); ``` ```ts -function signRegister(options: SignRegisterOptions): Promise; +function isTotalAccountsSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The signing options. +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 options: { account: Account; message: RegisterMessage }; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: boolean; ``` - A promise that resolves to the signature. +A boolean indicating if the `totalAccounts` method is supported. --- -## idGateway +## ERC4337.isValidateUserOpSupported - Calls the "idGateway" function on the contract. +Checks if the `validateUserOp` method is supported by the given contract. ### Example ```ts -import { idGateway } from "thirdweb/extensions/farcaster"; +import { isValidateUserOpSupported } from "thirdweb/extensions/erc4337"; -const result = await idGateway({ - contract, -}); +const supported = isValidateUserOpSupported(["0x..."]); ``` ```ts -function idGateway(options: BaseTransactionOptions): Promise; +function isValidateUserOpSupported( + availableSelectors: Array, +): boolean; ``` ### Parameters - The options for the idGateway function. +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 options: { contract: ThirdwebContract } & T; +let availableSelectors: Array; ``` ### Returns ```ts -let returnType: Promise; +let returnType: boolean; ``` - The parsed result of the function call. +A boolean indicating if the `validateUserOp` method is supported. --- -## keyGateway +## ERC4337.predictAccountAddress - Calls the "keyGateway" function on the contract. +Calls the "getAddress" function on the contract. ### Example ```ts -import { keyGateway } from "thirdweb/extensions/farcaster"; +import { getAddress } from "thirdweb/extensions/erc4337"; -const result = await keyGateway({ - contract, +const result = await getAddress({ + contract, + adminSigner: ..., + data: ..., }); ``` ```ts -function keyGateway(options: BaseTransactionOptions): Promise; +function predictAccountAddress( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the keyGateway function. +The options for the getAddress function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -21390,90 +22663,90 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## price +## ERC4337.removeAdmin - Calls the "price" function on the contract. +Removes admin permissions for a specified address. ### Example ```ts -import { price } from "thirdweb/extensions/farcaster"; +import { removeAdmin } from "thirdweb/extensions/erc4337"; +import { sendTransaction } from "thirdweb"; -const result = await price({ - contract, - extraStorage: ..., +const transaction = removeAdmin({ + contract, + account, + adminAddress: "0x...", }); + +await sendTransaction({ transaction, account }); ``` ```ts -function price( - options: BaseTransactionOptions, -): Promise; +function removeAdmin( + options: BaseTransactionOptions, +): PreparedTransaction; ``` ### Parameters - The options for the price function. +The options for the removeAdmin function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +The transaction object to be sent. --- -## register +## ERC4337.removeSessionKey - Prepares a transaction to call the "register" function on the contract. +Removes session key permissions for a specified address. ### Example ```ts +import { removeSessionKey } from "thirdweb/extensions/erc4337"; import { sendTransaction } from "thirdweb"; -import { register } from "thirdweb/extensions/farcaster"; -const transaction = register({ - contract, - recovery: ..., - extraStorage: ..., - overrides: { - ... - } +const transaction = removeSessionKey({ + contract, + account, + sessionKeyAddress, }); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function register( - options: BaseTransactionOptions< - RegisterParams | { asyncParams: () => Promise } - >, +function removeSessionKey( + options: BaseTransactionOptions, ): PreparedTransaction; ``` ### Parameters - The options for the "register" function. +The options for the removeSessionKey function. #### Type ```ts -let options: BaseTransactionOptions< - RegisterParams | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns @@ -21486,100 +22759,211 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +The transaction object to be sent. --- -## idRegistry +## ERC4337.shouldUpdateSessionKey - Calls the "idRegistry" function on the contract. +Checks if the session key should be updated. ### Example ```ts -import { idRegistry } from "thirdweb/extensions/farcaster"; +import { shouldUpdateSessionKey } from "thirdweb/extensions/erc4337"; -const result = await idRegistry({ - contract, +const shouldUpdate = await shouldUpdateSessionKey({ + accountContract, + sessionKeyAddress, + newPermissions, }); ``` ```ts -function idRegistry(options: BaseTransactionOptions): Promise; +function shouldUpdateSessionKey(args: { + accountContract: Readonly; + newPermissions: AccountPermissions; + sessionKeyAddress: string; +}): Promise; ``` ### Parameters - The options for the idRegistry function. - #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let args: { + accountContract: Readonly; + newPermissions: AccountPermissions; + sessionKeyAddress: string; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +A boolean indicating if the session key should be updated. --- -## price +## ERC4337.signerPermissionsUpdatedEvent - Calls the "price" function on the contract. +Creates an event object for the SignerPermissionsUpdated event. ### Example ```ts -import { price } from "thirdweb/extensions/farcaster"; +import { getContractEvents } from "thirdweb"; +import { signerPermissionsUpdatedEvent } from "thirdweb/extensions/erc4337"; -const result = await price({ - contract, - extraStorage: ..., +const events = await getContractEvents({ +contract, +events: [ + signerPermissionsUpdatedEvent({ + authorizingSigner: ..., + targetSigner: ..., +}) +], }); ``` ```ts -function price( - options: BaseTransactionOptions, -): Promise; +function signerPermissionsUpdatedEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "authorizingSigner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "targetSigner"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "signer"; readonly type: "address" }, + { readonly name: "isAdmin"; readonly type: "uint8" }, + { + readonly name: "approvedTargets"; + readonly type: "address[]"; + }, + { + readonly name: "nativeTokenLimitPerTransaction"; + readonly type: "uint256"; + }, + { + readonly name: "permissionStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "permissionEndTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "reqValidityStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "reqValidityEndTimestamp"; + readonly type: "uint128"; + }, + { readonly name: "uid"; readonly type: "bytes32" }, + ]; + readonly name: "permissions"; + readonly type: "tuple"; + }, + ]; + readonly name: "SignerPermissionsUpdated"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the price function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "authorizingSigner"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "targetSigner"; + readonly type: "address"; + }, + { + readonly components: readonly [ + { readonly name: "signer"; readonly type: "address" }, + { readonly name: "isAdmin"; readonly type: "uint8" }, + { + readonly name: "approvedTargets"; + readonly type: "address[]"; + }, + { + readonly name: "nativeTokenLimitPerTransaction"; + readonly type: "uint256"; + }, + { + readonly name: "permissionStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "permissionEndTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "reqValidityStartTimestamp"; + readonly type: "uint128"; + }, + { + readonly name: "reqValidityEndTimestamp"; + readonly type: "uint128"; + }, + { readonly name: "uid"; readonly type: "bytes32" }, + ]; + readonly name: "permissions"; + readonly type: "tuple"; + }, + ]; + readonly name: "SignerPermissionsUpdated"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## register +## ERC4337.simulateHandleOp - Prepares a transaction to call the "register" function on the contract. +Prepares a transaction to call the "simulateHandleOp" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { register } from "thirdweb/extensions/farcaster"; +import { simulateHandleOp } from "thirdweb/extensions/erc4337"; -const transaction = register({ +const transaction = simulateHandleOp({ contract, - recovery: ..., - extraStorage: ..., + op: ..., + target: ..., + targetCallData: ..., overrides: { ... } @@ -21590,22 +22974,24 @@ await sendTransaction({ transaction, account }); ``` ```ts -function register( +function simulateHandleOp( options: BaseTransactionOptions< - RegisterParams | { asyncParams: () => Promise } + | SimulateHandleOpParams + | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "register" function. +The options for the "simulateHandleOp" function. #### Type ```ts let options: BaseTransactionOptions< - RegisterParams | { asyncParams: () => Promise } + | SimulateHandleOpParams + | { asyncParams: () => Promise } >; ``` @@ -21619,32 +23005,32 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## REGISTER\_TYPEHASH +## ERC4337.totalAccounts - Calls the "REGISTER\_TYPEHASH" function on the contract. +Calls the "totalAccounts" function on the contract. ### Example ```ts -import { REGISTER_TYPEHASH } from "thirdweb/extensions/farcaster"; +import { totalAccounts } from "thirdweb/extensions/erc4337"; -const result = await REGISTER_TYPEHASH({ +const result = await totalAccounts({ contract, }); ``` ```ts -function REGISTER_TYPEHASH( +function totalAccounts( options: BaseTransactionOptions, -): Promise<`0x${string}`>; +): Promise; ``` ### Parameters - The options for the REGISTER\_TYPEHASH function. +The options for the totalAccounts function. #### Type @@ -21655,139 +23041,210 @@ let options: { contract: ThirdwebContract } & T; ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## registerFor +## ERC4337.userOperationEventEvent - Prepares a transaction to call the "registerFor" function on the contract. +Creates an event object for the UserOperationEvent event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { registerFor } from "thirdweb/extensions/farcaster"; +import { getContractEvents } from "thirdweb"; +import { userOperationEventEvent } from "thirdweb/extensions/erc4337"; -const transaction = registerFor({ - contract, - to: ..., - recovery: ..., - deadline: ..., - sig: ..., - extraStorage: ..., - overrides: { - ... - } +const events = await getContractEvents({ +contract, +events: [ + userOperationEventEvent({ + userOpHash: ..., + sender: ..., + paymaster: ..., +}) +], }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function registerFor( - options: BaseTransactionOptions< - | RegisterForParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function userOperationEventEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "userOpHash"; + readonly type: "bytes32"; + }, + { + readonly indexed: true; + readonly name: "sender"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "paymaster"; + readonly type: "address"; + }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "success"; readonly type: "bool" }, + { readonly name: "actualGasCost"; readonly type: "uint256" }, + { readonly name: "actualGasUsed"; readonly type: "uint256" }, + ]; + readonly name: "UserOperationEvent"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the "registerFor" function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions< - | RegisterForParams - | { asyncParams: () => Promise } ->; +let filters: Partial; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "userOpHash"; + readonly type: "bytes32"; + }, + { + readonly indexed: true; + readonly name: "sender"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "paymaster"; + readonly type: "address"; + }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "success"; readonly type: "bool" }, + { readonly name: "actualGasCost"; readonly type: "uint256" }, + { readonly name: "actualGasUsed"; readonly type: "uint256" }, + ]; + readonly name: "UserOperationEvent"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## setStorageRegistryEvent +## ERC4337.userOperationRevertReasonEvent - Creates an event object for the SetStorageRegistry event. +Creates an event object for the UserOperationRevertReason event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { setStorageRegistryEvent } from "thirdweb/extensions/farcaster"; +import { userOperationRevertReasonEvent } from "thirdweb/extensions/erc4337"; const events = await getContractEvents({ - contract, - events: [setStorageRegistryEvent()], +contract, +events: [ + userOperationRevertReasonEvent({ + userOpHash: ..., + sender: ..., +}) +], }); ``` ```ts -function setStorageRegistryEvent(): PreparedEvent<{ +function userOperationRevertReasonEvent( + filters: Partial, +): PreparedEvent<{ readonly inputs: readonly [ - { readonly name: "oldStorageRegistry"; readonly type: "address" }, - { readonly name: "newStorageRegistry"; readonly type: "address" }, + { + readonly indexed: true; + readonly name: "userOpHash"; + readonly type: "bytes32"; + }, + { + readonly indexed: true; + readonly name: "sender"; + readonly type: "address"; + }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "revertReason"; readonly type: "bytes" }, ]; - readonly name: "SetStorageRegistry"; + readonly name: "UserOperationRevertReason"; readonly type: "event"; }>; ``` +### Parameters + +Optional filters to apply to the event. + +#### Type + +```ts +let filters: Partial; +``` + ### Returns ```ts let returnType: PreparedEvent<{ readonly inputs: readonly [ - { readonly name: "oldStorageRegistry"; readonly type: "address" }, - { readonly name: "newStorageRegistry"; readonly type: "address" }, + { + readonly indexed: true; + readonly name: "userOpHash"; + readonly type: "bytes32"; + }, + { + readonly indexed: true; + readonly name: "sender"; + readonly type: "address"; + }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "revertReason"; readonly type: "bytes" }, ]; - readonly name: "SetStorageRegistry"; + readonly name: "UserOperationRevertReason"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. +--- +## ERC4626 --- -## storageRegistry +## ERC4626.asset - Calls the "storageRegistry" function on the contract. +Calls the "asset" function on the contract. ### Example ```ts -import { storageRegistry } from "thirdweb/extensions/farcaster"; +import { asset } from "thirdweb/extensions/erc4626"; -const result = await storageRegistry({ +const result = await asset({ contract, }); ``` ```ts -function storageRegistry( - options: BaseTransactionOptions, -): Promise; +function asset(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for the storageRegistry function. +The options for the asset function. #### Type @@ -21801,139 +23258,103 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## adminResetEvent +## ERC4626.convertToAssets - Creates an event object for the AdminReset event. +Calls the "convertToAssets" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { adminResetEvent } from "thirdweb/extensions/farcaster"; +import { convertToAssets } from "thirdweb/extensions/erc4626"; -const events = await getContractEvents({ -contract, -events: [ - adminResetEvent({ - fid: ..., - key: ..., -}) -], +const result = await convertToAssets({ + contract, + shares: ..., }); ``` ```ts -function adminResetEvent( - filters: Partial<{ fid: bigint; key: `0x${string}` }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - ]; - readonly name: "AdminReset"; - readonly type: "event"; -}>; +function convertToAssets( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the convertToAssets function. #### Type ```ts -let filters: Partial<{ fid: bigint; key: `0x${string}` }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - ]; - readonly name: "AdminReset"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH +## ERC4626.convertToShares - Calls the "CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH" function on the contract. +Calls the "convertToShares" function on the contract. ### Example ```ts -import { CHANGE_RECOVERY_ADDRESS_TYPEHASH } from "thirdweb/extensions/farcaster"; +import { convertToShares } from "thirdweb/extensions/erc4626"; -const result = await CHANGE_RECOVERY_ADDRESS_TYPEHASH({ - contract, +const result = await convertToShares({ + contract, + assets: ..., }); ``` ```ts -function CHANGE_RECOVERY_ADDRESS_TYPEHASH( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function convertToShares( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH function. +The options for the convertToShares function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## changeRecoveryAddress +## ERC4626.deposit - Prepares a transaction to call the "changeRecoveryAddress" function on the contract. +Prepares a transaction to call the "deposit" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { changeRecoveryAddress } from "thirdweb/extensions/farcaster"; +import { deposit } from "thirdweb/extensions/erc4626"; -const transaction = changeRecoveryAddress({ +const transaction = deposit({ contract, - recovery: ..., + assets: ..., + receiver: ..., overrides: { ... } @@ -21944,24 +23365,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function changeRecoveryAddress( +function deposit( options: BaseTransactionOptions< - | ChangeRecoveryAddressParams - | { asyncParams: () => Promise } + DepositParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "changeRecoveryAddress" function. +The options for the "deposit" function. #### Type ```ts let options: BaseTransactionOptions< - | ChangeRecoveryAddressParams - | { asyncParams: () => Promise } + DepositParams | { asyncParams: () => Promise } >; ``` @@ -21975,59 +23394,61 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## changeRecoveryAddressEvent +## ERC4626.depositEvent - Creates an event object for the ChangeRecoveryAddress event. +Creates an event object for the Deposit event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { changeRecoveryAddressEvent } from "thirdweb/extensions/farcaster"; +import { depositEvent } from "thirdweb/extensions/erc4626"; const events = await getContractEvents({ contract, events: [ - changeRecoveryAddressEvent({ - id: ..., - recovery: ..., + depositEvent({ + caller: ..., + owner: ..., }) ], }); ``` ```ts -function changeRecoveryAddressEvent( - filters: Partial<{ id: bigint; recovery: string }>, +function depositEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "id"; - readonly type: "uint256"; + readonly name: "caller"; + readonly type: "address"; }, { readonly indexed: true; - readonly name: "recovery"; + readonly name: "owner"; readonly type: "address"; }, + { readonly name: "assets"; readonly type: "uint256" }, + { readonly name: "shares"; readonly type: "uint256" }, ]; - readonly name: "ChangeRecoveryAddress"; + readonly name: "Deposit"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ id: bigint; recovery: string }>; +let filters: Partial; ``` ### Returns @@ -22037,169 +23458,94 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "id"; - readonly type: "uint256"; + readonly name: "caller"; + readonly type: "address"; }, { readonly indexed: true; - readonly name: "recovery"; + readonly name: "owner"; readonly type: "address"; }, + { readonly name: "assets"; readonly type: "uint256" }, + { readonly name: "shares"; readonly type: "uint256" }, ]; - readonly name: "ChangeRecoveryAddress"; + readonly name: "Deposit"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## custodyOf +## ERC4626.maxDeposit - Calls the "custodyOf" function on the contract. +Calls the "maxDeposit" function on the contract. ### Example ```ts -import { custodyOf } from "thirdweb/extensions/farcaster"; +import { maxDeposit } from "thirdweb/extensions/erc4626"; -const result = await custodyOf({ +const result = await maxDeposit({ contract, - fid: ..., -}); -``` - -```ts -function custodyOf( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the custodyOf function. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - The parsed result of the function call. ---- - -## freezeIdGatewayEvent - - Creates an event object for the FreezeIdGateway event. - -### Example - -```ts -import { getContractEvents } from "thirdweb"; -import { freezeIdGatewayEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ - contract, - events: [freezeIdGatewayEvent()], -}); -``` - -```ts -function freezeIdGatewayEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "idGateway"; readonly type: "address" }, - ]; - readonly name: "FreezeIdGateway"; - readonly type: "event"; -}>; -``` - -### Returns - -```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "idGateway"; readonly type: "address" }, - ]; - readonly name: "FreezeIdGateway"; - readonly type: "event"; -}>; -``` - - The prepared event object. ---- - -## gatewayFrozen - - Calls the "gatewayFrozen" function on the contract. - -### Example - -```ts -import { gatewayFrozen } from "thirdweb/extensions/farcaster"; - -const result = await gatewayFrozen({ - contract, + receiver: ..., }); ``` ```ts -function gatewayFrozen( - options: BaseTransactionOptions, -): Promise; +function maxDeposit( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the gatewayFrozen function. +The options for the maxDeposit function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## idCounter +## ERC4626.maxMint - Calls the "idCounter" function on the contract. +Calls the "maxMint" function on the contract. ### Example ```ts -import { idCounter } from "thirdweb/extensions/farcaster"; +import { maxMint } from "thirdweb/extensions/erc4626"; -const result = await idCounter({ - contract, +const result = await maxMint({ + contract, + receiver: ..., }); ``` ```ts -function idCounter(options: BaseTransactionOptions): Promise; +function maxMint( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the idCounter function. +The options for the maxMint function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -22208,75 +23554,78 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## idGateway +## ERC4626.maxRedeem - Calls the "idGateway" function on the contract. +Calls the "maxRedeem" function on the contract. ### Example ```ts -import { idGateway } from "thirdweb/extensions/farcaster"; +import { maxRedeem } from "thirdweb/extensions/erc4626"; -const result = await idGateway({ - contract, +const result = await maxRedeem({ + contract, + owner: ..., }); ``` ```ts -function idGateway(options: BaseTransactionOptions): Promise; +function maxRedeem( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the idGateway function. +The options for the maxRedeem function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## idOf +## ERC4626.maxWithdraw - Calls the "idOf" function on the contract. +Calls the "maxWithdraw" function on the contract. ### Example ```ts -import { idOf } from "thirdweb/extensions/farcaster"; +import { maxWithdraw } from "thirdweb/extensions/erc4626"; -const result = await idOf({ +const result = await maxWithdraw({ contract, owner: ..., }); ``` ```ts -function idOf( - options: BaseTransactionOptions, +function maxWithdraw( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the idOf function. +The options for the maxWithdraw function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns @@ -22285,25 +23634,23 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## recover +## ERC4626.mint - Prepares a transaction to call the "recover" function on the contract. +Prepares a transaction to call the "mint" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { recover } from "thirdweb/extensions/farcaster"; +import { mint } from "thirdweb/extensions/erc4626"; -const transaction = recover({ +const transaction = mint({ contract, - from: ..., - to: ..., - deadline: ..., - sig: ..., + shares: ..., + receiver: ..., overrides: { ... } @@ -22314,22 +23661,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function recover( +function mint( options: BaseTransactionOptions< - RecoverParams | { asyncParams: () => Promise } + MintParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "recover" function. +The options for the "mint" function. #### Type ```ts let options: BaseTransactionOptions< - RecoverParams | { asyncParams: () => Promise } + MintParams | { asyncParams: () => Promise } >; ``` @@ -22343,376 +23690,280 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## recoverEvent +## ERC4626.previewDeposit - Creates an event object for the Recover event. +Calls the "previewDeposit" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { recoverEvent } from "thirdweb/extensions/farcaster"; +import { previewDeposit } from "thirdweb/extensions/erc4626"; -const events = await getContractEvents({ -contract, -events: [ - recoverEvent({ - from: ..., - to: ..., - id: ..., -}) -], +const result = await previewDeposit({ + contract, + assets: ..., }); ``` ```ts -function recoverEvent( - filters: Partial<{ from: string; id: bigint; to: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "id"; - readonly type: "uint256"; - }, - ]; - readonly name: "Recover"; - readonly type: "event"; -}>; +function previewDeposit( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the previewDeposit function. #### Type ```ts -let filters: Partial<{ from: string; id: bigint; to: string }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "id"; - readonly type: "uint256"; - }, - ]; - readonly name: "Recover"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## recoverFor +## ERC4626.previewMint - Prepares a transaction to call the "recoverFor" function on the contract. +Calls the "previewMint" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { recoverFor } from "thirdweb/extensions/farcaster"; +import { previewMint } from "thirdweb/extensions/erc4626"; -const transaction = recoverFor({ +const result = await previewMint({ contract, - from: ..., - to: ..., - recoveryDeadline: ..., - recoverySig: ..., - toDeadline: ..., - toSig: ..., - overrides: { - ... - } + shares: ..., }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function recoverFor( - options: BaseTransactionOptions< - | RecoverForParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function previewMint( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "recoverFor" function. +The options for the previewMint function. #### Type ```ts -let options: BaseTransactionOptions< - RecoverForParams | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +The parsed result of the function call. --- -## recoveryOf +## ERC4626.previewRedeem - Calls the "recoveryOf" function on the contract. +Calls the "previewRedeem" function on the contract. ### Example ```ts -import { recoveryOf } from "thirdweb/extensions/farcaster"; +import { previewRedeem } from "thirdweb/extensions/erc4626"; -const result = await recoveryOf({ +const result = await previewRedeem({ contract, - fid: ..., + shares: ..., }); ``` ```ts -function recoveryOf( - options: BaseTransactionOptions, -): Promise; +function previewRedeem( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the recoveryOf function. +The options for the previewRedeem function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## registerEvent +## ERC4626.previewWithdraw - Creates an event object for the Register event. +Calls the "previewWithdraw" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { registerEvent } from "thirdweb/extensions/farcaster"; +import { previewWithdraw } from "thirdweb/extensions/erc4626"; -const events = await getContractEvents({ -contract, -events: [ - registerEvent({ - to: ..., - id: ..., -}) -], +const result = await previewWithdraw({ + contract, + assets: ..., }); ``` ```ts -function registerEvent( - filters: Partial<{ id: bigint; to: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "id"; - readonly type: "uint256"; - }, - { readonly name: "recovery"; readonly type: "address" }, - ]; - readonly name: "Register"; - readonly type: "event"; -}>; +function previewWithdraw( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the previewWithdraw function. #### Type ```ts -let filters: Partial<{ id: bigint; to: string }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "id"; - readonly type: "uint256"; - }, - { readonly name: "recovery"; readonly type: "address" }, - ]; - readonly name: "Register"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## setIdCounterEvent +## ERC4626.redeem - Creates an event object for the SetIdCounter event. +Prepares a transaction to call the "redeem" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { setIdCounterEvent } from "thirdweb/extensions/farcaster"; +import { sendTransaction } from "thirdweb"; +import { redeem } from "thirdweb/extensions/erc4626"; -const events = await getContractEvents({ - contract, - events: [setIdCounterEvent()], +const transaction = redeem({ + contract, + shares: ..., + receiver: ..., + owner: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function setIdCounterEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldCounter"; readonly type: "uint256" }, - { readonly name: "newCounter"; readonly type: "uint256" }, - ]; - readonly name: "SetIdCounter"; - readonly type: "event"; -}>; +function redeem( + options: BaseTransactionOptions< + RedeemParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; +``` + +### Parameters + +The options for the "redeem" function. + +#### Type + +```ts +let options: BaseTransactionOptions< + RedeemParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldCounter"; readonly type: "uint256" }, - { readonly name: "newCounter"; readonly type: "uint256" }, - ]; - readonly name: "SetIdCounter"; - readonly type: "event"; -}>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The prepared event object. +A prepared transaction object. --- -## setIdGatewayEvent +## ERC4626.totalAssets - Creates an event object for the SetIdGateway event. +Calls the "totalAssets" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { setIdGatewayEvent } from "thirdweb/extensions/farcaster"; +import { totalAssets } from "thirdweb/extensions/erc4626"; -const events = await getContractEvents({ +const result = await totalAssets({ contract, - events: [setIdGatewayEvent()], }); ``` ```ts -function setIdGatewayEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldIdGateway"; readonly type: "address" }, - { readonly name: "newIdGateway"; readonly type: "address" }, - ]; - readonly name: "SetIdGateway"; - readonly type: "event"; -}>; +function totalAssets( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the totalAssets function. + +#### Type + +```ts +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldIdGateway"; readonly type: "address" }, - { readonly name: "newIdGateway"; readonly type: "address" }, - ]; - readonly name: "SetIdGateway"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## transfer +## ERC4626.withdraw - Prepares a transaction to call the "transfer" function on the contract. +Prepares a transaction to call the "withdraw" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { transfer } from "thirdweb/extensions/farcaster"; +import { withdraw } from "thirdweb/extensions/erc4626"; -const transaction = transfer({ +const transaction = withdraw({ contract, - to: ..., - deadline: ..., - sig: ..., + assets: ..., + receiver: ..., + owner: ..., overrides: { ... } @@ -22723,22 +23974,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function transfer( +function withdraw( options: BaseTransactionOptions< - TransferParams | { asyncParams: () => Promise } + WithdrawParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "transfer" function. +The options for the "withdraw" function. #### Type ```ts let options: BaseTransactionOptions< - TransferParams | { asyncParams: () => Promise } + WithdrawParams | { asyncParams: () => Promise } >; ``` @@ -22752,1100 +24003,1149 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH +## ERC4626.withdrawEvent - Calls the "TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH" function on the contract. +Creates an event object for the Withdraw event. ### Example ```ts -import { TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH } from "thirdweb/extensions/farcaster"; +import { getContractEvents } from "thirdweb"; +import { withdrawEvent } from "thirdweb/extensions/erc4626"; -const result = await TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH({ - contract, +const events = await getContractEvents({ +contract, +events: [ + withdrawEvent({ + caller: ..., + receiver: ..., + owner: ..., +}) +], }); ``` ```ts -function TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function withdrawEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "caller"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "receiver"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { readonly name: "assets"; readonly type: "uint256" }, + { readonly name: "shares"; readonly type: "uint256" }, + ]; + readonly name: "Withdraw"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH function. +Optional filters to apply to the event. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "caller"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "receiver"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "owner"; + readonly type: "address"; + }, + { readonly name: "assets"; readonly type: "uint256" }, + { readonly name: "shares"; readonly type: "uint256" }, + ]; + readonly name: "Withdraw"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. +--- +## FARCASTER --- -## TRANSFER\_TYPEHASH +## FARCASTER.addSigner - Calls the "TRANSFER\_TYPEHASH" function on the contract. +Adds farcaster signer for the given account. ### Example ```ts -import { TRANSFER_TYPEHASH } from "thirdweb/extensions/farcaster"; +import { addSigner } from "thirdweb/extensions/farcaster"; +import { sendTransaction } from "thirdweb"; -const result = await TRANSFER_TYPEHASH({ - contract, +const transaction = addSigner({ + client, + appAccount, + signerPublicKey, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function TRANSFER_TYPEHASH( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function addSigner( + options: AddSignerParams, +): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; ``` ### Parameters - The options for the TRANSFER\_TYPEHASH function. +The options for adding the signer. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: Prettify< + { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + signerPublicKey: Hex; + } & ( + | { appAccount: Account } + | { + appAccountAddress: Address; + deadline: bigint; + signedKeyRequestMetadata: Hex; + } + ) +>; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: PreparedTransaction< + [], + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object to add the signer to the account. --- -## transferAndChangeRecovery +## FARCASTER.addSignerFor - Prepares a transaction to call the "transferAndChangeRecovery" function on the contract. +Adds farcaster signer for a given user. Helpful if you want to cover the gas fee for a user. ### Example ```ts +import { addSignerFor } from "thirdweb/extensions/farcaster"; import { sendTransaction } from "thirdweb"; -import { transferAndChangeRecovery } from "thirdweb/extensions/farcaster"; -const transaction = transferAndChangeRecovery({ - contract, - to: ..., - recovery: ..., - deadline: ..., - sig: ..., - overrides: { - ... - } +const transaction = addSignerFor({ + client, + appAccount, + userAccount, + signerPublicKey, }); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function transferAndChangeRecovery( - options: BaseTransactionOptions< - | TransferAndChangeRecoveryParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function addSignerFor( + options: AddSignerForParams, +): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; ``` ### Parameters - The options for the "transferAndChangeRecovery" function. +The options for adding the signer. #### Type ```ts -let options: BaseTransactionOptions< - | TransferAndChangeRecoveryParams - | { asyncParams: () => Promise } ->; -``` - -### Returns - -```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; -``` - - A prepared transaction object. ---- - -## transferEvent - - Creates an event object for the Transfer event. - -### Example - -```ts -import { getContractEvents } from "thirdweb"; -import { transferEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ -contract, -events: [ - transferEvent({ - from: ..., - to: ..., -}) -], -}); +let options: Prettify< + { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + signerPublicKey: Hex; + } & ( + | { appAccount: Account } + | { + appAccountAddress: Address; + deadline: bigint; + signedKeyRequestMetadata: Hex; + } + ) & + ( + | { userAccount: Account } + | { addSignature: Hex; deadline: bigint; userAddress: Address } + ) +>; ``` +### Returns + ```ts -function transferEvent( - filters: Partial<{ from: string; to: string }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { readonly name: "id"; readonly type: "uint256" }, - ]; - readonly name: "Transfer"; - readonly type: "event"; -}>; +let returnType: PreparedTransaction< + [], + AbiFunction, + PrepareTransactionOptions +>; ``` -### Parameters +A prepared transaction object to add the signer to the account. +--- - Optional filters to apply to the event. +## FARCASTER.createEd25519Keypair -#### Type +Generates an Ed25519 keypair to be used as an account signer. + +### Example + +```ts +createSigner(); +``` ```ts -let filters: Partial<{ from: string; to: string }>; +function createEd25519Keypair(): Promise; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "from"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "to"; - readonly type: "address"; - }, - { readonly name: "id"; readonly type: "uint256" }, - ]; - readonly name: "Transfer"; - readonly type: "event"; -}>; +let returnType: { privateKey: Hex; publicKey: Hex }; ``` - The prepared event object. +A promise resolving to the generated keypair. --- -## transferFor +## FARCASTER.encodeSignedKeyRequestMetadata - Prepares a transaction to call the "transferFor" function on the contract. +Encodes the signed key request metadata into a hexadecimal string. This function takes in the request signer's address, the key request signature, the request Fid, and the deadline, and returns the encoded ABI parameters as a hexadecimal string. It's used to prepare the metadata for transactions involving signed key requests. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { transferFor } from "thirdweb/extensions/farcaster"; - -const transaction = transferFor({ - contract, - from: ..., - to: ..., - fromDeadline: ..., - fromSig: ..., - toDeadline: ..., - toSig: ..., - overrides: { - ... - } +const encodedMetadata = encodeSignedKeyRequestMetadata({ + requestSigner: "0x123...", + keyRequestSignature: "0xabcd...", + requestFid: 123456789n, + deadline: 1657758061n, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function transferFor( - options: BaseTransactionOptions< - | TransferForParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function encodeSignedKeyRequestMetadata(options: { + deadline: bigint; + keyRequestSignature: `0x${string}`; + requestFid: bigint; + requestSigner: string; +}): `0x${string}`; ``` ### Parameters - The options for the "transferFor" function. +The options for encoding the signed key request metadata. #### Type ```ts -let options: BaseTransactionOptions< - | TransferForParams - | { asyncParams: () => Promise } ->; +let options: { + deadline: bigint; + keyRequestSignature: `0x${string}`; + requestFid: bigint; + requestSigner: string; +}; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: `0x${string}`; ``` - A prepared transaction object. +The encoded ABI parameters as a hexadecimal string. --- -## verifyFidSignature +## FARCASTER.getAddData - Calls the "verifyFidSignature" function on the contract. +Prepares the data required for signing an Add message according to EIP-712. ### Example -```ts -import { verifyFidSignature } from "thirdweb/extensions/farcaster"; +```typescript +const message: AddMessage = { + owner: "0xYourAddress", + keyType: 1, + key: "0xYourPublicKey", + metadataType: 1, + metadata: "0xYourMetadata", + nonce: BigInt("YourNonce"), + deadline: BigInt("YourDeadline"), +}; -const result = await verifyFidSignature({ - contract, - custodyAddress: ..., - fid: ..., - digest: ..., - sig: ..., -}); +const data = getAddData(message); ``` ```ts -function verifyFidSignature( - options: BaseTransactionOptions, -): Promise; +function getAddData(message: AddMessage): { + domain: { + readonly chainId: 10; + readonly name: "Farcaster KeyGateway"; + readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; + readonly version: "1"; + }; + message: AddMessage; + primaryType: "Add"; + types: { + readonly Add: readonly [ + { readonly name: "owner"; readonly type: "address" }, + { readonly name: "keyType"; readonly type: "uint32" }, + { readonly name: "key"; readonly type: "bytes" }, + { readonly name: "metadataType"; readonly type: "uint8" }, + { readonly name: "metadata"; readonly type: "bytes" }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "deadline"; readonly type: "uint256" }, + ]; + }; +}; ``` ### Parameters - The options for the verifyFidSignature function. +The AddMessage object containing the message to be signed. #### Type ```ts -let options: BaseTransactionOptions; +let message: { + deadline: bigint; + key: Hex; + keyType: number; + metadata: Hex; + metadataType: number; + nonce: bigint; + owner: Address; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + domain: { + readonly chainId: 10; + readonly name: "Farcaster KeyGateway"; + readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; + readonly version: "1"; + }; + message: AddMessage; + primaryType: "Add"; + types: { + readonly Add: readonly [ + { readonly name: "owner"; readonly type: "address" }, + { readonly name: "keyType"; readonly type: "uint32" }, + { readonly name: "key"; readonly type: "bytes" }, + { readonly name: "metadataType"; readonly type: "uint8" }, + { readonly name: "metadata"; readonly type: "bytes" }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "deadline"; readonly type: "uint256" }, + ]; + }; +}; ``` - The parsed result of the function call. +The data object structured according to EIP-712, ready for signing. --- -## add +## FARCASTER.getBundler - Prepares a transaction to call the "add" function on the contract. +Retrieves the Bundler contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { add } from "thirdweb/extensions/farcaster"; +import { getBundler } from "thirdweb/extensions/farcaster"; -const transaction = add({ - contract, - keyType: ..., - key: ..., - metadataType: ..., - metadata: ..., - overrides: { - ... - } +const bundler = await getBundler({ + client, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function add( - options: BaseTransactionOptions< - AddParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getBundler(options: FarcasterContractOptions): Readonly; ``` ### Parameters - The options for the "add" function. +The thirdweb client and an optional custom chain. #### Type ```ts -let options: BaseTransactionOptions< - AddParams | { asyncParams: () => Promise } ->; +let options: { chain?: Chain; client: ThirdwebClient }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Readonly; ``` - A prepared transaction object. +The Bundler contract instance. --- -## ADD\_TYPEHASH +## FARCASTER.getFid - Calls the "ADD\_TYPEHASH" function on the contract. +Retrieves the current fid for an account. ### Example ```ts -import { ADD_TYPEHASH } from "thirdweb/extensions/farcaster"; +import { getFid } from "thirdweb/extensions/farcaster"; -const result = await ADD_TYPEHASH({ - contract, +const price = await getFid({ + client, + address, }); ``` ```ts -function ADD_TYPEHASH( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function getFid(options: GetFidParams): Promise; ``` ### Parameters - The options for the ADD\_TYPEHASH function. +Parameters to pass to the function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + address: Address; + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; +}; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves to the account's fid, if one exists, otherwise 0. --- -## addFor +## FARCASTER.getIdGateway - Prepares a transaction to call the "addFor" function on the contract. +Retrieves the IdGateway contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { addFor } from "thirdweb/extensions/farcaster"; +import { getIdGatway } from "thirdweb/extensions/farcaster"; -const transaction = addFor({ - contract, - fidOwner: ..., - keyType: ..., - key: ..., - metadataType: ..., - metadata: ..., - deadline: ..., - sig: ..., - overrides: { - ... - } +const idGateway = await getIdGateway({ + client, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function addFor( - options: BaseTransactionOptions< - AddForParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function getIdGateway(options: FarcasterContractOptions): Readonly; ``` ### Parameters - The options for the "addFor" function. +The thirdweb client and an optional custom chain. #### Type ```ts -let options: BaseTransactionOptions< - AddForParams | { asyncParams: () => Promise } ->; +let options: { chain?: Chain; client: ThirdwebClient }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Readonly; ``` - A prepared transaction object. +The IdGateway contract instance. --- -## keyRegistry +## FARCASTER.getIdRegistry - Calls the "keyRegistry" function on the contract. +Retrieves the IdRegistry contract. ### Example ```ts -import { keyRegistry } from "thirdweb/extensions/farcaster"; +import { getIdRegistry } from "thirdweb/extensions/farcaster"; -const result = await keyRegistry({ - contract, +const idRegistry = await getIdRegistry({ + client, }); ``` ```ts -function keyRegistry( - options: BaseTransactionOptions, -): Promise; +function getIdRegistry(options: FarcasterContractOptions): Readonly; ``` ### Parameters - The options for the keyRegistry function. +The thirdweb client and an optional custom chain. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { chain?: Chain; client: ThirdwebClient }; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Readonly; ``` - The parsed result of the function call. +The IdRegistry contract instance. --- -## nonces +## FARCASTER.getKeyGateway - Calls the "nonces" function on the contract. +Retrieves the KeyGateway contract. ### Example ```ts -import { nonces } from "thirdweb/extensions/farcaster"; +import { getKeyGateway } from "thirdweb/extensions/farcaster"; -const result = await nonces({ - contract, - account: ..., +const keyGateway = await getKeyGateway({ + client, }); ``` ```ts -function nonces( - options: BaseTransactionOptions, -): Promise; +function getKeyGateway(options: FarcasterContractOptions): Readonly; ``` ### Parameters - The options for the nonces function. +The thirdweb client and an optional custom chain. #### Type ```ts -let options: BaseTransactionOptions; +let options: { chain?: Chain; client: ThirdwebClient }; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Readonly; ``` - The parsed result of the function call. +The KeyGateway contract instance. --- -## addEvent +## FARCASTER.getKeyRequestData - Creates an event object for the Add event. +Prepares the data required for signing a key request using EIP-712 typed data signing. This includes the domain, types, primary type, and the message to be signed. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { addEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ -contract, -events: [ - addEvent({ - fid: ..., - keyType: ..., - key: ..., -}) -], -}); +const message = { + requestFid: 123456789n, + key: "0x04bfc...", + deadline: 1657758061n, +}; +const eip712Data = getKeyRequestData(message); ``` ```ts -function addEvent( - filters: Partial<{ - fid: bigint; - key: `0x${string}`; - keyType: number; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "keyType"; - readonly type: "uint32"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - { readonly name: "metadataType"; readonly type: "uint8" }, - { readonly name: "metadata"; readonly type: "bytes" }, - ]; - readonly name: "Add"; - readonly type: "event"; -}>; +function getKeyRequestData(message: SignedKeyRequestMessage): { + domain: { + readonly chainId: 10; + readonly name: "Farcaster SignedKeyRequestValidator"; + readonly verifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553"; + readonly version: "1"; + }; + message: SignedKeyRequestMessage; + primaryType: "SignedKeyRequest"; + types: { + readonly SignedKeyRequest: Array<{ name: string; type: string }>; + }; +}; ``` ### Parameters - Optional filters to apply to the event. +The message to be signed, containing the request FID, key, and deadline. #### Type ```ts -let filters: Partial<{ - fid: bigint; - key: `0x${string}`; - keyType: number; -}>; +let message: { deadline: bigint; key: Hex; requestFid: bigint }; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "keyType"; - readonly type: "uint32"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - { readonly name: "metadataType"; readonly type: "uint8" }, - { readonly name: "metadata"; readonly type: "bytes" }, - ]; - readonly name: "Add"; - readonly type: "event"; -}>; +let returnType: { + domain: { + readonly chainId: 10; + readonly name: "Farcaster SignedKeyRequestValidator"; + readonly verifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553"; + readonly version: "1"; + }; + message: SignedKeyRequestMessage; + primaryType: "SignedKeyRequest"; + types: { + readonly SignedKeyRequest: Array<{ name: string; type: string }>; + }; +}; ``` - The prepared event object. +An object containing the domain, types, primary type, and the message for EIP-712 signing. --- -## adminResetEvent +## FARCASTER.getNonce - Creates an event object for the AdminReset event. +Retrieves the current key gateway nonce for an account. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { adminResetEvent } from "thirdweb/extensions/farcaster"; +import { getNonce } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ -contract, -events: [ - adminResetEvent({ - fid: ..., - key: ..., -}) -], +const nonce = await getNonce({ + client, + address, }); ``` ```ts -function adminResetEvent( - filters: Partial<{ fid: bigint; key: `0x${string}` }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - ]; - readonly name: "AdminReset"; - readonly type: "event"; -}>; +function getNonce(options: GetNonceParams): Promise; ``` ### Parameters - Optional filters to apply to the event. +Parameters to pass to the function. #### Type ```ts -let filters: Partial<{ fid: bigint; key: `0x${string}` }>; +let options: { + address: Address; + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; +}; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - ]; - readonly name: "AdminReset"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +A promise that resolves to the current nonce. --- -## freezeKeyGatewayEvent +## FARCASTER.getRegisterData - Creates an event object for the FreezeKeyGateway event. +Constructs the data required for signing a register message in the Farcaster ID Gateway. This includes the EIP-712 domain, types, and the message to be signed. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { freezeKeyGatewayEvent } from "thirdweb/extensions/farcaster"; +import { getRegisterData } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ - contract, - events: [freezeKeyGatewayEvent()], -}); +const data = getRegisterData(message); ``` ```ts -function freezeKeyGatewayEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "keyGateway"; readonly type: "address" }, - ]; - readonly name: "FreezeKeyGateway"; - readonly type: "event"; -}>; +function getRegisterData(message: RegisterMessage): { + domain: { + readonly chainId: 10; + readonly name: "Farcaster IdGateway"; + readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69"; + readonly version: "1"; + }; + message: RegisterMessage; + primaryType: "Register"; + types: { + readonly Register: readonly [ + { readonly name: "to"; readonly type: "address" }, + { readonly name: "recovery"; readonly type: "address" }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "deadline"; readonly type: "uint256" }, + ]; + }; +}; +``` + +### Parameters + +The register message containing the necessary information for the signature. + +#### Type + +```ts +let message: { + deadline: bigint; + nonce: bigint; + recovery: Address; + to: Address; +}; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "keyGateway"; readonly type: "address" }, - ]; - readonly name: "FreezeKeyGateway"; - readonly type: "event"; -}>; +let returnType: { + domain: { + readonly chainId: 10; + readonly name: "Farcaster IdGateway"; + readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69"; + readonly version: "1"; + }; + message: RegisterMessage; + primaryType: "Register"; + types: { + readonly Register: readonly [ + { readonly name: "to"; readonly type: "address" }, + { readonly name: "recovery"; readonly type: "address" }, + { readonly name: "nonce"; readonly type: "uint256" }, + { readonly name: "deadline"; readonly type: "uint256" }, + ]; + }; +}; ``` - The prepared event object. +An object containing the EIP-712 domain, types, and the message, ready to be signed. --- -## gatewayFrozen +## FARCASTER.getRegistrationPrice - Calls the "gatewayFrozen" function on the contract. +Retrieves the current cost to register a Farcaster fid in wei. ### Example ```ts -import { gatewayFrozen } from "thirdweb/extensions/farcaster"; +import { getRegistrationPrice } from "thirdweb/extensions/farcaster"; -const result = await gatewayFrozen({ - contract, +const price = await getRegistrationPrice({ + client, }); ``` ```ts -function gatewayFrozen( - options: BaseTransactionOptions, -): Promise; +function getRegistrationPrice( + options: GetRegistrationPriceParams, +): Promise; ``` ### Parameters - The options for the gatewayFrozen function. +An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + extraStorage?: bigint | number | string; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves to the current cost of a Farcaster fid in wei. --- -## idRegistry +## FARCASTER.getSignedKeyRequestMetadata - Calls the "idRegistry" function on the contract. +Generates the signed key request metadata to add a signer to an account. This function can either sign a new key request using an account object or use an existing key request signature. It prepares the metadata necessary for transactions involving signed key requests. ### Example ```ts -import { idRegistry } from "thirdweb/extensions/farcaster"; +import { getSignedKeyRequestMetadata } from "thirdweb/extensions/farcaster"; -const result = await idRegistry({ - contract, +// Using an existing signature +const signedMetadata = await getSignedKeyRequestMetadata({ + keyRequestSignature: "0xabcd...", + accountAddress: "0x123...", + message: { + requestFid: 123456789n, + deadline: 1657758061n, + }, +}); + +// Signing a new key request +const signedMetadata = await getSignedKeyRequestMetadata({ + account, + message: { + requestFid: 123456789n, + deadline: 1657758061n, + }, }); ``` ```ts -function idRegistry(options: BaseTransactionOptions): Promise; +function getSignedKeyRequestMetadata( + options: SignedKeyRequestMetadataOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the idRegistry function. +The options for signing the key request or using an existing signature. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: Prettify< + { message: SignedKeyRequestMessage } & ( + | { account: Account } + | { accountAddress: Address; keyRequestSignature: Hex } + ) +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +A promise that resolves to the hexadecimal string of the encoded ABI parameters. --- -## keyAt +## FARCASTER.getStoragePrice - Calls the "keyAt" function on the contract. +Retrieves the current cost to register a Farcaster fid in wei. ### Example ```ts -import { keyAt } from "thirdweb/extensions/farcaster"; +import { getStoragePrice } from "thirdweb/extensions/farcaster"; -const result = await keyAt({ - contract, - fid: ..., - state: ..., - index: ..., +const price = await getStoragePrice({ + client, }); ``` ```ts -function keyAt( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function getStoragePrice( + options: GetStoragePriceParams, +): Promise; ``` ### Parameters - The options for the keyAt function. +An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. #### Type ```ts -let options: BaseTransactionOptions; +let options: { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + units?: bigint | number | string; +}; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves to the current cost of a Farcaster fid in USD. --- -## keyDataOf +## FARCASTER.getStorageRegistry - Calls the "keyDataOf" function on the contract. +Retrieves the StorageRegistry contract. ### Example ```ts -import { keyDataOf } from "thirdweb/extensions/farcaster"; +import { getStorageRegistry } from "thirdweb/extensions/farcaster"; -const result = await keyDataOf({ - contract, - fid: ..., - key: ..., +const storageRegistry = await getStorageRegistry({ + client, }); ``` ```ts -function keyDataOf( - options: BaseTransactionOptions, -): Promise; +function getStorageRegistry( + options: FarcasterContractOptions, +): Readonly; ``` ### Parameters - The options for the keyDataOf function. +The thirdweb client and an optional custom chain. #### Type ```ts -let options: BaseTransactionOptions; +let options: { chain?: Chain; client: ThirdwebClient }; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Readonly; ``` - The parsed result of the function call. +The StorageRegistry contract instance. --- -## keyGateway +## FARCASTER.getUsdRegistrationPrice - Calls the "keyGateway" function on the contract. +Retrieves the current cost to register a Farcaster fid in USD. ### Example ```ts -import { keyGateway } from "thirdweb/extensions/farcaster"; +import { getUsdRegistrationPrice } from "thirdweb/extensions/farcaster"; -const result = await keyGateway({ - contract, +const price = await getUsdRegistrationPrice({ + client, }); ``` ```ts -function keyGateway(options: BaseTransactionOptions): Promise; +function getUsdRegistrationPrice( + options: GetUsdRegistrationPriceParams, +): Promise; ``` ### Parameters - The options for the keyGateway function. +An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + extraStorage?: bigint | number | string; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves to the current cost of a Farcaster fid in USD. --- -## keysOf +## FARCASTER.getUsdStoragePrice - Calls the "keysOf" function on the contract. +Retrieves the current cost to register a Farcaster fid in USD. ### Example ```ts -import { keysOf } from "thirdweb/extensions/farcaster"; +import { getUsdStoragePrice } from "thirdweb/extensions/farcaster"; -const result = await keysOf({ - contract, - fid: ..., - state: ..., +const price = await getUsdStoragePrice({ + client, }); ``` ```ts -function keysOf(options: BaseTransactionOptions) : Promise> +function getUsdStoragePrice( + options: GetUsdStoragePriceParams, +): Promise; ``` ### Parameters - The options for the keysOf function. +An object containing a client to use to fetch the price and the amount of extra storage to include in the returned price. #### Type ```ts -let options: BaseTransactionOptions; +let options: { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + units?: bigint | number | string; +}; ``` ### Returns ```ts -let returnType: Promise> +let returnType: Promise; ``` - The parsed result of the function call. +A promise that resolves to the current cost of a Farcaster fid in USD. --- -## maxKeysPerFid +## FARCASTER.registerFid - Calls the "maxKeysPerFid" function on the contract. +Registers a Farcaster fid for the given wallet. ### Example ```ts -import { maxKeysPerFid } from "thirdweb/extensions/farcaster"; +import { registerFid } from "thirdweb/extensions/farcaster"; +import { sendTransaction } from "thirdweb"; -const result = await maxKeysPerFid({ - contract, +const transaction = registerFid({ + client, + recoveryAddress, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function maxKeysPerFid( - options: BaseTransactionOptions, -): Promise; +function registerFid( + options: RegisterFidParams, +): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; ``` ### Parameters - The options for the maxKeysPerFid function. +The options for registering an account. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + extraStorage?: bigint | string | number; + recoveryAddress: Address; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + [], + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object to register the account. --- -## remove +## FARCASTER.registerFidAndSigner - Prepares a transaction to call the "remove" function on the contract. +Registers a Farcaster fid and signer for the given wallet using the provided app account. ### Example ```ts +import { registerFidAndSigner } from "thirdweb/extensions/farcaster"; import { sendTransaction } from "thirdweb"; -import { remove } from "thirdweb/extensions/farcaster"; -const transaction = remove({ - contract, - key: ..., - overrides: { - ... - } +const transaction = registerFidAndSigner({ + client, + userAccount, + appAccount, + recoveryAddress, + signerPublicKey, }); -// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function remove( - options: BaseTransactionOptions< - RemoveParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function registerFidAndSigner( + options: RegisterFidAndSignerParams, +): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; ``` ### Parameters - The options for the "remove" function. +The options for registering an account. #### Type ```ts -let options: BaseTransactionOptions< - RemoveParams | { asyncParams: () => Promise } +let options: Prettify< + { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + extraStorage?: bigint | number; + recoveryAddress: Address; + signerPublicKey: Hex; + } & ( + | { userAccount: Account } + | { + addSignature: Hex; + deadline: bigint; + registerSignature: Hex; + userAddress: Address; + } + ) & + ( + | { appAccount: Account } + | { + appAccountAddress: Address; + deadline: bigint; + signedKeyRequestMetadata: Hex; + } + ) >; ``` @@ -23853,523 +25153,372 @@ let options: BaseTransactionOptions< ```ts let returnType: PreparedTransaction< - any, + [], AbiFunction, PrepareTransactionOptions >; ``` - A prepared transaction object. +A prepared transaction object to register the account. --- -## REMOVE\_TYPEHASH +## FARCASTER.rentStorage - Calls the "REMOVE\_TYPEHASH" function on the contract. +Rent storage for the provided farcaster fid. ### Example ```ts -import { REMOVE_TYPEHASH } from "thirdweb/extensions/farcaster"; +import { rentStorage } from "thirdweb/extensions/farcaster"; +import { sendTransaction } from "thirdweb"; -const result = await REMOVE_TYPEHASH({ - contract, +const transaction = rentStorage({ + client, + fid, + units, }); + +await sendTransaction({ transaction, account }); ``` ```ts -function REMOVE_TYPEHASH( - options: BaseTransactionOptions, -): Promise<`0x${string}`>; +function rentStorage( + options: RentStorageParams, +): PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>; ``` ### Parameters - The options for the REMOVE\_TYPEHASH function. +The options for calling the `rentStorage` function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: { + chain?: Chain; + client: ThirdwebClient; + disableCache?: boolean; + fid: bigint | number | string; + units?: bigint | number | string; +}; ``` ### Returns ```ts -let returnType: Promise<`0x${string}`>; +let returnType: PreparedTransaction< + [], + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object to rent the storage. --- -## removeEvent +## FARCASTER.signAdd - Creates an event object for the Remove event. +Signs an Add message using the account's signTypedData method. ### Example -```ts -import { getContractEvents } from "thirdweb"; -import { removeEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ -contract, -events: [ - removeEvent({ - fid: ..., - key: ..., -}) -], +```typescript +const signedMessage = await signAdd({ + account: yourAccount, + message: yourAddMessage, }); ``` ```ts -function removeEvent( - filters: Partial<{ fid: bigint; key: `0x${string}` }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - ]; - readonly name: "Remove"; - readonly type: "event"; -}>; +function signAdd(options: SignAddOptions): Promise<`0x${string}`>; ``` ### Parameters - Optional filters to apply to the event. +The options for signing the Add message. #### Type ```ts -let filters: Partial<{ fid: bigint; key: `0x${string}` }>; +let options: { account: Account; message: AddMessage }; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "fid"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "key"; - readonly type: "bytes"; - }, - { readonly name: "keyBytes"; readonly type: "bytes" }, - ]; - readonly name: "Remove"; - readonly type: "event"; -}>; +let returnType: Promise<`0x${string}`>; ``` - The prepared event object. +A promise that resolves to the signature of the Add message. --- -## removeFor +## FARCASTER.signKeyRequest - Prepares a transaction to call the "removeFor" function on the contract. +Signs a key request message using EIP-712 typed data signing. This function prepares the data for signing, signs it with the provided account, and returns the signature. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { removeFor } from "thirdweb/extensions/farcaster"; - -const transaction = removeFor({ - contract, - fidOwner: ..., - key: ..., - deadline: ..., - sig: ..., - overrides: { - ... - } -}); +const message = { + requestFid: 123456789n, + key: "0x04bfc...", + deadline: 1657758061n, +}; -// Send the transaction -await sendTransaction({ transaction, account }); +const signature = signKeyRequest({ account: signerAccount, message }); ``` ```ts -function removeFor( - options: BaseTransactionOptions< - RemoveForParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function signKeyRequest( + options: SignKeyRequestOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the "removeFor" function. +The options for signing the key request, including the account and the message. #### Type ```ts -let options: BaseTransactionOptions< - RemoveForParams | { asyncParams: () => Promise } ->; +let options: { account: Account; message: SignedKeyRequestMessage }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise<`0x${string}`>; ``` - A prepared transaction object. +A promise that resolves to the signature of the key request. --- -## setIdRegistryEvent +## FARCASTER.signRegister - Creates an event object for the SetIdRegistry event. +Signs the register message for Farcaster ID Gateway. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { setIdRegistryEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ - contract, - events: [setIdRegistryEvent()], -}); -``` - -```ts -function setIdRegistryEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldIdRegistry"; readonly type: "address" }, - { readonly name: "newIdRegistry"; readonly type: "address" }, - ]; - readonly name: "SetIdRegistry"; - readonly type: "event"; -}>; +const signature = await signRegister({ account, message }); ``` -### Returns - ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldIdRegistry"; readonly type: "address" }, - { readonly name: "newIdRegistry"; readonly type: "address" }, - ]; - readonly name: "SetIdRegistry"; - readonly type: "event"; -}>; +function signRegister( + options: SignRegisterOptions, +): Promise<`0x${string}`>; ``` - The prepared event object. ---- - -## setKeyGatewayEvent - - Creates an event object for the SetKeyGateway event. +### Parameters -### Example +The signing options. -```ts -import { getContractEvents } from "thirdweb"; -import { setKeyGatewayEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ - contract, - events: [setKeyGatewayEvent()], -}); -``` +#### Type ```ts -function setKeyGatewayEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldKeyGateway"; readonly type: "address" }, - { readonly name: "newKeyGateway"; readonly type: "address" }, - ]; - readonly name: "SetKeyGateway"; - readonly type: "event"; -}>; +let options: { account: Account; message: RegisterMessage }; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldKeyGateway"; readonly type: "address" }, - { readonly name: "newKeyGateway"; readonly type: "address" }, - ]; - readonly name: "SetKeyGateway"; - readonly type: "event"; -}>; +let returnType: Promise<`0x${string}`>; ``` - The prepared event object. +A promise that resolves to the signature. --- -## setMaxKeysPerFidEvent +## FARCASTER.idGateway - Creates an event object for the SetMaxKeysPerFid event. +Calls the "idGateway" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { setMaxKeysPerFidEvent } from "thirdweb/extensions/farcaster"; +import { idGateway } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ +const result = await idGateway({ contract, - events: [setMaxKeysPerFidEvent()], }); ``` ```ts -function setMaxKeysPerFidEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldMax"; readonly type: "uint256" }, - { readonly name: "newMax"; readonly type: "uint256" }, - ]; - readonly name: "SetMaxKeysPerFid"; - readonly type: "event"; -}>; -``` - -### Returns - -```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "oldMax"; readonly type: "uint256" }, - { readonly name: "newMax"; readonly type: "uint256" }, - ]; - readonly name: "SetMaxKeysPerFid"; - readonly type: "event"; -}>; +function idGateway(options: BaseTransactionOptions): Promise; ``` - The prepared event object. ---- - -## setValidatorEvent - - Creates an event object for the SetValidator event. +### Parameters -### Example +The options for the idGateway function. -```ts -import { getContractEvents } from "thirdweb"; -import { setValidatorEvent } from "thirdweb/extensions/farcaster"; - -const events = await getContractEvents({ - contract, - events: [setValidatorEvent()], -}); -``` +#### Type ```ts -function setValidatorEvent(): PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "keyType"; readonly type: "uint32" }, - { readonly name: "metadataType"; readonly type: "uint8" }, - { readonly name: "oldValidator"; readonly type: "address" }, - { readonly name: "newValidator"; readonly type: "address" }, - ]; - readonly name: "SetValidator"; - readonly type: "event"; -}>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { readonly name: "keyType"; readonly type: "uint32" }, - { readonly name: "metadataType"; readonly type: "uint8" }, - { readonly name: "oldValidator"; readonly type: "address" }, - { readonly name: "newValidator"; readonly type: "address" }, - ]; - readonly name: "SetValidator"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## totalKeys +## FARCASTER.keyGateway - Calls the "totalKeys" function on the contract. +Calls the "keyGateway" function on the contract. ### Example ```ts -import { totalKeys } from "thirdweb/extensions/farcaster"; +import { keyGateway } from "thirdweb/extensions/farcaster"; -const result = await totalKeys({ - contract, - fid: ..., - state: ..., +const result = await keyGateway({ + contract, }); ``` ```ts -function totalKeys( - options: BaseTransactionOptions, -): Promise; +function keyGateway(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for the totalKeys function. +The options for the keyGateway function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## batchRent +## FARCASTER.price - Prepares a transaction to call the "batchRent" function on the contract. +Calls the "price" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { batchRent } from "thirdweb/extensions/farcaster"; +import { price } from "thirdweb/extensions/farcaster"; -const transaction = batchRent({ +const result = await price({ contract, - fids: ..., - units: ..., - overrides: { - ... - } + extraStorage: ..., }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function batchRent( - options: BaseTransactionOptions< - BatchRentParams | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function price( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "batchRent" function. +The options for the price function. #### Type ```ts -let options: BaseTransactionOptions< - BatchRentParams | { asyncParams: () => Promise } ->; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +The parsed result of the function call. --- -## deprecationTimestamp +## FARCASTER.register - Calls the "deprecationTimestamp" function on the contract. +Prepares a transaction to call the "register" function on the contract. ### Example ```ts -import { deprecationTimestamp } from "thirdweb/extensions/farcaster"; +import { sendTransaction } from "thirdweb"; +import { register } from "thirdweb/extensions/farcaster"; -const result = await deprecationTimestamp({ - contract, +const transaction = register({ + contract, + recovery: ..., + extraStorage: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function deprecationTimestamp( - options: BaseTransactionOptions, -): Promise; +function register( + options: BaseTransactionOptions< + RegisterParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the deprecationTimestamp function. +The options for the "register" function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions< + RegisterParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## maxUnits +## FARCASTER.idRegistry - Calls the "maxUnits" function on the contract. +Calls the "idRegistry" function on the contract. ### Example ```ts -import { maxUnits } from "thirdweb/extensions/farcaster"; +import { idRegistry } from "thirdweb/extensions/farcaster"; -const result = await maxUnits({ +const result = await idRegistry({ contract, }); ``` ```ts -function maxUnits(options: BaseTransactionOptions): Promise; +function idRegistry(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for the maxUnits function. +The options for the idRegistry function. #### Type @@ -24380,15 +25529,15 @@ let options: { contract: ThirdwebContract } & T; ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## price +## FARCASTER.price - Calls the "price" function on the contract. +Calls the "price" function on the contract. ### Example @@ -24397,7 +25546,7 @@ import { price } from "thirdweb/extensions/farcaster"; const result = await price({ contract, - units: ..., + extraStorage: ..., }); ``` @@ -24409,7 +25558,7 @@ function price( ### Parameters - The options for the price function. +The options for the price function. #### Type @@ -24423,23 +25572,23 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## rent +## FARCASTER.register - Prepares a transaction to call the "rent" function on the contract. +Prepares a transaction to call the "register" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { rent } from "thirdweb/extensions/farcaster"; +import { register } from "thirdweb/extensions/farcaster"; -const transaction = rent({ +const transaction = register({ contract, - fid: ..., - units: ..., + recovery: ..., + extraStorage: ..., overrides: { ... } @@ -24450,22 +25599,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function rent( +function register( options: BaseTransactionOptions< - RentParams | { asyncParams: () => Promise } + RegisterParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "rent" function. +The options for the "register" function. #### Type ```ts let options: BaseTransactionOptions< - RentParams | { asyncParams: () => Promise } + RegisterParams | { asyncParams: () => Promise } >; ``` @@ -24479,32 +25628,32 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## rentedUnits +## FARCASTER.REGISTER\_TYPEHASH - Calls the "rentedUnits" function on the contract. +Calls the "REGISTER\_TYPEHASH" function on the contract. ### Example ```ts -import { rentedUnits } from "thirdweb/extensions/farcaster"; +import { REGISTER_TYPEHASH } from "thirdweb/extensions/farcaster"; -const result = await rentedUnits({ +const result = await REGISTER_TYPEHASH({ contract, }); ``` ```ts -function rentedUnits( +function REGISTER_TYPEHASH( options: BaseTransactionOptions, -): Promise; +): Promise<`0x${string}`>; ``` ### Parameters - The options for the rentedUnits function. +The options for the REGISTER\_TYPEHASH function. #### Type @@ -24515,1315 +25664,1613 @@ let options: { contract: ThirdwebContract } & T; ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## unitPrice +## FARCASTER.registerFor - Calls the "unitPrice" function on the contract. +Prepares a transaction to call the "registerFor" function on the contract. ### Example ```ts -import { unitPrice } from "thirdweb/extensions/farcaster"; +import { sendTransaction } from "thirdweb"; +import { registerFor } from "thirdweb/extensions/farcaster"; -const result = await unitPrice({ - contract, +const transaction = registerFor({ + contract, + to: ..., + recovery: ..., + deadline: ..., + sig: ..., + extraStorage: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function unitPrice(options: BaseTransactionOptions): Promise; +function registerFor( + options: BaseTransactionOptions< + | RegisterForParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the unitPrice function. +The options for the "registerFor" function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions< + | RegisterForParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## usdUnitPrice +## FARCASTER.setStorageRegistryEvent - Calls the "usdUnitPrice" function on the contract. +Creates an event object for the SetStorageRegistry event. ### Example ```ts -import { usdUnitPrice } from "thirdweb/extensions/farcaster"; +import { getContractEvents } from "thirdweb"; +import { setStorageRegistryEvent } from "thirdweb/extensions/farcaster"; -const result = await usdUnitPrice({ +const events = await getContractEvents({ contract, + events: [setStorageRegistryEvent()], }); ``` ```ts -function usdUnitPrice( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the usdUnitPrice function. - -#### Type - -```ts -let options: { contract: ThirdwebContract } & T; +function setStorageRegistryEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldStorageRegistry"; readonly type: "address" }, + { readonly name: "newStorageRegistry"; readonly type: "address" }, + ]; + readonly name: "SetStorageRegistry"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldStorageRegistry"; readonly type: "address" }, + { readonly name: "newStorageRegistry"; readonly type: "address" }, + ]; + readonly name: "SetStorageRegistry"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. ---- -## LENS +The prepared event object. --- -## exists +## FARCASTER.storageRegistry - Calls the "exists" function on the contract. +Calls the "storageRegistry" function on the contract. ### Example ```ts -import { exists } from "thirdweb/extensions/lens"; +import { storageRegistry } from "thirdweb/extensions/farcaster"; -const result = await exists({ - contract, - tokenId: ..., +const result = await storageRegistry({ + contract, }); ``` ```ts -function exists( - options: BaseTransactionOptions, -): Promise; +function storageRegistry( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the exists function. +The options for the storageRegistry function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getContentURI +## FARCASTER.adminResetEvent - Calls the "getContentURI" function on the contract. +Creates an event object for the AdminReset event. ### Example ```ts -import { getContentURI } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { adminResetEvent } from "thirdweb/extensions/farcaster"; -const result = await getContentURI({ - contract, - profileId: ..., - pubId: ..., +const events = await getContractEvents({ +contract, +events: [ + adminResetEvent({ + fid: ..., + key: ..., +}) +], }); ``` ```ts -function getContentURI( - options: BaseTransactionOptions, -): Promise; +function adminResetEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "fid"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "key"; + readonly type: "bytes"; + }, + { readonly name: "keyBytes"; readonly type: "bytes" }, + ]; + readonly name: "AdminReset"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the getContentURI function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "fid"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "key"; + readonly type: "bytes"; + }, + { readonly name: "keyBytes"; readonly type: "bytes" }, + ]; + readonly name: "AdminReset"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getDefaultHandle +## FARCASTER.CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH - Calls the "getDefaultHandle" function on the contract. +Calls the "CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH" function on the contract. ### Example ```ts -import { getDefaultHandle } from "thirdweb/extensions/lens"; +import { CHANGE_RECOVERY_ADDRESS_TYPEHASH } from "thirdweb/extensions/farcaster"; -const result = await getDefaultHandle({ - contract, - profileId: ..., +const result = await CHANGE_RECOVERY_ADDRESS_TYPEHASH({ + contract, }); ``` ```ts -function getDefaultHandle( - options: BaseTransactionOptions, -): Promise; +function CHANGE_RECOVERY_ADDRESS_TYPEHASH( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the getDefaultHandle function. +The options for the CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getFollowData +## FARCASTER.changeRecoveryAddress - Calls the "getFollowData" function on the contract. +Prepares a transaction to call the "changeRecoveryAddress" function on the contract. ### Example ```ts -import { getFollowData } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { changeRecoveryAddress } from "thirdweb/extensions/farcaster"; -const result = await getFollowData({ +const transaction = changeRecoveryAddress({ contract, - followTokenId: ..., + recovery: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getFollowData( - options: BaseTransactionOptions, -): Promise<{ - followerProfileId: bigint; - followTimestamp: number; - originalFollowTimestamp: number; - profileIdAllowedToRecover: bigint; -}>; +function changeRecoveryAddress( + options: BaseTransactionOptions< + | ChangeRecoveryAddressParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the getFollowData function. +The options for the "changeRecoveryAddress" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | ChangeRecoveryAddressParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise<{ - followerProfileId: bigint; - followTimestamp: number; - originalFollowTimestamp: number; - profileIdAllowedToRecover: bigint; -}>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getFollowerCount +## FARCASTER.changeRecoveryAddressEvent - Calls the "getFollowerCount" function on the contract. +Creates an event object for the ChangeRecoveryAddress event. ### Example ```ts -import { getFollowerCount } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { changeRecoveryAddressEvent } from "thirdweb/extensions/farcaster"; -const result = await getFollowerCount({ - contract, +const events = await getContractEvents({ +contract, +events: [ + changeRecoveryAddressEvent({ + id: ..., + recovery: ..., +}) +], }); ``` ```ts -function getFollowerCount( - options: BaseTransactionOptions, -): Promise; +function changeRecoveryAddressEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "id"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "recovery"; + readonly type: "address"; + }, + ]; + readonly name: "ChangeRecoveryAddress"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the getFollowerCount function. +Optional filters to apply to the event. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "id"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "recovery"; + readonly type: "address"; + }, + ]; + readonly name: "ChangeRecoveryAddress"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getFollowerProfileId +## FARCASTER.custodyOf - Calls the "getFollowerProfileId" function on the contract. +Calls the "custodyOf" function on the contract. ### Example ```ts -import { getFollowerProfileId } from "thirdweb/extensions/lens"; +import { custodyOf } from "thirdweb/extensions/farcaster"; -const result = await getFollowerProfileId({ +const result = await custodyOf({ contract, - followTokenId: ..., + fid: ..., }); ``` ```ts -function getFollowerProfileId( - options: BaseTransactionOptions, -): Promise; +function custodyOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the getFollowerProfileId function. +The options for the custodyOf function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getFollowTokenId +## FARCASTER.freezeIdGatewayEvent - Calls the "getFollowTokenId" function on the contract. +Creates an event object for the FreezeIdGateway event. ### Example ```ts -import { getFollowTokenId } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { freezeIdGatewayEvent } from "thirdweb/extensions/farcaster"; -const result = await getFollowTokenId({ - contract, - followerProfileId: ..., +const events = await getContractEvents({ + contract, + events: [freezeIdGatewayEvent()], }); ``` ```ts -function getFollowTokenId( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the getFollowTokenId function. - -#### Type - -```ts -let options: BaseTransactionOptions; +function freezeIdGatewayEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "idGateway"; readonly type: "address" }, + ]; + readonly name: "FreezeIdGateway"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "idGateway"; readonly type: "address" }, + ]; + readonly name: "FreezeIdGateway"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getFullProfile - - Return the profile data _with Lens handle_ and optional join date +## FARCASTER.gatewayFrozen - In Lens Protocol, each profile is associated with an ERC721 token, thus, the tokenId represent profileId and the 2 terms can be used interchangeably +Calls the "gatewayFrozen" function on the contract. ### Example ```ts -import { getFullProfile } from "thirdweb/extension/lens"; +import { gatewayFrozen } from "thirdweb/extensions/farcaster"; -const profileId = 10000n; // profileId is the tokenId of the NFT -const lensProfile = await getFullProfile({ profileId, client }); +const result = await gatewayFrozen({ + contract, +}); ``` ```ts -function getFullProfile( - options: GetFullProfileParams, -): Promise; +function gatewayFrozen( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters +The options for the gatewayFrozen function. + #### Type ```ts -let options: { - client: ThirdwebClient; - includeJoinDate?: boolean; - overrides?: { - chain?: Chain; - lensHandleAddress?: string; - lensHubAddress?: string; - tokenHandleRegistryAddress?: string; - }; - profileId: bigint; -}; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: { - handle: string; - joinDate: bigint | null; - profileData: LensProfileSchema | null; -} | null; +let returnType: Promise; ``` + +The parsed result of the function call. --- -## getHandle +## FARCASTER.idCounter - Calls the "getHandle" function on the contract. +Calls the "idCounter" function on the contract. ### Example ```ts -import { getHandle } from "thirdweb/extensions/lens"; +import { idCounter } from "thirdweb/extensions/farcaster"; -const result = await getHandle({ - contract, - tokenId: ..., +const result = await idCounter({ + contract, }); ``` ```ts -function getHandle( - options: BaseTransactionOptions, -): Promise; +function idCounter(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for the getHandle function. +The options for the idCounter function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getHandleFromProfileId +## FARCASTER.idGateway - Return the Lens handle of a profile in the format: lens/@`` +Calls the "idGateway" function on the contract. ### Example ```ts -import { getHandleFromProfileId } from "thirdweb/extensions/lens"; +import { idGateway } from "thirdweb/extensions/farcaster"; -const profileId = 461662n; -const handle = await getHandleFromProfileId({ profileId, client }); // "lens/@captain_jack" +const result = await idGateway({ + contract, +}); ``` ```ts -function getHandleFromProfileId( - options: GetHandleFromProfileIdParams, -): Promise; +function idGateway(options: BaseTransactionOptions): Promise; ``` ### Parameters +The options for the idGateway function. + #### Type ```ts -let options: { - client: ThirdwebClient; - overrides?: { - chain?: Chain; - lensHandleAddress?: string; - tokenHandleRegistryAddress?: string; - }; - profileId: bigint; -}; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` + +The parsed result of the function call. --- -## getHandleTokenURIContract +## FARCASTER.idOf - Calls the "getHandleTokenURIContract" function on the contract. +Calls the "idOf" function on the contract. ### Example ```ts -import { getHandleTokenURIContract } from "thirdweb/extensions/lens"; +import { idOf } from "thirdweb/extensions/farcaster"; -const result = await getHandleTokenURIContract({ - contract, +const result = await idOf({ + contract, + owner: ..., }); ``` ```ts -function getHandleTokenURIContract( - options: BaseTransactionOptions, -): Promise; +function idOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the getHandleTokenURIContract function. +The options for the idOf function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getLocalName +## FARCASTER.recover - Calls the "getLocalName" function on the contract. +Prepares a transaction to call the "recover" function on the contract. ### Example ```ts -import { getLocalName } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { recover } from "thirdweb/extensions/farcaster"; -const result = await getLocalName({ +const transaction = recover({ contract, - tokenId: ..., + from: ..., + to: ..., + deadline: ..., + sig: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getLocalName( - options: BaseTransactionOptions, -): Promise; +function recover( + options: BaseTransactionOptions< + RecoverParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the getLocalName function. +The options for the "recover" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + RecoverParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getModuleTypes +## FARCASTER.recoverEvent - Calls the "getModuleTypes" function on the contract. +Creates an event object for the Recover event. ### Example ```ts -import { getModuleTypes } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { recoverEvent } from "thirdweb/extensions/farcaster"; -const result = await getModuleTypes({ - contract, - moduleAddress: ..., +const events = await getContractEvents({ +contract, +events: [ + recoverEvent({ + from: ..., + to: ..., + id: ..., +}) +], }); ``` ```ts -function getModuleTypes( - options: BaseTransactionOptions, -): Promise; +function recoverEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "to"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "id"; + readonly type: "uint256"; + }, + ]; + readonly name: "Recover"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the getModuleTypes function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "to"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "id"; + readonly type: "uint256"; + }, + ]; + readonly name: "Recover"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getOriginalFollowTimestamp +## FARCASTER.recoverFor - Calls the "getOriginalFollowTimestamp" function on the contract. +Prepares a transaction to call the "recoverFor" function on the contract. ### Example ```ts -import { getOriginalFollowTimestamp } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { recoverFor } from "thirdweb/extensions/farcaster"; -const result = await getOriginalFollowTimestamp({ +const transaction = recoverFor({ contract, - followTokenId: ..., + from: ..., + to: ..., + recoveryDeadline: ..., + recoverySig: ..., + toDeadline: ..., + toSig: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getOriginalFollowTimestamp( - options: BaseTransactionOptions, -): Promise; +function recoverFor( + options: BaseTransactionOptions< + | RecoverForParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the getOriginalFollowTimestamp function. +The options for the "recoverFor" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + RecoverForParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getProfile +## FARCASTER.recoveryOf - Calls the "getProfile" function on the contract. +Calls the "recoveryOf" function on the contract. ### Example ```ts -import { getProfile } from "thirdweb/extensions/lens"; +import { recoveryOf } from "thirdweb/extensions/farcaster"; -const result = await getProfile({ +const result = await recoveryOf({ contract, - profileId: ..., + fid: ..., }); ``` ```ts -function getProfile( - options: BaseTransactionOptions, -): Promise<{ - __DEPRECATED__followNFTURI: string; - __DEPRECATED__handle: string; - __DEPRECATED__imageURI: string; - followModule: string; - followNFT: string; - metadataURI: string; - pubCount: bigint; -}>; +function recoveryOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the getProfile function. +The options for the recoveryOf function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<{ - __DEPRECATED__followNFTURI: string; - __DEPRECATED__handle: string; - __DEPRECATED__imageURI: string; - followModule: string; - followNFT: string; - metadataURI: string; - pubCount: bigint; -}>; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getProfileIdAllowedToRecover +## FARCASTER.registerEvent - Calls the "getProfileIdAllowedToRecover" function on the contract. +Creates an event object for the Register event. ### Example ```ts -import { getProfileIdAllowedToRecover } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { registerEvent } from "thirdweb/extensions/farcaster"; -const result = await getProfileIdAllowedToRecover({ - contract, - followTokenId: ..., +const events = await getContractEvents({ +contract, +events: [ + registerEvent({ + to: ..., + id: ..., +}) +], }); ``` ```ts -function getProfileIdAllowedToRecover( - options: BaseTransactionOptions, -): Promise; +function registerEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "to"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "id"; + readonly type: "uint256"; + }, + { readonly name: "recovery"; readonly type: "address" }, + ]; + readonly name: "Register"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the getProfileIdAllowedToRecover function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "to"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "id"; + readonly type: "uint256"; + }, + { readonly name: "recovery"; readonly type: "address" }, + ]; + readonly name: "Register"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getProfileIdByHandleHash +## FARCASTER.setIdCounterEvent - Calls the "getProfileIdByHandleHash" function on the contract. +Creates an event object for the SetIdCounter event. ### Example ```ts -import { getProfileIdByHandleHash } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { setIdCounterEvent } from "thirdweb/extensions/farcaster"; -const result = await getProfileIdByHandleHash({ - contract, - handleHash: ..., +const events = await getContractEvents({ + contract, + events: [setIdCounterEvent()], }); ``` ```ts -function getProfileIdByHandleHash( - options: BaseTransactionOptions, -): Promise; -``` - -### Parameters - - The options for the getProfileIdByHandleHash function. - -#### Type - -```ts -let options: BaseTransactionOptions; +function setIdCounterEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldCounter"; readonly type: "uint256" }, + { readonly name: "newCounter"; readonly type: "uint256" }, + ]; + readonly name: "SetIdCounter"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldCounter"; readonly type: "uint256" }, + { readonly name: "newCounter"; readonly type: "uint256" }, + ]; + readonly name: "SetIdCounter"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## getProfileMetadata +## FARCASTER.setIdGatewayEvent - Download user lens profile from Arweave This method does NOT give you the user handle & join-time - consider using `getFullProfileData` instead It is useful & cost efficient if you only want to get user's name, bio, picture, coverPicture etc. +Creates an event object for the SetIdGateway event. ### Example ```ts -import { getProfileMetadata } from "thirdweb/extensions/lens"; - -const profileData = await getProfileMetadata({ profileId, client }); +import { getContractEvents } from "thirdweb"; +import { setIdGatewayEvent } from "thirdweb/extensions/farcaster"; -if (profileData) { - console.log("Display name: ", profileData.lens.name); - console.log("Bio: ", profileData.lens.bio); -} -``` - -```ts -function getProfileMetadata( - options: GetProfileMetadataParams, -): Promise; +const events = await getContractEvents({ + contract, + events: [setIdGatewayEvent()], +}); ``` -### Parameters - -#### Type - ```ts -let options: { - client: ThirdwebClient; - overrides?: { chain?: Chain; lensHubAddress?: string }; - profileId: bigint; -}; +function setIdGatewayEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldIdGateway"; readonly type: "address" }, + { readonly name: "newIdGateway"; readonly type: "address" }, + ]; + readonly name: "SetIdGateway"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: { - lens: { - appId?: string; - attributes: Array; - bio: string; - coverPicture: string; - id: string; - name: string; - picture: string; - }; - signature: string; -}; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldIdGateway"; readonly type: "address" }, + { readonly name: "newIdGateway"; readonly type: "address" }, + ]; + readonly name: "SetIdGateway"; + readonly type: "event"; +}>; ``` - LensProfileSchema | null +The prepared event object. --- -## getPublication +## FARCASTER.transfer - Calls the "getPublication" function on the contract. +Prepares a transaction to call the "transfer" function on the contract. ### Example ```ts -import { getPublication } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { transfer } from "thirdweb/extensions/farcaster"; -const result = await getPublication({ +const transaction = transfer({ contract, - profileId: ..., - pubId: ..., + to: ..., + deadline: ..., + sig: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getPublication( - options: BaseTransactionOptions, -): Promise<{ - __DEPRECATED__collectModule: string; - __DEPRECATED__collectNFT: string; - contentURI: string; - pointedProfileId: bigint; - pointedPubId: bigint; - pubType: number; - referenceModule: string; - rootProfileId: bigint; - rootPubId: bigint; -}>; +function transfer( + options: BaseTransactionOptions< + TransferParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the getPublication function. +The options for the "transfer" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + TransferParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise<{ - __DEPRECATED__collectModule: string; - __DEPRECATED__collectNFT: string; - contentURI: string; - pointedProfileId: bigint; - pointedPubId: bigint; - pubType: number; - referenceModule: string; - rootProfileId: bigint; - rootPubId: bigint; -}>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## getTokenId +## FARCASTER.TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH - Calls the "getTokenId" function on the contract. +Calls the "TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH" function on the contract. ### Example ```ts -import { getTokenId } from "thirdweb/extensions/lens"; +import { TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH } from "thirdweb/extensions/farcaster"; -const result = await getTokenId({ - contract, - localName: ..., +const result = await TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH({ + contract, }); ``` ```ts -function getTokenId( - options: BaseTransactionOptions, -): Promise; +function TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the getTokenId function. +The options for the TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isErc20CurrencyRegistered +## FARCASTER.TRANSFER\_TYPEHASH - Calls the "isErc20CurrencyRegistered" function on the contract. +Calls the "TRANSFER\_TYPEHASH" function on the contract. ### Example ```ts -import { isErc20CurrencyRegistered } from "thirdweb/extensions/lens"; +import { TRANSFER_TYPEHASH } from "thirdweb/extensions/farcaster"; -const result = await isErc20CurrencyRegistered({ - contract, - currencyAddress: ..., +const result = await TRANSFER_TYPEHASH({ + contract, }); ``` ```ts -function isErc20CurrencyRegistered( - options: BaseTransactionOptions, -): Promise; +function TRANSFER_TYPEHASH( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the isErc20CurrencyRegistered function. +The options for the TRANSFER\_TYPEHASH function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isFollowing +## FARCASTER.transferAndChangeRecovery - Calls the "isFollowing" function on the contract. +Prepares a transaction to call the "transferAndChangeRecovery" function on the contract. ### Example ```ts -import { isFollowing } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { transferAndChangeRecovery } from "thirdweb/extensions/farcaster"; -const result = await isFollowing({ +const transaction = transferAndChangeRecovery({ contract, - followerProfileId: ..., + to: ..., + recovery: ..., + deadline: ..., + sig: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isFollowing( - options: BaseTransactionOptions, -): Promise; +function transferAndChangeRecovery( + options: BaseTransactionOptions< + | TransferAndChangeRecoveryParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the isFollowing function. +The options for the "transferAndChangeRecovery" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | TransferAndChangeRecoveryParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## isModuleRegistered +## FARCASTER.transferEvent - Calls the "isModuleRegistered" function on the contract. +Creates an event object for the Transfer event. ### Example ```ts -import { isModuleRegistered } from "thirdweb/extensions/lens"; +import { getContractEvents } from "thirdweb"; +import { transferEvent } from "thirdweb/extensions/farcaster"; -const result = await isModuleRegistered({ - contract, - moduleAddress: ..., +const events = await getContractEvents({ +contract, +events: [ + transferEvent({ + from: ..., + to: ..., +}) +], }); ``` ```ts -function isModuleRegistered( - options: BaseTransactionOptions, -): Promise; +function transferEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "to"; + readonly type: "address"; + }, + { readonly name: "id"; readonly type: "uint256" }, + ]; + readonly name: "Transfer"; + readonly type: "event"; +}>; ``` ### Parameters - The options for the isModuleRegistered function. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "from"; + readonly type: "address"; + }, + { + readonly indexed: true; + readonly name: "to"; + readonly type: "address"; + }, + { readonly name: "id"; readonly type: "uint256" }, + ]; + readonly name: "Transfer"; + readonly type: "event"; +}>; ``` - The parsed result of the function call. +The prepared event object. --- -## isModuleRegisteredAs +## FARCASTER.transferFor - Calls the "isModuleRegisteredAs" function on the contract. +Prepares a transaction to call the "transferFor" function on the contract. ### Example ```ts -import { isModuleRegisteredAs } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { transferFor } from "thirdweb/extensions/farcaster"; -const result = await isModuleRegisteredAs({ +const transaction = transferFor({ contract, - moduleAddress: ..., - moduleType: ..., + from: ..., + to: ..., + fromDeadline: ..., + fromSig: ..., + toDeadline: ..., + toSig: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function isModuleRegisteredAs( - options: BaseTransactionOptions, -): Promise; +function transferFor( + options: BaseTransactionOptions< + | TransferForParams + | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the isModuleRegisteredAs function. +The options for the "transferFor" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + | TransferForParams + | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## mintTimestampOf +## FARCASTER.verifyFidSignature - Calls the "mintTimestampOf" function on the contract. +Calls the "verifyFidSignature" function on the contract. ### Example ```ts -import { mintTimestampOf } from "thirdweb/extensions/lens"; +import { verifyFidSignature } from "thirdweb/extensions/farcaster"; -const result = await mintTimestampOf({ +const result = await verifyFidSignature({ contract, - tokenId: ..., + custodyAddress: ..., + fid: ..., + digest: ..., + sig: ..., }); ``` ```ts -function mintTimestampOf( - options: BaseTransactionOptions, -): Promise; +function verifyFidSignature( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the mintTimestampOf function. +The options for the verifyFidSignature function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## mintTimestampOfFollowNFT +## FARCASTER.add - Calls the "mintTimestampOf" function on the contract. +Prepares a transaction to call the "add" function on the contract. ### Example ```ts -import { mintTimestampOf } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { add } from "thirdweb/extensions/farcaster"; -const result = await mintTimestampOf({ +const transaction = add({ contract, - tokenId: ..., + keyType: ..., + key: ..., + metadataType: ..., + metadata: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function mintTimestampOfFollowNFT( - options: BaseTransactionOptions, -): Promise; +function add( + options: BaseTransactionOptions< + AddParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the mintTimestampOf function. +The options for the "add" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + AddParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## nonces +## FARCASTER.ADD\_TYPEHASH - Calls the "nonces" function on the contract. +Calls the "ADD\_TYPEHASH" function on the contract. ### Example ```ts -import { nonces } from "thirdweb/extensions/lens"; +import { ADD_TYPEHASH } from "thirdweb/extensions/farcaster"; -const result = await nonces({ - contract, - signer: ..., +const result = await ADD_TYPEHASH({ + contract, }); ``` ```ts -function nonces( - options: BaseTransactionOptions, -): Promise; +function ADD_TYPEHASH( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for the nonces function. +The options for the ADD\_TYPEHASH function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## resolve +## FARCASTER.addFor - Calls the "resolve" function on the contract. +Prepares a transaction to call the "addFor" function on the contract. ### Example ```ts -import { resolve } from "thirdweb/extensions/lens"; +import { sendTransaction } from "thirdweb"; +import { addFor } from "thirdweb/extensions/farcaster"; -const result = await resolve({ +const transaction = addFor({ contract, - handleId: ..., + fidOwner: ..., + keyType: ..., + key: ..., + metadataType: ..., + metadata: ..., + deadline: ..., + sig: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function resolve( - options: BaseTransactionOptions, -): Promise; +function addFor( + options: BaseTransactionOptions< + AddForParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for the resolve function. +The options for the "addFor" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + AddForParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: Promise; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The parsed result of the function call. +A prepared transaction object. --- -## resolveAddress +## FARCASTER.keyRegistry - Take in a Lens handle or local-name and return the wallet address behind that handle/local-name. For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name +Calls the "keyRegistry" function on the contract. ### Example ```ts -import { resolveAddress } from "thirdweb/extensions/lens"; +import { keyRegistry } from "thirdweb/extensions/farcaster"; -const walletAddress = await resolveAddress({ - name: "vitalik", - client, +const result = await keyRegistry({ + contract, }); ``` ```ts -function resolveAddress( - options: ResolveLensAddressParams, +function keyRegistry( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters +The options for the keyRegistry function. + #### Type ```ts -let options: { - client: ThirdwebClient; - name: string; - overrides?: { chain?: Chain; lensHandleContractAddress?: string }; -}; +let options: { contract: ThirdwebContract } & T; ``` ### Returns @@ -25831,118 +27278,109 @@ let options: { ```ts let returnType: Promise; ``` + +The parsed result of the function call. --- -## tokenDataOf +## FARCASTER.nonces - Calls the "tokenDataOf" function on the contract. +Calls the "nonces" function on the contract. ### Example ```ts -import { tokenDataOf } from "thirdweb/extensions/lens"; +import { nonces } from "thirdweb/extensions/farcaster"; -const result = await tokenDataOf({ +const result = await nonces({ contract, - tokenId: ..., + account: ..., }); ``` ```ts -function tokenDataOf( - options: BaseTransactionOptions, -): Promise<{ mintTimestamp: bigint; owner: string }>; +function nonces( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the tokenDataOf function. +The options for the nonces function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise<{ mintTimestamp: bigint; owner: string }>; +let returnType: Promise; ``` - The parsed result of the function call. ---- -## MARKETPLACE +The parsed result of the function call. --- -## acceptedOfferEvent +## FARCASTER.addEvent - Creates an event object for the AcceptedOffer event. +Creates an event object for the Add event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { acceptedOfferEvent } from "thirdweb/extensions/marketplace"; +import { addEvent } from "thirdweb/extensions/farcaster"; const events = await getContractEvents({ contract, events: [ - acceptedOfferEvent({ - offeror: ..., - offerId: ..., - assetContract: ..., + addEvent({ + fid: ..., + keyType: ..., + key: ..., }) ], }); ``` ```ts -function acceptedOfferEvent( - filters: Partial<{ - assetContract: string; - offerId: bigint; - offeror: string; - }>, +function addEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "offeror"; - readonly type: "address"; + readonly name: "fid"; + readonly type: "uint256"; }, { readonly indexed: true; - readonly name: "offerId"; - readonly type: "uint256"; + readonly name: "keyType"; + readonly type: "uint32"; }, { readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; + readonly name: "key"; + readonly type: "bytes"; }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "seller"; readonly type: "address" }, - { readonly name: "quantityBought"; readonly type: "uint256" }, - { readonly name: "totalPricePaid"; readonly type: "uint256" }, + { readonly name: "keyBytes"; readonly type: "bytes" }, + { readonly name: "metadataType"; readonly type: "uint8" }, + { readonly name: "metadata"; readonly type: "bytes" }, ]; - readonly name: "AcceptedOffer"; + readonly name: "Add"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - assetContract: string; - offerId: bigint; - offeror: string; -}>; +let filters: Partial; ``` ### Returns @@ -25952,771 +27390,569 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "offeror"; - readonly type: "address"; + readonly name: "fid"; + readonly type: "uint256"; }, { readonly indexed: true; - readonly name: "offerId"; - readonly type: "uint256"; + readonly name: "keyType"; + readonly type: "uint32"; }, { readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; + readonly name: "key"; + readonly type: "bytes"; }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "seller"; readonly type: "address" }, - { readonly name: "quantityBought"; readonly type: "uint256" }, - { readonly name: "totalPricePaid"; readonly type: "uint256" }, + { readonly name: "keyBytes"; readonly type: "bytes" }, + { readonly name: "metadataType"; readonly type: "uint8" }, + { readonly name: "metadata"; readonly type: "bytes" }, ]; - readonly name: "AcceptedOffer"; + readonly name: "Add"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## acceptOffer +## FARCASTER.adminResetEvent - Accepts an offer after performing necessary checks and validations. Throws an error if the offer is not active, the offeror's balance is insufficient, or the offeror's allowance is insufficient. +Creates an event object for the AdminReset event. ### Example ```ts -import { acceptOffer } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; +import { getContractEvents } from "thirdweb"; +import { adminResetEvent } from "thirdweb/extensions/farcaster"; -const acceptOfferTx = acceptOffer({ - contract, - offerId: 1n, +const events = await getContractEvents({ +contract, +events: [ + adminResetEvent({ + fid: ..., + key: ..., +}) +], }); - -await sendTransaction({ transaction, account }); ``` ```ts -function acceptOffer( - options: BaseTransactionOptions, -): PreparedTransaction; +function adminResetEvent( + filters: Partial, +): PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "fid"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "key"; + readonly type: "bytes"; + }, + { readonly name: "keyBytes"; readonly type: "bytes" }, + ]; + readonly name: "AdminReset"; + readonly type: "event"; +}>; ``` ### Parameters - The options for accepting the offer. +Optional filters to apply to the event. #### Type ```ts -let options: BaseTransactionOptions; +let filters: Partial; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { + readonly indexed: true; + readonly name: "fid"; + readonly type: "uint256"; + }, + { + readonly indexed: true; + readonly name: "key"; + readonly type: "bytes"; + }, + { readonly name: "keyBytes"; readonly type: "bytes" }, + ]; + readonly name: "AdminReset"; + readonly type: "event"; +}>; ``` - A transaction object that can be sent to accept the offer. +The prepared event object. --- -## approveBuyerForListing +## FARCASTER.freezeKeyGatewayEvent - Prepares a transaction to call the "approveBuyerForListing" function on the contract. +Creates an event object for the FreezeKeyGateway event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { approveBuyerForListing } from "thirdweb/extensions/marketplace"; +import { getContractEvents } from "thirdweb"; +import { freezeKeyGatewayEvent } from "thirdweb/extensions/farcaster"; -const transaction = approveBuyerForListing({ - contract, - listingId: ..., - buyer: ..., - toApprove: ..., - overrides: { - ... - } +const events = await getContractEvents({ + contract, + events: [freezeKeyGatewayEvent()], }); - -// Send the transaction -await sendTransaction({ transaction, account }); -``` - -```ts -function approveBuyerForListing( - options: BaseTransactionOptions< - | ApproveBuyerForListingParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; ``` -### Parameters - - The options for the "approveBuyerForListing" function. - -#### Type - ```ts -let options: BaseTransactionOptions< - | ApproveBuyerForListingParams - | { asyncParams: () => Promise } ->; +function freezeKeyGatewayEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "keyGateway"; readonly type: "address" }, + ]; + readonly name: "FreezeKeyGateway"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "keyGateway"; readonly type: "address" }, + ]; + readonly name: "FreezeKeyGateway"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## approveCurrencyForListing +## FARCASTER.gatewayFrozen - Prepares a transaction to call the "approveCurrencyForListing" function on the contract. +Calls the "gatewayFrozen" function on the contract. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { approveCurrencyForListing } from "thirdweb/extensions/marketplace"; +import { gatewayFrozen } from "thirdweb/extensions/farcaster"; -const transaction = approveCurrencyForListing({ - contract, - listingId: ..., - currency: ..., - pricePerTokenInCurrency: ..., - overrides: { - ... - } +const result = await gatewayFrozen({ + contract, }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function approveCurrencyForListing( - options: BaseTransactionOptions< - | ApproveCurrencyForListingParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function gatewayFrozen( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the "approveCurrencyForListing" function. +The options for the gatewayFrozen function. #### Type ```ts -let options: BaseTransactionOptions< - | ApproveCurrencyForListingParams - | { asyncParams: () => Promise } ->; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A prepared transaction object. +The parsed result of the function call. --- -## auctionClosedEvent +## FARCASTER.idRegistry - Creates an event object for the AuctionClosed event. +Calls the "idRegistry" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { auctionClosedEvent } from "thirdweb/extensions/marketplace"; +import { idRegistry } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ -contract, -events: [ - auctionClosedEvent({ - auctionId: ..., - assetContract: ..., - closer: ..., -}) -], +const result = await idRegistry({ + contract, }); ``` ```ts -function auctionClosedEvent( - filters: Partial<{ - assetContract: string; - auctionId: bigint; - closer: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "closer"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "auctionCreator"; readonly type: "address" }, - { readonly name: "winningBidder"; readonly type: "address" }, - ]; - readonly name: "AuctionClosed"; - readonly type: "event"; -}>; +function idRegistry(options: BaseTransactionOptions): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the idRegistry function. #### Type ```ts -let filters: Partial<{ - assetContract: string; - auctionId: bigint; - closer: string; -}>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "closer"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "auctionCreator"; readonly type: "address" }, - { readonly name: "winningBidder"; readonly type: "address" }, - ]; - readonly name: "AuctionClosed"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## bidInAuction +## FARCASTER.keyAt - Places a bid in an English auction. +Calls the "keyAt" function on the contract. ### Example ```ts -import { bidInAuction } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; +import { keyAt } from "thirdweb/extensions/farcaster"; -const transaction = bidInAuction({ - contract, - auctionId: 0n, - bidAmount: "100", +const result = await keyAt({ + contract, + fid: ..., + state: ..., + index: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function bidInAuction( - options: BaseTransactionOptions, -): PreparedTransaction; +function keyAt( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - The options for placing the bid. +The options for the keyAt function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise<`0x${string}`>; ``` - A transaction that can be sent to place the bid. +The parsed result of the function call. --- -## buyerApprovedForListingEvent +## FARCASTER.keyDataOf - Creates an event object for the BuyerApprovedForListing event. +Calls the "keyDataOf" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { buyerApprovedForListingEvent } from "thirdweb/extensions/marketplace"; +import { keyDataOf } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ -contract, -events: [ - buyerApprovedForListingEvent({ - listingId: ..., - buyer: ..., -}) -], +const result = await keyDataOf({ + contract, + fid: ..., + key: ..., }); ``` ```ts -function buyerApprovedForListingEvent( - filters: Partial<{ buyer: string; listingId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "buyer"; - readonly type: "address"; - }, - { readonly name: "approved"; readonly type: "bool" }, - ]; - readonly name: "BuyerApprovedForListing"; - readonly type: "event"; -}>; +function keyDataOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the keyDataOf function. #### Type ```ts -let filters: Partial<{ buyer: string; listingId: bigint }>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "buyer"; - readonly type: "address"; - }, - { readonly name: "approved"; readonly type: "bool" }, - ]; - readonly name: "BuyerApprovedForListing"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## buyFromListing +## FARCASTER.keyGateway - Buys a listing from the marketplace. +Calls the "keyGateway" function on the contract. ### Example ```ts -import { buyFromListing } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; +import { keyGateway } from "thirdweb/extensions/farcaster"; -const transaction = buyFromListing({ +const result = await keyGateway({ contract, - listingId: 1n, - quantity: 1n, - recipient: "0x...", }); - -await sendTransaction({ transaction, account }); ``` - When using `buyFromListing` with Pay, the `erc20Value` will be automatically set to the listing currency. - ```ts -function buyFromListing( - options: BaseTransactionOptions, -): PreparedTransaction; +function keyGateway(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for buying from a listing. +The options for the keyGateway function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A promise that resolves to the transaction result. +The parsed result of the function call. --- -## buyoutAuction +## FARCASTER.keysOf - Buys out an English auction. +Calls the "keysOf" function on the contract. ### Example -```ts -import { buyoutAuction } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; - -const transaction = buyoutAuction({ - contract, - auctionId: 0n, -}); +```ts +import { keysOf } from "thirdweb/extensions/farcaster"; -await sendTransaction({ transaction, account }); +const result = await keysOf({ + contract, + fid: ..., + state: ..., +}); ``` ```ts -function buyoutAuction( - options: BaseTransactionOptions, -): PreparedTransaction; +function keysOf(options: BaseTransactionOptions) : Promise> ``` ### Parameters - The options for buying out the auction. +The options for the keysOf function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise> ``` - A transaction that can be sent to buy out the auction. +The parsed result of the function call. --- -## cancelAuction +## FARCASTER.maxKeysPerFid - Cancels an auction by providing the necessary options. +Calls the "maxKeysPerFid" function on the contract. ### Example ```ts -import { cancelAuction } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; +import { maxKeysPerFid } from "thirdweb/extensions/farcaster"; -const transaction = cancelAuction({ +const result = await maxKeysPerFid({ contract, - auctionId: 0n, }); - -await sendTransaction({ transaction, account }); ``` ```ts -function cancelAuction( - options: BaseTransactionOptions, -): PreparedTransaction; +function maxKeysPerFid( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for canceling the auction. +The options for the maxKeysPerFid function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A transaction that can be sent to cancel the auction. +The parsed result of the function call. --- -## cancelledAuctionEvent +## FARCASTER.remove - Creates an event object for the CancelledAuction event. +Prepares a transaction to call the "remove" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { cancelledAuctionEvent } from "thirdweb/extensions/marketplace"; +import { sendTransaction } from "thirdweb"; +import { remove } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ -contract, -events: [ - cancelledAuctionEvent({ - auctionCreator: ..., - auctionId: ..., -}) -], +const transaction = remove({ + contract, + key: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function cancelledAuctionEvent( - filters: Partial<{ auctionCreator: string; auctionId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - ]; - readonly name: "CancelledAuction"; - readonly type: "event"; -}>; +function remove( + options: BaseTransactionOptions< + RemoveParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - Optional filters to apply to the event. +The options for the "remove" function. #### Type ```ts -let filters: Partial<{ auctionCreator: string; auctionId: bigint }>; +let options: BaseTransactionOptions< + RemoveParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - ]; - readonly name: "CancelledAuction"; - readonly type: "event"; -}>; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - The prepared event object. +A prepared transaction object. --- -## cancelledListingEvent +## FARCASTER.REMOVE\_TYPEHASH - Creates an event object for the CancelledListing event. +Calls the "REMOVE\_TYPEHASH" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { cancelledListingEvent } from "thirdweb/extensions/marketplace"; +import { REMOVE_TYPEHASH } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ -contract, -events: [ - cancelledListingEvent({ - listingCreator: ..., - listingId: ..., -}) -], +const result = await REMOVE_TYPEHASH({ + contract, }); ``` ```ts -function cancelledListingEvent( - filters: Partial<{ listingCreator: string; listingId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - ]; - readonly name: "CancelledListing"; - readonly type: "event"; -}>; +function REMOVE_TYPEHASH( + options: BaseTransactionOptions, +): Promise<`0x${string}`>; ``` ### Parameters - Optional filters to apply to the event. +The options for the REMOVE\_TYPEHASH function. #### Type ```ts -let filters: Partial<{ listingCreator: string; listingId: bigint }>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - ]; - readonly name: "CancelledListing"; - readonly type: "event"; -}>; +let returnType: Promise<`0x${string}`>; ``` - The prepared event object. +The parsed result of the function call. --- -## cancelledOfferEvent +## FARCASTER.removeEvent - Creates an event object for the CancelledOffer event. +Creates an event object for the Remove event. ### Example ```ts import { getContractEvents } from "thirdweb"; -import { cancelledOfferEvent } from "thirdweb/extensions/marketplace"; +import { removeEvent } from "thirdweb/extensions/farcaster"; const events = await getContractEvents({ contract, events: [ - cancelledOfferEvent({ - offeror: ..., - offerId: ..., + removeEvent({ + fid: ..., + key: ..., }) ], }); ``` ```ts -function cancelledOfferEvent( - filters: Partial<{ offerId: bigint; offeror: string }>, +function removeEvent( + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "offeror"; - readonly type: "address"; + readonly name: "fid"; + readonly type: "uint256"; }, { readonly indexed: true; - readonly name: "offerId"; - readonly type: "uint256"; + readonly name: "key"; + readonly type: "bytes"; }, + { readonly name: "keyBytes"; readonly type: "bytes" }, ]; - readonly name: "CancelledOffer"; + readonly name: "Remove"; readonly type: "event"; }>; ``` ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ offerId: bigint; offeror: string }>; +let filters: Partial; ``` ### Returns @@ -26726,36 +27962,40 @@ let returnType: PreparedEvent<{ readonly inputs: readonly [ { readonly indexed: true; - readonly name: "offeror"; - readonly type: "address"; + readonly name: "fid"; + readonly type: "uint256"; }, { readonly indexed: true; - readonly name: "offerId"; - readonly type: "uint256"; + readonly name: "key"; + readonly type: "bytes"; }, + { readonly name: "keyBytes"; readonly type: "bytes" }, ]; - readonly name: "CancelledOffer"; + readonly name: "Remove"; readonly type: "event"; }>; ``` - The prepared event object. +The prepared event object. --- -## cancelListing +## FARCASTER.removeFor - Prepares a transaction to call the "cancelListing" function on the contract. +Prepares a transaction to call the "removeFor" function on the contract. ### Example ```ts import { sendTransaction } from "thirdweb"; -import { cancelListing } from "thirdweb/extensions/marketplace"; +import { removeFor } from "thirdweb/extensions/farcaster"; -const transaction = cancelListing({ +const transaction = removeFor({ contract, - listingId: ..., + fidOwner: ..., + key: ..., + deadline: ..., + sig: ..., overrides: { ... } @@ -26766,24 +28006,22 @@ await sendTransaction({ transaction, account }); ``` ```ts -function cancelListing( +function removeFor( options: BaseTransactionOptions< - | CancelListingParams - | { asyncParams: () => Promise } + RemoveForParams | { asyncParams: () => Promise } >, ): PreparedTransaction; ``` ### Parameters - The options for the "cancelListing" function. +The options for the "removeFor" function. #### Type ```ts let options: BaseTransactionOptions< - | CancelListingParams - | { asyncParams: () => Promise } + RemoveForParams | { asyncParams: () => Promise } >; ``` @@ -26797,257 +28035,267 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## cancelOffer +## FARCASTER.setIdRegistryEvent - Prepares a transaction to call the "cancelOffer" function on the contract. +Creates an event object for the SetIdRegistry event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { cancelOffer } from "thirdweb/extensions/marketplace"; +import { getContractEvents } from "thirdweb"; +import { setIdRegistryEvent } from "thirdweb/extensions/farcaster"; -const transaction = cancelOffer({ - contract, - offerId: ..., - overrides: { - ... - } +const events = await getContractEvents({ + contract, + events: [setIdRegistryEvent()], }); - -// Send the transaction -await sendTransaction({ transaction, account }); -``` - -```ts -function cancelOffer( - options: BaseTransactionOptions< - | CancelOfferParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; ``` -### Parameters - - The options for the "cancelOffer" function. - -#### Type - ```ts -let options: BaseTransactionOptions< - | CancelOfferParams - | { asyncParams: () => Promise } ->; +function setIdRegistryEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldIdRegistry"; readonly type: "address" }, + { readonly name: "newIdRegistry"; readonly type: "address" }, + ]; + readonly name: "SetIdRegistry"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldIdRegistry"; readonly type: "address" }, + { readonly name: "newIdRegistry"; readonly type: "address" }, + ]; + readonly name: "SetIdRegistry"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## collectAuctionPayout +## FARCASTER.setKeyGatewayEvent - Prepares a transaction to call the "collectAuctionPayout" function on the contract. +Creates an event object for the SetKeyGateway event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { collectAuctionPayout } from "thirdweb/extensions/marketplace"; +import { getContractEvents } from "thirdweb"; +import { setKeyGatewayEvent } from "thirdweb/extensions/farcaster"; -const transaction = collectAuctionPayout({ - contract, - auctionId: ..., - overrides: { - ... - } +const events = await getContractEvents({ + contract, + events: [setKeyGatewayEvent()], }); - -// Send the transaction -await sendTransaction({ transaction, account }); -``` - -```ts -function collectAuctionPayout( - options: BaseTransactionOptions< - | CollectAuctionPayoutParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; ``` -### Parameters - - The options for the "collectAuctionPayout" function. - -#### Type - ```ts -let options: BaseTransactionOptions< - | CollectAuctionPayoutParams - | { asyncParams: () => Promise } ->; +function setKeyGatewayEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldKeyGateway"; readonly type: "address" }, + { readonly name: "newKeyGateway"; readonly type: "address" }, + ]; + readonly name: "SetKeyGateway"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldKeyGateway"; readonly type: "address" }, + { readonly name: "newKeyGateway"; readonly type: "address" }, + ]; + readonly name: "SetKeyGateway"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## collectAuctionTokens +## FARCASTER.setMaxKeysPerFidEvent - Prepares a transaction to call the "collectAuctionTokens" function on the contract. +Creates an event object for the SetMaxKeysPerFid event. ### Example ```ts -import { sendTransaction } from "thirdweb"; -import { collectAuctionTokens } from "thirdweb/extensions/marketplace"; +import { getContractEvents } from "thirdweb"; +import { setMaxKeysPerFidEvent } from "thirdweb/extensions/farcaster"; -const transaction = collectAuctionTokens({ - contract, - auctionId: ..., - overrides: { - ... - } +const events = await getContractEvents({ + contract, + events: [setMaxKeysPerFidEvent()], }); - -// Send the transaction -await sendTransaction({ transaction, account }); ``` ```ts -function collectAuctionTokens( - options: BaseTransactionOptions< - | CollectAuctionTokensParams - | { asyncParams: () => Promise } - >, -): PreparedTransaction; +function setMaxKeysPerFidEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldMax"; readonly type: "uint256" }, + { readonly name: "newMax"; readonly type: "uint256" }, + ]; + readonly name: "SetMaxKeysPerFid"; + readonly type: "event"; +}>; ``` -### Parameters +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "oldMax"; readonly type: "uint256" }, + { readonly name: "newMax"; readonly type: "uint256" }, + ]; + readonly name: "SetMaxKeysPerFid"; + readonly type: "event"; +}>; +``` - The options for the "collectAuctionTokens" function. +The prepared event object. +--- -#### Type +## FARCASTER.setValidatorEvent + +Creates an event object for the SetValidator event. + +### Example ```ts -let options: BaseTransactionOptions< - | CollectAuctionTokensParams - | { asyncParams: () => Promise } ->; +import { getContractEvents } from "thirdweb"; +import { setValidatorEvent } from "thirdweb/extensions/farcaster"; + +const events = await getContractEvents({ + contract, + events: [setValidatorEvent()], +}); +``` + +```ts +function setValidatorEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "keyType"; readonly type: "uint32" }, + { readonly name: "metadataType"; readonly type: "uint8" }, + { readonly name: "oldValidator"; readonly type: "address" }, + { readonly name: "newValidator"; readonly type: "address" }, + ]; + readonly name: "SetValidator"; + readonly type: "event"; +}>; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "keyType"; readonly type: "uint32" }, + { readonly name: "metadataType"; readonly type: "uint8" }, + { readonly name: "oldValidator"; readonly type: "address" }, + { readonly name: "newValidator"; readonly type: "address" }, + ]; + readonly name: "SetValidator"; + readonly type: "event"; +}>; ``` - A prepared transaction object. +The prepared event object. --- -## createAuction +## FARCASTER.totalKeys - Creates an auction. +Calls the "totalKeys" function on the contract. ### Example -```typescript -import { createAuction } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; - -const transaction = createAuction({...}); +```ts +import { totalKeys } from "thirdweb/extensions/farcaster"; -await sendTransaction({ transaction, account }); +const result = await totalKeys({ + contract, + fid: ..., + state: ..., +}); ``` ```ts -function createAuction( - options: BaseTransactionOptions, -): PreparedTransaction; +function totalKeys( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for creating the auction. +The options for the totalKeys function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - The result of creating the auction. +The parsed result of the function call. --- -## createListing +## FARCASTER.batchRent - Creates a direct listing. +Prepares a transaction to call the "batchRent" function on the contract. ### Example -```typescript -import { createListing } from "thirdweb/extensions/marketplace"; +```ts import { sendTransaction } from "thirdweb"; +import { batchRent } from "thirdweb/extensions/farcaster"; -const transaction = createListing({ - assetContractAddress: "0x...", // the NFT contract address that you want to sell - tokenId={0n}, // the token id you want to sell - pricePerToken="0.1" // sell for 0.1 +const transaction = batchRent({ + contract, + fids: ..., + units: ..., + overrides: { + ... + } }); +// Send the transaction await sendTransaction({ transaction, account }); ``` ```ts -function createListing( - options: BaseTransactionOptions, +function batchRent( + options: BaseTransactionOptions< + BatchRentParams | { asyncParams: () => Promise } + >, ): PreparedTransaction; ``` ### Parameters - The options for creating the direct listing. +The options for the "batchRent" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + BatchRentParams | { asyncParams: () => Promise } +>; ``` ### Returns @@ -27060,117 +28308,74 @@ let returnType: PreparedTransaction< >; ``` - The result of creating the direct listing. +A prepared transaction object. --- -## currencyApprovedForListingEvent +## FARCASTER.deprecationTimestamp - Creates an event object for the CurrencyApprovedForListing event. +Calls the "deprecationTimestamp" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { currencyApprovedForListingEvent } from "thirdweb/extensions/marketplace"; +import { deprecationTimestamp } from "thirdweb/extensions/farcaster"; -const events = await getContractEvents({ -contract, -events: [ - currencyApprovedForListingEvent({ - listingId: ..., - currency: ..., -}) -], +const result = await deprecationTimestamp({ + contract, }); ``` ```ts -function currencyApprovedForListingEvent( - filters: Partial<{ currency: string; listingId: bigint }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "currency"; - readonly type: "address"; - }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - ]; - readonly name: "CurrencyApprovedForListing"; - readonly type: "event"; -}>; +function deprecationTimestamp( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the deprecationTimestamp function. #### Type ```ts -let filters: Partial<{ currency: string; listingId: bigint }>; +let options: { contract: ThirdwebContract } & T; ``` ### Returns -```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "currency"; - readonly type: "address"; - }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - ]; - readonly name: "CurrencyApprovedForListing"; - readonly type: "event"; -}>; +```ts +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## currencyPriceForListing +## FARCASTER.maxUnits - Retrieves the currency price for a listing. +Calls the "maxUnits" function on the contract. ### Example ```ts -import { currencyPriceForListing } from "thirdweb/extensions/marketplace"; +import { maxUnits } from "thirdweb/extensions/farcaster"; -const price = await currencyPriceForListing({ +const result = await maxUnits({ contract, - listingId: 1n, - currency: "0x...", }); ``` ```ts -function currencyPriceForListing( - options: BaseTransactionOptions, -): Promise; +function maxUnits(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for retrieving the currency price. +The options for the maxUnits function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns @@ -27179,1815 +28384,1325 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - A promise that resolves to the currency price as a bigint. +The parsed result of the function call. --- -## executeSale +## FARCASTER.price - Executes a sale for an English auction. +Calls the "price" function on the contract. ### Example ```ts -import { executeSale } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; +import { price } from "thirdweb/extensions/farcaster"; -const transaction = executeSale({ - contract, - auctionId: 0n, +const result = await price({ + contract, + units: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function executeSale( - options: BaseTransactionOptions, -): PreparedTransaction; +function price( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for executing the sale. +The options for the price function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise; ``` - A transaction that can be sent to execute the sale. +The parsed result of the function call. --- -## getAllAuctions +## FARCASTER.rent - Retrieves all auctions based on the provided options. +Prepares a transaction to call the "rent" function on the contract. ### Example ```ts -import { getAllAuctions } from "thirdweb/extensions/marketplace"; +import { sendTransaction } from "thirdweb"; +import { rent } from "thirdweb/extensions/farcaster"; -const listings = await getAllAuctions({ - contract, - start: 0, - count: 10, +const transaction = rent({ + contract, + fid: ..., + units: ..., + overrides: { + ... + } }); + +// Send the transaction +await sendTransaction({ transaction, account }); ``` ```ts -function getAllAuctions( - options: BaseTransactionOptions, -): Promise>; +function rent( + options: BaseTransactionOptions< + RentParams | { asyncParams: () => Promise } + >, +): PreparedTransaction; ``` ### Parameters - The options for retrieving the auctions. +The options for the "rent" function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions< + RentParams | { asyncParams: () => Promise } +>; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - bidBufferBps: bigint; - buyoutBidAmount: bigint; - buyoutCurrencyValue: GetBalanceResult; - creatorAddress: Address; - currencyContractAddress: Address; - endTimeInSeconds: bigint; - id: bigint; - minimumBidAmount: bigint; - minimumBidCurrencyValue: GetBalanceResult; - quantity: bigint; - startTimeInSeconds: bigint; - status: ListingStatus; - timeBufferInSeconds: bigint; - tokenId: bigint; - type: "english-auction"; -}; +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; ``` - A promise that resolves to the auctions array. +A prepared transaction object. --- -## getAllListings +## FARCASTER.rentedUnits - Retrieves all direct listings based on the provided options. +Calls the "rentedUnits" function on the contract. ### Example ```ts -import { getAllListings } from "thirdweb/extensions/marketplace"; +import { rentedUnits } from "thirdweb/extensions/farcaster"; -const listings = await getAllListings({ +const result = await rentedUnits({ contract, - start: 0, - count: 10, }); ``` ```ts -function getAllListings( - options: BaseTransactionOptions, -): Promise>; +function rentedUnits( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the listing. +The options for the rentedUnits function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - creatorAddress: Address; - currencyContractAddress: Address; - currencyValuePerToken: GetBalanceResult; - endTimeInSeconds: bigint; - id: bigint; - isReservedListing: boolean; - pricePerToken: bigint; - quantity: bigint; - startTimeInSeconds: bigint; - status: ListingStatus; - tokenId: bigint; - type: "direct-listing"; -}; +let returnType: Promise; ``` - A promise that resolves to the direct listings array. +The parsed result of the function call. --- -## getAllOffers +## FARCASTER.unitPrice - Retrieves all offers based on the provided options. +Calls the "unitPrice" function on the contract. ### Example ```ts -import { getAllOffers } from "thirdweb/extensions/marketplace"; +import { unitPrice } from "thirdweb/extensions/farcaster"; -const listings = await getAllOffers({ +const result = await unitPrice({ contract, - start: 0, - count: 10, }); ``` ```ts -function getAllOffers( - options: BaseTransactionOptions, -): Promise>; +function unitPrice(options: BaseTransactionOptions): Promise; ``` ### Parameters - The options for retrieving the offers. +The options for the unitPrice function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - currencyContractAddress: Address; - currencyValue: GetBalanceResult; - endTimeInSeconds: bigint; - id: bigint; - offerorAddress: Address; - quantity: bigint; - status: ListingStatus; - tokenId: bigint; - totalPrice: bigint; -}; +let returnType: Promise; ``` - A promise that resolves to the offers array. +The parsed result of the function call. --- -## getAllValidAuctions +## FARCASTER.usdUnitPrice - Retrieves all valid auctions based on the provided options. +Calls the "usdUnitPrice" function on the contract. ### Example ```ts -import { getAllValidAuctions } from "thirdweb/extensions/marketplace"; +import { usdUnitPrice } from "thirdweb/extensions/farcaster"; -const validAuctions = await getAllValidAuctions({ +const result = await usdUnitPrice({ contract, - start: 0, - count: 10, }); ``` ```ts -function getAllValidAuctions( - options: BaseTransactionOptions, -): Promise>; +function usdUnitPrice( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the listing. +The options for the usdUnitPrice function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - bidBufferBps: bigint; - buyoutBidAmount: bigint; - buyoutCurrencyValue: GetBalanceResult; - creatorAddress: Address; - currencyContractAddress: Address; - endTimeInSeconds: bigint; - id: bigint; - minimumBidAmount: bigint; - minimumBidCurrencyValue: GetBalanceResult; - quantity: bigint; - startTimeInSeconds: bigint; - status: ListingStatus; - timeBufferInSeconds: bigint; - tokenId: bigint; - type: "english-auction"; -}; +let returnType: Promise; ``` - A promise that resolves to the valid auctions array. +The parsed result of the function call. +--- +## LENS --- -## getAllValidListings +## LENS.exists - Retrieves all valid direct listings based on the provided options. +Calls the "exists" function on the contract. ### Example ```ts -import { getAllValidListings } from "thirdweb/extensions/marketplace"; +import { exists } from "thirdweb/extensions/lens"; -const validListings = await getAllValidListings({ - contract, - start: 0, - count: 10, +const result = await exists({ + contract, + tokenId: ..., }); ``` ```ts -function getAllValidListings( - options: BaseTransactionOptions, -): Promise>; +function exists( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the valid listing. +The options for the exists function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - creatorAddress: Address; - currencyContractAddress: Address; - currencyValuePerToken: GetBalanceResult; - endTimeInSeconds: bigint; - id: bigint; - isReservedListing: boolean; - pricePerToken: bigint; - quantity: bigint; - startTimeInSeconds: bigint; - status: ListingStatus; - tokenId: bigint; - type: "direct-listing"; -}; +let returnType: Promise; ``` - A promise that resolves to the direct listings array. +The parsed result of the function call. --- -## getAllValidOffers +## LENS.getContentURI - Retrieves all valid offers based on the provided options. +Calls the "getContentURI" function on the contract. ### Example ```ts -import { getAllValidOffers } from "thirdweb/extensions/marketplace"; +import { getContentURI } from "thirdweb/extensions/lens"; -const validOffers = await getAllValidOffers({ - contract, - start: 0, - count: 10, +const result = await getContentURI({ + contract, + profileId: ..., + pubId: ..., }); ``` ```ts -function getAllValidOffers( - options: BaseTransactionOptions, -): Promise>; +function getContentURI( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the valid offers. +The options for the getContentURI function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - currencyContractAddress: Address; - currencyValue: GetBalanceResult; - endTimeInSeconds: bigint; - id: bigint; - offerorAddress: Address; - quantity: bigint; - status: ListingStatus; - tokenId: bigint; - totalPrice: bigint; -}; +let returnType: Promise; ``` - A promise that resolves to the offers array. +The parsed result of the function call. --- -## getAuction +## LENS.getDefaultHandle - Retrieves an auction listing based on the provided options. +Calls the "getDefaultHandle" function on the contract. ### Example ```ts -import { getListing } from "thirdweb/extensions/marketplace"; +import { getDefaultHandle } from "thirdweb/extensions/lens"; -const listing = await getListing({ contract, listingId: 1n }); +const result = await getDefaultHandle({ + contract, + profileId: ..., +}); ``` ```ts -function getAuction( - options: BaseTransactionOptions, -): Promise; +function getDefaultHandle( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the listing. +The options for the getDefaultHandle function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - bidBufferBps: bigint; - buyoutBidAmount: bigint; - buyoutCurrencyValue: GetBalanceResult; - creatorAddress: Address; - currencyContractAddress: Address; - endTimeInSeconds: bigint; - id: bigint; - minimumBidAmount: bigint; - minimumBidCurrencyValue: GetBalanceResult; - quantity: bigint; - startTimeInSeconds: bigint; - status: ListingStatus; - timeBufferInSeconds: bigint; - tokenId: bigint; - type: "english-auction"; -}; +let returnType: Promise; ``` - A promise that resolves to the direct listing. +The parsed result of the function call. --- -## getListing +## LENS.getFollowData - Retrieves a direct listing based on the provided options. +Calls the "getFollowData" function on the contract. ### Example ```ts -import { getListing } from "thirdweb/extensions/marketplace"; +import { getFollowData } from "thirdweb/extensions/lens"; -const listing = await getListing({ contract, listingId: 1n }); +const result = await getFollowData({ + contract, + followTokenId: ..., +}); ``` ```ts -function getListing( - options: BaseTransactionOptions, -): Promise; +function getFollowData( + options: BaseTransactionOptions, +): Promise<{ + followerProfileId: bigint; + followTimestamp: number; + originalFollowTimestamp: number; + profileIdAllowedToRecover: bigint; +}>; ``` ### Parameters - The options for retrieving the listing. +The options for the getFollowData function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - creatorAddress: Address; - currencyContractAddress: Address; - currencyValuePerToken: GetBalanceResult; - endTimeInSeconds: bigint; - id: bigint; - isReservedListing: boolean; - pricePerToken: bigint; - quantity: bigint; - startTimeInSeconds: bigint; - status: ListingStatus; - tokenId: bigint; - type: "direct-listing"; -}; +let returnType: Promise<{ + followerProfileId: bigint; + followTimestamp: number; + originalFollowTimestamp: number; + profileIdAllowedToRecover: bigint; +}>; ``` - A promise that resolves to the direct listing. +The parsed result of the function call. --- -## getOffer +## LENS.getFollowerCount - Retrieves an offer based on the provided options. +Calls the "getFollowerCount" function on the contract. ### Example ```ts -import { getOffer } from "thirdweb/extensions/marketplace"; +import { getFollowerCount } from "thirdweb/extensions/lens"; -const listing = await getOffer({ contract, listingId: 1n }); +const result = await getFollowerCount({ + contract, +}); ``` ```ts -function getOffer( - options: BaseTransactionOptions, -): Promise; +function getFollowerCount( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the offer. +The options for the getFollowerCount function. #### Type ```ts -let options: BaseTransactionOptions; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: { - asset: NFT; - assetContractAddress: Address; - currencyContractAddress: Address; - currencyValue: GetBalanceResult; - endTimeInSeconds: bigint; - id: bigint; - offerorAddress: Address; - quantity: bigint; - status: ListingStatus; - tokenId: bigint; - totalPrice: bigint; -}; +let returnType: Promise; ``` - A promise that resolves to the offer. +The parsed result of the function call. --- -## getWinningBid +## LENS.getFollowerProfileId - Retrieves the winning bid information for a given auction. +Calls the "getFollowerProfileId" function on the contract. ### Example ```ts -import { getWinningBid } from "thirdweb/extensions/marketplace"; +import { getFollowerProfileId } from "thirdweb/extensions/lens"; -const winningBid = await getWinningBid({ - contract, - auctionId: 0n, +const result = await getFollowerProfileId({ + contract, + followTokenId: ..., }); ``` ```ts -function getWinningBid( - options: BaseTransactionOptions, -): Promise< - | undefined - | { - bidAmountWei: bigint; - bidderAddress: string; - currencyAddress: string; - currencyValue: CurrencyValue; - } ->; +function getFollowerProfileId( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for retrieving the winning bid. +The options for the getFollowerProfileId function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise< - | undefined - | { - bidAmountWei: bigint; - bidderAddress: string; - currencyAddress: string; - currencyValue: CurrencyValue; - } ->; +let returnType: Promise; ``` - The winning bid information, or undefined if there is no winning bid. +The parsed result of the function call. --- -## isBidInAuctionSupported +## LENS.getFollowTokenId - Checks if the `bidInAuction` method is supported by the given contract. +Calls the "getFollowTokenId" function on the contract. ### Example ```ts -import { isBidInAuctionSupported } from "thirdweb/extensions/marketplace"; +import { getFollowTokenId } from "thirdweb/extensions/lens"; -const supported = isBidInAuctionSupported(["0x..."]); +const result = await getFollowTokenId({ + contract, + followerProfileId: ..., +}); ``` ```ts -function isBidInAuctionSupported( - availableSelectors: Array, -): boolean; +function getFollowTokenId( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getFollowTokenId function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `bidInAuction` method is supported. +The parsed result of the function call. --- -## isBuyerApprovedForListing +## LENS.getFullProfile + +Return the profile data _with Lens handle_ and optional join date - Checks if the buyer is approved for a listing. +In Lens Protocol, each profile is associated with an ERC721 token, thus, the tokenId represent profileId and the 2 terms can be used interchangeably ### Example ```ts -import { isBuyerApprovedForListing } from "thirdweb/extensions/marketplace"; +import { getFullProfile } from "thirdweb/extension/lens"; -const isApproved = await isBuyerApprovedForListing({ - contract, - listingId: 1n, - buyer: "0x...", -}); +const profileId = 10000n; // profileId is the tokenId of the NFT +const lensProfile = await getFullProfile({ profileId, client }); ``` ```ts -function isBuyerApprovedForListing( - options: BaseTransactionOptions, -): Promise; +function getFullProfile( + options: GetFullProfileParams, +): Promise; ``` ### Parameters - The options for checking buyer approval. - #### Type ```ts -let options: BaseTransactionOptions; +let options: { + client: ThirdwebClient; + includeJoinDate?: boolean; + overrides?: { + chain?: Chain; + lensHandleAddress?: string; + lensHubAddress?: string; + tokenHandleRegistryAddress?: string; + }; + profileId: bigint; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + handle: string; + joinDate: bigint | null; + profileData: LensProfileSchema | null; +} | null; ``` - - A promise that resolves to a boolean indicating whether the buyer is approved for the listing. --- -## isBuyFromListingSupported +## LENS.getHandle - Checks if the `buyFromListing` method is supported by the given contract. +Calls the "getHandle" function on the contract. ### Example ```ts -import { isBuyFromListingSupported } from "thirdweb/extensions/marketplace"; +import { getHandle } from "thirdweb/extensions/lens"; -const supported = isBuyFromListingSupported(["0x..."]); +const result = await getHandle({ + contract, + tokenId: ..., +}); ``` ```ts -function isBuyFromListingSupported( - availableSelectors: Array, -): boolean; +function getHandle( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getHandle function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `buyFromListing` method is supported. +The parsed result of the function call. --- -## isCancelAuctionSupported +## LENS.getHandleFromProfileId - Checks if the `cancelAuction` method is supported by the given contract. +Return the Lens handle of a profile in the format: lens/@`` ### Example ```ts -import { isCancelAuctionSupported } from "thirdweb/extensions/marketplace"; +import { getHandleFromProfileId } from "thirdweb/extensions/lens"; -const supported = isCancelAuctionSupported(["0x..."]); +const profileId = 461662n; +const handle = await getHandleFromProfileId({ profileId, client }); // "lens/@captain_jack" ``` ```ts -function isCancelAuctionSupported( - availableSelectors: Array, -): boolean; +function getHandleFromProfileId( + options: GetHandleFromProfileIdParams, +): Promise; ``` ### 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; +let options: { + client: ThirdwebClient; + overrides?: { + chain?: Chain; + lensHandleAddress?: string; + tokenHandleRegistryAddress?: string; + }; + profileId: bigint; +}; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - - A boolean indicating if the `cancelAuction` method is supported. --- -## isCancelListingSupported +## LENS.getHandleTokenURIContract - Checks if the `cancelListing` method is supported by the given contract. +Calls the "getHandleTokenURIContract" function on the contract. ### Example ```ts -import { isCancelListingSupported } from "thirdweb/extensions/marketplace"; +import { getHandleTokenURIContract } from "thirdweb/extensions/lens"; -const supported = isCancelListingSupported(["0x..."]); +const result = await getHandleTokenURIContract({ + contract, +}); ``` ```ts -function isCancelListingSupported( - availableSelectors: Array, -): boolean; +function getHandleTokenURIContract( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getHandleTokenURIContract function. #### Type ```ts -let availableSelectors: Array; +let options: { contract: ThirdwebContract } & T; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `cancelListing` method is supported. +The parsed result of the function call. --- -## isCreateAuctionSupported +## LENS.getLocalName - Checks if the `createAuction` method is supported by the given contract. +Calls the "getLocalName" function on the contract. ### Example ```ts -import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace"; +import { getLocalName } from "thirdweb/extensions/lens"; -const supported = isCreateAuctionSupported(["0x..."]); +const result = await getLocalName({ + contract, + tokenId: ..., +}); ``` ```ts -function isCreateAuctionSupported( - availableSelectors: Array, -): boolean; +function getLocalName( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getLocalName function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `createAuction` method is supported. +The parsed result of the function call. --- -## isCreateListingSupported +## LENS.getModuleTypes - Checks if the `createListing` method is supported by the given contract. +Calls the "getModuleTypes" function on the contract. ### Example ```ts -import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace"; +import { getModuleTypes } from "thirdweb/extensions/lens"; -const supported = isCreateAuctionSupported(["0x..."]); +const result = await getModuleTypes({ + contract, + moduleAddress: ..., +}); ``` ```ts -function isCreateListingSupported( - availableSelectors: Array, -): boolean; +function getModuleTypes( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getModuleTypes function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `createListing` method is supported. +The parsed result of the function call. --- -## isCurrencyApprovedForListing +## LENS.getOriginalFollowTimestamp - Calls the "isCurrencyApprovedForListing" function on the contract. +Calls the "getOriginalFollowTimestamp" function on the contract. ### Example ```ts -import { isCurrencyApprovedForListing } from "thirdweb/extensions/marketplace"; +import { getOriginalFollowTimestamp } from "thirdweb/extensions/lens"; -const result = await isCurrencyApprovedForListing({ +const result = await getOriginalFollowTimestamp({ contract, - listingId: ..., - currency: ..., + followTokenId: ..., }); ``` ```ts -function isCurrencyApprovedForListing( - options: BaseTransactionOptions, -): Promise; +function getOriginalFollowTimestamp( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - The options for the isCurrencyApprovedForListing function. +The options for the getOriginalFollowTimestamp function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isGetAuctionSupported +## LENS.getProfile - Checks if the `getAuction` method is supported by the given contract. +Calls the "getProfile" function on the contract. ### Example ```ts -import { isGetAuctionSupported } from "thirdweb/extensions/marketplace"; +import { getProfile } from "thirdweb/extensions/lens"; -const supported = isGetAuctionSupported(["0x..."]); +const result = await getProfile({ + contract, + profileId: ..., +}); ``` ```ts -function isGetAuctionSupported( - availableSelectors: Array, -): boolean; +function getProfile( + options: BaseTransactionOptions, +): Promise<{ + __DEPRECATED__followNFTURI: string; + __DEPRECATED__handle: string; + __DEPRECATED__imageURI: string; + followModule: string; + followNFT: string; + metadataURI: string; + pubCount: bigint; +}>; ``` ### 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. +The options for the getProfile function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise<{ + __DEPRECATED__followNFTURI: string; + __DEPRECATED__handle: string; + __DEPRECATED__imageURI: string; + followModule: string; + followNFT: string; + metadataURI: string; + pubCount: bigint; +}>; ``` - A boolean indicating if the `getAuction` method is supported. +The parsed result of the function call. --- -## isGetListingSupported +## LENS.getProfileIdAllowedToRecover - Checks if the `isGetListingSupported` method is supported by the given contract. +Calls the "getProfileIdAllowedToRecover" function on the contract. ### Example ```ts -import { isGetListingSupported } from "thirdweb/extensions/marketplace"; +import { getProfileIdAllowedToRecover } from "thirdweb/extensions/lens"; -const supported = isGetListingSupported(["0x..."]); +const result = await getProfileIdAllowedToRecover({ + contract, + followTokenId: ..., +}); ``` ```ts -function isGetListingSupported( - availableSelectors: Array, -): boolean; +function getProfileIdAllowedToRecover( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getProfileIdAllowedToRecover function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `isGetListingSupported` method is supported. +The parsed result of the function call. --- -## isGetWinningBidSupported +## LENS.getProfileIdByHandleHash - Checks if the `getWinningBid` method is supported by the given contract. +Calls the "getProfileIdByHandleHash" function on the contract. ### Example ```ts -import { isGetWinningBidSupported } from "thirdweb/extensions/marketplace"; +import { getProfileIdByHandleHash } from "thirdweb/extensions/lens"; -const supported = isGetWinningBidSupported(["0x..."]); +const result = await getProfileIdByHandleHash({ + contract, + handleHash: ..., +}); ``` ```ts -function isGetWinningBidSupported( - availableSelectors: Array, -): boolean; +function getProfileIdByHandleHash( + options: BaseTransactionOptions, +): Promise; ``` ### 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. +The options for the getProfileIdByHandleHash function. #### Type ```ts -let availableSelectors: Array; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: boolean; +let returnType: Promise; ``` - A boolean indicating if the `getWinningBid` method is supported. +The parsed result of the function call. --- -## isNewWinningBid +## LENS.getProfileMetadata - Calls the "isNewWinningBid" function on the contract. +Download user lens profile from Arweave This method does NOT give you the user handle & join-time - consider using `getFullProfileData` instead It is useful & cost efficient if you only want to get user's name, bio, picture, coverPicture etc. ### Example ```ts -import { isNewWinningBid } from "thirdweb/extensions/marketplace"; +import { getProfileMetadata } from "thirdweb/extensions/lens"; -const result = await isNewWinningBid({ - contract, - auctionId: ..., - bidAmount: ..., -}); +const profileData = await getProfileMetadata({ profileId, client }); + +if (profileData) { + console.log("Display name: ", profileData.lens.name); + console.log("Bio: ", profileData.lens.bio); +} ``` ```ts -function isNewWinningBid( - options: BaseTransactionOptions, -): Promise; +function getProfileMetadata( + options: GetProfileMetadataParams, +): Promise; ``` ### Parameters - The options for the isNewWinningBid function. - #### Type ```ts -let options: BaseTransactionOptions; +let options: { + client: ThirdwebClient; + overrides?: { chain?: Chain; lensHubAddress?: string }; + profileId: bigint; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + lens: { + appId?: string; + attributes: Array; + bio: string; + coverPicture: string; + id: string; + name: string; + picture: string; + }; + signature: string; +}; ``` - The parsed result of the function call. +LensProfileSchema | null --- -## makeOffer +## LENS.getPublication - Makes an offer for any asset (ERC721 or ERC1155). +Calls the "getPublication" function on the contract. ### Example ```ts -import { makeOffer } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; +import { getPublication } from "thirdweb/extensions/lens"; -const offerTx = makeOffer({ - contract, - assetContractAddress: "0x1234567890123456789012345678901234567890", - tokenId: 1n, - currencyContractAddress: - "0x1234567890123456789012345678901234567890", - offerExpiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24), - totalOffer: "1.0", +const result = await getPublication({ + contract, + profileId: ..., + pubId: ..., }); - -await sendTransaction({ transaction, account }); ``` ```ts -function makeOffer( - options: BaseTransactionOptions, -): PreparedTransaction; +function getPublication( + options: BaseTransactionOptions, +): Promise<{ + __DEPRECATED__collectModule: string; + __DEPRECATED__collectNFT: string; + contentURI: string; + pointedProfileId: bigint; + pointedPubId: bigint; + pubType: number; + referenceModule: string; + rootProfileId: bigint; + rootPubId: bigint; +}>; ``` ### Parameters - The options for making the offer. +The options for the getPublication function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise<{ + __DEPRECATED__collectModule: string; + __DEPRECATED__collectNFT: string; + contentURI: string; + pointedProfileId: bigint; + pointedPubId: bigint; + pubType: number; + referenceModule: string; + rootProfileId: bigint; + rootPubId: bigint; +}>; ``` - A transaction object that can be sent to make the offer. +The parsed result of the function call. --- -## newAuctionEvent +## LENS.getTokenId - Creates an event object for the NewAuction event. +Calls the "getTokenId" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { newAuctionEvent } from "thirdweb/extensions/marketplace"; +import { getTokenId } from "thirdweb/extensions/lens"; -const events = await getContractEvents({ -contract, -events: [ - newAuctionEvent({ - auctionCreator: ..., - auctionId: ..., - assetContract: ..., -}) -], +const result = await getTokenId({ + contract, + localName: ..., }); ``` ```ts -function newAuctionEvent( - filters: Partial<{ - assetContract: string; - auctionCreator: string; - auctionId: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "auctionId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { - readonly name: "minimumBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "buyoutBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "timeBufferInSeconds"; - readonly type: "uint64"; - }, - { readonly name: "bidBufferBps"; readonly type: "uint64" }, - { readonly name: "startTimestamp"; readonly type: "uint64" }, - { readonly name: "endTimestamp"; readonly type: "uint64" }, - { readonly name: "auctionCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - ]; - readonly name: "auction"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewAuction"; - readonly type: "event"; -}>; +function getTokenId( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the getTokenId function. #### Type ```ts -let filters: Partial<{ - assetContract: string; - auctionCreator: string; - auctionId: bigint; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "auctionId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { - readonly name: "minimumBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "buyoutBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "timeBufferInSeconds"; - readonly type: "uint64"; - }, - { readonly name: "bidBufferBps"; readonly type: "uint64" }, - { readonly name: "startTimestamp"; readonly type: "uint64" }, - { readonly name: "endTimestamp"; readonly type: "uint64" }, - { readonly name: "auctionCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - ]; - readonly name: "auction"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewAuction"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## newBidEvent +## LENS.isErc20CurrencyRegistered - Creates an event object for the NewBid event. +Calls the "isErc20CurrencyRegistered" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { newBidEvent } from "thirdweb/extensions/marketplace"; +import { isErc20CurrencyRegistered } from "thirdweb/extensions/lens"; -const events = await getContractEvents({ -contract, -events: [ - newBidEvent({ - auctionId: ..., - bidder: ..., - assetContract: ..., -}) -], +const result = await isErc20CurrencyRegistered({ + contract, + currencyAddress: ..., }); ``` ```ts -function newBidEvent( - filters: Partial<{ - assetContract: string; - auctionId: bigint; - bidder: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "bidder"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { readonly name: "bidAmount"; readonly type: "uint256" }, - { - readonly components: readonly [ - { readonly name: "auctionId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { - readonly name: "minimumBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "buyoutBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "timeBufferInSeconds"; - readonly type: "uint64"; - }, - { readonly name: "bidBufferBps"; readonly type: "uint64" }, - { readonly name: "startTimestamp"; readonly type: "uint64" }, - { readonly name: "endTimestamp"; readonly type: "uint64" }, - { readonly name: "auctionCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - ]; - readonly name: "auction"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewBid"; - readonly type: "event"; -}>; +function isErc20CurrencyRegistered( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the isErc20CurrencyRegistered function. #### Type ```ts -let filters: Partial<{ - assetContract: string; - auctionId: bigint; - bidder: string; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "auctionId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "bidder"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { readonly name: "bidAmount"; readonly type: "uint256" }, - { - readonly components: readonly [ - { readonly name: "auctionId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { - readonly name: "minimumBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "buyoutBidAmount"; - readonly type: "uint256"; - }, - { - readonly name: "timeBufferInSeconds"; - readonly type: "uint64"; - }, - { readonly name: "bidBufferBps"; readonly type: "uint64" }, - { readonly name: "startTimestamp"; readonly type: "uint64" }, - { readonly name: "endTimestamp"; readonly type: "uint64" }, - { readonly name: "auctionCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - ]; - readonly name: "auction"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewBid"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## newListingEvent +## LENS.isFollowing - Creates an event object for the NewListing event. +Calls the "isFollowing" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { newListingEvent } from "thirdweb/extensions/marketplace"; +import { isFollowing } from "thirdweb/extensions/lens"; -const events = await getContractEvents({ -contract, -events: [ - newListingEvent({ - listingCreator: ..., - listingId: ..., - assetContract: ..., -}) -], +const result = await isFollowing({ + contract, + followerProfileId: ..., }); ``` ```ts -function newListingEvent( - filters: Partial<{ - assetContract: string; - listingCreator: string; - listingId: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "listingId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "startTimestamp"; readonly type: "uint128" }, - { readonly name: "endTimestamp"; readonly type: "uint128" }, - { readonly name: "listingCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - { readonly name: "reserved"; readonly type: "bool" }, - ]; - readonly name: "listing"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewListing"; - readonly type: "event"; -}>; +function isFollowing( + options: BaseTransactionOptions, +): Promise; +``` + +### Parameters + +The options for the isFollowing function. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +The parsed result of the function call. +--- + +## LENS.isModuleRegistered + +Calls the "isModuleRegistered" function on the contract. + +### Example + +```ts +import { isModuleRegistered } from "thirdweb/extensions/lens"; + +const result = await isModuleRegistered({ + contract, + moduleAddress: ..., +}); +``` + +```ts +function isModuleRegistered( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the isModuleRegistered function. #### Type ```ts -let filters: Partial<{ - assetContract: string; - listingCreator: string; - listingId: bigint; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "listingId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "startTimestamp"; readonly type: "uint128" }, - { readonly name: "endTimestamp"; readonly type: "uint128" }, - { readonly name: "listingCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - { readonly name: "reserved"; readonly type: "bool" }, - ]; - readonly name: "listing"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewListing"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## newOfferEvent +## LENS.isModuleRegisteredAs - Creates an event object for the NewOffer event. +Calls the "isModuleRegisteredAs" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { newOfferEvent } from "thirdweb/extensions/marketplace"; +import { isModuleRegisteredAs } from "thirdweb/extensions/lens"; -const events = await getContractEvents({ -contract, -events: [ - newOfferEvent({ - offeror: ..., - offerId: ..., - assetContract: ..., -}) -], +const result = await isModuleRegisteredAs({ + contract, + moduleAddress: ..., + moduleType: ..., }); ``` ```ts -function newOfferEvent( - filters: Partial<{ - assetContract: string; - offerId: bigint; - offeror: string; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "offeror"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "offerId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "offerId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "totalPrice"; readonly type: "uint256" }, - { - readonly name: "expirationTimestamp"; - readonly type: "uint256"; - }, - { readonly name: "offeror"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - ]; - readonly name: "offer"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewOffer"; - readonly type: "event"; -}>; +function isModuleRegisteredAs( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the isModuleRegisteredAs function. #### Type ```ts -let filters: Partial<{ - assetContract: string; - offerId: bigint; - offeror: string; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "offeror"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "offerId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "offerId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "totalPrice"; readonly type: "uint256" }, - { - readonly name: "expirationTimestamp"; - readonly type: "uint256"; - }, - { readonly name: "offeror"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - ]; - readonly name: "offer"; - readonly type: "tuple"; - }, - ]; - readonly name: "NewOffer"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## newSaleEvent +## LENS.mintTimestampOf - Creates an event object for the NewSale event. +Calls the "mintTimestampOf" function on the contract. ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { newSaleEvent } from "thirdweb/extensions/marketplace"; +import { mintTimestampOf } from "thirdweb/extensions/lens"; -const events = await getContractEvents({ -contract, -events: [ - newSaleEvent({ - listingCreator: ..., - listingId: ..., - assetContract: ..., -}) -], +const result = await mintTimestampOf({ + contract, + tokenId: ..., }); ``` ```ts -function newSaleEvent( - filters: Partial<{ - assetContract: string; - listingCreator: string; - listingId: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "buyer"; readonly type: "address" }, - { readonly name: "quantityBought"; readonly type: "uint256" }, - { readonly name: "totalPricePaid"; readonly type: "uint256" }, - ]; - readonly name: "NewSale"; - readonly type: "event"; -}>; +function mintTimestampOf( + options: BaseTransactionOptions, +): Promise; ``` ### Parameters - Optional filters to apply to the event. +The options for the mintTimestampOf function. #### Type ```ts -let filters: Partial<{ - assetContract: string; - listingCreator: string; - listingId: bigint; -}>; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "buyer"; readonly type: "address" }, - { readonly name: "quantityBought"; readonly type: "uint256" }, - { readonly name: "totalPricePaid"; readonly type: "uint256" }, - ]; - readonly name: "NewSale"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - The prepared event object. +The parsed result of the function call. --- -## totalAuctions +## LENS.mintTimestampOfFollowNFT - Calls the "totalAuctions" function on the contract. +Calls the "mintTimestampOf" function on the contract. ### Example ```ts -import { totalAuctions } from "thirdweb/extensions/marketplace"; +import { mintTimestampOf } from "thirdweb/extensions/lens"; -const result = await totalAuctions({ - contract, +const result = await mintTimestampOf({ + contract, + tokenId: ..., }); ``` ```ts -function totalAuctions( - options: BaseTransactionOptions, +function mintTimestampOfFollowNFT( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the totalAuctions function. +The options for the mintTimestampOf function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -28996,37 +29711,38 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## totalListings +## LENS.nonces - Calls the "totalListings" function on the contract. +Calls the "nonces" function on the contract. ### Example ```ts -import { totalListings } from "thirdweb/extensions/marketplace"; +import { nonces } from "thirdweb/extensions/lens"; -const result = await totalListings({ - contract, +const result = await nonces({ + contract, + signer: ..., }); ``` ```ts -function totalListings( - options: BaseTransactionOptions, +function nonces( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the totalListings function. +The options for the nonces function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -29035,37 +29751,38 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## totalOffers +## LENS.resolve - Calls the "totalOffers" function on the contract. +Calls the "resolve" function on the contract. ### Example ```ts -import { totalOffers } from "thirdweb/extensions/marketplace"; +import { resolve } from "thirdweb/extensions/lens"; -const result = await totalOffers({ - contract, +const result = await resolve({ + contract, + handleId: ..., }); ``` ```ts -function totalOffers( - options: BaseTransactionOptions, +function resolve( + options: BaseTransactionOptions, ): Promise; ``` ### Parameters - The options for the totalOffers function. +The options for the resolve function. #### Type ```ts -let options: { contract: ThirdwebContract } & T; +let options: BaseTransactionOptions; ``` ### Returns @@ -29074,189 +29791,94 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## updatedListingEvent +## LENS.resolveAddress - Creates an event object for the UpdatedListing event. +Take in a Lens handle or local-name and return the wallet address behind that handle/local-name. For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name ### Example ```ts -import { getContractEvents } from "thirdweb"; -import { updatedListingEvent } from "thirdweb/extensions/marketplace"; +import { resolveAddress } from "thirdweb/extensions/lens"; -const events = await getContractEvents({ -contract, -events: [ - updatedListingEvent({ - listingCreator: ..., - listingId: ..., - assetContract: ..., -}) -], +const walletAddress = await resolveAddress({ + name: "vitalik", + client, }); ``` ```ts -function updatedListingEvent( - filters: Partial<{ - assetContract: string; - listingCreator: string; - listingId: bigint; - }>, -): PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "listingId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "startTimestamp"; readonly type: "uint128" }, - { readonly name: "endTimestamp"; readonly type: "uint128" }, - { readonly name: "listingCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - { readonly name: "reserved"; readonly type: "bool" }, - ]; - readonly name: "listing"; - readonly type: "tuple"; - }, - ]; - readonly name: "UpdatedListing"; - readonly type: "event"; -}>; +function resolveAddress( + options: ResolveLensAddressParams, +): Promise; ``` ### Parameters - Optional filters to apply to the event. - #### Type ```ts -let filters: Partial<{ - assetContract: string; - listingCreator: string; - listingId: bigint; -}>; +let options: { + client: ThirdwebClient; + name: string; + overrides?: { chain?: Chain; lensHandleContractAddress?: string }; +}; ``` ### Returns ```ts -let returnType: PreparedEvent<{ - readonly inputs: readonly [ - { - readonly indexed: true; - readonly name: "listingCreator"; - readonly type: "address"; - }, - { - readonly indexed: true; - readonly name: "listingId"; - readonly type: "uint256"; - }, - { - readonly indexed: true; - readonly name: "assetContract"; - readonly type: "address"; - }, - { - readonly components: readonly [ - { readonly name: "listingId"; readonly type: "uint256" }, - { readonly name: "tokenId"; readonly type: "uint256" }, - { readonly name: "quantity"; readonly type: "uint256" }, - { readonly name: "pricePerToken"; readonly type: "uint256" }, - { readonly name: "startTimestamp"; readonly type: "uint128" }, - { readonly name: "endTimestamp"; readonly type: "uint128" }, - { readonly name: "listingCreator"; readonly type: "address" }, - { readonly name: "assetContract"; readonly type: "address" }, - { readonly name: "currency"; readonly type: "address" }, - { readonly name: "tokenType"; readonly type: "uint8" }, - { readonly name: "status"; readonly type: "uint8" }, - { readonly name: "reserved"; readonly type: "bool" }, - ]; - readonly name: "listing"; - readonly type: "tuple"; - }, - ]; - readonly name: "UpdatedListing"; - readonly type: "event"; -}>; +let returnType: Promise; ``` - - The prepared event object. --- -## updateListing +## LENS.tokenDataOf - Updates an existing direct listing. +Calls the "tokenDataOf" function on the contract. ### Example -```typescript -import { updateListing } from "thirdweb/extensions/marketplace"; -import { sendTransaction } from "thirdweb"; - -const transaction = updateListing({...}); +```ts +import { tokenDataOf } from "thirdweb/extensions/lens"; -await sendTransaction({ transaction, account }); +const result = await tokenDataOf({ + contract, + tokenId: ..., +}); ``` ```ts -function updateListing( - options: BaseTransactionOptions, -): PreparedTransaction; +function tokenDataOf( + options: BaseTransactionOptions, +): Promise<{ mintTimestamp: bigint; owner: string }>; ``` ### Parameters - The options for updating the direct listing. +The options for the tokenDataOf function. #### Type ```ts -let options: BaseTransactionOptions; +let options: BaseTransactionOptions; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; +let returnType: Promise<{ mintTimestamp: bigint; owner: string }>; ``` - The result of updating the direct listing. +The parsed result of the function call. --- ## MULTICALL3 --- -## aggregate +## MULTICALL3.aggregate - Prepares a transaction to call the "aggregate" function on the contract. +Prepares a transaction to call the "aggregate" function on the contract. ### Example @@ -29286,7 +29908,7 @@ function aggregate( ### Parameters - The options for the "aggregate" function. +The options for the "aggregate" function. #### Type @@ -29306,12 +29928,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## aggregate3 +## MULTICALL3.aggregate3 - Prepares a transaction to call the "aggregate3" function on the contract. +Prepares a transaction to call the "aggregate3" function on the contract. ### Example @@ -29342,7 +29964,7 @@ function aggregate3( ### Parameters - The options for the "aggregate3" function. +The options for the "aggregate3" function. #### Type @@ -29362,12 +29984,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## aggregate3Value +## MULTICALL3.aggregate3Value - Prepares a transaction to call the "aggregate3Value" function on the contract. +Prepares a transaction to call the "aggregate3Value" function on the contract. ### Example @@ -29398,7 +30020,7 @@ function aggregate3Value( ### Parameters - The options for the "aggregate3Value" function. +The options for the "aggregate3Value" function. #### Type @@ -29419,12 +30041,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## blockAndAggregate +## MULTICALL3.blockAndAggregate - Prepares a transaction to call the "blockAndAggregate" function on the contract. +Prepares a transaction to call the "blockAndAggregate" function on the contract. ### Example @@ -29455,7 +30077,7 @@ function blockAndAggregate( ### Parameters - The options for the "blockAndAggregate" function. +The options for the "blockAndAggregate" function. #### Type @@ -29476,12 +30098,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## getBasefee +## MULTICALL3.getBasefee - Calls the "getBasefee" function on the contract. +Calls the "getBasefee" function on the contract. ### Example @@ -29499,7 +30121,7 @@ function getBasefee(options: BaseTransactionOptions): Promise; ### Parameters - The options for the getBasefee function. +The options for the getBasefee function. #### Type @@ -29513,12 +30135,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getBlockHash +## MULTICALL3.getBlockHash - Calls the "getBlockHash" function on the contract. +Calls the "getBlockHash" function on the contract. ### Example @@ -29539,7 +30161,7 @@ function getBlockHash( ### Parameters - The options for the getBlockHash function. +The options for the getBlockHash function. #### Type @@ -29553,12 +30175,12 @@ let options: BaseTransactionOptions; let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getBlockNumber +## MULTICALL3.getBlockNumber - Calls the "getBlockNumber" function on the contract. +Calls the "getBlockNumber" function on the contract. ### Example @@ -29578,7 +30200,7 @@ function getBlockNumber( ### Parameters - The options for the getBlockNumber function. +The options for the getBlockNumber function. #### Type @@ -29592,12 +30214,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getChainId +## MULTICALL3.getChainId - Calls the "getChainId" function on the contract. +Calls the "getChainId" function on the contract. ### Example @@ -29615,7 +30237,7 @@ function getChainId(options: BaseTransactionOptions): Promise; ### Parameters - The options for the getChainId function. +The options for the getChainId function. #### Type @@ -29629,12 +30251,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getCurrentBlockCoinbase +## MULTICALL3.getCurrentBlockCoinbase - Calls the "getCurrentBlockCoinbase" function on the contract. +Calls the "getCurrentBlockCoinbase" function on the contract. ### Example @@ -29654,7 +30276,7 @@ function getCurrentBlockCoinbase( ### Parameters - The options for the getCurrentBlockCoinbase function. +The options for the getCurrentBlockCoinbase function. #### Type @@ -29668,12 +30290,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getCurrentBlockDifficulty +## MULTICALL3.getCurrentBlockDifficulty - Calls the "getCurrentBlockDifficulty" function on the contract. +Calls the "getCurrentBlockDifficulty" function on the contract. ### Example @@ -29693,7 +30315,7 @@ function getCurrentBlockDifficulty( ### Parameters - The options for the getCurrentBlockDifficulty function. +The options for the getCurrentBlockDifficulty function. #### Type @@ -29707,12 +30329,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getCurrentBlockGasLimit +## MULTICALL3.getCurrentBlockGasLimit - Calls the "getCurrentBlockGasLimit" function on the contract. +Calls the "getCurrentBlockGasLimit" function on the contract. ### Example @@ -29732,7 +30354,7 @@ function getCurrentBlockGasLimit( ### Parameters - The options for the getCurrentBlockGasLimit function. +The options for the getCurrentBlockGasLimit function. #### Type @@ -29746,12 +30368,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getCurrentBlockTimestamp +## MULTICALL3.getCurrentBlockTimestamp - Calls the "getCurrentBlockTimestamp" function on the contract. +Calls the "getCurrentBlockTimestamp" function on the contract. ### Example @@ -29771,7 +30393,7 @@ function getCurrentBlockTimestamp( ### Parameters - The options for the getCurrentBlockTimestamp function. +The options for the getCurrentBlockTimestamp function. #### Type @@ -29785,12 +30407,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getEthBalance +## MULTICALL3.getEthBalance - Calls the "getEthBalance" function on the contract. +Calls the "getEthBalance" function on the contract. ### Example @@ -29811,7 +30433,7 @@ function getEthBalance( ### Parameters - The options for the getEthBalance function. +The options for the getEthBalance function. #### Type @@ -29825,12 +30447,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getLastBlockHash +## MULTICALL3.getLastBlockHash - Calls the "getLastBlockHash" function on the contract. +Calls the "getLastBlockHash" function on the contract. ### Example @@ -29850,7 +30472,7 @@ function getLastBlockHash( ### Parameters - The options for the getLastBlockHash function. +The options for the getLastBlockHash function. #### Type @@ -29864,12 +30486,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise<`0x${string}`>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## tryAggregate +## MULTICALL3.tryAggregate - Prepares a transaction to call the "tryAggregate" function on the contract. +Prepares a transaction to call the "tryAggregate" function on the contract. ### Example @@ -29901,7 +30523,7 @@ function tryAggregate( ### Parameters - The options for the "tryAggregate" function. +The options for the "tryAggregate" function. #### Type @@ -29922,12 +30544,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## tryBlockAndAggregate +## MULTICALL3.tryBlockAndAggregate - Prepares a transaction to call the "tryBlockAndAggregate" function on the contract. +Prepares a transaction to call the "tryBlockAndAggregate" function on the contract. ### Example @@ -29959,7 +30581,7 @@ function tryBlockAndAggregate( ### Parameters - The options for the "tryBlockAndAggregate" function. +The options for the "tryBlockAndAggregate" function. #### Type @@ -29980,12 +30602,16 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## PACK --- -## createNewPack +## PACK.createNewPack + +Deprecated + +\[Pack contract is incompatible with Pectra update. Support for this contract is being removed in next release.\] ### Example @@ -30053,9 +30679,9 @@ let returnType: PreparedTransaction< ``` --- -## createPack +## PACK.createPack - Prepares a transaction to call the "createPack" function on the contract. +Prepares a transaction to call the "createPack" function on the contract. ### Example @@ -30091,7 +30717,7 @@ function createPack( ### Parameters - The options for the "createPack" function. +The options for the "createPack" function. #### Type @@ -30111,12 +30737,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## getPackContents +## PACK.getPackContents - Calls the "getPackContents" function on the contract. +Calls the "getPackContents" function on the contract. ### Example @@ -30135,7 +30761,7 @@ function getPackContents(options: BaseTransactionOptions) ### Parameters - The options for the getPackContents function. +The options for the getPackContents function. #### Type @@ -30149,12 +30775,12 @@ let options: BaseTransactionOptions; let returnType: Promise, readonly Array]> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getTokenCountOfBundle +## PACK.getTokenCountOfBundle - Calls the "getTokenCountOfBundle" function on the contract. +Calls the "getTokenCountOfBundle" function on the contract. ### Example @@ -30175,7 +30801,7 @@ function getTokenCountOfBundle( ### Parameters - The options for the getTokenCountOfBundle function. +The options for the getTokenCountOfBundle function. #### Type @@ -30189,12 +30815,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## openPack +## PACK.openPack - Prepares a transaction to call the "openPack" function on the contract. +Prepares a transaction to call the "openPack" function on the contract. ### Example @@ -30225,7 +30851,7 @@ function openPack( ### Parameters - The options for the "openPack" function. +The options for the "openPack" function. #### Type @@ -30245,12 +30871,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## packCreatedEvent +## PACK.packCreatedEvent - Creates an event object for the PackCreated event. +Creates an event object for the PackCreated event. ### Example @@ -30270,7 +30896,7 @@ events: [ ```ts function packCreatedEvent( - filters: Partial<{ packId: bigint }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -30288,12 +30914,12 @@ function packCreatedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ packId: bigint }>; +let filters: Partial; ``` ### Returns @@ -30314,12 +30940,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## packOpenedEvent +## PACK.packOpenedEvent - Creates an event object for the PackOpened event. +Creates an event object for the PackOpened event. ### Example @@ -30340,7 +30966,7 @@ events: [ ```ts function packOpenedEvent( - filters: Partial<{ opener: string; packId: bigint }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -30372,12 +30998,12 @@ function packOpenedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ opener: string; packId: bigint }>; +let filters: Partial; ``` ### Returns @@ -30412,12 +31038,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## packUpdatedEvent +## PACK.packUpdatedEvent - Creates an event object for the PackUpdated event. +Creates an event object for the PackUpdated event. ### Example @@ -30437,7 +31063,7 @@ events: [ ```ts function packUpdatedEvent( - filters: Partial<{ packId: bigint }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -30455,12 +31081,12 @@ function packUpdatedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ packId: bigint }>; +let filters: Partial; ``` ### Returns @@ -30481,14 +31107,14 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- ## PERMISSIONS --- -## getAllRoleMembers +## PERMISSIONS.getAllRoleMembers - Retrieves all members of a specific role. +Retrieves all members of a specific role. ### Example @@ -30509,7 +31135,7 @@ function getAllRoleMembers( ### Parameters - The options for retrieving role members. +The options for retrieving role members. #### Type @@ -30523,12 +31149,12 @@ let options: BaseTransactionOptions; let returnType: Promise>; ``` - A promise that resolves to an array of strings representing the role members. +A promise that resolves to an array of strings representing the role members. --- -## getRoleAdmin +## PERMISSIONS.getRoleAdmin - Gets the admin of a role. +Gets the admin of a role. ### Example @@ -30549,7 +31175,7 @@ function getRoleAdmin( ### Parameters - The options for getting the role's admin. +The options for getting the role's admin. #### Type @@ -30563,12 +31189,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The address of the role's admin. +The address of the role's admin. --- -## getRoleHash +## PERMISSIONS.getRoleHash - Get a hex value of a smart contract role You need the hex value to interact with the smart contracts. +Get a hex value of a smart contract role You need the hex value to interact with the smart contracts. ### Example @@ -30582,7 +31208,7 @@ function getRoleHash(role: RoleInput): `0x${string}`; ### Parameters - string +string #### Type @@ -30596,12 +31222,12 @@ let role: RoleInput; let returnType: `0x${string}`; ``` - hex value of the contract role +hex value of the contract role --- -## getRoleMember +## PERMISSIONS.getRoleMember - Retrieves a specific member of a specific role. +Retrieves a specific member of a specific role. ### Example @@ -30623,7 +31249,7 @@ function getRoleMember( ### Parameters - The options for retrieving the role member. +The options for retrieving the role member. #### Type @@ -30637,12 +31263,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - A promise that resolves to the address of the role member. +A promise that resolves to the address of the role member. --- -## getRoleMemberCount +## PERMISSIONS.getRoleMemberCount - Retrieves the number of members of a specific role. +Retrieves the number of members of a specific role. ### Example @@ -30663,7 +31289,7 @@ function getRoleMemberCount( ### Parameters - The options for retrieving role member count. +The options for retrieving role member count. #### Type @@ -30677,12 +31303,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - A promise that resolves to the number of members of the role. +A promise that resolves to the number of members of the role. --- -## grantRole +## PERMISSIONS.grantRole - Grants a role to a target account. +Grants a role to a target account. ### Example @@ -30707,7 +31333,7 @@ function grantRole( ### Parameters - The options for granting the role. +The options for granting the role. #### Type @@ -30725,12 +31351,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction that grants the role when sent. +A transaction that grants the role when sent. --- -## hasRole +## PERMISSIONS.hasRole - Checks if the target account has the role. +Checks if the target account has the role. ### Example @@ -30752,7 +31378,7 @@ function hasRole( ### Parameters - The options for checking the role. +The options for checking the role. #### Type @@ -30766,12 +31392,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - A boolean that is true if the target account has the role. +A boolean that is true if the target account has the role. --- -## isGetAllRoleMembersSupported +## PERMISSIONS.isGetAllRoleMembersSupported - Checks if the `getAllRoleMembers` method is supported by the given contract. +Checks if the `getAllRoleMembers` method is supported by the given contract. ### Example @@ -30789,7 +31415,7 @@ function isGetAllRoleMembersSupported( ### 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. +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 @@ -30803,12 +31429,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getAllRoleMembers` method is supported. +A boolean indicating if the `getAllRoleMembers` method is supported. --- -## isGetRoleAdminSupported +## PERMISSIONS.isGetRoleAdminSupported - Checks if the `getRoleAdmin` method is supported by the given contract. +Checks if the `getRoleAdmin` method is supported by the given contract. ### Example @@ -30825,7 +31451,7 @@ function isGetRoleAdminSupported( ### 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. +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 @@ -30839,12 +31465,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getRoleAdmin` method is supported. +A boolean indicating if the `getRoleAdmin` method is supported. --- -## isGetRoleMemberCountSupported +## PERMISSIONS.isGetRoleMemberCountSupported - Checks if the `getRoleMemberCount` method is supported by the given contract. +Checks if the `getRoleMemberCount` method is supported by the given contract. ### Example @@ -30861,7 +31487,7 @@ function isGetRoleMemberCountSupported( ### 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. +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 @@ -30875,12 +31501,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getRoleMemberCount` method is supported. +A boolean indicating if the `getRoleMemberCount` method is supported. --- -## isGetRoleMemberSupported +## PERMISSIONS.isGetRoleMemberSupported - Checks if the `getRoleMember` method is supported by the given contract. +Checks if the `getRoleMember` method is supported by the given contract. ### Example @@ -30897,7 +31523,7 @@ function isGetRoleMemberSupported( ### 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. +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 @@ -30911,12 +31537,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getRoleMember` method is supported. +A boolean indicating if the `getRoleMember` method is supported. --- -## isGrantRoleSupported +## PERMISSIONS.isGrantRoleSupported - Checks if the `grantRole` method is supported by the given contract. +Checks if the `grantRole` method is supported by the given contract. ### Example @@ -30934,7 +31560,7 @@ function isGrantRoleSupported( ### 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. +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 @@ -30948,12 +31574,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `grantRole` method is supported. +A boolean indicating if the `grantRole` method is supported. --- -## isHasRoleSupported +## PERMISSIONS.isHasRoleSupported - Checks if the `hasRole` method is supported by the given contract. +Checks if the `hasRole` method is supported by the given contract. ### Example @@ -30970,7 +31596,7 @@ function isHasRoleSupported( ### 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. +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 @@ -30984,12 +31610,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `hasRole` method is supported. +A boolean indicating if the `hasRole` method is supported. --- -## isRenounceRoleSupported +## PERMISSIONS.isRenounceRoleSupported - Checks if the `renounceRole` method is supported by the given contract. +Checks if the `renounceRole` method is supported by the given contract. ### Example @@ -31007,7 +31633,7 @@ function isRenounceRoleSupported( ### 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. +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 @@ -31021,12 +31647,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `renounceRole` method is supported. +A boolean indicating if the `renounceRole` method is supported. --- -## isRevokeRoleSupported +## PERMISSIONS.isRevokeRoleSupported - Checks if the `revokeRole` method is supported by the given contract. +Checks if the `revokeRole` method is supported by the given contract. ### Example @@ -31044,7 +31670,7 @@ function isRevokeRoleSupported( ### 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. +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 @@ -31058,12 +31684,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `revokeRole` method is supported. +A boolean indicating if the `revokeRole` method is supported. --- -## renounceRole +## PERMISSIONS.renounceRole - Lets the target account renounce the role. (The target account must be the sender of the transaction.) +Lets the target account renounce the role. (The target account must be the sender of the transaction.) ### Example @@ -31087,7 +31713,7 @@ function renounceRole( ### Parameters - The options for renouncing the role. +The options for renouncing the role. #### Type @@ -31105,12 +31731,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction that revokes the role when sent. +A transaction that revokes the role when sent. --- -## revokeRole +## PERMISSIONS.revokeRole - Revokes a role from a target account. +Revokes a role from a target account. ### Example @@ -31135,7 +31761,7 @@ function revokeRole( ### Parameters - The options for revoking the role. +The options for revoking the role. #### Type @@ -31153,12 +31779,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction that revokes the role when sent. +A transaction that revokes the role when sent. --- -## roleAdminChangedEvent +## PERMISSIONS.roleAdminChangedEvent - Creates an event object for the RoleAdminChanged event. +Creates an event object for the RoleAdminChanged event. ### Example @@ -31180,11 +31806,7 @@ events: [ ```ts function roleAdminChangedEvent( - filters: Partial<{ - newAdminRole: `0x${string}`; - previousAdminRole: `0x${string}`; - role: `0x${string}`; - }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -31210,16 +31832,12 @@ function roleAdminChangedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - newAdminRole: `0x${string}`; - previousAdminRole: `0x${string}`; - role: `0x${string}`; -}>; +let filters: Partial; ``` ### Returns @@ -31248,12 +31866,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## roleGrantedEvent +## PERMISSIONS.roleGrantedEvent - Creates an event object for the RoleGranted event. +Creates an event object for the RoleGranted event. ### Example @@ -31275,11 +31893,7 @@ events: [ ```ts function roleGrantedEvent( - filters: Partial<{ - account: string; - role: `0x${string}`; - sender: string; - }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -31305,16 +31919,12 @@ function roleGrantedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - account: string; - role: `0x${string}`; - sender: string; -}>; +let filters: Partial; ``` ### Returns @@ -31343,12 +31953,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## roleRevokedEvent +## PERMISSIONS.roleRevokedEvent - Creates an event object for the RoleRevoked event. +Creates an event object for the RoleRevoked event. ### Example @@ -31370,11 +31980,7 @@ events: [ ```ts function roleRevokedEvent( - filters: Partial<{ - account: string; - role: `0x${string}`; - sender: string; - }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -31400,16 +32006,12 @@ function roleRevokedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - account: string; - role: `0x${string}`; - sender: string; -}>; +let filters: Partial; ``` ### Returns @@ -31438,14 +32040,14 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- ## SPLIT --- -## distribute +## SPLIT.distribute - Prepares a transaction to call the "distribute" function on the contract. +Prepares a transaction to call the "distribute" function on the contract. ### Example @@ -31467,7 +32069,7 @@ function distribute( ### Parameters - The options for the "distribute" function. +The options for the "distribute" function. #### Type @@ -31485,12 +32087,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## distributeByToken +## SPLIT.distributeByToken - This extension is similar to the `distribute` extension, however it require you to specify the token (address) that you want to distribute +This extension is similar to the `distribute` extension, however it require you to specify the token (address) that you want to distribute ### Example @@ -31547,12 +32149,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## getAllRecipientsAddresses +## SPLIT.getAllRecipientsAddresses - Get the addresses of all recipients of a [thirdweb Split contract](https://thirdweb.com/thirdweb.eth/Split) +Get the addresses of all recipients of a [thirdweb Split contract](https://thirdweb.com/thirdweb.eth/Split) ### Example @@ -31582,12 +32184,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise>; ``` - an array of wallet addresses +an array of wallet addresses --- -## getAllRecipientsPercentages +## SPLIT.getAllRecipientsPercentages - Get all the recipients of a Split contracts +Get all the recipients of a Split contracts ### Example @@ -31628,12 +32230,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: { address: string; splitPercentage: number }; ``` - an array of recipients' addresses and split percentage of each +an array of recipients' addresses and split percentage of each --- -## getRecipientSplitPercentage +## SPLIT.getRecipientSplitPercentage - Get the split percentage of a recipient +Get the split percentage of a recipient ### Example @@ -31653,7 +32255,7 @@ function getRecipientSplitPercentage( ### Parameters - The options for the transaction +The options for the transaction #### Type @@ -31667,12 +32269,12 @@ let options: BaseTransactionOptions<{ recipientAddress: string }>; let returnType: { address: string; splitPercentage: number }; ``` - The split percentage of the recipient +The split percentage of the recipient --- -## payee +## SPLIT.payee - Calls the "payee" function on the contract. +Calls the "payee" function on the contract. ### Example @@ -31693,7 +32295,7 @@ function payee( ### Parameters - The options for the payee function. +The options for the payee function. #### Type @@ -31707,12 +32309,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## payeeCount +## SPLIT.payeeCount - Calls the "payeeCount" function on the contract. +Calls the "payeeCount" function on the contract. ### Example @@ -31730,7 +32332,7 @@ function payeeCount(options: BaseTransactionOptions): Promise; ### Parameters - The options for the payeeCount function. +The options for the payeeCount function. #### Type @@ -31744,12 +32346,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## releasable +## SPLIT.releasable - Calls the "releasable" function on the contract. +Calls the "releasable" function on the contract. ### Example @@ -31770,7 +32372,7 @@ function releasable( ### Parameters - The options for the releasable function. +The options for the releasable function. #### Type @@ -31784,12 +32386,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## releasableByToken +## SPLIT.releasableByToken - Calls the "releasable" function on the contract. +Calls the "releasable" function on the contract. ### Example @@ -31810,7 +32412,7 @@ function releasableByToken( ### Parameters - The options for the releasable function. +The options for the releasable function. #### Type @@ -31824,12 +32426,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## release +## SPLIT.release - Prepares a transaction to call the "release" function on the contract. +Prepares a transaction to call the "release" function on the contract. ### Example @@ -31859,7 +32461,7 @@ function release( ### Parameters - The options for the "release" function. +The options for the "release" function. #### Type @@ -31879,12 +32481,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## releaseByToken +## SPLIT.releaseByToken - Similar to the `release` extension, however this one requires you to specify a tokenAddress to release +Similar to the `release` extension, however this one requires you to specify a tokenAddress to release ### Example @@ -31950,9 +32552,9 @@ let returnType: PreparedTransaction< ``` --- -## released +## SPLIT.released - Calls the "released" function on the contract. +Calls the "released" function on the contract. ### Example @@ -31973,7 +32575,7 @@ function released( ### Parameters - The options for the released function. +The options for the released function. #### Type @@ -31987,12 +32589,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## releasedByToken +## SPLIT.releasedByToken - Calls the "released" function on the contract. Similar to the `released` extension, however this one requires you to specify a tokenAddress +Calls the "released" function on the contract. Similar to the `released` extension, however this one requires you to specify a tokenAddress ### Example @@ -32016,7 +32618,7 @@ function releasedByToken( ### Parameters - The options for the released function. +The options for the released function. #### Type @@ -32032,12 +32634,12 @@ let options: BaseTransactionOptions< let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## shares +## SPLIT.shares - Calls the "shares" function on the contract. +Calls the "shares" function on the contract. ### Example @@ -32058,7 +32660,7 @@ function shares( ### Parameters - The options for the shares function. +The options for the shares function. #### Type @@ -32072,12 +32674,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## totalReleased +## SPLIT.totalReleased - Calls the "totalReleased" function on the contract. +Calls the "totalReleased" function on the contract. ### Example @@ -32097,7 +32699,7 @@ function totalReleased( ### Parameters - The options for the totalReleased function. +The options for the totalReleased function. #### Type @@ -32111,12 +32713,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## totalReleasedByToken +## SPLIT.totalReleasedByToken - Calls the "totalReleased" function on the contract. Similar to the `release` extension, however this one requires you to specify a tokenAddress +Calls the "totalReleased" function on the contract. Similar to the `release` extension, however this one requires you to specify a tokenAddress ### Example @@ -32137,7 +32739,7 @@ function totalReleasedByToken( ### Parameters - The options for the totalReleased function. +The options for the totalReleased function. #### Type @@ -32151,14 +32753,14 @@ let options: BaseTransactionOptions<{ tokenAddress: string }>; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- ## THIRDWEB --- -## add +## THIRDWEB.add - Prepares a transaction to call the "add" function on the contract. +Prepares a transaction to call the "add" function on the contract. ### Example @@ -32191,7 +32793,7 @@ function add( ### Parameters - The options for the "add" function. +The options for the "add" function. #### Type @@ -32211,12 +32813,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## contractType +## THIRDWEB.contractType - Calls the "contractType" function on the contract. +Calls the "contractType" function on the contract. ### Example @@ -32236,7 +32838,7 @@ function contractType( ### Parameters - The options for the contractType function. +The options for the contractType function. #### Type @@ -32250,12 +32852,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## count +## THIRDWEB.count - Calls the "count" function on the contract. +Calls the "count" function on the contract. ### Example @@ -32276,7 +32878,7 @@ function count( ### Parameters - The options for the count function. +The options for the count function. #### Type @@ -32290,12 +32892,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## deployProxyByImplementation +## THIRDWEB.deployProxyByImplementation - Prepares a transaction to call the "deployProxyByImplementation" function on the contract. +Prepares a transaction to call the "deployProxyByImplementation" function on the contract. ### Example @@ -32330,7 +32932,7 @@ function deployProxyByImplementation( ### Parameters - The options for the "deployProxyByImplementation" function. +The options for the "deployProxyByImplementation" function. #### Type @@ -32351,12 +32953,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## getAll +## THIRDWEB.getAll - Calls the "getAll" function on the contract. +Calls the "getAll" function on the contract. ### Example @@ -32375,7 +32977,7 @@ function getAll(options: BaseTransactionOptions) : Promise; let returnType: Promise> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getAllPublishedContracts +## THIRDWEB.getAllPublishedContracts - Calls the "getAllPublishedContracts" function on the contract. +Calls the "getAllPublishedContracts" function on the contract. ### Example @@ -32413,7 +33015,7 @@ function getAllPublishedContracts(options: BaseTransactionOptions; let returnType: Promise> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getMetadataUri +## THIRDWEB.getMetadataUri - Calls the "getMetadataUri" function on the contract. +Calls the "getMetadataUri" function on the contract. ### Example @@ -32454,7 +33056,7 @@ function getMetadataUri( ### Parameters - The options for the getMetadataUri function. +The options for the getMetadataUri function. #### Type @@ -32468,12 +33070,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getPublishedContract +## THIRDWEB.getPublishedContract - Calls the "getPublishedContract" function on the contract. +Calls the "getPublishedContract" function on the contract. ### Example @@ -32501,7 +33103,7 @@ function getPublishedContract( ### Parameters - The options for the getPublishedContract function. +The options for the getPublishedContract function. #### Type @@ -32521,12 +33123,12 @@ let returnType: Promise<{ }>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getPublishedContractVersions +## THIRDWEB.getPublishedContractVersions - Calls the "getPublishedContractVersions" function on the contract. +Calls the "getPublishedContractVersions" function on the contract. ### Example @@ -32546,7 +33148,7 @@ function getPublishedContractVersions(options: BaseTransactionOptions; let returnType: Promise> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getPublishedUriFromCompilerUri +## THIRDWEB.getPublishedUriFromCompilerUri - Calls the "getPublishedUriFromCompilerUri" function on the contract. +Calls the "getPublishedUriFromCompilerUri" function on the contract. ### Example @@ -32584,7 +33186,7 @@ function getPublishedUriFromCompilerUri(options: BaseTransactionOptions; let returnType: Promise> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getPublisherProfileUri +## THIRDWEB.getPublisherProfileUri - Calls the "getPublisherProfileUri" function on the contract. +Calls the "getPublisherProfileUri" function on the contract. ### Example @@ -32624,7 +33226,7 @@ function getPublisherProfileUri( ### Parameters - The options for the getPublisherProfileUri function. +The options for the getPublisherProfileUri function. #### Type @@ -32638,12 +33240,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isContractTypeSupported +## THIRDWEB.isContractTypeSupported - Checks if the `contractType` method is supported by the given contract. +Checks if the `contractType` method is supported by the given contract. ### Example @@ -32661,7 +33263,7 @@ function isContractTypeSupported( ### 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. +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 @@ -32675,12 +33277,55 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `contractType` method is supported. +A boolean indicating if the `contractType` method is supported. +--- + +## THIRDWEB.publishContract + +Publish a contract to the contract publisher. + +### Example + +```ts +const tx = publishContract({ + contract, + account, + metadata, +}); +``` + +```ts +function publishContract( + options: BaseTransactionOptions, +): PreparedTransaction; +``` + +### Parameters + +The options for publishing the contract. + +#### Type + +```ts +let options: BaseTransactionOptions; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +The transaction to publish the contract. --- -## remove +## THIRDWEB.remove - Prepares a transaction to call the "remove" function on the contract. +Prepares a transaction to call the "remove" function on the contract. ### Example @@ -32712,7 +33357,7 @@ function remove( ### Parameters - The options for the "remove" function. +The options for the "remove" function. #### Type @@ -32732,12 +33377,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setPublisherProfileUri +## THIRDWEB.setPublisherProfileUri - Prepares a transaction to call the "setPublisherProfileUri" function on the contract. +Prepares a transaction to call the "setPublisherProfileUri" function on the contract. ### Example @@ -32769,7 +33414,7 @@ function setPublisherProfileUri( ### Parameters - The options for the "setPublisherProfileUri" function. +The options for the "setPublisherProfileUri" function. #### Type @@ -32790,12 +33435,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## unpublishContract +## THIRDWEB.unpublishContract - Prepares a transaction to call the "unpublishContract" function on the contract. +Prepares a transaction to call the "unpublishContract" function on the contract. ### Example @@ -32827,7 +33472,7 @@ function unpublishContract( ### Parameters - The options for the "unpublishContract" function. +The options for the "unpublishContract" function. #### Type @@ -32848,59 +33493,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. ---- -## thirdweb ---- - -## publishContract - - Publish a contract to the contract publisher. - -### Example - -```ts -const tx = publishContract({ - contract, - account, - metadata, -}); -``` - -```ts -function publishContract( - options: BaseTransactionOptions, -): PreparedTransaction; -``` - -### Parameters - - The options for publishing the contract. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; -``` - - The transaction to publish the contract. +A prepared transaction object. --- ## UNISWAP --- -## createPool +## UNISWAP.createPool - Prepares a transaction to call the "createPool" function on the contract. +Prepares a transaction to call the "createPool" function on the contract. ### Example @@ -32933,7 +33533,7 @@ function createPool( ### Parameters - The options for the "createPool" function. +The options for the "createPool" function. #### Type @@ -32953,12 +33553,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## enableFeeAmount +## UNISWAP.enableFeeAmount - Prepares a transaction to call the "enableFeeAmount" function on the contract. +Prepares a transaction to call the "enableFeeAmount" function on the contract. ### Example @@ -32990,7 +33590,7 @@ function enableFeeAmount( ### Parameters - The options for the "enableFeeAmount" function. +The options for the "enableFeeAmount" function. #### Type @@ -33011,12 +33611,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## exactInput +## UNISWAP.exactInput - Prepares a transaction to call the "exactInput" function on the contract. +Prepares a transaction to call the "exactInput" function on the contract. ### Example @@ -33047,7 +33647,7 @@ function exactInput( ### Parameters - The options for the "exactInput" function. +The options for the "exactInput" function. #### Type @@ -33067,12 +33667,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## exactInputSingle +## UNISWAP.exactInputSingle - Prepares a transaction to call the "exactInputSingle" function on the contract. +Prepares a transaction to call the "exactInputSingle" function on the contract. ### Example @@ -33103,7 +33703,7 @@ function exactInputSingle( ### Parameters - The options for the "exactInputSingle" function. +The options for the "exactInputSingle" function. #### Type @@ -33124,12 +33724,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## exactOutput +## UNISWAP.exactOutput - Prepares a transaction to call the "exactOutput" function on the contract. +Prepares a transaction to call the "exactOutput" function on the contract. ### Example @@ -33160,7 +33760,7 @@ function exactOutput( ### Parameters - The options for the "exactOutput" function. +The options for the "exactOutput" function. #### Type @@ -33181,12 +33781,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## exactOutputSingle +## UNISWAP.exactOutputSingle - Prepares a transaction to call the "exactOutputSingle" function on the contract. +Prepares a transaction to call the "exactOutputSingle" function on the contract. ### Example @@ -33217,7 +33817,7 @@ function exactOutputSingle( ### Parameters - The options for the "exactOutputSingle" function. +The options for the "exactOutputSingle" function. #### Type @@ -33238,12 +33838,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## feeAmountEnabledEvent +## UNISWAP.feeAmountEnabledEvent - Creates an event object for the FeeAmountEnabled event. +Creates an event object for the FeeAmountEnabled event. ### Example @@ -33281,12 +33881,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## feeAmountTickSpacing +## UNISWAP.feeAmountTickSpacing - Calls the "feeAmountTickSpacing" function on the contract. +Calls the "feeAmountTickSpacing" function on the contract. ### Example @@ -33307,7 +33907,7 @@ function feeAmountTickSpacing( ### Parameters - The options for the feeAmountTickSpacing function. +The options for the feeAmountTickSpacing function. #### Type @@ -33321,12 +33921,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getPool +## UNISWAP.getPool - Calls the "getPool" function on the contract. +Calls the "getPool" function on the contract. ### Example @@ -33349,7 +33949,7 @@ function getPool( ### Parameters - The options for the getPool function. +The options for the getPool function. #### Type @@ -33363,12 +33963,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getUniswapV3Pool +## UNISWAP.getUniswapV3Pool - Finds the Uniswap V3 pools for the two tokens. +Finds the Uniswap V3 pools for the two tokens. ### Example @@ -33389,7 +33989,7 @@ function getUniswapV3Pool( ### Parameters - The token pair to find any pools for any Uniswap contract that implements getPool. +The token pair to find any pools for any Uniswap contract that implements getPool. #### Type @@ -33406,12 +34006,12 @@ let returnType: { }; ``` - The pools' addresses and fees. +The pools' addresses and fees. --- -## owner +## UNISWAP.owner - Calls the "owner" function on the contract. +Calls the "owner" function on the contract. ### Example @@ -33429,7 +34029,7 @@ function owner(options: BaseTransactionOptions): Promise; ### Parameters - The options for the owner function. +The options for the owner function. #### Type @@ -33443,12 +34043,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## ownerChangedEvent +## UNISWAP.ownerChangedEvent - Creates an event object for the OwnerChanged event. +Creates an event object for the OwnerChanged event. ### Example @@ -33469,7 +34069,7 @@ events: [ ```ts function ownerChangedEvent( - filters: Partial<{ newOwner: string; oldOwner: string }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -33490,12 +34090,12 @@ function ownerChangedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ newOwner: string; oldOwner: string }>; +let filters: Partial; ``` ### Returns @@ -33519,12 +34119,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## poolCreatedEvent +## UNISWAP.poolCreatedEvent - Creates an event object for the PoolCreated event. +Creates an event object for the PoolCreated event. ### Example @@ -33546,11 +34146,7 @@ events: [ ```ts function poolCreatedEvent( - filters: Partial<{ - sender: string; - token0: string; - token1: string; - }>, + filters: Partial, ): PreparedEvent<{ readonly inputs: readonly [ { @@ -33580,16 +34176,12 @@ function poolCreatedEvent( ### Parameters - Optional filters to apply to the event. +Optional filters to apply to the event. #### Type ```ts -let filters: Partial<{ - sender: string; - token0: string; - token1: string; -}>; +let filters: Partial; ``` ### Returns @@ -33622,12 +34214,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## quoteExactInput +## UNISWAP.quoteExactInput - Prepares a transaction to call the "quoteExactInput" function on the contract. +Prepares a transaction to call the "quoteExactInput" function on the contract. ### Example @@ -33659,7 +34251,7 @@ function quoteExactInput( ### Parameters - The options for the "quoteExactInput" function. +The options for the "quoteExactInput" function. #### Type @@ -33680,12 +34272,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## quoteExactInputSingle +## UNISWAP.quoteExactInputSingle - Prepares a transaction to call the "quoteExactInputSingle" function on the contract. +Prepares a transaction to call the "quoteExactInputSingle" function on the contract. ### Example @@ -33720,7 +34312,7 @@ function quoteExactInputSingle( ### Parameters - The options for the "quoteExactInputSingle" function. +The options for the "quoteExactInputSingle" function. #### Type @@ -33741,12 +34333,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## quoteExactOutput +## UNISWAP.quoteExactOutput - Prepares a transaction to call the "quoteExactOutput" function on the contract. +Prepares a transaction to call the "quoteExactOutput" function on the contract. ### Example @@ -33778,7 +34370,7 @@ function quoteExactOutput( ### Parameters - The options for the "quoteExactOutput" function. +The options for the "quoteExactOutput" function. #### Type @@ -33799,12 +34391,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## quoteExactOutputSingle +## UNISWAP.quoteExactOutputSingle - Prepares a transaction to call the "quoteExactOutputSingle" function on the contract. +Prepares a transaction to call the "quoteExactOutputSingle" function on the contract. ### Example @@ -33839,7 +34431,7 @@ function quoteExactOutputSingle( ### Parameters - The options for the "quoteExactOutputSingle" function. +The options for the "quoteExactOutputSingle" function. #### Type @@ -33860,12 +34452,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setOwner +## UNISWAP.setOwner - Prepares a transaction to call the "setOwner" function on the contract. +Prepares a transaction to call the "setOwner" function on the contract. ### Example @@ -33895,7 +34487,7 @@ function setOwner( ### Parameters - The options for the "setOwner" function. +The options for the "setOwner" function. #### Type @@ -33915,14 +34507,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## UNSTOPPABLE-DOMAINS --- -## namehash +## UNSTOPPABLE-DOMAINS.namehash - Calls the "namehash" function on the contract. +Calls the "namehash" function on the contract. ### Example @@ -33943,7 +34535,7 @@ function namehash( ### Parameters - The options for the namehash function. +The options for the namehash function. #### Type @@ -33957,16 +34549,16 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## resolveAddress +## UNSTOPPABLE-DOMAINS.resolveAddress - Resolve an Unstoppable-Domain domain to an Ethereum address +Resolve an Unstoppable-Domain domain to an Ethereum address ### Example -#### Basic usage +#### Basic usage ```ts import { resolveAddress } from "thirdweb/extension/unstoppable-domains"; @@ -33977,9 +34569,9 @@ const address = await resolveAddress({ }); ``` -#### Custom resolver +#### Custom resolver - By default this extension will try to resolve the name on Polygon mainnet, you can decide to customize the resolver contract by specifying `resolverAddress` and `resolverChain` +By default this extension will try to resolve the name on Polygon mainnet, you can decide to customize the resolver contract by specifying `resolverAddress` and `resolverChain` ```ts import { ethereum } from "thirdweb/chains"; @@ -34000,7 +34592,7 @@ function resolveAddress( ### Parameters - The options for resolving an UD domain +The options for resolving an UD domain #### Type @@ -34019,16 +34611,16 @@ let options: { let returnType: Promise; ``` - The Ethereum address associated with the domain name. [ Learn more](https://docs.unstoppabledomains.com/reverse-resolution/) +The Ethereum address associated with the domain name. [Learn more](https://docs.unstoppabledomains.com/reverse-resolution/) --- -## resolveName +## UNSTOPPABLE-DOMAINS.resolveName - Resolves the primary Untoppable-Domains name for a specified address. +Resolves the primary Untoppable-Domains name for a specified address. ### Example -#### Basic usage +#### Basic usage ```ts import { resolveName } from "thirdweb/extension/unstoppable-domains"; @@ -34039,9 +34631,9 @@ const name = await resolveName({ }); ``` -#### Custom resolver +#### Custom resolver - By default this extension will try to resolve the address on Polygon mainnet, you can decide to customize the resolver contract by specifying `resolverAddress` and `resolverChain` +By default this extension will try to resolve the address on Polygon mainnet, you can decide to customize the resolver contract by specifying `resolverAddress` and `resolverChain` ```ts import { ethereum } from "thirdweb/chains"; @@ -34060,7 +34652,7 @@ function resolveName(options: ResolveUDNameOptions): Promise; ### Parameters - The options for resolving an UD domain +The options for resolving an UD domain #### Type @@ -34080,9 +34672,9 @@ let returnType: Promise; ``` --- -## reverseNameOf +## UNSTOPPABLE-DOMAINS.reverseNameOf - Calls the "reverseNameOf" function on the contract. +Calls the "reverseNameOf" function on the contract. ### Example @@ -34103,7 +34695,7 @@ function reverseNameOf( ### Parameters - The options for the reverseNameOf function. +The options for the reverseNameOf function. #### Type @@ -34117,14 +34709,14 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- ## VOTE --- -## canExecute +## VOTE.canExecute - Simulate the `execute` method of the Vote contract, to check if you can execute a proposal +Simulate the `execute` method of the Vote contract, to check if you can execute a proposal ### Example @@ -34154,12 +34746,12 @@ let options: BaseTransactionOptions<{ proposalId: bigint }>; let returnType: Promise; ``` - boolean - `true` if the proposal is executable, else `false` +boolean - `true` if the proposal is executable, else `false` --- -## castVote +## VOTE.castVote - Prepares a transaction to call the "castVote" function on the contract. +Prepares a transaction to call the "castVote" function on the contract. ### Example @@ -34190,7 +34782,7 @@ function castVote( ### Parameters - The options for the "castVote" function. +The options for the "castVote" function. #### Type @@ -34210,12 +34802,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## castVoteBySig +## VOTE.castVoteBySig - Prepares a transaction to call the "castVoteBySig" function on the contract. +Prepares a transaction to call the "castVoteBySig" function on the contract. ### Example @@ -34250,7 +34842,7 @@ function castVoteBySig( ### Parameters - The options for the "castVoteBySig" function. +The options for the "castVoteBySig" function. #### Type @@ -34271,12 +34863,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## castVoteWithReason +## VOTE.castVoteWithReason - Prepares a transaction to call the "castVoteWithReason" function on the contract. +Prepares a transaction to call the "castVoteWithReason" function on the contract. ### Example @@ -34309,7 +34901,7 @@ function castVoteWithReason( ### Parameters - The options for the "castVoteWithReason" function. +The options for the "castVoteWithReason" function. #### Type @@ -34330,12 +34922,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## castVoteWithReasonAndParams +## VOTE.castVoteWithReasonAndParams - Prepares a transaction to call the "castVoteWithReasonAndParams" function on the contract. +Prepares a transaction to call the "castVoteWithReasonAndParams" function on the contract. ### Example @@ -34371,7 +34963,7 @@ function castVoteWithReasonAndParams( ### Parameters - The options for the "castVoteWithReasonAndParams" function. +The options for the "castVoteWithReasonAndParams" function. #### Type @@ -34392,12 +34984,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## castVoteWithReasonAndParamsBySig +## VOTE.castVoteWithReasonAndParamsBySig - Prepares a transaction to call the "castVoteWithReasonAndParamsBySig" function on the contract. +Prepares a transaction to call the "castVoteWithReasonAndParamsBySig" function on the contract. ### Example @@ -34436,7 +35028,7 @@ function castVoteWithReasonAndParamsBySig( ### Parameters - The options for the "castVoteWithReasonAndParamsBySig" function. +The options for the "castVoteWithReasonAndParamsBySig" function. #### Type @@ -34459,12 +35051,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## execute +## VOTE.execute - Prepares a transaction to call the "execute" function on the contract. +Prepares a transaction to call the "execute" function on the contract. ### Example @@ -34497,7 +35089,7 @@ function execute( ### Parameters - The options for the "execute" function. +The options for the "execute" function. #### Type @@ -34517,12 +35109,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## executeProposal +## VOTE.executeProposal - Execute a Proposal +Execute a Proposal ### Example @@ -34557,12 +35149,12 @@ let returnType: PreparedTransaction< >; ``` - a prepared transaction for the `execute` method +a prepared transaction for the `execute` method --- -## getAll +## VOTE.getAll - Get all proposals from a Vote contract with some extra info attached for each proposal (current state and votes) +Get all proposals from a Vote contract with some extra info attached for each proposal (current state and votes) ### Example @@ -34606,12 +35198,12 @@ let returnType: { }; ``` - An array containing proposals data +An array containing proposals data --- -## getAllProposals +## VOTE.getAllProposals - Calls the "getAllProposals" function on the contract. +Calls the "getAllProposals" function on the contract. ### Example @@ -34629,7 +35221,7 @@ function getAllProposals(options: BaseTransactionOptions) : Promise } & T; let returnType: Promise; description: string; endBlock: bigint; proposalId: bigint; proposer: string; signatures: readonly Array; startBlock: bigint; targets: readonly Array; values: readonly Array }>> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getProposalVoteCounts +## VOTE.getProposalVoteCounts - Get the info about Against, For and Abstain votes of a proposal +Get the info about Against, For and Abstain votes of a proposal ### Example @@ -34685,12 +35277,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - the object containing the info about Against, For and Abstain votes of a proposal Note: the count is displayed in "wei" +the object containing the info about Against, For and Abstain votes of a proposal Note: the count is displayed in "wei" --- -## getVotes +## VOTE.getVotes - Calls the "getVotes" function on the contract. +Calls the "getVotes" function on the contract. ### Example @@ -34712,7 +35304,7 @@ function getVotes( ### Parameters - The options for the getVotes function. +The options for the getVotes function. #### Type @@ -34726,12 +35318,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getVotesWithParams +## VOTE.getVotesWithParams - Calls the "getVotesWithParams" function on the contract. +Calls the "getVotesWithParams" function on the contract. ### Example @@ -34754,7 +35346,7 @@ function getVotesWithParams( ### Parameters - The options for the getVotesWithParams function. +The options for the getVotesWithParams function. #### Type @@ -34768,12 +35360,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## hashProposal +## VOTE.hashProposal - Calls the "hashProposal" function on the contract. +Calls the "hashProposal" function on the contract. ### Example @@ -34797,7 +35389,7 @@ function hashProposal( ### Parameters - The options for the hashProposal function. +The options for the hashProposal function. #### Type @@ -34811,12 +35403,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## hasVoted +## VOTE.hasVoted - Calls the "hasVoted" function on the contract. +Calls the "hasVoted" function on the contract. ### Example @@ -34838,7 +35430,7 @@ function hasVoted( ### Parameters - The options for the hasVoted function. +The options for the hasVoted function. #### Type @@ -34852,12 +35444,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## proposalDeadline +## VOTE.proposalDeadline - Calls the "proposalDeadline" function on the contract. +Calls the "proposalDeadline" function on the contract. ### Example @@ -34878,7 +35470,7 @@ function proposalDeadline( ### Parameters - The options for the proposalDeadline function. +The options for the proposalDeadline function. #### Type @@ -34892,12 +35484,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## proposalExists +## VOTE.proposalExists - Check if a proposal exists based on a given proposalId +Check if a proposal exists based on a given proposalId ### Example @@ -34931,9 +35523,9 @@ let returnType: Promise; `true` if the proposal exists, else `false` --- -## proposalIndex +## VOTE.proposalIndex - Calls the "proposalIndex" function on the contract. +Calls the "proposalIndex" function on the contract. ### Example @@ -34953,7 +35545,7 @@ function proposalIndex( ### Parameters - The options for the proposalIndex function. +The options for the proposalIndex function. #### Type @@ -34967,12 +35559,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## proposals +## VOTE.proposals - Calls the "proposals" function on the contract. +Calls the "proposals" function on the contract. ### Example @@ -34993,7 +35585,7 @@ function proposals( ### Parameters - The options for the proposals function. +The options for the proposals function. #### Type @@ -35009,12 +35601,12 @@ let returnType: Promise< >; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## proposalSnapshot +## VOTE.proposalSnapshot - Calls the "proposalSnapshot" function on the contract. +Calls the "proposalSnapshot" function on the contract. ### Example @@ -35035,7 +35627,7 @@ function proposalSnapshot( ### Parameters - The options for the proposalSnapshot function. +The options for the proposalSnapshot function. #### Type @@ -35049,12 +35641,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## proposalThreshold +## VOTE.proposalThreshold - Calls the "proposalThreshold" function on the contract. +Calls the "proposalThreshold" function on the contract. ### Example @@ -35074,7 +35666,7 @@ function proposalThreshold( ### Parameters - The options for the proposalThreshold function. +The options for the proposalThreshold function. #### Type @@ -35088,12 +35680,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## proposalVotes +## VOTE.proposalVotes - Calls the "proposalVotes" function on the contract. +Calls the "proposalVotes" function on the contract. ### Example @@ -35114,7 +35706,7 @@ function proposalVotes( ### Parameters - The options for the proposalVotes function. +The options for the proposalVotes function. #### Type @@ -35128,12 +35720,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## propose +## VOTE.propose - Prepares a transaction to call the "propose" function on the contract. +Prepares a transaction to call the "propose" function on the contract. ### Example @@ -35166,7 +35758,7 @@ function propose( ### Parameters - The options for the "propose" function. +The options for the "propose" function. #### Type @@ -35186,12 +35778,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## quorum +## VOTE.quorum - Calls the "quorum" function on the contract. +Calls the "quorum" function on the contract. ### Example @@ -35212,7 +35804,7 @@ function quorum( ### Parameters - The options for the quorum function. +The options for the quorum function. #### Type @@ -35226,12 +35818,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## quorumDenominator +## VOTE.quorumDenominator - Calls the "quorumDenominator" function on the contract. +Calls the "quorumDenominator" function on the contract. ### Example @@ -35251,7 +35843,7 @@ function quorumDenominator( ### Parameters - The options for the quorumDenominator function. +The options for the quorumDenominator function. #### Type @@ -35265,12 +35857,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## quorumNumeratorByBlockNumber +## VOTE.quorumNumeratorByBlockNumber - Calls the "quorumDenominator" function on the contract with an extra param called `blockNumber` . This extension is similar to the `quorumDenominator` extension, except that it takes in a bigint (blockNumber) +Calls the "quorumDenominator" function on the contract with an extra param called `blockNumber`. This extension is similar to the `quorumDenominator` extension, except that it takes in a bigint (blockNumber) ### Example @@ -35291,7 +35883,7 @@ function quorumNumeratorByBlockNumber( ### Parameters - The options for the quorumDenominator function. +The options for the quorumDenominator function. #### Type @@ -35305,12 +35897,12 @@ let options: BaseTransactionOptions<{ blockNumber: bigint }>; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## relay +## VOTE.relay - Prepares a transaction to call the "relay" function on the contract. +Prepares a transaction to call the "relay" function on the contract. ### Example @@ -35342,7 +35934,7 @@ function relay( ### Parameters - The options for the "relay" function. +The options for the "relay" function. #### Type @@ -35362,12 +35954,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setProposalThreshold +## VOTE.setProposalThreshold - Prepares a transaction to call the "setProposalThreshold" function on the contract. +Prepares a transaction to call the "setProposalThreshold" function on the contract. ### Example @@ -35398,7 +35990,7 @@ function setProposalThreshold( ### Parameters - The options for the "setProposalThreshold" function. +The options for the "setProposalThreshold" function. #### Type @@ -35419,12 +36011,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setVotingDelay +## VOTE.setVotingDelay - Prepares a transaction to call the "setVotingDelay" function on the contract. +Prepares a transaction to call the "setVotingDelay" function on the contract. ### Example @@ -35455,7 +36047,7 @@ function setVotingDelay( ### Parameters - The options for the "setVotingDelay" function. +The options for the "setVotingDelay" function. #### Type @@ -35476,12 +36068,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setVotingPeriod +## VOTE.setVotingPeriod - Prepares a transaction to call the "setVotingPeriod" function on the contract. +Prepares a transaction to call the "setVotingPeriod" function on the contract. ### Example @@ -35512,7 +36104,7 @@ function setVotingPeriod( ### Parameters - The options for the "setVotingPeriod" function. +The options for the "setVotingPeriod" function. #### Type @@ -35533,12 +36125,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## state +## VOTE.state - Calls the "state" function on the contract. +Calls the "state" function on the contract. ### Example @@ -35559,7 +36151,7 @@ function state( ### Parameters - The options for the state function. +The options for the state function. #### Type @@ -35573,12 +36165,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## token +## VOTE.token - Calls the "token" function on the contract. +Calls the "token" function on the contract. ### Example @@ -35596,7 +36188,7 @@ function token(options: BaseTransactionOptions): Promise; ### Parameters - The options for the token function. +The options for the token function. #### Type @@ -35610,12 +36202,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## updateQuorumNumerator +## VOTE.updateQuorumNumerator - Prepares a transaction to call the "updateQuorumNumerator" function on the contract. +Prepares a transaction to call the "updateQuorumNumerator" function on the contract. ### Example @@ -35646,7 +36238,7 @@ function updateQuorumNumerator( ### Parameters - The options for the "updateQuorumNumerator" function. +The options for the "updateQuorumNumerator" function. #### Type @@ -35667,12 +36259,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## votingDelay +## VOTE.votingDelay - Calls the "votingDelay" function on the contract. +Calls the "votingDelay" function on the contract. ### Example @@ -35692,7 +36284,7 @@ function votingDelay( ### Parameters - The options for the votingDelay function. +The options for the votingDelay function. #### Type @@ -35706,12 +36298,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## votingPeriod +## VOTE.votingPeriod - Calls the "votingPeriod" function on the contract. +Calls the "votingPeriod" function on the contract. ### Example @@ -35731,7 +36323,7 @@ function votingPeriod( ### Parameters - The options for the votingPeriod function. +The options for the votingPeriod function. #### Type @@ -35745,14 +36337,14 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- ## MODULES --- -## cancelOwnershipHandover +## MODULES.cancelOwnershipHandover - Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. +Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. ### Example @@ -35774,7 +36366,7 @@ function cancelOwnershipHandover( ### Parameters - The options for the "cancelOwnershipHandover" function. +The options for the "cancelOwnershipHandover" function. #### Type @@ -35792,12 +36384,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## completeOwnershipHandover +## MODULES.completeOwnershipHandover - Prepares a transaction to call the "completeOwnershipHandover" function on the contract. +Prepares a transaction to call the "completeOwnershipHandover" function on the contract. ### Example @@ -35828,7 +36420,7 @@ function completeOwnershipHandover( ### Parameters - The options for the "completeOwnershipHandover" function. +The options for the "completeOwnershipHandover" function. #### Type @@ -35849,12 +36441,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## getInstalledModules +## MODULES.getInstalledModules - Calls the "getInstalledModules" function on the contract. +Calls the "getInstalledModules" function on the contract. ### Example @@ -35872,7 +36464,7 @@ function getInstalledModules(options: BaseTransactionOptions) : Promise } & T; let returnType: Promise; fallbackFunctions: readonly Array<{ permissionBits: bigint; selector: `0x${string}` }>; registerInstallationCallback: boolean; requiredInterfaces: readonly Array<`0x${string}`>; supportedInterfaces: readonly Array<`0x${string}`> }; implementation: string }>> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getModuleConfig +## MODULES.getModuleConfig - Calls the "getModuleConfig" function on the contract. +Calls the "getModuleConfig" function on the contract. ### Example @@ -35909,7 +36501,7 @@ function getModuleConfig(options: BaseTransactionOptions) : Promise<{ callbackFu ### Parameters - The options for the getModuleConfig function. +The options for the getModuleConfig function. #### Type @@ -35923,12 +36515,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise<{ callbackFunctions: readonly Array<{ selector: `0x${string}` }>; fallbackFunctions: readonly Array<{ permissionBits: bigint; selector: `0x${string}` }>; registerInstallationCallback: boolean; requiredInterfaces: readonly Array<`0x${string}`>; supportedInterfaces: readonly Array<`0x${string}`> }> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getSupportedCallbackFunctions +## MODULES.getSupportedCallbackFunctions - Calls the "getSupportedCallbackFunctions" function on the contract. +Calls the "getSupportedCallbackFunctions" function on the contract. ### Example @@ -35946,7 +36538,7 @@ function getSupportedCallbackFunctions(options: BaseTransactionOptions) : Promis ### Parameters - The options for the getSupportedCallbackFunctions function. +The options for the getSupportedCallbackFunctions function. #### Type @@ -35960,12 +36552,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise> ``` - The parsed result of the function call. +The parsed result of the function call. --- -## grantRoles +## MODULES.grantRoles - Prepares a transaction to call the "grantRoles" function on the contract. +Prepares a transaction to call the "grantRoles" function on the contract. ### Example @@ -35997,7 +36589,7 @@ function grantRoles( ### Parameters - The options for the "grantRoles" function. +The options for the "grantRoles" function. #### Type @@ -36017,12 +36609,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## hasAllRoles +## MODULES.hasAllRoles - Calls the "hasAllRoles" function on the contract. +Calls the "hasAllRoles" function on the contract. ### Example @@ -36044,7 +36636,7 @@ function hasAllRoles( ### Parameters - The options for the hasAllRoles function. +The options for the hasAllRoles function. #### Type @@ -36058,12 +36650,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## hasAnyRole +## MODULES.hasAnyRole - Calls the "hasAnyRole" function on the contract. +Calls the "hasAnyRole" function on the contract. ### Example @@ -36085,7 +36677,7 @@ function hasAnyRole( ### Parameters - The options for the hasAnyRole function. +The options for the hasAnyRole function. #### Type @@ -36099,12 +36691,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## installModule +## MODULES.installModule - Prepares a transaction to call the "installModule" function on the contract. +Prepares a transaction to call the "installModule" function on the contract. ### Example @@ -36136,7 +36728,7 @@ function installModule( ### Parameters - The options for the "installModule" function. +The options for the "installModule" function. #### Type @@ -36157,12 +36749,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## isGetInstalledModulesSupported +## MODULES.isGetInstalledModulesSupported - Checks if the `getInstalledModules` method is supported by the given contract. +Checks if the `getInstalledModules` method is supported by the given contract. ### Example @@ -36179,7 +36771,7 @@ function isGetInstalledModulesSupported( ### 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. +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 @@ -36193,12 +36785,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getInstalledModules` method is supported. +A boolean indicating if the `getInstalledModules` method is supported. --- -## isGetModuleConfigSupported +## MODULES.isGetModuleConfigSupported - Checks if the `getModuleConfig` method is supported by the given contract. +Checks if the `getModuleConfig` method is supported by the given contract. ### Example @@ -36215,7 +36807,7 @@ function isGetModuleConfigSupported( ### 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. +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 @@ -36229,12 +36821,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getModuleConfig` method is supported. +A boolean indicating if the `getModuleConfig` method is supported. --- -## isGetSupportedCallbackFunctionsSupported +## MODULES.isGetSupportedCallbackFunctionsSupported - Checks if the `getSupportedCallbackFunctions` method is supported by the given contract. +Checks if the `getSupportedCallbackFunctions` method is supported by the given contract. ### Example @@ -36251,7 +36843,7 @@ function isGetSupportedCallbackFunctionsSupported( ### 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. +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 @@ -36265,12 +36857,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `getSupportedCallbackFunctions` method is supported. +A boolean indicating if the `getSupportedCallbackFunctions` method is supported. --- -## isInstallModuleSupported +## MODULES.isInstallModuleSupported - Checks if the `installModule` method is supported by the given contract. +Checks if the `installModule` method is supported by the given contract. ### Example @@ -36288,7 +36880,7 @@ function isInstallModuleSupported( ### 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. +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 @@ -36302,12 +36894,12 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `installModule` method is supported. +A boolean indicating if the `installModule` method is supported. --- -## isUninstallModuleSupported +## MODULES.isUninstallModuleSupported - Checks if the `uninstallModule` method is supported by the given contract. +Checks if the `uninstallModule` method is supported by the given contract. ### Example @@ -36325,7 +36917,7 @@ function isUninstallModuleSupported( ### 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. +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 @@ -36339,12 +36931,57 @@ let availableSelectors: Array; let returnType: boolean; ``` - A boolean indicating if the `uninstallModule` method is supported. +A boolean indicating if the `uninstallModule` method is supported. --- -## owner +## MODULES.moduleInstalledEvent - Calls the "owner" function on the contract. +Creates an event object for the ModuleInstalled event. + +### Example + +```ts +import { getContractEvents } from "thirdweb"; +import { moduleInstalledEvent } from "thirdweb/extensions/modules"; + +const events = await getContractEvents({ + contract, + events: [moduleInstalledEvent()], +}); +``` + +```ts +function moduleInstalledEvent(): PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "caller"; readonly type: "address" }, + { readonly name: "implementation"; readonly type: "address" }, + { readonly name: "installedModule"; readonly type: "address" }, + ]; + readonly name: "ModuleInstalled"; + readonly type: "event"; +}>; +``` + +### Returns + +```ts +let returnType: PreparedEvent<{ + readonly inputs: readonly [ + { readonly name: "caller"; readonly type: "address" }, + { readonly name: "implementation"; readonly type: "address" }, + { readonly name: "installedModule"; readonly type: "address" }, + ]; + readonly name: "ModuleInstalled"; + readonly type: "event"; +}>; +``` + +The prepared event object. +--- + +## MODULES.owner + +Calls the "owner" function on the contract. ### Example @@ -36362,7 +36999,7 @@ function owner(options: BaseTransactionOptions): Promise; ### Parameters - The options for the owner function. +The options for the owner function. #### Type @@ -36376,12 +37013,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## ownershipHandoverExpiresAt +## MODULES.ownershipHandoverExpiresAt - Calls the "ownershipHandoverExpiresAt" function on the contract. +Calls the "ownershipHandoverExpiresAt" function on the contract. ### Example @@ -36402,7 +37039,7 @@ function ownershipHandoverExpiresAt( ### Parameters - The options for the ownershipHandoverExpiresAt function. +The options for the ownershipHandoverExpiresAt function. #### Type @@ -36416,12 +37053,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## renounceOwnership +## MODULES.renounceOwnership - Prepares a transaction to call the "renounceOwnership" function on the contract. +Prepares a transaction to call the "renounceOwnership" function on the contract. ### Example @@ -36443,7 +37080,7 @@ function renounceOwnership( ### Parameters - The options for the "renounceOwnership" function. +The options for the "renounceOwnership" function. #### Type @@ -36461,12 +37098,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## renounceRoles +## MODULES.renounceRoles - Prepares a transaction to call the "renounceRoles" function on the contract. +Prepares a transaction to call the "renounceRoles" function on the contract. ### Example @@ -36497,7 +37134,7 @@ function renounceRoles( ### Parameters - The options for the "renounceRoles" function. +The options for the "renounceRoles" function. #### Type @@ -36518,12 +37155,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## requestOwnershipHandover +## MODULES.requestOwnershipHandover - Prepares a transaction to call the "requestOwnershipHandover" function on the contract. +Prepares a transaction to call the "requestOwnershipHandover" function on the contract. ### Example @@ -36545,7 +37182,7 @@ function requestOwnershipHandover( ### Parameters - The options for the "requestOwnershipHandover" function. +The options for the "requestOwnershipHandover" function. #### Type @@ -36563,12 +37200,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## revokeRoles +## MODULES.revokeRoles - Prepares a transaction to call the "revokeRoles" function on the contract. +Prepares a transaction to call the "revokeRoles" function on the contract. ### Example @@ -36600,7 +37237,7 @@ function revokeRoles( ### Parameters - The options for the "revokeRoles" function. +The options for the "revokeRoles" function. #### Type @@ -36621,12 +37258,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## rolesOf +## MODULES.rolesOf - Calls the "rolesOf" function on the contract. +Calls the "rolesOf" function on the contract. ### Example @@ -36647,7 +37284,7 @@ function rolesOf( ### Parameters - The options for the rolesOf function. +The options for the rolesOf function. #### Type @@ -36661,12 +37298,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## transferOwnership +## MODULES.transferOwnership - Prepares a transaction to call the "transferOwnership" function on the contract. +Prepares a transaction to call the "transferOwnership" function on the contract. ### Example @@ -36697,7 +37334,7 @@ function transferOwnership( ### Parameters - The options for the "transferOwnership" function. +The options for the "transferOwnership" function. #### Type @@ -36718,12 +37355,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## uninstallModule +## MODULES.uninstallModule - Prepares a transaction to call the "uninstallModule" function on the contract. +Prepares a transaction to call the "uninstallModule" function on the contract. ### Example @@ -36755,7 +37392,7 @@ function uninstallModule( ### Parameters - The options for the "uninstallModule" function. +The options for the "uninstallModule" function. #### Type @@ -36776,12 +37413,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## encodeMintParams +## MODULES.encodeMintParams - Encodes the parameters for the "encodeBytesBeforeMintERC20" function. +Encodes the parameters for the "encodeBytesBeforeMintERC20" function. ### Example @@ -36800,7 +37437,7 @@ function encodeMintParams( ### Parameters - The options for the encodeBytesBeforeMintERC20 function. +The options for the encodeBytesBeforeMintERC20 function. #### Type @@ -36814,12 +37451,12 @@ let options: EncodeBytesBeforeMintERC20Params; let returnType: `0x${string}`; ``` - The encoded ABI parameters. +The encoded ABI parameters. --- -## encodeMintParams +## MODULES.encodeMintParams - Encodes the parameters for the "encodeBytesBeforeMintERC20" function. +Encodes the parameters for the "encodeBytesBeforeMintERC20" function. ### Example @@ -36838,7 +37475,7 @@ function encodeMintParams( ### Parameters - The options for the encodeBytesBeforeMintERC20 function. +The options for the encodeBytesBeforeMintERC20 function. #### Type @@ -36852,12 +37489,12 @@ let options: EncodeBytesBeforeMintERC20Params; let returnType: `0x${string}`; ``` - The encoded ABI parameters. +The encoded ABI parameters. --- -## encodeMintParams +## MODULES.encodeMintParams - Encodes the parameters for the "encodeBytesBeforeMintERC721" function. +Encodes the parameters for the "encodeBytesBeforeMintERC721" function. ### Example @@ -36876,7 +37513,7 @@ function encodeMintParams( ### Parameters - The options for the encodeBytesBeforeMintERC721 function. +The options for the encodeBytesBeforeMintERC721 function. #### Type @@ -36890,16 +37527,16 @@ let options: EncodeBytesBeforeMintERC721Params; let returnType: `0x${string}`; ``` - The encoded ABI parameters. +The encoded ABI parameters. --- ## EIP5792 --- -## getCallsStatus +## EIP5792.getCallsStatus - Get the status of an [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle. +Get the status of an [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle. - This function is dependent on the wallet's support for EIP-5792 and could fail. +This function is dependent on the wallet's support for EIP-5792 and could fail. ### Example @@ -36909,18 +37546,26 @@ import { createThirdwebClient } from "thirdweb"; const client = createThirdwebClient({ clientId: ... }); - const bundleId = await sendCalls({ wallet, client, calls }); + const result = await sendCalls({ wallet, client, calls }); let result; - while (result.status !== "CONFIRMED") { - result = await getCallsStatus({ wallet, client, bundleId }); + while (result.status !== "success") { + result = await getCallsStatus(result); } ``` ```ts function getCallsStatus( options: GetCallsStatusOptions, -): Promise; +): Promise<{ + atomic: boolean; + chainId: number; + id: string; + receipts?: Array>; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; +}>; ``` ### Parameters @@ -36929,8 +37574,8 @@ function getCallsStatus( ```ts let options: { - bundleId: WalletSendCallsId; client: ThirdwebClient; + id: WalletSendCallsId; wallet: Wallet; }; ``` @@ -36939,19 +37584,23 @@ let options: { ```ts let returnType: { - receipts: Array>; - status: "PENDING" | "CONFIRMED"; + blockHash: Hex; + blockNumber: quantity; + gasUsed: quantity; + logs: Array<{ address: string; data: Hex; topics: Array }>; + status: status; + transactionHash: Hex; }; ``` * A promise that resolves to the bundle's status and receipts (if available). GetCallsStatusResponse --- -## getCapabilities +## EIP5792.getCapabilities - Get the capabilities of a wallet based on the [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) specification. +Get the capabilities of a wallet based on the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) specification. - This function is dependent on the wallet's support for EIP-5792, but will not throw. _The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792._ +This function is dependent on the wallet's support for EIP-5792, but will not throw._The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792._ ### Example @@ -36965,7 +37614,7 @@ const capabilities = await getCapabilities({ wallet }); ```ts function getCapabilities( options: GetCapabilitiesOptions, -): Promise; +): Promise<{ message?: string }>; ``` ### Parameters @@ -36979,565 +37628,278 @@ let options: GetCapabilitiesOptions; ### Returns ```ts -let returnType: Prettify< - WalletCapabilitiesRecord ->; +let returnType: Promise<{ message?: string }>; ``` -* A promise that resolves to the capabilities of the wallet based on the [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) spec. +* A promise that resolves to the capabilities of the wallet based on the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) spec. --- -## sendCalls +## EIP5792.sendAndConfirmCalls - 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. +Send and confirm calls in a single transaction. - This function is dependent on the wallet's support for EIP-5792 and could fail. - -* getCallsStatus for how to retrieve the status of the bundle. -* getCapabilities for how to retrieve the capabilities of the wallet. +This is a convenience function that sends the calls with `sendCalls` and then waits for the receipts with `waitForCallsReceipt`. ### Example ```ts -import { createThirdwebClient } from "thirdweb"; -import { sendCalls } from "thirdweb/wallets/eip5792"; - -const client = createThirdwebClient({ clientId: ... }); -const wallet = createWallet("com.coinbase.wallet"); - -const sendTx1 = approve({ - contract: USDT_CONTRACT, - amount: 100, - spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6", - }); -const sendTx2 = approve({ - contract: USDT_CONTRACT, - amount: 100, - spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", - }); -const bundleId = await sendCalls({ - wallet, - client, - calls: [sendTx1, sendTx2], +const call1 = approve({ + contract: USDT_CONTRACT, + amount: 100, + spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", }); -``` - - Sponsor transactions with a paymaster: - -```ts -const bundleId = await sendCalls({ - wallet, - client, - calls: [send1, send2], - capabilities: { - paymasterService: { - url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}` - } - } +const call2 = transfer({ + contract: USDT_CONTRACT, + to: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", + amount: 100, }); - We recommend proxying any paymaster calls via an API route you setup and control. -``` - -```ts -function sendCalls( - options: SendCallsOptions, -): Promise; -``` - -### Parameters - -#### Type - -```ts -let options: SendCallsOptions; -``` - -### Returns - -```ts -let returnType: WalletSendCallsId; -``` - - The ID of the bundle of the calls. ---- - -## waitForBundle - - Waits for the [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle to be confirmed. - - This function is dependent on the wallet's support for EIP-5792 and could fail. - -### Example - -```ts -import { waitForBundle } from "thirdweb/wallets/eip5792"; -const result = await waitForBundle({ - client, - chain, - wallet, - bundleId: "0x123...", +const result = await sendAndConfirmCalls({ + calls: [call1, call2], + wallet: wallet, }); +console.log("Transaction receipts:", result.receipts); ``` ```ts -function waitForBundle(options: { - bundleId: string; - chain: Readonly; - client: ThirdwebClient; - maxBlocksWaitTime?: number; - wallet: Wallet; -}): Promise; +function sendAndConfirmCalls( + options: { + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; + } & { maxBlocksWaitTime?: number }, +): Promise<{ + atomic: boolean; + chainId: number; + id: string; + receipts?: Array>; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; +}>; ``` ### Parameters - The options for waiting for the bundle. By default, the max wait time is 100 blocks. +The options for sending and confirming calls. #### Type ```ts let options: { - bundleId: string; - chain: Readonly; - client: ThirdwebClient; - maxBlocksWaitTime?: number; - wallet: Wallet; -}; + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; +} & { maxBlocksWaitTime?: number }; ``` ### Returns ```ts let returnType: { - receipts: Array>; - status: "PENDING" | "CONFIRMED"; -}; -``` - - A promise that resolves with the final getCallsStatus result. ---- -# Modules ---- -## Common ---- - -## checkModulesCompatibility - - Check if the given modules are compatible with the given core contract - -```ts -function checkModulesCompatibility(options: { - chain: Readonly; - client: ThirdwebClient; - coreBytecode: string; - moduleBytecodes: Array; -}): Promise; -``` - -### Parameters - -#### Type - -```ts -let options: { - chain: Readonly; - client: ThirdwebClient; - coreBytecode: string; - moduleBytecodes: Array; + blockHash: Hex; + blockNumber: quantity; + gasUsed: quantity; + logs: Array<{ address: string; data: Hex; topics: Array }>; + status: status; + transactionHash: Hex; }; ``` -### Returns - -```ts -let returnType: Promise; -``` +The receipts of the calls. --- -## deployModularContract +## EIP5792.sendCalls - Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +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. -### Example +This function is dependent on the wallet's support for EIP-5792 and could fail. -```ts -import { deployModularContract } from "thirdweb/modules"; -const contractAddress = await deployModularContract({ - chain, - client, - account, - core: "ERC20", - params: { - name: "MyToken", - description: "My Token contract", - symbol: "MT", - }, - modules: [ - ClaimableERC721.module({ - primarySaleRecipient: "0x...", - }), - RoyaltyERC721.module({ - royaltyRecipient: "0x...", - royaltyBps: 500n, - }), - ], -}); -``` - -```ts -function deployModularContract(options: { - account: Account; - chain: Readonly; - client: ThirdwebClient; - core: CoreType; - modules?: Array; - params: ModularContractParams; - publisher?: string; - salt?: string; -}): Promise; -``` - -### Parameters - - The deployment options. - -#### Type - -```ts -let options: { - account: Account; - chain: Readonly; - client: ThirdwebClient; - core: CoreType; - modules?: Array; - params: ModularContractParams; - publisher?: string; - salt?: string; -}; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - The deployed contract address. ---- - -## getDeployedModule - - Gets a deployed module implementation contract. +* getCallsStatus for how to retrieve the status of the bundle. +* getCapabilities for how to retrieve the capabilities of the wallet. ### Example ```ts -import { getDeployedModule } from "thirdweb/modules"; +import { createThirdwebClient } from "thirdweb"; +import { sendCalls } from "thirdweb/wallets/eip5792"; + +const client = createThirdwebClient({ clientId: ... }); +const wallet = createWallet("com.coinbase.wallet"); +await wallet.connect({ client }); -const module = await getDeployedModule({ +const sendTx1 = approve({ + contract: USDT_CONTRACT, + amount: 100, + spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6", + }); +const sendTx2 = approve({ + contract: USDT_CONTRACT, + amount: 100, + spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", + }); +const bundleId = await sendCalls({ + wallet, client, - chain, - contractId, - publisher, + calls: [sendTx1, sendTx2], }); ``` -```ts -function getDeployedModule(options: { - chain: Readonly; - client: ThirdwebClient; - contractId: string; - publisher?: string; -}): Promise>>; -``` - -### Parameters - - The options to use. - -#### Type +Sponsor transactions with a paymaster: ```ts -let options: { - chain: Readonly; - client: ThirdwebClient; - contractId: string; - publisher?: string; -}; -``` - -### Returns - -```ts -let returnType: Promise>>; -``` - - The module. ---- - -## getOrDeployModule - - Gets or deploys a module implementation contract. - -### Example - -```ts -import { getOrDeployModule } from "thirdweb/modules"; - -const module = await getOrDeployModule({ +const bundleId = await sendCalls({ + wallet, client, - chain, - account, - contractId, - publisher, + calls: [send1, send2], + capabilities: { + paymasterService: { + url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`, + }, + }, }); ``` +We recommend proxying any paymaster calls via an API route you setup and control. + ```ts -function getOrDeployModule(options: { - account: Account; - chain: Readonly; +function sendCalls(options: { + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; +}): Promise<{ + chain: Readonly; client: ThirdwebClient; - contractId: string; - publisher?: string; -}): Promise>>; + id: string; + wallet: Wallet; +}>; ``` ### Parameters - The options to use. - #### Type ```ts let options: { - account: Account; - chain: Readonly; - client: ThirdwebClient; - contractId: string; - publisher?: string; + atomicRequired?: boolean; + calls: Array>; + capabilities?: WalletCapabilities; + chain?: Readonly; + version?: string; + wallet: Wallet; }; ``` ### Returns ```ts -let returnType: Promise>>; +let returnType: Promise<{ + chain: Readonly; + client: ThirdwebClient; + id: string; + wallet: Wallet; +}>; ``` - The module. +The ID of the bundle of the calls. --- -## grantMinterRole - - Grants the minter role to a user. - -### Example - -```ts -import { grantMinterRole } from "thirdweb/modules"; - -const tx = await grantMinterRole({ - contract, - user: userAddress, -}); -``` - -```ts -function grantMinterRole( - options: BaseTransactionOptions, -): PreparedTransaction; -``` - -### Parameters - - The transaction options. - -#### Type - -```ts -let options: BaseTransactionOptions; -``` - -### Returns - -```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; -``` - - The transaction to send. ---- +## EIP5792.waitForCallsReceipt -## installPublishedModule +Waits for the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle to be confirmed. - Install a published module on a modular contract +This function is dependent on the wallet's support for EIP-5792 and could fail. ### Example ```ts -import { installPublishedModule } from "thirdweb/modules"; -const transaction = installPublishedModule({ +import { waitForCallsReceipt } from "thirdweb/wallets/eip5792"; +const result = await waitForCallsReceipt({ client, chain, - account, - contract, - moduleName: "MyModule", - publisherAddress: "0x...", + wallet, + id: "0x123...", }); -await sendTransaction({ transaction, account }); -``` - -```ts -function installPublishedModule( - options: InstallPublishedModuleOptions, -): PreparedTransaction; -``` - -### Parameters - - The options for installing a published module - -#### Type - -```ts -let options: { - account: Account; - constructorParams?: Record; - contract: ThirdwebContract; - moduleData?: `0x${string}`; - moduleName: string; - publisher?: string; - version?: string; -}; -``` - -### Returns - -```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; ``` - A prepared transaction to send ---- - -## uninstallModuleByProxy - - Uninstall an module by proxy - -### Example +Example with useSendCalls: ```ts -import { uninstallModuleByProxy } from "thirdweb/modules"; -const transaction = uninstallModuleByProxy({ +const sendResult = await sendCalls({ client, chain, - contract, - moduleProxyAddress: "0x...", + wallet, + calls: [...], }); -await sendTransaction({ transaction, account }); +const confirmResult = await waitForCallsReceipt(sendResult); +console.log("Transaction confirmed: ", confirmResult.receipts?.[0].transactionHash); ``` ```ts -function uninstallModuleByProxy( - options: UninstallModuleByProxyOptions, -): PreparedTransaction; +function waitForCallsReceipt(options: { + chain: Readonly; + client: ThirdwebClient; + id: string; + maxBlocksWaitTime?: number; + wallet: Wallet; +}): Promise<{ + atomic: boolean; + chainId: number; + id: string; + receipts?: Array>; + status: undefined | "pending" | "success" | "failure"; + statusCode: number; + version: string; +}>; ``` ### Parameters - The options for uninstalling an module by proxy +The options for waiting for the bundle. By default, the max wait time is 100 blocks. #### Type ```ts let options: { - chain: Chain; + chain: Readonly; client: ThirdwebClient; - contract: ThirdwebContract; - moduleData?: `0x${string}`; - moduleProxyAddress: string; + id: string; + maxBlocksWaitTime?: number; + wallet: Wallet; }; ``` ### Returns ```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; -``` - - A prepared transaction to send ---- - -## uninstallPublishedModule - - Uninstall a published module - -### Example - -```ts -import { uninstallPublishedModule } from "thirdweb/modules"; -const transaction = uninstallPublishedModule({ - client, - chain, - contract, - moduleName: "MyModule", - publisherAddress: "0x...", -}); -await sendTransaction({ transaction, account }); -``` - -```ts -function uninstallPublishedModule( - options: UninstallPublishedModuleOptions, -): PreparedTransaction; -``` - -### Parameters - - The options for uninstalling a published module - -#### Type - -```ts -let options: { - contract: ThirdwebContract; - moduleData?: `0x${string}`; - moduleName: string; - publisherAddress?: string; - version?: string; +let returnType: { + blockHash: Hex; + blockNumber: quantity; + gasUsed: quantity; + logs: Array<{ address: string; data: Hex; topics: Array }>; + status: status; + transactionHash: Hex; }; ``` -### Returns - -```ts -let returnType: PreparedTransaction< - any, - AbiFunction, - PrepareTransactionOptions ->; -``` - - A prepared transaction to send +A promise that resolves with the final getCallsStatus result. +--- +# Modules --- ## BatchMetadataERC1155 --- -## batchMetadataUpdateEvent +## BatchMetadataERC1155.batchMetadataUpdateEvent - Creates an event object for the BatchMetadataUpdate event. +Creates an event object for the BatchMetadataUpdate event. ### Example @@ -37589,12 +37951,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## encodeInstall +## BatchMetadataERC1155.encodeInstall - Encodes the install data for the BatchMetadataERC1155 module. +Encodes the install data for the BatchMetadataERC1155 module. ```ts function encodeInstall(): string; @@ -37609,9 +37971,9 @@ let returnType: string; * The encoded data. --- -## install +## BatchMetadataERC1155.install - Installs the BatchMetadataERC1155 module on a core contract. +Installs the BatchMetadataERC1155 module on a core contract. ### Example @@ -37632,7 +37994,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }): PreparedTransaction; ``` @@ -37644,7 +38006,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }; ``` @@ -37658,12 +38020,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## module +## BatchMetadataERC1155.module - Convenience function to add the BatchMetadataERC1155 module as a default module on a core contract. +Convenience function to add the BatchMetadataERC1155 module as a default module on a core contract. ### Example @@ -37690,14 +38052,14 @@ function module(params?: { publisher?: string; }): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -37710,7 +38072,7 @@ let params: { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` @@ -37718,9 +38080,9 @@ let returnType: (args: { * The module function. --- -## uploadMetadata +## BatchMetadataERC1155.uploadMetadata - Uploads metadata for a batch of NFTs. +Uploads metadata for a batch of NFTs. ### Example @@ -37746,7 +38108,7 @@ function uploadMetadata( ### Parameters - The options for the transaction. +The options for the transaction. #### Type @@ -37764,14 +38126,14 @@ let returnType: PreparedTransaction< >; ``` - The transaction to upload the metadata. +The transaction to upload the metadata. --- ## BatchMetadataERC721 --- -## batchMetadataUpdateEvent +## BatchMetadataERC721.batchMetadataUpdateEvent - Creates an event object for the BatchMetadataUpdate event. +Creates an event object for the BatchMetadataUpdate event. ### Example @@ -37823,12 +38185,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## encodeInstall +## BatchMetadataERC721.encodeInstall - Encodes the install data for the BatchMetadataERC721 module. +Encodes the install data for the BatchMetadataERC721 module. ```ts function encodeInstall(): string; @@ -37843,9 +38205,9 @@ let returnType: string; * The encoded data. --- -## install +## BatchMetadataERC721.install - Installs the BatchMetadataERC721 module on a core contract. +Installs the BatchMetadataERC721 module on a core contract. ### Example @@ -37866,7 +38228,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }): PreparedTransaction; ``` @@ -37878,7 +38240,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }; ``` @@ -37892,12 +38254,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## module +## BatchMetadataERC721.module - Convenience function to add the BatchMetadataERC721 module as a default module on a core contract. +Convenience function to add the BatchMetadataERC721 module as a default module on a core contract. ### Example @@ -37924,14 +38286,14 @@ function module(params?: { publisher?: string; }): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -37944,7 +38306,7 @@ let params: { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` @@ -37952,9 +38314,9 @@ let returnType: (args: { * The module function. --- -## uploadMetadata +## BatchMetadataERC721.uploadMetadata - Uploads metadata for a batch of NFTs. +Uploads metadata for a batch of NFTs. ### Example @@ -37980,7 +38342,7 @@ function uploadMetadata( ### Parameters - The options for the transaction. +The options for the transaction. #### Type @@ -37998,14 +38360,14 @@ let returnType: PreparedTransaction< >; ``` - The transaction to upload the metadata. +The transaction to upload the metadata. --- ## ClaimableERC1155 --- -## encodeInstall +## ClaimableERC1155.encodeInstall - Encodes the install data for the ClaimableERC1155 module. +Encodes the install data for the ClaimableERC1155 module. ```ts function encodeInstall( @@ -38015,7 +38377,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -38032,9 +38394,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## getClaimCondition +## ClaimableERC1155.getClaimCondition - Calls the "getClaimConditionByTokenId" function on the contract. +Calls the "getClaimConditionByTokenId" function on the contract. ### Example @@ -38064,7 +38426,7 @@ function getClaimCondition( ### Parameters - The options for the getClaimConditionByTokenId function. +The options for the getClaimConditionByTokenId function. #### Type @@ -38087,12 +38449,12 @@ let returnType: Promise<{ }>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getSaleConfig +## ClaimableERC1155.getSaleConfig - Calls the "getSaleConfig" function on the contract. +Calls the "getSaleConfig" function on the contract. ### Example @@ -38112,7 +38474,7 @@ function getSaleConfig( ### Parameters - The options for the getSaleConfig function. +The options for the getSaleConfig function. #### Type @@ -38126,12 +38488,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## ClaimableERC1155.install - Installs the ClaimableERC1155 module on a core contract. +Installs the ClaimableERC1155 module on a core contract. ### Example @@ -38155,7 +38517,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -38167,7 +38529,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -38181,12 +38543,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## mint +## ClaimableERC1155.mint - Mints ERC1155 tokens to a specified address via a ClaimableERC1155 module. +Mints ERC1155 tokens to a specified address via a ClaimableERC1155 module. ### Example @@ -38211,7 +38573,7 @@ function mint( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -38229,12 +38591,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## module +## ClaimableERC1155.module - Convenience function to add the ClaimableERC1155 module as a default module on a core contract. +Convenience function to add the ClaimableERC1155 module as a default module on a core contract. ### Example @@ -38262,14 +38624,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -38282,7 +38644,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -38290,9 +38652,9 @@ let returnType: (args: { * The module function. --- -## setClaimCondition +## ClaimableERC1155.setClaimCondition - Sets the claim conditions for a given token ID. +Sets the claim conditions for a given token ID. ### Example @@ -38320,7 +38682,7 @@ function setClaimCondition( ### Parameters - The options for setting the claim conditions. +The options for setting the claim conditions. #### Type @@ -38340,12 +38702,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to set the claim conditions. +A transaction to set the claim conditions. --- -## setSaleConfig +## ClaimableERC1155.setSaleConfig - Prepares a transaction to call the "setSaleConfig" function on the contract. +Prepares a transaction to call the "setSaleConfig" function on the contract. ### Example @@ -38376,7 +38738,7 @@ function setSaleConfig( ### Parameters - The options for the "setSaleConfig" function. +The options for the "setSaleConfig" function. #### Type @@ -38397,14 +38759,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## ClaimableERC20 --- -## encodeInstall +## ClaimableERC20.encodeInstall - Encodes the install data for the ClaimableERC20 module. +Encodes the install data for the ClaimableERC20 module. ```ts function encodeInstall( @@ -38414,7 +38776,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -38431,9 +38793,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## getClaimCondition +## ClaimableERC20.getClaimCondition - Calls the "getClaimCondition" function on the contract. +Calls the "getClaimCondition" function on the contract. ### Example @@ -38462,7 +38824,7 @@ function getClaimCondition( ### Parameters - The options for the getClaimCondition function. +The options for the getClaimCondition function. #### Type @@ -38485,12 +38847,12 @@ let returnType: Promise<{ }>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getSaleConfig +## ClaimableERC20.getSaleConfig - Calls the "getSaleConfig" function on the contract. +Calls the "getSaleConfig" function on the contract. ### Example @@ -38510,7 +38872,7 @@ function getSaleConfig( ### Parameters - The options for the getSaleConfig function. +The options for the getSaleConfig function. #### Type @@ -38524,12 +38886,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## ClaimableERC20.install - Installs the ClaimableERC20 module on a core contract. +Installs the ClaimableERC20 module on a core contract. ### Example @@ -38553,7 +38915,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -38565,7 +38927,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -38579,12 +38941,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## mint +## ClaimableERC20.mint - Mints tokens to a specified address via a ClaimableERC20 module. +Mints tokens to a specified address via a ClaimableERC20 module. ### Example @@ -38609,7 +38971,7 @@ function mint( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -38627,12 +38989,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## module +## ClaimableERC20.module - Convenience function to add the ClaimableERC20 module as a default module on a core contract. +Convenience function to add the ClaimableERC20 module as a default module on a core contract. ### Example @@ -38660,14 +39022,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -38680,7 +39042,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -38688,9 +39050,9 @@ let returnType: (args: { * The module function. --- -## setClaimCondition +## ClaimableERC20.setClaimCondition - Sets the claim conditions for a given token ID. +Sets the claim conditions for a given token ID. ### Example @@ -38715,7 +39077,7 @@ function setClaimCondition( ### Parameters - The options for setting the claim conditions. +The options for setting the claim conditions. #### Type @@ -38733,12 +39095,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to set the claim conditions. +A transaction to set the claim conditions. --- -## setSaleConfig +## ClaimableERC20.setSaleConfig - Prepares a transaction to call the "setSaleConfig" function on the contract. +Prepares a transaction to call the "setSaleConfig" function on the contract. ### Example @@ -38769,7 +39131,7 @@ function setSaleConfig( ### Parameters - The options for the "setSaleConfig" function. +The options for the "setSaleConfig" function. #### Type @@ -38790,14 +39152,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## ClaimableERC721 --- -## encodeInstall +## ClaimableERC721.encodeInstall - Encodes the install data for the ClaimableERC721 module. +Encodes the install data for the ClaimableERC721 module. ```ts function encodeInstall( @@ -38807,7 +39169,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -38824,9 +39186,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## getClaimCondition +## ClaimableERC721.getClaimCondition - Calls the "getClaimCondition" function on the contract. +Calls the "getClaimCondition" function on the contract. ### Example @@ -38855,7 +39217,7 @@ function getClaimCondition( ### Parameters - The options for the getClaimCondition function. +The options for the getClaimCondition function. #### Type @@ -38878,12 +39240,12 @@ let returnType: Promise<{ }>; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getSaleConfig +## ClaimableERC721.getSaleConfig - Calls the "getSaleConfig" function on the contract. +Calls the "getSaleConfig" function on the contract. ### Example @@ -38903,7 +39265,7 @@ function getSaleConfig( ### Parameters - The options for the getSaleConfig function. +The options for the getSaleConfig function. #### Type @@ -38917,12 +39279,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## ClaimableERC721.install - Installs the ClaimableERC721 module on a core contract. +Installs the ClaimableERC721 module on a core contract. ### Example @@ -38946,7 +39308,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -38958,7 +39320,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -38972,12 +39334,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## mint +## ClaimableERC721.mint - Mints ERC721 tokens to a specified address via a ClaimableERC721 module. +Mints ERC721 tokens to a specified address via a ClaimableERC721 module. ### Example @@ -39002,7 +39364,7 @@ function mint( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -39020,12 +39382,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## module +## ClaimableERC721.module - Convenience function to add the ClaimableERC721 module as a default module on a core contract. +Convenience function to add the ClaimableERC721 module as a default module on a core contract. ### Example @@ -39053,14 +39415,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -39073,7 +39435,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -39081,9 +39443,9 @@ let returnType: (args: { * The module function. --- -## setClaimCondition +## ClaimableERC721.setClaimCondition - Sets the claim conditions for a given token ID. +Sets the claim conditions for a given token ID. ### Example @@ -39108,7 +39470,7 @@ function setClaimCondition( ### Parameters - The options for setting the claim conditions. +The options for setting the claim conditions. #### Type @@ -39126,12 +39488,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to set the claim conditions. +A transaction to set the claim conditions. --- -## setSaleConfig +## ClaimableERC721.setSaleConfig - Prepares a transaction to call the "setSaleConfig" function on the contract. +Prepares a transaction to call the "setSaleConfig" function on the contract. ### Example @@ -39162,7 +39524,7 @@ function setSaleConfig( ### Parameters - The options for the "setSaleConfig" function. +The options for the "setSaleConfig" function. #### Type @@ -39183,14 +39545,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## MintableERC1155 --- -## encodeInstall +## MintableERC1155.encodeInstall - Encodes the install data for the MintableERC1155 module. +Encodes the install data for the MintableERC1155 module. ```ts function encodeInstall( @@ -39200,7 +39562,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -39217,9 +39579,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## generateMintSignature +## MintableERC1155.generateMintSignature - Generates a payload and signature for minting ERC1155 tokens with a signature. +Generates a payload and signature for minting ERC1155 tokens with a signature. ### Example @@ -39272,7 +39634,7 @@ function generateMintSignature( ### Parameters - The options for generating the payload and signature. +The options for generating the payload and signature. #### Type @@ -39300,12 +39662,12 @@ let returnType: Promise<{ }>; ``` - The payload and signature. +The payload and signature. --- -## getSaleConfig +## MintableERC1155.getSaleConfig - Calls the "getSaleConfig" function on the contract. +Calls the "getSaleConfig" function on the contract. ### Example @@ -39325,7 +39687,7 @@ function getSaleConfig( ### Parameters - The options for the getSaleConfig function. +The options for the getSaleConfig function. #### Type @@ -39339,12 +39701,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## MintableERC1155.install - Installs the MintableERC1155 module on a core contract. +Installs the MintableERC1155 module on a core contract. ### Example @@ -39368,7 +39730,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -39380,7 +39742,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -39394,12 +39756,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## mintWithRole +## MintableERC1155.mintWithRole - Mints ERC1155 tokens to a specified address via a MintableERC1155 module. +Mints ERC1155 tokens to a specified address via a MintableERC1155 module. ### Example @@ -39429,7 +39791,7 @@ function mintWithRole( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -39447,12 +39809,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## mintWithSignature +## MintableERC1155.mintWithSignature - Mints ERC1155 tokens to a specified address with a signature via a MintableERC1155 module. +Mints ERC1155 tokens to a specified address with a signature via a MintableERC1155 module. ### Example @@ -39505,7 +39867,7 @@ function mintWithSignature( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -39532,12 +39894,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## module +## MintableERC1155.module - Convenience function to add the MintableERC1155 module as a default module on a core contract. +Convenience function to add the MintableERC1155 module as a default module on a core contract. ### Example @@ -39565,14 +39927,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -39585,7 +39947,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -39593,9 +39955,9 @@ let returnType: (args: { * The module function. --- -## setSaleConfig +## MintableERC1155.setSaleConfig - Prepares a transaction to call the "setSaleConfig" function on the contract. +Prepares a transaction to call the "setSaleConfig" function on the contract. ### Example @@ -39626,7 +39988,7 @@ function setSaleConfig( ### Parameters - The options for the "setSaleConfig" function. +The options for the "setSaleConfig" function. #### Type @@ -39647,14 +40009,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## MintableERC20 --- -## encodeInstall +## MintableERC20.encodeInstall - Encodes the install data for the MintableERC20 module. +Encodes the install data for the MintableERC20 module. ```ts function encodeInstall( @@ -39664,7 +40026,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -39681,9 +40043,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## generateMintSignature +## MintableERC20.generateMintSignature - Generates a mint signature for a given mint request to be used with a MintableERC20 module. +Generates a mint signature for a given mint request to be used with a MintableERC20 module. ### Example @@ -39725,7 +40087,7 @@ function generateMintSignature( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -39747,12 +40109,12 @@ let returnType: Promise<{ }>; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## getSaleConfig +## MintableERC20.getSaleConfig - Calls the "getSaleConfig" function on the contract. +Calls the "getSaleConfig" function on the contract. ### Example @@ -39772,7 +40134,7 @@ function getSaleConfig( ### Parameters - The options for the getSaleConfig function. +The options for the getSaleConfig function. #### Type @@ -39786,12 +40148,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## MintableERC20.install - Installs the MintableERC20 module on a core contract. +Installs the MintableERC20 module on a core contract. ### Example @@ -39815,7 +40177,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -39827,7 +40189,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -39841,12 +40203,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## mintWithRole +## MintableERC20.mintWithRole - Mints ERC20 tokens to a specified address via a MintableERC20 module. +Mints ERC20 tokens to a specified address via a MintableERC20 module. ### Example @@ -39871,7 +40233,7 @@ function mintWithRole( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -39889,12 +40251,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## mintWithSignature +## MintableERC20.mintWithSignature - Mints ERC20 tokens to a specified address with a signature via a MintableERC20 module. +Mints ERC20 tokens to a specified address with a signature via a MintableERC20 module. ### Example @@ -39940,7 +40302,7 @@ function mintWithSignature( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -39961,12 +40323,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## module +## MintableERC20.module - Convenience function to add the MintableERC20 module as a default module on a core contract. +Convenience function to add the MintableERC20 module as a default module on a core contract. ### Example @@ -39994,14 +40356,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -40014,7 +40376,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -40022,9 +40384,9 @@ let returnType: (args: { * The module function. --- -## setSaleConfig +## MintableERC20.setSaleConfig - Prepares a transaction to call the "setSaleConfig" function on the contract. +Prepares a transaction to call the "setSaleConfig" function on the contract. ### Example @@ -40055,7 +40417,7 @@ function setSaleConfig( ### Parameters - The options for the "setSaleConfig" function. +The options for the "setSaleConfig" function. #### Type @@ -40076,14 +40438,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## MintableERC721 --- -## encodeInstall +## MintableERC721.encodeInstall - Encodes the install data for the MintableERC721 module. +Encodes the install data for the MintableERC721 module. ```ts function encodeInstall( @@ -40093,7 +40455,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -40110,9 +40472,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## generateMintSignature +## MintableERC721.generateMintSignature - Generates a payload and signature for minting ERC721 tokens via a MintableERC721 module. +Generates a payload and signature for minting ERC721 tokens via a MintableERC721 module. ### Example @@ -40165,7 +40527,7 @@ function generateMintSignature( ### Parameters - The options for generating the payload and signature. +The options for generating the payload and signature. #### Type @@ -40192,12 +40554,12 @@ let returnType: Promise<{ }>; ``` - The payload and signature. +The payload and signature. --- -## getSaleConfig +## MintableERC721.getSaleConfig - Calls the "getSaleConfig" function on the contract. +Calls the "getSaleConfig" function on the contract. ### Example @@ -40217,7 +40579,7 @@ function getSaleConfig( ### Parameters - The options for the getSaleConfig function. +The options for the getSaleConfig function. #### Type @@ -40231,12 +40593,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## MintableERC721.install - Installs the MintableERC721 module on a core contract. +Installs the MintableERC721 module on a core contract. ### Example @@ -40260,7 +40622,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -40272,7 +40634,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -40286,12 +40648,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## mintWithRole +## MintableERC721.mintWithRole - Mints ERC721 tokens to a specified address via a MintableERC721 module. +Mints ERC721 tokens to a specified address via a MintableERC721 module. ### Example @@ -40322,7 +40684,7 @@ function mintWithRole( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -40340,12 +40702,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## mintWithSignature +## MintableERC721.mintWithSignature - Mints ERC721 tokens to a specified address with a signature via a MintableERC721 module. +Mints ERC721 tokens to a specified address with a signature via a MintableERC721 module. ### Example @@ -40398,7 +40760,7 @@ function mintWithSignature( ### Parameters - The options for minting tokens. +The options for minting tokens. #### Type @@ -40424,12 +40786,12 @@ let returnType: PreparedTransaction< >; ``` - A transaction to mint tokens. +A transaction to mint tokens. --- -## module +## MintableERC721.module - Convenience function to add the MintableERC721 module as a default module on a core contract. +Convenience function to add the MintableERC721 module as a default module on a core contract. ### Example @@ -40457,14 +40819,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -40477,7 +40839,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -40485,9 +40847,9 @@ let returnType: (args: { * The module function. --- -## setSaleConfig +## MintableERC721.setSaleConfig - Prepares a transaction to call the "setSaleConfig" function on the contract. +Prepares a transaction to call the "setSaleConfig" function on the contract. ### Example @@ -40518,7 +40880,7 @@ function setSaleConfig( ### Parameters - The options for the "setSaleConfig" function. +The options for the "setSaleConfig" function. #### Type @@ -40539,14 +40901,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## OpenEditionMetadataERC721 --- -## batchMetadataUpdateEvent +## OpenEditionMetadataERC721.batchMetadataUpdateEvent - Creates an event object for the BatchMetadataUpdate event. +Creates an event object for the BatchMetadataUpdate event. ### Example @@ -40584,12 +40946,12 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- -## encodeInstall +## OpenEditionMetadataERC721.encodeInstall - Encodes the install data for the OpenEditionMetadataERC721 module. +Encodes the install data for the OpenEditionMetadataERC721 module. ```ts function encodeInstall(): string; @@ -40604,9 +40966,9 @@ let returnType: string; * The encoded data. --- -## install +## OpenEditionMetadataERC721.install - Installs the OpenEditionMetadataERC721 module on a core contract. +Installs the OpenEditionMetadataERC721 module on a core contract. ### Example @@ -40627,7 +40989,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }): PreparedTransaction; ``` @@ -40639,7 +41001,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }; ``` @@ -40653,12 +41015,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## module +## OpenEditionMetadataERC721.module - Convenience function to add the OpenEditionMetadataERC721 module as a default module on a core contract. +Convenience function to add the OpenEditionMetadataERC721 module as a default module on a core contract. ### Example @@ -40685,14 +41047,14 @@ function module(params?: { publisher?: string; }): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -40705,7 +41067,7 @@ let params: { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` @@ -40713,9 +41075,9 @@ let returnType: (args: { * The module function. --- -## setSharedMetadata +## OpenEditionMetadataERC721.setSharedMetadata - Prepares a transaction to call the "setSharedMetadata" function on the contract. +Prepares a transaction to call the "setSharedMetadata" function on the contract. ### Example @@ -40746,7 +41108,7 @@ function setSharedMetadata( ### Parameters - The options for the "setSharedMetadata" function. +The options for the "setSharedMetadata" function. #### Type @@ -40767,12 +41129,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## sharedMetadataUpdatedEvent +## OpenEditionMetadataERC721.sharedMetadataUpdatedEvent - Creates an event object for the SharedMetadataUpdated event. +Creates an event object for the SharedMetadataUpdated event. ### Example @@ -40814,14 +41176,14 @@ let returnType: PreparedEvent<{ }>; ``` - The prepared event object. +The prepared event object. --- ## RoyaltyERC1155 --- -## encodeInstall +## RoyaltyERC1155.encodeInstall - Encodes the install data for the RoyaltyERC1155 module. +Encodes the install data for the RoyaltyERC1155 module. ```ts function encodeInstall( @@ -40831,7 +41193,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -40848,9 +41210,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## getDefaultRoyaltyInfo +## RoyaltyERC1155.getDefaultRoyaltyInfo - Calls the "getDefaultRoyaltyInfo" function on the contract. +Calls the "getDefaultRoyaltyInfo" function on the contract. ### Example @@ -40870,7 +41232,7 @@ function getDefaultRoyaltyInfo( ### Parameters - The options for the getDefaultRoyaltyInfo function. +The options for the getDefaultRoyaltyInfo function. #### Type @@ -40884,12 +41246,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getRoyaltyInfoForToken +## RoyaltyERC1155.getRoyaltyInfoForToken - Calls the "getRoyaltyInfoForToken" function on the contract. +Calls the "getRoyaltyInfoForToken" function on the contract. ### Example @@ -40910,7 +41272,7 @@ function getRoyaltyInfoForToken( ### Parameters - The options for the getRoyaltyInfoForToken function. +The options for the getRoyaltyInfoForToken function. #### Type @@ -40924,12 +41286,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getTransferValidationFunction +## RoyaltyERC1155.getTransferValidationFunction - Calls the "getTransferValidationFunction" function on the contract. +Calls the "getTransferValidationFunction" function on the contract. ### Example @@ -40949,7 +41311,7 @@ function getTransferValidationFunction( ### Parameters - The options for the getTransferValidationFunction function. +The options for the getTransferValidationFunction function. #### Type @@ -40963,12 +41325,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getTransferValidator +## RoyaltyERC1155.getTransferValidator - Calls the "getTransferValidator" function on the contract. +Calls the "getTransferValidator" function on the contract. ### Example @@ -40988,7 +41350,7 @@ function getTransferValidator( ### Parameters - The options for the getTransferValidator function. +The options for the getTransferValidator function. #### Type @@ -41002,12 +41364,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## RoyaltyERC1155.install - Installs the RoyaltyERC1155 module on a core contract. +Installs the RoyaltyERC1155 module on a core contract. ### Example @@ -41033,7 +41395,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -41045,7 +41407,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -41059,12 +41421,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## module +## RoyaltyERC1155.module - Convenience function to add the RoyaltyERC1155 module as a default module on a core contract. +Convenience function to add the RoyaltyERC1155 module as a default module on a core contract. ### Example @@ -41094,14 +41456,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -41114,7 +41476,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -41122,9 +41484,9 @@ let returnType: (args: { * The module function. --- -## royaltyInfo +## RoyaltyERC1155.royaltyInfo - Calls the "royaltyInfo" function on the contract. +Calls the "royaltyInfo" function on the contract. ### Example @@ -41146,7 +41508,7 @@ function royaltyInfo( ### Parameters - The options for the royaltyInfo function. +The options for the royaltyInfo function. #### Type @@ -41160,12 +41522,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## setDefaultRoyaltyInfo +## RoyaltyERC1155.setDefaultRoyaltyInfo - Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. +Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. ### Example @@ -41197,7 +41559,7 @@ function setDefaultRoyaltyInfo( ### Parameters - The options for the "setDefaultRoyaltyInfo" function. +The options for the "setDefaultRoyaltyInfo" function. #### Type @@ -41218,12 +41580,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setRoyaltyInfoForToken +## RoyaltyERC1155.setRoyaltyInfoForToken - Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. +Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. ### Example @@ -41256,7 +41618,7 @@ function setRoyaltyInfoForToken( ### Parameters - The options for the "setRoyaltyInfoForToken" function. +The options for the "setRoyaltyInfoForToken" function. #### Type @@ -41277,12 +41639,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setTransferValidator +## RoyaltyERC1155.setTransferValidator - Prepares a transaction to call the "setTransferValidator" function on the contract. +Prepares a transaction to call the "setTransferValidator" function on the contract. ### Example @@ -41313,7 +41675,7 @@ function setTransferValidator( ### Parameters - The options for the "setTransferValidator" function. +The options for the "setTransferValidator" function. #### Type @@ -41334,14 +41696,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## RoyaltyERC721 --- -## encodeInstall +## RoyaltyERC721.encodeInstall - Encodes the install data for the RoyaltyERC721 module. +Encodes the install data for the RoyaltyERC721 module. ```ts function encodeInstall( @@ -41351,7 +41713,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -41368,9 +41730,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## getDefaultRoyaltyInfo +## RoyaltyERC721.getDefaultRoyaltyInfo - Calls the "getDefaultRoyaltyInfo" function on the contract. +Calls the "getDefaultRoyaltyInfo" function on the contract. ### Example @@ -41390,7 +41752,7 @@ function getDefaultRoyaltyInfo( ### Parameters - The options for the getDefaultRoyaltyInfo function. +The options for the getDefaultRoyaltyInfo function. #### Type @@ -41404,12 +41766,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getRoyaltyInfoForToken +## RoyaltyERC721.getRoyaltyInfoForToken - Calls the "getRoyaltyInfoForToken" function on the contract. +Calls the "getRoyaltyInfoForToken" function on the contract. ### Example @@ -41430,7 +41792,7 @@ function getRoyaltyInfoForToken( ### Parameters - The options for the getRoyaltyInfoForToken function. +The options for the getRoyaltyInfoForToken function. #### Type @@ -41444,12 +41806,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getTransferValidationFunction +## RoyaltyERC721.getTransferValidationFunction - Calls the "getTransferValidationFunction" function on the contract. +Calls the "getTransferValidationFunction" function on the contract. ### Example @@ -41469,7 +41831,7 @@ function getTransferValidationFunction( ### Parameters - The options for the getTransferValidationFunction function. +The options for the getTransferValidationFunction function. #### Type @@ -41483,12 +41845,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## getTransferValidator +## RoyaltyERC721.getTransferValidator - Calls the "getTransferValidator" function on the contract. +Calls the "getTransferValidator" function on the contract. ### Example @@ -41508,7 +41870,7 @@ function getTransferValidator( ### Parameters - The options for the getTransferValidator function. +The options for the getTransferValidator function. #### Type @@ -41522,12 +41884,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## install +## RoyaltyERC721.install - Installs the RoyaltyERC721 module on a core contract. +Installs the RoyaltyERC721 module on a core contract. ### Example @@ -41553,7 +41915,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -41565,7 +41927,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -41579,12 +41941,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## module +## RoyaltyERC721.module - Convenience function to add the RoyaltyERC721 module as a default module on a core contract. +Convenience function to add the RoyaltyERC721 module as a default module on a core contract. ### Example @@ -41614,14 +41976,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -41634,7 +41996,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -41642,9 +42004,9 @@ let returnType: (args: { * The module function. --- -## royaltyInfo +## RoyaltyERC721.royaltyInfo - Calls the "royaltyInfo" function on the contract. +Calls the "royaltyInfo" function on the contract. ### Example @@ -41666,7 +42028,7 @@ function royaltyInfo( ### Parameters - The options for the royaltyInfo function. +The options for the royaltyInfo function. #### Type @@ -41680,12 +42042,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## setDefaultRoyaltyInfo +## RoyaltyERC721.setDefaultRoyaltyInfo - Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. +Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. ### Example @@ -41717,7 +42079,7 @@ function setDefaultRoyaltyInfo( ### Parameters - The options for the "setDefaultRoyaltyInfo" function. +The options for the "setDefaultRoyaltyInfo" function. #### Type @@ -41738,12 +42100,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setRoyaltyInfoForToken +## RoyaltyERC721.setRoyaltyInfoForToken - Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. +Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. ### Example @@ -41776,7 +42138,7 @@ function setRoyaltyInfoForToken( ### Parameters - The options for the "setRoyaltyInfoForToken" function. +The options for the "setRoyaltyInfoForToken" function. #### Type @@ -41797,12 +42159,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setTransferValidator +## RoyaltyERC721.setTransferValidator - Prepares a transaction to call the "setTransferValidator" function on the contract. +Prepares a transaction to call the "setTransferValidator" function on the contract. ### Example @@ -41833,7 +42195,7 @@ function setTransferValidator( ### Parameters - The options for the "setTransferValidator" function. +The options for the "setTransferValidator" function. #### Type @@ -41854,14 +42216,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## SequentialTokenIdERC1155 --- -## encodeInstall +## SequentialTokenIdERC1155.encodeInstall - Encodes the install data for the SequentialTokenIdERC1155 module. +Encodes the install data for the SequentialTokenIdERC1155 module. ```ts function encodeInstall( @@ -41871,7 +42233,7 @@ function encodeInstall( ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -41888,9 +42250,9 @@ let returnType: `0x${string}`; * The encoded data. --- -## install +## SequentialTokenIdERC1155.install - Installs the SequentialTokenIdERC1155 module on a core contract. +Installs the SequentialTokenIdERC1155 module on a core contract. ### Example @@ -41914,7 +42276,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }): PreparedTransaction; ``` @@ -41926,7 +42288,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params: EncodeBytesOnInstallParams & { publisher?: string }; }; ``` @@ -41940,12 +42302,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## module +## SequentialTokenIdERC1155.module - Convenience function to add the SequentialTokenIdERC1155 module as a default module on a core contract. +Convenience function to add the SequentialTokenIdERC1155 module as a default module on a core contract. ### Example @@ -41973,14 +42335,14 @@ function module( params: EncodeBytesOnInstallParams & { publisher?: string }, ): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -41993,7 +42355,7 @@ let params: EncodeBytesOnInstallParams & { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: `0x${string}`; module: `0x${string}` }>; ``` @@ -42003,9 +42365,9 @@ let returnType: (args: { ## TransferableERC1155 --- -## encodeInstall +## TransferableERC1155.encodeInstall - Encodes the install data for the TransferableERC1155 module. +Encodes the install data for the TransferableERC1155 module. ```ts function encodeInstall(): string; @@ -42020,9 +42382,9 @@ let returnType: string; * The encoded data. --- -## install +## TransferableERC1155.install - Installs the TransferableERC1155 module on a core contract. +Installs the TransferableERC1155 module on a core contract. ### Example @@ -42043,7 +42405,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }): PreparedTransaction; ``` @@ -42055,7 +42417,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }; ``` @@ -42069,12 +42431,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## isTransferEnabled +## TransferableERC1155.isTransferEnabled - Calls the "isTransferEnabled" function on the contract. +Calls the "isTransferEnabled" function on the contract. ### Example @@ -42094,7 +42456,7 @@ function isTransferEnabled( ### Parameters - The options for the isTransferEnabled function. +The options for the isTransferEnabled function. #### Type @@ -42108,12 +42470,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isTransferEnabledFor +## TransferableERC1155.isTransferEnabledFor - Calls the "isTransferEnabledFor" function on the contract. +Calls the "isTransferEnabledFor" function on the contract. ### Example @@ -42134,7 +42496,7 @@ function isTransferEnabledFor( ### Parameters - The options for the isTransferEnabledFor function. +The options for the isTransferEnabledFor function. #### Type @@ -42148,12 +42510,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## module +## TransferableERC1155.module - Convenience function to add the TransferableERC1155 module as a default module on a core contract. +Convenience function to add the TransferableERC1155 module as a default module on a core contract. ### Example @@ -42180,14 +42542,14 @@ function module(params?: { publisher?: string; }): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -42200,7 +42562,7 @@ let params: { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` @@ -42208,9 +42570,9 @@ let returnType: (args: { * The module function. --- -## setTransferable +## TransferableERC1155.setTransferable - Prepares a transaction to call the "setTransferable" function on the contract. +Prepares a transaction to call the "setTransferable" function on the contract. ### Example @@ -42241,7 +42603,7 @@ function setTransferable( ### Parameters - The options for the "setTransferable" function. +The options for the "setTransferable" function. #### Type @@ -42262,12 +42624,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setTransferableFor +## TransferableERC1155.setTransferableFor - Prepares a transaction to call the "setTransferableFor" function on the contract. +Prepares a transaction to call the "setTransferableFor" function on the contract. ### Example @@ -42299,7 +42661,7 @@ function setTransferableFor( ### Parameters - The options for the "setTransferableFor" function. +The options for the "setTransferableFor" function. #### Type @@ -42320,14 +42682,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## TransferableERC20 --- -## encodeInstall +## TransferableERC20.encodeInstall - Encodes the install data for the TransferableERC20 module. +Encodes the install data for the TransferableERC20 module. ```ts function encodeInstall(): string; @@ -42342,9 +42704,9 @@ let returnType: string; * The encoded data. --- -## install +## TransferableERC20.install - Installs the TransferableERC20 module on a core contract. +Installs the TransferableERC20 module on a core contract. ### Example @@ -42365,7 +42727,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }): PreparedTransaction; ``` @@ -42377,7 +42739,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }; ``` @@ -42391,12 +42753,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## isTransferEnabled +## TransferableERC20.isTransferEnabled - Calls the "isTransferEnabled" function on the contract. +Calls the "isTransferEnabled" function on the contract. ### Example @@ -42416,7 +42778,7 @@ function isTransferEnabled( ### Parameters - The options for the isTransferEnabled function. +The options for the isTransferEnabled function. #### Type @@ -42430,12 +42792,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isTransferEnabledFor +## TransferableERC20.isTransferEnabledFor - Calls the "isTransferEnabledFor" function on the contract. +Calls the "isTransferEnabledFor" function on the contract. ### Example @@ -42456,7 +42818,7 @@ function isTransferEnabledFor( ### Parameters - The options for the isTransferEnabledFor function. +The options for the isTransferEnabledFor function. #### Type @@ -42470,12 +42832,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## module +## TransferableERC20.module - Convenience function to add the TransferableERC20 module as a default module on a core contract. +Convenience function to add the TransferableERC20 module as a default module on a core contract. ### Example @@ -42502,14 +42864,14 @@ function module(params?: { publisher?: string; }): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -42522,7 +42884,7 @@ let params: { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` @@ -42530,9 +42892,9 @@ let returnType: (args: { * The module function. --- -## setTransferable +## TransferableERC20.setTransferable - Prepares a transaction to call the "setTransferable" function on the contract. +Prepares a transaction to call the "setTransferable" function on the contract. ### Example @@ -42563,7 +42925,7 @@ function setTransferable( ### Parameters - The options for the "setTransferable" function. +The options for the "setTransferable" function. #### Type @@ -42584,12 +42946,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setTransferableFor +## TransferableERC20.setTransferableFor - Prepares a transaction to call the "setTransferableFor" function on the contract. +Prepares a transaction to call the "setTransferableFor" function on the contract. ### Example @@ -42621,7 +42983,7 @@ function setTransferableFor( ### Parameters - The options for the "setTransferableFor" function. +The options for the "setTransferableFor" function. #### Type @@ -42642,14 +43004,14 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- ## TransferableERC721 --- -## encodeInstall +## TransferableERC721.encodeInstall - Encodes the install data for the TransferableERC721 module. +Encodes the install data for the TransferableERC721 module. ```ts function encodeInstall(): string; @@ -42664,9 +43026,9 @@ let returnType: string; * The encoded data. --- -## install +## TransferableERC721.install - Installs the TransferableERC721 module on a core contract. +Installs the TransferableERC721 module on a core contract. ### Example @@ -42687,7 +43049,7 @@ await sendTransaction({ ```ts function install(options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }): PreparedTransaction; ``` @@ -42699,7 +43061,7 @@ function install(options: { ```ts let options: { account: Account; - contract: Readonly>; + contract: Readonly; params?: { publisher?: string }; }; ``` @@ -42713,12 +43075,12 @@ let returnType: Readonly & { }; ``` - the transaction to install the module +the transaction to install the module --- -## isTransferEnabled +## TransferableERC721.isTransferEnabled - Calls the "isTransferEnabled" function on the contract. +Calls the "isTransferEnabled" function on the contract. ### Example @@ -42738,7 +43100,7 @@ function isTransferEnabled( ### Parameters - The options for the isTransferEnabled function. +The options for the isTransferEnabled function. #### Type @@ -42752,12 +43114,12 @@ let options: { contract: ThirdwebContract } & T; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## isTransferEnabledFor +## TransferableERC721.isTransferEnabledFor - Calls the "isTransferEnabledFor" function on the contract. +Calls the "isTransferEnabledFor" function on the contract. ### Example @@ -42778,7 +43140,7 @@ function isTransferEnabledFor( ### Parameters - The options for the isTransferEnabledFor function. +The options for the isTransferEnabledFor function. #### Type @@ -42792,12 +43154,12 @@ let options: BaseTransactionOptions; let returnType: Promise; ``` - The parsed result of the function call. +The parsed result of the function call. --- -## module +## TransferableERC721.module - Convenience function to add the TransferableERC721 module as a default module on a core contract. +Convenience function to add the TransferableERC721 module as a default module on a core contract. ### Example @@ -42824,14 +43186,14 @@ function module(params?: { publisher?: string; }): (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` ### Parameters - The parameters for the module. +The parameters for the module. #### Type @@ -42844,7 +43206,7 @@ let params: { publisher?: string }; ```ts let returnType: (args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; }) => Promise<{ data: "0x"; module: `0x${string}` }>; ``` @@ -42852,9 +43214,9 @@ let returnType: (args: { * The module function. --- -## setTransferable +## TransferableERC721.setTransferable - Prepares a transaction to call the "setTransferable" function on the contract. +Prepares a transaction to call the "setTransferable" function on the contract. ### Example @@ -42885,7 +43247,7 @@ function setTransferable( ### Parameters - The options for the "setTransferable" function. +The options for the "setTransferable" function. #### Type @@ -42906,12 +43268,12 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. --- -## setTransferableFor +## TransferableERC721.setTransferableFor - Prepares a transaction to call the "setTransferableFor" function on the contract. +Prepares a transaction to call the "setTransferableFor" function on the contract. ### Example @@ -42943,7 +43305,7 @@ function setTransferableFor( ### Parameters - The options for the "setTransferableFor" function. +The options for the "setTransferableFor" function. #### Type @@ -42964,22 +43326,532 @@ let returnType: PreparedTransaction< >; ``` - A prepared transaction object. +A prepared transaction object. +--- +# Universal Bridge +--- +## Buy +--- + +## Buy.prepare + +Prepares a _finalized_ Universal Bridge quote for the provided buy request with transaction data. This function will return everything `quote` does, with the addition of a series of prepared transactions and the associated expiration timestamp. + +### Example + +```typescript +import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb"; + +const quote = await Bridge.Buy.prepare({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + client: thirdwebClient, +}); +``` + +This will return a quote that might look like: + +```typescript +{ + originAmount: 2000030000n, + destinationAmount: 1000000000000000000n, + blockNumber: 22026509n, + timestamp: 1741730936680, + estimatedExecutionTimeMs: 1000 + steps: [ + { + originToken: { + chainId: 1, + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + symbol: "USDC", + name: "USDC", + decimals: 6, + priceUsd: 1, + iconUri: "https://..." + }, + destinationToken: { + chainId: 10, + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + symbol: "ETH", + name: "Ethereum", + decimals: 18, + priceUsd: 2000, + iconUri: "https://..." + }, + originAmount: 2000030000n, + destinationAmount: 1000000000000000000n, + estimatedExecutionTimeMs: 1000 + transactions: [ + { + action: "approval", + id: "0x", + to: "0x...", + data: "0x...", + chainId: 10, + type: "eip1559" + }, + { + action: "buy", + to: "0x...", + value: 10000026098875381n, + data: "0x...", + chainId: 10, + type: "eip1559" + } + ] + } + ], + expiration: 1741730936680, + intent: { + originChainId: 1, + originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + destinationChainId: 10, + destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + amount: 1000000000000000000n + } +} +``` + +### Sending the transactions + +The `transactions` array is a series of transactions ready to be executed (with `sendTransaction`) one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions: + +* Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction. +* All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address. +* If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price. + +NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full bridge completion on the destination chain. + +You can access this functions input and output types with `Buy.prepare.Options` and `Buy.prepare.Result`, respectively. + +You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option. + +```ts +const quote = await Bridge.Buy.prepare({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + purchaseData: { + size: "large", + shippingAddress: "123 Main St, New York, NY 10001", + }, + client: thirdwebClient, +}); +``` + +To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option. + +```ts +const quote = await Bridge.Buy.prepare({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps + client: thirdwebClient, +}); +``` + +```ts +function prepare(options: Options): Promise; +``` + +### Parameters + +The options for the quote. + +#### Type + +```ts +let options: Options; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to a finalized quote and transactions for the requested buy. +--- + +## Buy.quote + +Retrieves a Universal Bridge quote for the provided buy intent. The quote will specify the necessary `originAmount` to receive the desired `destinationAmount`, which is specified with the `buyAmountWei` option. + +### Example + +```typescript +import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb"; + +const quote = await Bridge.Buy.quote({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + client: thirdwebClient, +}); +``` + +This will return a quote that might look like: + +```typescript +{ + originAmount: 10000026098875381n, + destinationAmount: 1000000000000000000n, + blockNumber: 22026509n, + timestamp: 1741730936680, + estimatedExecutionTimeMs: 1000 + steps: [ + { + originToken: { + chainId: 1, + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + symbol: "ETH", + name: "Ethereum", + decimals: 18, + priceUsd: 0.0025, + iconUri: "https://..." + }, + destinationToken: { + chainId: 10, + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + symbol: "ETH", + name: "Ethereum", + decimals: 18, + priceUsd: 0.0025, + iconUri: "https://..." + }, + originAmount: 10000026098875381n, + destinationAmount: 1000000000000000000n, + estimatedExecutionTimeMs: 1000 + } + ], + intent: { + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: 1000000000000000000n + } +} +``` + +The quote is an _estimate_ for how much you would expect to pay for a specific buy. This quote is not guaranteed and you should use `Buy.prepare` to get a finalized quote with transaction data ready for execution. So why use `quote`? The quote function is sometimes slightly faster than `prepare`, and can be used before the user connects their wallet. + +You can access this functions input and output types with `Buy.quote.Options` and `Buy.quote.Result`, respectively. + +To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option. + +```ts +const quote = await Bridge.Buy.quote({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps + client: thirdwebClient, +}); +``` + +```ts +function quote(options: Options): Promise; +``` + +### Parameters + +The options for the quote. + +#### Type + +```ts +let options: Options; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to a non-finalized quote for the requested buy. +--- +## Sell +--- + +## Sell.prepare + +Prepares a _finalized_ Universal Bridge quote for the provided sell request with transaction data. This function will return everything `quote` does, with the addition of a series of prepared transactions and the associated expiration timestamp. + +### Example + +```typescript +import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb"; + +const quote = await Bridge.Sell.prepare({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + client: thirdwebClient, +}); +``` + +This will return a quote that might look like: + +```typescript +{ + originAmount: 2000000000n, + destinationAmount: 9980000000000000000n, + blockNumber: 22026509n, + timestamp: 1741730936680, + estimatedExecutionTimeMs: 1000 + steps: [ + { + originToken: { + chainId: 1, + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + symbol: "USDC", + name: "USDC", + decimals: 6, + priceUsd: 1, + iconUri: "https://..." + }, + destinationToken: { + chainId: 10, + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + symbol: "ETH", + name: "Ethereum", + decimals: 18, + priceUsd: 2000, + iconUri: "https://..." + }, + originAmount: 2000000000n, + destinationAmount: 9980000000000000000n, + estimatedExecutionTimeMs: 1000 + } + transactions: [ + { + id: "0x...", + action: "approval", + to: "0x...", + data: "0x...", + chainId: 10, + type: "eip1559" + }, + { + id: "0x...", + action: "sell", + to: "0x...", + data: "0x...", + chainId: 10, + type: "eip1559" + } + ], + ], + expiration: 1741730936680, + intent: { + originChainId: 1, + originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + destinationChainId: 10, + destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + amount: 2000000000n + } +} +``` + +### Sending the transactions + +The `transactions` array is a series of transactions ready to be executed (with `sendTransaction`) must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions: + +* Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction. +* All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address. +* If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price. + +NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full bridge completion on the destination chain. + +You can access this functions input and output types with `Sell.prepare.Options` and `Sell.prepare.Result`, respectively. + +You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option. + +```ts +const quote = await Bridge.Sell.prepare({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + purchaseData: { + size: "large", + shippingAddress: "123 Main St, New York, NY 10001", + }, + client: thirdwebClient, +}); +``` + +To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option. + +```ts +const quote = await Bridge.Sell.prepare({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps + client: thirdwebClient, +}); +``` + +```ts +function prepare(options: Options): Promise; +``` + +### Parameters + +The options for the quote. + +#### Type + +```ts +let options: Options; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to a finalized quote and transactions for the requested sell. +--- + +## Sell.quote + +Retrieves a Universal Bridge quote for the provided sell intent. The quote will specify the expected `destinationAmount` that will be received in exchange for the specified `originAmount`, which is specified with the `sellAmountWei` option. + +### Example + +```typescript +import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb"; + +const quote = await Bridge.Sell.quote({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + client: thirdwebClient, +}); +``` + +This will return a quote that might look like: + +```typescript +{ + originAmount: 1000000000000000000n, + destinationAmount: 9999979011973735n, + blockNumber: 22026509n, + timestamp: 1741730936680, + estimatedExecutionTimeMs: 1000 + steps: [ + { + originToken: { + chainId: 1, + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + symbol: "ETH", + name: "Ethereum", + decimals: 18, + priceUsd: 2000, + iconUri: "https://..." + }, + destinationToken: { + chainId: 10, + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + symbol: "ETH", + name: "Ethereum", + decimals: 18, + priceUsd: 2000, + iconUri: "https://..." + }, + originAmount: 1000000000000000000n, + destinationAmount: 99999979011973735n, + estimatedExecutionTimeMs: 1000 + } + ], + intent: { + originChainId: 1, + originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + destinationChainId: 10, + destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + amount: 1000000000000000000n + } +} +``` + +The quote is an _estimate_ for how much you would expect to receive for a specific sell. This quote is not guaranteed and you should use `Sell.prepare` to get a finalized quote with transaction data ready for execution. So why use `quote`? The quote function is sometimes slightly faster than `prepare`, and can be used before the user connects their wallet. + +You can access this functions input and output types with `Sell.quote.Options` and `Sell.quote.Result`, respectively. + +To limit quotes to routes that have a certain number of steps involved, use the `maxSteps` option. + +```ts +const quote = await Bridge.Sell.quote({ + originChainId: 1, + originTokenAddress: NATIVE_TOKEN_ADDRESS, + destinationChainId: 10, + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, + amount: toWei("0.01"), + maxSteps: 2, // Will only return a quote for routes with 2 or fewer steps + client: thirdwebClient, +}); +``` + +```ts +function quote(options: Options): Promise; +``` + +### Parameters + +The options for the quote. + +#### Type + +```ts +let options: Options; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to a non-finalized quote for the requested sell. --- # Client --- ## createThirdwebClient - Creates a Thirdweb client using the provided client ID (client-side) or secret key (server-side). +Creates a Thirdweb client using the provided client ID (client-side) or secret key (server-side). - Get your client ID and secret key from the Thirdweb dashboard [ here](https://thirdweb.com/create-api-key) . \*\*Never share your secret key with anyone. +Get your client ID and secret key from the Thirdweb dashboard [here](https://thirdweb.com/create-api-key). \*\*Never share your secret key with anyone. - A client is necessary for most functions in the thirdweb SDK. It provides access to thirdweb APIs including built-in RPC, storage, and more. +A client is necessary for most functions in the thirdweb SDK. It provides access to thirdweb APIs including built-in RPC, storage, and more. ### Example - Create a client on the client side (client ID): +Create a client on the client side (client ID): ```ts import { createThirdwebClient } from "thirdweb"; @@ -42987,7 +43859,7 @@ import { createThirdwebClient } from "thirdweb"; const client = createThirdwebClient({ clientId: "..." }); ``` - Create a client on the server (secret key): +Create a client on the server (secret key): ```ts import { createThirdwebClient } from "thirdweb"; @@ -43003,7 +43875,7 @@ function createThirdwebClient( ### Parameters - The options for creating the client. +The options for creating the client. #### Type @@ -43026,18 +43898,18 @@ let returnType: { } & Readonly; ``` - The created Thirdweb client. +The created Thirdweb client. --- # Wallets --- ## AccountAvatar - The component for showing the avatar of the account. If fetches all the social profiles linked to your wallet, including: Farcaster, ENS, Lens (more to be added) You can choose which social profile you want to display. Defaults to the first item in the list. +The component for showing the avatar of the account. If fetches all the social profiles linked to your wallet, including: Farcaster, ENS, Lens (more to be added) You can choose which social profile you want to display. Defaults to the first item in the list. ### Example -#### Basic usage +#### Basic usage ```tsx import { AccountProvider, AccountAvatar } from "thirdweb/react"; @@ -43047,13 +43919,13 @@ import { AccountProvider, AccountAvatar } from "thirdweb/react"; ; ``` - Result: An `` component, if the avatar is resolved successfully +Result: An `` component, if the avatar is resolved successfully ```html ``` -#### Show a loading sign when the avatar is being resolved +#### Show a loading sign when the avatar is being resolved ```tsx import { AccountProvider, AccountAvatar } from "thirdweb/react"; @@ -43063,7 +43935,7 @@ import { AccountProvider, AccountAvatar } from "thirdweb/react"; ; ``` -#### Fallback to something when the avatar fails to resolve +#### Fallback to something when the avatar fails to resolve ```tsx import { AccountProvider, AccountAvatar } from "thirdweb/react"; @@ -43073,9 +43945,9 @@ import { AccountProvider, AccountAvatar } from "thirdweb/react"; ; ``` -#### Select a social profile to display +#### Select a social profile to display - If you wallet associates with more than one social profiles (Lens, Farcaster, ENS, etc.) You can specify which service you want to prioritize using the `socialType` props +If you wallet associates with more than one social profiles (Lens, Farcaster, ENS, etc.) You can specify which service you want to prioritize using the `socialType` props ```tsx import { AccountProvider, AccountAvatar } from "thirdweb/react"; @@ -43088,9 +43960,9 @@ import { AccountProvider, AccountAvatar } from "thirdweb/react"; ; ``` -#### Custom ENS resolver chain +#### Custom ENS resolver chain - This component shares the same props with the ENS extension `resolveAvatar` +This component shares the same props with the ENS extension `resolveAvatar` ```tsx import { AccountProvider, AccountAvatar } from "thirdweb/react"; @@ -43101,9 +43973,9 @@ import { base } from "thirdweb/chains"; ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",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 : "eager" | "lazy",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -43134,16 +44006,16 @@ let __namedParameters: {about : string,accessKey : string,alt : string,aria-acti let returnType: null | Element; ``` - An `` if the avatar is resolved successfully +An `` if the avatar is resolved successfully --- ## AccountBalance - This component fetches and shows the balance of the wallet address on a given chain. It inherits all the attributes of a HTML `` component, hence you can style it just like how you would style a normal `` +This component fetches and shows the balance of the wallet address on a given chain. 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 +#### Basic usage ```tsx import { AccountProvider, AccountBalance } from "thirdweb/react"; @@ -43154,15 +44026,15 @@ import { ethereum } from "thirdweb/chains"; ; ``` - Result: +Result: ```html 1.091435 ETH ``` -#### Format the balance (round up, shorten etc.) +#### Format the balance (round up, shorten etc.) - The AccountBalance component accepts a `formatFn` which takes in an object of type `AccountBalanceInfo` and outputs a string The function is used to modify the display value of the wallet balance (either in crypto or fiat) +The AccountBalance component accepts a `formatFn` which takes in an object of type `AccountBalanceInfo` and outputs a string The function is used to modify the display value of the wallet balance (either in crypto or fiat) ```tsx import type { AccountBalanceInfo } from "thirdweb/react"; @@ -43173,13 +44045,13 @@ const format = (props: AccountInfoBalance):string => `${formatNumber(props.balan ``` - Result: +Result: ```html 1.1 eth // the balance is rounded up to 1 decimal and the symbol is lowercased ``` -#### Show a loading sign when the balance is being fetched +#### Show a loading sign when the balance is being fetched ```tsx import { AccountProvider, AccountBalance } from "thirdweb/react"; @@ -43189,7 +44061,7 @@ import { AccountProvider, AccountBalance } from "thirdweb/react"; ; ``` -#### Fallback to something when the balance fails to resolve +#### Fallback to something when the balance fails to resolve ```tsx @@ -43200,9 +44072,9 @@ import { AccountProvider, AccountBalance } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ,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",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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",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" | "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} ``` ### Returns @@ -43236,13 +44108,13 @@ let returnType: null | Element; ## AccountName - This component is used to display the name of the account. A "name" in this context is the username, or account of the social profiles that the wallet may have. In case a name is not found or failed to resolve, you can always fallback to displaying the wallet address instead by using the `fallbackComponent` prop. +This component is used to display the name of the account. A "name" in this context is the username, or account of the social profiles that the wallet may have. In case a name is not found or failed to resolve, you can always fallback to displaying the wallet address instead by using the `fallbackComponent` prop. - This component inherits all attribute of a native HTML `` element, so you can style it just like how you would style a `` . +This component inherits all attribute of a native HTML `` element, so you can style it just like how you would style a ``. ### Example -#### Basic usage +#### Basic usage ```tsx import { AccountProvider, AccountName } from "thirdweb/react"; @@ -43252,19 +44124,19 @@ import { AccountProvider, AccountName } from "thirdweb/react"; ; ``` -#### Show wallet address while social name is being loaded +#### Show wallet address while social name is being loaded ```tsx } />; ``` -#### Fallback to showing wallet address if fail to resolve social name +#### Fallback to showing wallet address if fail to resolve social name ```tsx } />; ``` -#### Transform the account name using `formatFn` prop +#### Transform the account name using `formatFn` prop ```tsx import { isAddress, shortenAddress } from "thirdweb/utils"; @@ -43276,9 +44148,9 @@ const formatName = (name: string) => name.toUpperCase(); return ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -43307,7 +44179,7 @@ let props: {about : string,accessKey : string,aria-activedescendant : string,ari let returnType: null | Element; ``` - A `` containing the name of the account +A `` containing the name of the account ```html {name} @@ -43316,11 +44188,11 @@ let returnType: null | Element; ## WalletIcon - This component tries to resolve the icon of a given wallet, then return an image. +This component tries to resolve the icon of a given wallet, then return an image. ### Example -#### Basic usage +#### Basic usage ```tsx import { WalletProvider, WalletIcon } from "thirdweb/react"; @@ -43330,27 +44202,27 @@ import { WalletProvider, WalletIcon } from "thirdweb/react"; ; ``` - Result: An `` component with the src of the icon +Result: An `` component with the src of the icon ```html ``` -#### Show a loading sign while the icon is being loaded +#### Show a loading sign while the icon is being loaded ```tsx } />; ``` -#### Fallback to a dummy image if the wallet icon fails to resolve +#### Fallback to a dummy image if the wallet icon fails to resolve ```tsx } />; ``` -#### Usage with queryOptions +#### Usage with queryOptions - WalletIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic +WalletIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic ```tsx ; @@ -43367,7 +44239,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" | "step" | "page" | "location" | "date",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" | "tree" | "listbox",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",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 : "eager" | "lazy",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -43376,12 +44248,12 @@ let __namedParameters: {about : string,accessKey : string,alt : string,aria-acti let returnType: null | Element; ``` - an `` with the src of the wallet icon +an `` with the src of the wallet icon --- ## deploySmartAccount - Deployes a smart account via a dummy transaction. +Deployes a smart account via a dummy transaction. If the account is already deployed, this will do nothing. ### Example @@ -43398,14 +44270,14 @@ const account = await deploySmartAccount({ ```ts function deploySmartAccount(args: { - accountContract: Readonly>; - chain: Readonly; + accountContract: Readonly; + chain: Readonly; client: ThirdwebClient; smartAccount: Account; }): Promise< | undefined | { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; @@ -43415,14 +44287,14 @@ function deploySmartAccount(args: { ### Parameters - Arguments for the deployment. +Arguments for the deployment. #### Type ```ts let args: { - accountContract: Readonly>; - chain: Readonly; + accountContract: Readonly; + chain: Readonly; client: ThirdwebClient; smartAccount: Account; }; @@ -43434,7 +44306,7 @@ let args: { let returnType: Promise< | undefined | { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; @@ -43445,7 +44317,7 @@ let returnType: Promise< ## getUser - Gets user based on the provided query parameters. This function is only available on the server (a secret key is required in the client). +Gets user based on the provided query parameters. This function is only available on the server (a secret key is required in the client). ### Example @@ -43467,12 +44339,12 @@ function getUser(options: { id?: string; phone?: string; walletAddress?: string; -}): Promise; +}): Promise; ``` ### Parameters - The options for the get user function. +The options for the get user function. #### Type @@ -43496,17 +44368,18 @@ let returnType: { email?: string; phone?: string; profiles: Array; + smartAccountAddress?: string; userId: string; walletAddress: string; }; ``` - A user object or null if not found. +A user object or null if not found. --- ## authenticate - Authenticates the user based on the provided authentication arguments. +Authenticates the user based on the provided authentication arguments. ### Example @@ -43521,7 +44394,7 @@ const result = await authenticate({ }); ``` - Authenticate to a backend account (only do this on your backend): +Authenticate to a backend account (only do this on your backend): ```ts import { authenticate } from "thirdweb/wallets/in-app"; @@ -43541,7 +44414,7 @@ function authenticate( ### Parameters - The authentication arguments. +The authentication arguments. #### Type @@ -43555,12 +44428,12 @@ let args: AuthArgsType; let returnType: Promise; ``` - A promise that resolves to the authentication result. +A promise that resolves to the authentication result. --- ## authenticateWithRedirect - Authenticates the user based on the provided authentication arguments using a redirect. +Authenticates the user based on the provided authentication arguments using a redirect. ### Example @@ -43586,7 +44459,7 @@ function authenticateWithRedirect( ### Parameters - The authentication arguments. +The authentication arguments. #### Type @@ -43603,29 +44476,29 @@ let args: SocialAuthArgsType & { let returnType: Promise; ``` - A promise that resolves to the authentication result. +A promise that resolves to the authentication result. --- ## createWallet - Creates a wallet based on the provided ID and arguments. +Creates a wallet based on the provided ID and arguments. * Supports 500+ wallets * Handles both injected browser wallets and WalletConnect sessions -[ View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) +[View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) ### Example -### Connecting the wallet +### Connecting the wallet - Once created, you can connect the wallet to your app by calling the `connect` method. +Once created, you can connect the wallet to your app by calling the `connect` method. - The `connect` method returns a promise that resolves to the connected account. +The `connect` method returns a promise that resolves to the connected account. - Each wallet type can have different connect options. [ View the different connect options](https://portal.thirdweb.com/references/typescript/v5/WalletConnectionOption) +Each wallet type can have different connect options. [View the different connect options](https://portal.thirdweb.com/references/typescript/v5/WalletConnectionOption) -### Connecting to an injected wallet +### Connecting to an injected wallet ```ts import { createWallet } from "thirdweb/wallets"; @@ -43637,9 +44510,9 @@ const account = await metamaskWallet.connect({ }); ``` - You can check if a wallet is installed by calling the [ injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider) method. +You can check if a wallet is installed by calling the [injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider) method. -### Connecting via WalletConnect modal +### Connecting via WalletConnect modal ```ts import { createWallet } from "thirdweb/wallets"; @@ -43661,9 +44534,9 @@ await metamask.connect({ }); ``` -[ View ConnectWallet connection options](https://portal.thirdweb.com/references/typescript/v5/WCConnectOptions) +[View ConnectWallet connection options](https://portal.thirdweb.com/references/typescript/v5/WCConnectOptions) -### Connecting with coinbase wallet +### Connecting with coinbase wallet ```ts import { createWallet } from "thirdweb/wallets"; @@ -43686,9 +44559,9 @@ const account = await cbWallet.connect({ }); ``` -[ View Coinbase wallet creation options](https://portal.thirdweb.com/references/typescript/v5/CoinbaseWalletCreationOptions) +[View Coinbase wallet creation options](https://portal.thirdweb.com/references/typescript/v5/CoinbaseWalletCreationOptions) -### Connecting with a smart wallet +### Connecting with a smart wallet ```ts import { createWallet } from "thirdweb/wallets"; @@ -43710,7 +44583,7 @@ function createWallet(...args: CreateWalletArgs): Wallet; ### Parameters - The arguments for creating the wallet. +The arguments for creating the wallet. #### Type @@ -43729,18 +44602,18 @@ let returnType: Wallet; ## createWalletAdapter - Creates a wallet from the given account. +Creates a wallet from the given account. - You can use this to: +You can use this to: * convert a third party library wallet (wagmi, viem, ethers) into a thirdweb wallet. * connect with a private key (for automated tests) - Available wallet adatpers: +Available wallet adatpers: -* [ Viem](https://portal.thirdweb.com/references/typescript/v5/viemAdapter) -* [ Ethers 6](https://portal.thirdweb.com/references/typescript/v5/ethers6Adapter) -* [ Ethers 5](https://portal.thirdweb.com/references/typescript/v5/ethers5Adapter) +* [Viem](https://portal.thirdweb.com/references/typescript/v5/viemAdapter) +* [Ethers 6](https://portal.thirdweb.com/references/typescript/v5/ethers6Adapter) +* [Ethers 5](https://portal.thirdweb.com/references/typescript/v5/ethers5Adapter) ### Example @@ -43768,7 +44641,7 @@ function createWalletAdapter( ### Parameters - The options for the adapter wallet. +The options for the adapter wallet. #### Type @@ -43788,12 +44661,12 @@ let options: { let returnType: Wallet<"adapter">; ``` - a wallet instance. +a wallet instance. --- ## createWalletConnectClient - Creates a new WalletConnect client for interacting with another application. +Creates a new WalletConnect client for interacting with another application. ### Example @@ -43806,7 +44679,7 @@ const client = await createWalletConnectClient({ }); ``` - Pass custom handlers: +Pass custom handlers: ```ts import { createWalletConnectClient } from "thirdweb/wallets"; @@ -43822,7 +44695,7 @@ const client = await createWalletConnectClient({ }); ``` - Pass connect and disconnect callbacks: +Pass connect and disconnect callbacks: ```ts import { createWalletConnectClient } from "thirdweb/wallets"; @@ -43889,12 +44762,12 @@ function createWalletConnectClient(options: { }) => Promise<`0x${string}`>; }; wallet: Wallet; -}): Promise; +}): Promise; ``` ### Parameters - The options to use to create the WalletConnect client. +The options to use to create the WalletConnect client. #### Type @@ -43954,15 +44827,15 @@ let options: { ### Returns ```ts -let returnType: Awaited>; +let returnType: Promise; ``` - The WalletConnect client. Use this client to connect to a WalletConnect URI with createWalletConnectSession. +The WalletConnect client. Use this client to connect to a WalletConnect URI with createWalletConnectSession. --- ## createWalletConnectSession - Initiates a new WalletConnect session for interacting with another application. +Initiates a new WalletConnect session for interacting with another application. ### Example @@ -43991,7 +44864,7 @@ function createWalletConnectSession( ### Parameters - The options to use to create the WalletConnect session. +The options to use to create the WalletConnect session. #### Type @@ -44008,7 +44881,7 @@ let returnType: void; ## disconnectWalletConnectSession - Disconnects a WalletConnect session. +Disconnects a WalletConnect session. ### Example @@ -44030,7 +44903,7 @@ function disconnectWalletConnectSession(options: { ### Parameters - The options to use to disconnect the WalletConnect session. +The options to use to disconnect the WalletConnect session. #### Type @@ -44050,17 +44923,17 @@ let returnType: Promise; ## ecosystemWallet - Creates an [ Ecosystem Wallet](https://portal.thirdweb.com/connect/wallet/overview) based on various authentication methods. Full list of available authentication methods [ here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure) . +Creates an [Ecosystem Wallet](https://portal.thirdweb.com/connect/wallet/overview) based on various authentication methods. Full list of available authentication methods [here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure). - Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods. +Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods. - Refer to [ inAppWallet](https://portal.thirdweb.com/typescript/v5/inAppWallet) for detailed usage examples. +Refer to [inAppWallet](https://portal.thirdweb.com/typescript/v5/inAppWallet) for detailed usage examples. ### Example -#### Logging into an ecosystem wallet +#### Logging into an ecosystem wallet - Below is the general code snippet needed to connect via a given auth strategy to an ecosystem wallet. For more variants on the various auth strategies, refer to [ inAppWallet](https://portal.thirdweb.com/typescript/v5/inAppWallet) . +Below is the general code snippet needed to connect via a given auth strategy to an ecosystem wallet. For more variants on the various auth strategies, refer to [inAppWallet](https://portal.thirdweb.com/typescript/v5/inAppWallet). ```ts import { ecosystemWallet } from "thirdweb/wallets"; @@ -44074,11 +44947,11 @@ const account = await wallet.connect({ }); ``` -[ View all connection options](https://portal.thirdweb.com/references/typescript/v5/EcosystemWalletConnectionOptions) . +[View all connection options](https://portal.thirdweb.com/references/typescript/v5/EcosystemWalletConnectionOptions). -#### Connect to a restricted ecosystem wallet with your designated partner ID +#### Connect to a restricted ecosystem wallet with your designated partner ID - The parnter ID will be provided to you by the ecosystem with which you're integrating. +The partner ID will be provided to you by the ecosystem with which you're integrating. ```ts import { ecosystemWallet } from "thirdweb/wallets"; @@ -44091,7 +44964,7 @@ const wallet = ecosystemWallet("ecosystem.hooli", { function ecosystemWallet( id: `ecosystem.${string}`, options: EcosystemWalletCreationOptions, -): Wallet; +): Wallet<`ecosystem.${string}`>; ``` ### Parameters @@ -44107,26 +44980,28 @@ let id: `ecosystem.${string}`; ```ts let options: { auth?: { + allowedSmsCountryCodes?: Array; defaultSmsCountryCode?: SupportedSmsCountry; mode?: "popup" | "redirect" | "window"; redirectUrl?: string; }; partnerId?: string; + storage?: AsyncStorage; }; ``` ### Returns ```ts -let returnType: Wallet; +let returnType: Wallet<`ecosystem.${string}`>; ``` - The created ecosystem wallet. +The created ecosystem wallet. --- ## getActiveWalletConnectSessions - Retrieves all active WalletConnect sessions. +Retrieves all active WalletConnect sessions. ### Example @@ -44148,12 +45023,12 @@ function getActiveWalletConnectSessions(): Promise< let returnType: { origin?: string; topic: string }; ``` - All active WalletConnect sessions. +All active WalletConnect sessions. --- ## getProfiles - Gets the linked profiles for the connected in-app or ecosystem wallet. +Gets the linked profiles for the connected in-app or ecosystem wallet. ### Example @@ -44169,7 +45044,7 @@ console.log(profiles[0].details.email); console.log(profiles[0].details.phone); ``` -#### Getting profiles for a ecosystem user +#### Getting profiles for a ecosystem user ```ts import { getProfiles } from "thirdweb/wallets/in-app"; @@ -44210,12 +45085,12 @@ let returnType: { }; ``` - An array of accounts user profiles linked to the connected wallet. +An array of accounts user profiles linked to the connected wallet. --- ## getUserEmail - Retrieves the authenticated user email for the active in-app wallet. +Retrieves the authenticated user email for the active in-app wallet. ### Example @@ -44234,7 +45109,7 @@ function getUserEmail( ### Parameters - The arguments for retrieving the authenticated user. +The arguments for retrieving the authenticated user. #### Type @@ -44248,12 +45123,12 @@ let options: { client: ThirdwebClient; ecosystem?: Ecosystem }; let returnType: Promise; ``` - The authenticated user email if logged in and wallet initialized, otherwise undefined. +The authenticated user email if logged in and wallet initialized, otherwise undefined. --- ## getUserPhoneNumber - Retrieves the authenticated user phone number for the active embedded wallet. +Retrieves the authenticated user phone number for the active embedded wallet. ### Example @@ -44272,7 +45147,7 @@ function getUserPhoneNumber( ### Parameters - The arguments for retrieving the authenticated user. +The arguments for retrieving the authenticated user. #### Type @@ -44286,18 +45161,18 @@ let options: { client: ThirdwebClient; ecosystem?: Ecosystem }; let returnType: Promise; ``` - The authenticated user phone number if authenticated with phone number, otherwise undefined. +The authenticated user phone number if authenticated with phone number, otherwise undefined. --- ## inAppWallet - Creates an app scoped wallet for users based on various authentication methods. Full list of available authentication methods [ here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure) . +Creates an app scoped wallet for users based on various authentication methods. Full list of available authentication methods [here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure). - Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods. +Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods. ### Example -#### Login with socials +#### Login with socials ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44307,21 +45182,27 @@ const wallet = inAppWallet(); const account = await wallet.connect({ client, chain, - strategy: "google", + strategy: "google", // or "apple", "facebook","discord", "github", "twitch", "x", "telegram", "line", "coinbase", etc }); ``` -[ View all available social auth methods](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure) +[View all available social auth methods](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure) + +#### Enable smart accounts and sponsor gas for your users: -#### Enable smart accounts and sponsor gas for your users: +With the `executionMode` option, you can enable smart accounts and sponsor gas for your users. + +_Using EIP-7702_ (recommended): + +On chains with EIP-7702 enabled, you can upgrade the inapp wallet to a smart account, keeping the same address and performance as the regular EOA. ```ts import { inAppWallet } from "thirdweb/wallets"; import { sepolia } from "thirdweb/chains"; const wallet = inAppWallet({ - smartAccount: { - chain: sepolia, + executionMode: { + mode: "EIP7702", sponsorGas: true, }, }); @@ -44333,7 +45214,27 @@ const account = await wallet.connect({ }); ``` -#### Login with email +_Using EIP-4337_: + +On chains without EIP-7702 enabled, you can still use smart accounts using EIP-4337, this will return a different address (the smart contract address) than the regular EOA. + +```ts +import { inAppWallet } from "thirdweb/wallets/in-app"; + +const wallet = inAppWallet({ + executionMode: { + mode: "EIP4337", + smartAccount: { + chain: sepolia, // chain required for EIP-4337 + sponsorGas: true, + }, + }, +}); +``` + +#### Login with email + +To login with email, you can use the `preAuthenticate` function to first send a verification code to the user's email, then login with the verification code. ```ts import { @@ -44360,23 +45261,9 @@ const account = await wallet.connect({ }); ``` -#### Login with SIWE +#### Login with phone number -```ts -import { inAppWallet, createWallet } from "thirdweb/wallets"; - -const rabby = createWallet("io.rabby"); -const inAppWallet = inAppWallet(); - -const account = await inAppWallet.connect({ - strategy: "wallet", - chain: mainnet, - wallet: rabby, - client: MY_CLIENT, -}); -``` - -#### Login with phone number +Similar to email, you can login with a phone number by first sending a verification code to the user's phone number, then login with the verification code. ```ts import { @@ -44403,7 +45290,27 @@ const account = await wallet.connect({ }); ``` -#### Login with passkey +#### Login with another wallet (SIWE) + +You can also login to the in-app wallet with another existing wallet by signing a standard Sign in with Ethereum (SIWE) message. + +```ts +import { inAppWallet, createWallet } from "thirdweb/wallets"; + +const rabby = createWallet("io.rabby"); +const inAppWallet = inAppWallet(); + +const account = await inAppWallet.connect({ + strategy: "wallet", + chain: mainnet, + wallet: rabby, + client: MY_CLIENT, +}); +``` + +#### Login with passkey + +You can also login with a passkey. This mode requires specifying whether it should create a new passkey, or sign in with an existing passkey. We recommend checking if the user has a passkey stored in their browser to automatically login with it. ```ts import { @@ -44422,7 +45329,11 @@ await wallet.connect({ }); ``` -#### Connect to a guest account +#### Connect to a guest account + +You can also connect to a guest account, this will create a new account for the user instantly and store it in the browser's local storage. + +You can later "upgrade" this account by linking another auth method, like email or phone for example. This will preserve the account's address and history. ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44435,7 +45346,11 @@ const account = await wallet.connect({ }); ``` -#### Connect to a backend account +#### Connect to a backend account + +For usage in backends, you can create wallets with the `backend` strategy and a stable walletSecret. + +Make sure to keep that walletSecret safe as it is the key to access that wallet, never expose it to the client. ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44445,13 +45360,13 @@ const wallet = inAppWallet(); const account = await wallet.connect({ client, strategy: "backend", - walletSecret: "...", // Provided by your app + walletSecret: "...", // Your own secret, keep it safe }); ``` -#### Connect with custom JWT (any OIDC provider) +#### Connect with custom JWT (any OIDC provider) - You can use any OIDC provider to authenticate your users. Make sure to configure it in your dashboard under in-app wallet settings. +You can use any OIDC provider to authenticate your users. Make sure to configure it in your dashboard under in-app wallet settings. ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44465,9 +45380,9 @@ const account = await wallet.connect({ }); ``` -#### Connect with custom endpoint +#### Connect with custom endpoint - You can also use your own endpoint to authenticate your users. Make sure to configure it in your dashboard under in-app wallet settings. +You can also use your own endpoint to authenticate your users. Make sure to configure it in your dashboard under in-app wallet settings. ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44481,12 +45396,16 @@ const account = await wallet.connect({ }); ``` -#### Specify a logo for your login page (Connect UI) +#### Specify a logo, icon and name for your login page (Connect UI) + +You can specify a logo, icon and name for your login page to customize how in-app wallets are displayed in the Connect UI components (ConnectButton and ConnectEmbed). ```ts import { inAppWallet } from "thirdweb/wallets"; const wallet = inAppWallet({ metadata: { + name: "My App", + icon: "https://example.com/icon.png", image: { src: "https://example.com/logo.png", alt: "My logo", @@ -44497,7 +45416,9 @@ const wallet = inAppWallet({ }); ``` -#### Hide the ability to export the private key within the Connect Modal UI +#### Hide the ability to export the private key within the Connect Modal UI + +By default, the Connect Modal will show a button to export the private key of the wallet. You can hide this button by setting the `hidePrivateKeyExport` option to `true`. ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44506,9 +45427,9 @@ const wallet = inAppWallet({ }); ``` -#### Open the Oauth window in the same tab +#### Open the Oauth window in the same tab - By default, the Oauth window will open in a popup window. You can change this behavior by setting the `auth.mode` option to `"redirect"` . +By default, the Oauth window will open in a popup window. You can change this behavior by setting the `auth.mode` option to `"redirect"`. ```ts import { inAppWallet } from "thirdweb/wallets"; @@ -44519,6 +45440,31 @@ const wallet = inAppWallet({ }); ``` +#### Override storage for the wallet state + +By default, wallet state is stored in the browser's local storage if in the browser, or in-memory storage if not in the browser. You can override this behavior by providing a custom storage object, useful for server side and CLI integrations. + +```ts +import { inAppWallet } from "thirdweb/wallets"; +import { AsyncStorage } from "thirdweb/storage"; + +const myStorage: AsyncStorage = { + getItem: async (key) => { + return customGet(`CUSTOM_STORAGE_KEY${key}`); + }, + setItem: async (key, value) => { + return customSet(`CUSTOM_STORAGE_KEY${key}`, value); + }, + removeItem: async (key) => { + return customRemove(`CUSTOM_STORAGE_KEY${key}`); + }, +}; + +const wallet = inAppWallet({ + storage: myStorage, +}); +``` + ```ts function inAppWallet( createOptions?: InAppWalletCreationOptions, @@ -44527,7 +45473,7 @@ function inAppWallet( ### Parameters - configuration options Refer to [ InAppWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/InAppWalletCreationOptions) to see the available options. +configuration options Refer to [InAppWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/InAppWalletCreationOptions) to see the available options. #### Type @@ -44535,23 +45481,28 @@ function inAppWallet( let createOptions: | { auth?: { + allowedSmsCountryCodes?: Array; defaultSmsCountryCode?: SupportedSmsCountry; mode?: "popup" | "redirect" | "window"; options: Array; passkeyDomain?: string; redirectUrl?: string; }; + executionMode?: ExecutionModeOptions; hidePrivateKeyExport?: boolean; metadata?: { + icon?: string; image?: { alt?: string; height?: number; src: string; width?: number; }; + name?: string; }; partnerId?: string; smartAccount?: SmartWalletOptions; + storage?: AsyncStorage; } | undefined; ``` @@ -44562,16 +45513,16 @@ let createOptions: let returnType: Wallet<"inApp">; ``` - The created in-app wallet. +The created in-app wallet. --- ## linkProfile - Connects a new profile (and new authentication method) to the current user. +Connects a new profile (and new authentication method) to the current user. - Requires a connected in-app or ecosystem account. +Requires a connected in-app or ecosystem account. - _When a profile is linked to the account, that profile can then be used to sign into the same account._ +_When a profile is linked to the account, that profile can then be used to sign into the same account._ ### Example @@ -44608,12 +45559,12 @@ let returnType: { }; ``` - A promise that resolves to the currently linked profiles when the connection is successful. +A promise that resolves to the currently linked profiles when the connection is successful. --- ## preAuthenticate - Pre-authenticates the user based on the provided authentication strategy. Use this function to send a verification code to the user's email or phone number. +Pre-authenticates the user based on the provided authentication strategy. Use this function to send a verification code to the user's email or phone number. ### Example @@ -44633,7 +45584,7 @@ function preAuthenticate(args: PreAuthArgsType): Promise; ### Parameters - The arguments required for pre-authentication. +The arguments required for pre-authentication. #### Type @@ -44647,12 +45598,12 @@ let args: PreAuthArgsType; let returnType: Promise; ``` - A promise that resolves to the pre-authentication result. +A promise that resolves to the pre-authentication result. --- ## privateKeyToAccount - Get an `Account` object from a private key. +Get an `Account` object from a private key. ### Example @@ -44673,7 +45624,7 @@ function privateKeyToAccount( ### Parameters - The options for `privateKeyToAccount`Refer to the type [PrivateKeyToAccountOptions](https://portal.thirdweb.com/references/typescript/v5/PrivateKeyToAccountOptions) +The options for `privateKeyToAccount`Refer to the type [PrivateKeyToAccountOptions](https://portal.thirdweb.com/references/typescript/v5/PrivateKeyToAccountOptions) #### Type @@ -44704,8 +45655,12 @@ let returnType: { ) => Promise; signMessage: ({ message, + originalMessage, + chainId, }: { + chainId?: number; message: SignableMessage; + originalMessage?: string; }) => Promise; signTransaction?: (tx: SerializableTransaction) => Promise; signTypedData: ( @@ -44715,14 +45670,14 @@ let returnType: { }; ``` - The `Account` object that represents the private key +The `Account` object that represents the private key --- ## smartWallet - Creates a ERC4337 smart wallet based on a admin account. +Creates a ERC4337 smart wallet based on a admin account. - Smart wallets are smart contract wallets that enable multiple benefits for users: +Smart wallets are smart contract wallets that enable multiple benefits for users: * Sponsor gas fees for transactions * Multiple owners @@ -44731,17 +45686,17 @@ let returnType: { * Predictable addresses * Programmable features -[ Learn more about account abstraction](https://portal.thirdweb.com/connect/account-abstraction/how-it-works) +[Learn more about account abstraction](https://portal.thirdweb.com/connect/account-abstraction/how-it-works) ### Example -### Connect to a smart wallet +### Connect to a smart wallet - To connect to a smart wallet, you need to provide an admin account as the `personalAccount` option. +To connect to a smart wallet, you need to provide an admin account as the `personalAccount` option. - Any wallet can be used as an admin account, including an in-app wallets. +Any wallet can be used as an admin account, including an in-app wallets. - The `sponsorGas` option is used to enable sponsored gas for transactions automatically. +The `sponsorGas` option is used to enable sponsored gas for transactions automatically. ```ts import { smartWallet, inAppWallet } from "thirdweb/wallets"; @@ -44774,9 +45729,9 @@ await sendTransaction({ }); ``` -### Using a custom account factory +### Using a custom account factory - You can pass a custom account factory to the `smartWallet` function to use a your own account factory. +You can pass a custom account factory to the `smartWallet` function to use a your own account factory. ```ts import { smartWallet } from "thirdweb/wallets"; @@ -44789,11 +45744,11 @@ const wallet = smartWallet({ }); ``` -### Using v0.7 Entrypoint +### Using v0.7 Entrypoint - Both v0.6 (default) and v0.7 ERC4337 Entrypoints are supported. To use the v0.7 Entrypoint, simply pass in a compatible account factory. +Both v0.6 (default) and v0.7 ERC4337 Entrypoints are supported. To use the v0.7 Entrypoint, simply pass in a compatible account factory. - You can use the predeployed `DEFAULT_ACCOUNT_FACTORY_V0_7` or deploy your own [ AccountFactory v0.7](https://thirdweb.com/thirdweb.eth/AccountFactory%5F0%5F7) . +You can use the predeployed `DEFAULT_ACCOUNT_FACTORY_V0_7` or deploy your own [AccountFactory v0.7](https://thirdweb.com/thirdweb.eth/AccountFactory%5F0%5F7). ```ts import { @@ -44809,9 +45764,9 @@ const wallet = smartWallet({ }); ``` -### Configuring the smart wallet +### Configuring the smart wallet - You can pass options to the `smartWallet` function to configure the smart wallet. +You can pass options to the `smartWallet` function to configure the smart wallet. ```ts import { smartWallet } from "thirdweb/wallets"; @@ -44833,7 +45788,7 @@ const wallet = smartWallet({ }); ``` - Refer to [ SmartWalletOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletOptions) for more details. +Refer to [SmartWalletOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletOptions) for more details. ```ts function smartWallet( @@ -44843,7 +45798,7 @@ function smartWallet( ### Parameters - The options for creating the wallet. Refer to [ SmartWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletCreationOptions) for more details. +The options for creating the wallet. Refer to [SmartWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletCreationOptions) for more details. #### Type @@ -44893,6 +45848,7 @@ let createOptions: Prettify< }) => Promise; tokenPaymaster?: TokenPaymasterConfig; }; + sessionKey?: { address: string; permissions: AccountPermissions }; } & ({ gasless: boolean } | { sponsorGas: boolean }) >; ``` @@ -44903,12 +45859,12 @@ let createOptions: Prettify< let returnType: Wallet<"smart">; ``` - The created smart wallet. +The created smart wallet. --- ## unlinkProfile - Disconnects an existing profile (authentication method) from the current user. Once disconnected, that profile can no longer be used to sign into the account. +Disconnects an existing profile (authentication method) from the current user. Once disconnected, that profile can no longer be used to sign into the account. ### Example @@ -44934,7 +45890,7 @@ function unlinkProfile(args: UnlinkParams): Promise>; ### Parameters - The object containing the profile that we want to unlink. +The object containing the profile that we want to unlink. #### Type @@ -44956,12 +45912,12 @@ let returnType: { }; ``` - A promise that resolves to the updated linked profiles. +A promise that resolves to the updated linked profiles. --- ## walletConnect - Creates a wallet that allows connecting to any wallet that supports the WalletConnect protocol. +Creates a wallet that allows connecting to any wallet that supports the WalletConnect protocol. ### Example @@ -44985,12 +45941,16 @@ function walletConnect(): Wallet<"walletConnect">; let returnType: Wallet<"walletConnect">; ``` - The created smart wallet. +The created smart wallet. --- ## engineAccount - Creates an account that uses your engine backend wallet for sending transactions and signing messages. +Deprecated + +This for v2 dedicated engine instances, for v3 and engine cloud use Engine.serverWallet() + +Creates an account that uses your engine backend wallet for sending transactions and signing messages. ### Example @@ -45022,7 +45982,7 @@ function engineAccount(options: EngineAccountOptions): Account; ### Parameters - The options for the engine account. +The options for the engine account. #### Type @@ -45031,6 +45991,11 @@ let options: { authToken: string; chain?: Chain; engineUrl: string; + overrides?: { + accountAddress?: string; + accountFactoryAddress?: string; + accountSalt?: string; + }; walletAddress: string; }; ``` @@ -45058,8 +46023,12 @@ let returnType: { ) => Promise; signMessage: ({ message, + originalMessage, + chainId, }: { + chainId?: number; message: SignableMessage; + originalMessage?: string; }) => Promise; signTransaction?: (tx: SerializableTransaction) => Promise; signTypedData: ( @@ -45069,14 +46038,14 @@ let returnType: { }; ``` - An account that uses your engine backend wallet. +An account that uses your engine backend wallet. --- -## erc7579 +## ERC7579.erc7579 - Config for a ERC7579 modular smart wallet. +Config for a ERC7579 modular smart wallet. - This configuration is in BETA, expect breaking changes. +This configuration is in BETA, expect breaking changes. ### Example @@ -45100,7 +46069,7 @@ function erc7579(options: ERC7579Config): SmartWalletOptions; ### Parameters - Optional overrides for the smart wallet. +Optional overrides for the smart wallet. #### Type @@ -45159,18 +46128,91 @@ let returnType: Prettify< }) => Promise; tokenPaymaster?: TokenPaymasterConfig; }; + sessionKey?: { address: string; permissions: AccountPermissions }; } & ({ gasless: boolean } | { sponsorGas: boolean }) >; ``` - The smart wallet options. +The smart wallet options. +--- +# Wallet Connection +--- + +## AutoConnect + +AutoConnect last connected wallet on page reload or revisit. Note: If you are using `ConnectButton` or `ConnectEmbed` components, You don't need to use this component as it is already included. + +This is useful if you are manually connecting the wallets using the [useConnect](https://portal.thirdweb.com/references/typescript/v5/useConnect) hook and want to auto connect the last connected wallets on page reload or revisit. + +You can also use the [useAutoConnect](https://portal.thirdweb.com/references/typescript/v5/useAutoConnect) hook to achieve the same result. + +To check if the wallet in in the process of auto connecting, you can use the [useIsAutoConnecting](https://portal.thirdweb.com/references/typescript/v5/useIsAutoConnecting) hook. + +### Example + +```tsx +import { AutoConnect } from "thirdweb/react"; +import { createWallet, inAppWallet } from "thirdweb/wallets"; + +// list of wallets that your app uses +const wallets = [ + inAppWallet(), + createWallet("io.metamask"), + createWallet("me.rainbow"), +]; + +function Example() { + return ( + + ); +} +``` + +```ts +function AutoConnect(props: AutoConnectProps): Element; +``` + +### Parameters + +Object of type `AutoConnectProps`. Refer to [AutoConnectProps](https://portal.thirdweb.com/references/typescript/v5/AutoConnectProps) + +#### Type + +```ts +let props: { + accountAbstraction?: SmartWalletOptions; + appMetadata?: AppMetadata; + chain?: Chain; + client: ThirdwebClient; + onConnect?: (wallet: Wallet) => void; + onTimeout?: () => void; + siweAuth?: { + doLogin: () => Promise; + isLoggedIn: boolean | undefined; + isLoggingIn: boolean | undefined; + requiresAuth: boolean; + }; + timeout?: number; + wallets?: Array; +}; +``` + +### Returns + +```ts +let returnType: Element; +``` --- # Wallet Utilities --- ## generateAccount - Generates a new account with a random private key. +Generates a new account with a random private key. ### Example @@ -45187,7 +46229,7 @@ function generateAccount( ### Parameters - The options for generating the account. +The options for generating the account. #### Type @@ -45218,8 +46260,12 @@ let returnType: { ) => Promise; signMessage: ({ message, + originalMessage, + chainId, }: { + chainId?: number; message: SignableMessage; + originalMessage?: string; }) => Promise; signTransaction?: (tx: SerializableTransaction) => Promise; signTypedData: ( @@ -45229,12 +46275,12 @@ let returnType: { }; ``` - A Thirdweb account. +A Thirdweb account. --- ## getWalletBalance - Retrieves the balance of a token or native currency for a given wallet. +Retrieves the balance of a token or native currency for a given wallet. ### Example @@ -45251,12 +46297,12 @@ const balance = await getWalletBalance({ ```ts function getWalletBalance( options: GetWalletBalanceOptions, -): Promise; +): Promise; ``` ### Parameters - The options for retrieving the token balance. +The options for retrieving the token balance. #### Type @@ -45272,15 +46318,23 @@ let options: { ### Returns ```ts -let returnType: Promise; +let returnType: { + chainId: number; + decimals: number; + displayValue: string; + name: string; + symbol: string; + tokenAddress: string; + value: bigint; +}; ``` - A promise that resolves to the token balance result. +A promise that resolves to the token balance result. --- ## injectedProvider - Get Injected Provider for given wallet by passing a wallet ID (rdns) using [ EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) Provider Discovery. +Get Injected Provider for given wallet by passing a wallet ID (rdns) using [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) Provider Discovery. ### Example @@ -45295,12 +46349,12 @@ if (metamaskProvider) { ``` ```ts -function injectedProvider(walletId: WalletId): Ethereum | undefined; +function injectedProvider(walletId: WalletId): undefined | Ethereum; ``` ### Parameters - The Wallet Id (rdns) to check. +The Wallet Id (rdns) to check. #### Type @@ -45319,15 +46373,15 @@ let walletId: ### Returns ```ts -let returnType: Ethereum | undefined; +let returnType: undefined | Ethereum; ``` - The details of the Injected Provider if it exists. `undefined` otherwise. +The details of the Injected Provider if it exists. `undefined` otherwise. --- ## getSocialIcon - Gets the icon URI for a given social authentication provider +Gets the icon URI for a given social authentication provider ### Example @@ -45339,6 +46393,7 @@ const appleIcon = getSocialIcon("apple"); ```ts function getSocialIcon( provider: + | ({} & string) | "google" | "apple" | "facebook" @@ -45356,19 +46411,19 @@ function getSocialIcon( | "email" | "phone" | "passkey" - | "wallet" - | ({} & string), + | "wallet", ): string; ``` ### Parameters - The authentication provider to get the icon for +The authentication provider to get the icon for #### Type ```ts let provider: + | ({} & string) | "google" | "apple" | "facebook" @@ -45386,8 +46441,7 @@ let provider: | "email" | "phone" | "passkey" - | "wallet" - | ({} & string); + | "wallet"; ``` ### Returns @@ -45396,23 +46450,24 @@ let provider: let returnType: string; ``` - A data URI containing the SVG icon for the provider, or a generic wallet icon if the provider is not recognized +A data URI containing the SVG icon for the provider, or a generic wallet icon if the provider is not recognized --- ## hasStoredPasskey - Returns whether this device has a stored passkey ready to be used for sign-in +Returns whether this device has a stored passkey ready to be used for sign-in ```ts function hasStoredPasskey( client: ThirdwebClient, ecosystemId?: `ecosystem.${string}`, + storage?: AsyncStorage, ): Promise; ``` ### Parameters - the thirdweb client +the thirdweb client #### Type @@ -45429,18 +46484,28 @@ let client: { let ecosystemId: `ecosystem.${string}`; ``` +#### Type + +```ts +let storage: { + getItem: (key: string) => Promise; + removeItem: (key: string) => Promise; + setItem: (key: string, value: string) => Promise; +}; +``` + ### Returns ```ts let returnType: Promise; ``` - whether the device has a stored passkey +whether the device has a stored passkey --- ## bundleUserOp - Bundle a user operation. +Bundle a user operation. ### Example @@ -45457,12 +46522,12 @@ const userOpHash = await bundleUserOp({ function bundleUserOp(args: { options: BundlerOptions; userOp: UserOperationV06 | UserOperationV07; -}): Promise; +}): Promise<`0x${string}`>; ``` ### Parameters - The options for bundling a user operation. +The options for bundling a user operation. #### Type @@ -45476,15 +46541,15 @@ let args: { ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - The bundle hash of the user operation. +The bundle hash of the user operation. --- ## createAndSignUserOp - Create and sign a user operation. +Create and sign a user operation. ### Example @@ -45503,6 +46568,7 @@ const userOp = await createAndSignUserOp({ function createAndSignUserOp(options: { adminAccount: Account; client: ThirdwebClient; + isDeployedOverride?: boolean; smartWalletOptions: SmartWalletOptions; transactions: Array; waitForDeployment?: boolean; @@ -45511,7 +46577,7 @@ function createAndSignUserOp(options: { ### Parameters - The options for creating and signing the user operation +The options for creating and signing the user operation #### Type @@ -45519,6 +46585,7 @@ function createAndSignUserOp(options: { let options: { adminAccount: Account; client: ThirdwebClient; + isDeployedOverride?: boolean; smartWalletOptions: SmartWalletOptions; transactions: Array; waitForDeployment?: boolean; @@ -45536,7 +46603,7 @@ let returnType: Promise; ## createUnsignedUserOp - Creates an unsigned user operation from a prepared transaction. +Creates an unsigned user operation from a prepared transaction. ### Example @@ -45557,154 +46624,46 @@ const userOp = await createUnsignedUserOp({ ```ts function createUnsignedUserOp(args: { - accountContract: Readonly>; + accountContract: Readonly; adminAddress: string; - factoryContract: Readonly>; + factoryContract: Readonly; + isDeployedOverride?: boolean; overrides?: { accountAddress?: string; accountSalt?: string; bundlerUrl?: string; createAccount?: ( - factoryContract: Readonly>, + factoryContract: Readonly, admin: string, ) => PreparedTransaction; entrypointAddress?: string; execute?: ( - accountContract: Readonly>, + accountContract: Readonly, transaction: SendTransactionOption, ) => PreparedTransaction; executeBatch?: ( - accountContract: Readonly>, + accountContract: Readonly, transactions: Array, ) => PreparedTransaction; - getAccountNonce?: ( - accountContract: Readonly>, - ) => Promise; + getAccountNonce?: (accountContract: Readonly) => Promise; paymaster?: ( userOp: UserOperationV06 | UserOperationV07, ) => Promise; predictAddress?: ( - factoryContract: Readonly>, + factoryContract: Readonly, admin: string, ) => Promise; signMessage?: (options: { - accountContract: Readonly>; + accountContract: Readonly; adminAccount: Account; - factoryContract: Readonly>; + factoryContract: Readonly; message: SignableMessage; }) => Promise<`0x${string}`>; signTypedData?: (options: { - accountContract: Readonly>; + accountContract: Readonly; adminAccount: Account; - factoryContract: Readonly>; - typedData: Definition< - typedData, - primaryType, - typedData extends { - address?: undefined; - bool?: undefined; - bytes?: undefined; - bytes1?: undefined; - bytes10?: undefined; - bytes11?: undefined; - bytes12?: undefined; - bytes13?: undefined; - bytes14?: undefined; - bytes15?: undefined; - bytes16?: undefined; - bytes17?: undefined; - bytes18?: undefined; - bytes19?: undefined; - bytes2?: undefined; - bytes20?: undefined; - bytes21?: undefined; - bytes22?: undefined; - bytes23?: undefined; - bytes24?: undefined; - bytes25?: undefined; - bytes26?: undefined; - bytes27?: undefined; - bytes28?: undefined; - bytes29?: undefined; - bytes3?: undefined; - bytes30?: undefined; - bytes31?: undefined; - bytes32?: undefined; - bytes4?: undefined; - bytes5?: undefined; - bytes6?: undefined; - bytes7?: undefined; - bytes8?: undefined; - bytes9?: undefined; - int104?: undefined; - int112?: undefined; - int120?: undefined; - int128?: undefined; - int136?: undefined; - int144?: undefined; - int152?: undefined; - int16?: undefined; - int160?: undefined; - int168?: undefined; - int176?: undefined; - int184?: undefined; - int192?: undefined; - int200?: undefined; - int208?: undefined; - int216?: undefined; - int224?: undefined; - int232?: undefined; - int24?: undefined; - int240?: undefined; - int248?: undefined; - int256?: undefined; - int32?: undefined; - int40?: undefined; - int48?: undefined; - int56?: undefined; - int64?: undefined; - int72?: undefined; - int8?: undefined; - int80?: undefined; - int88?: undefined; - int96?: undefined; - string?: undefined; - uint104?: undefined; - uint112?: undefined; - uint120?: undefined; - uint128?: undefined; - uint136?: undefined; - uint144?: undefined; - uint152?: undefined; - uint16?: undefined; - uint160?: undefined; - uint168?: undefined; - uint176?: undefined; - uint184?: undefined; - uint192?: undefined; - uint200?: undefined; - uint208?: undefined; - uint216?: undefined; - uint224?: undefined; - uint232?: undefined; - uint24?: undefined; - uint240?: undefined; - uint248?: undefined; - uint256?: undefined; - uint32?: undefined; - uint40?: undefined; - uint48?: undefined; - uint56?: undefined; - uint64?: undefined; - uint72?: undefined; - uint8?: undefined; - uint80?: undefined; - uint88?: undefined; - uint96?: undefined; - } - ? keyof typedData - : string - >; + factoryContract: Readonly; + typedData: Definition; }) => Promise<`0x${string}`>; tokenPaymaster?: TokenPaymasterConfig; }; @@ -45716,160 +46675,52 @@ function createUnsignedUserOp(args: { ### Parameters - The prepared transaction and options +The prepared transaction and options #### Type ```ts let args: { - accountContract: Readonly>; + accountContract: Readonly; adminAddress: string; - factoryContract: Readonly>; + factoryContract: Readonly; + isDeployedOverride?: boolean; overrides?: { accountAddress?: string; accountSalt?: string; bundlerUrl?: string; createAccount?: ( - factoryContract: Readonly>, + factoryContract: Readonly, admin: string, ) => PreparedTransaction; entrypointAddress?: string; execute?: ( - accountContract: Readonly>, + accountContract: Readonly, transaction: SendTransactionOption, ) => PreparedTransaction; executeBatch?: ( - accountContract: Readonly>, + accountContract: Readonly, transactions: Array, ) => PreparedTransaction; - getAccountNonce?: ( - accountContract: Readonly>, - ) => Promise; + getAccountNonce?: (accountContract: Readonly) => Promise; paymaster?: ( userOp: UserOperationV06 | UserOperationV07, ) => Promise; predictAddress?: ( - factoryContract: Readonly>, + factoryContract: Readonly, admin: string, ) => Promise; signMessage?: (options: { - accountContract: Readonly>; + accountContract: Readonly; adminAccount: Account; - factoryContract: Readonly>; + factoryContract: Readonly; message: SignableMessage; }) => Promise<`0x${string}`>; signTypedData?: (options: { - accountContract: Readonly>; + accountContract: Readonly; adminAccount: Account; - factoryContract: Readonly>; - typedData: Definition< - typedData, - primaryType, - typedData extends { - address?: undefined; - bool?: undefined; - bytes?: undefined; - bytes1?: undefined; - bytes10?: undefined; - bytes11?: undefined; - bytes12?: undefined; - bytes13?: undefined; - bytes14?: undefined; - bytes15?: undefined; - bytes16?: undefined; - bytes17?: undefined; - bytes18?: undefined; - bytes19?: undefined; - bytes2?: undefined; - bytes20?: undefined; - bytes21?: undefined; - bytes22?: undefined; - bytes23?: undefined; - bytes24?: undefined; - bytes25?: undefined; - bytes26?: undefined; - bytes27?: undefined; - bytes28?: undefined; - bytes29?: undefined; - bytes3?: undefined; - bytes30?: undefined; - bytes31?: undefined; - bytes32?: undefined; - bytes4?: undefined; - bytes5?: undefined; - bytes6?: undefined; - bytes7?: undefined; - bytes8?: undefined; - bytes9?: undefined; - int104?: undefined; - int112?: undefined; - int120?: undefined; - int128?: undefined; - int136?: undefined; - int144?: undefined; - int152?: undefined; - int16?: undefined; - int160?: undefined; - int168?: undefined; - int176?: undefined; - int184?: undefined; - int192?: undefined; - int200?: undefined; - int208?: undefined; - int216?: undefined; - int224?: undefined; - int232?: undefined; - int24?: undefined; - int240?: undefined; - int248?: undefined; - int256?: undefined; - int32?: undefined; - int40?: undefined; - int48?: undefined; - int56?: undefined; - int64?: undefined; - int72?: undefined; - int8?: undefined; - int80?: undefined; - int88?: undefined; - int96?: undefined; - string?: undefined; - uint104?: undefined; - uint112?: undefined; - uint120?: undefined; - uint128?: undefined; - uint136?: undefined; - uint144?: undefined; - uint152?: undefined; - uint16?: undefined; - uint160?: undefined; - uint168?: undefined; - uint176?: undefined; - uint184?: undefined; - uint192?: undefined; - uint200?: undefined; - uint208?: undefined; - uint216?: undefined; - uint224?: undefined; - uint232?: undefined; - uint24?: undefined; - uint240?: undefined; - uint248?: undefined; - uint256?: undefined; - uint32?: undefined; - uint40?: undefined; - uint48?: undefined; - uint56?: undefined; - uint64?: undefined; - uint72?: undefined; - uint8?: undefined; - uint80?: undefined; - uint88?: undefined; - uint96?: undefined; - } - ? keyof typedData - : string - >; + factoryContract: Readonly; + typedData: Definition; }) => Promise<`0x${string}`>; tokenPaymaster?: TokenPaymasterConfig; }; @@ -45890,7 +46741,7 @@ let returnType: Promise; ## estimateUserOpGas - Estimate the gas cost of a user operation. +Estimate the gas cost of a user operation. ### Example @@ -45915,7 +46766,7 @@ function estimateUserOpGas( ### Parameters - The options for estimating the gas cost of a user operation. +The options for estimating the gas cost of a user operation. #### Type @@ -45932,12 +46783,62 @@ let args: { let returnType: Promise; ``` - The estimated gas cost of the user operation. +The estimated gas cost of the user operation. +--- + +## estimateUserOpGasCost + +Estimate the gas cost of a user operation. + +### Example + +```ts +import { estimateUserOpGasCost } from "thirdweb/wallets/smart"; + +const gasCost = await estimateUserOpGasCost({ + transactions, + adminAccount, + client, + smartWalletOptions, +}); +``` + +```ts +function estimateUserOpGasCost(args: { + adminAccount: Account; + client: ThirdwebClient; + smartWalletOptions: SmartWalletOptions; + transactions: Array; +}): Promise<{ ether: string; wei: bigint }>; +``` + +### Parameters + +The options for estimating the gas cost of a user operation. + +#### Type + +```ts +let args: { + adminAccount: Account; + client: ThirdwebClient; + smartWalletOptions: SmartWalletOptions; + transactions: Array; +}; +``` + +### Returns + +```ts +let returnType: Promise<{ ether: string; wei: bigint }>; +``` + +The estimated gas cost of the user operation. --- ## getPaymasterAndData - Get paymaster and data details for a user operation. +Get paymaster and data details for a user operation. ### Example @@ -45955,7 +46856,7 @@ const paymasterAndData = await getPaymasterAndData({ ```ts function getPaymasterAndData(args: { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; entrypointAddress?: string; paymasterOverride?: ( @@ -45967,13 +46868,13 @@ function getPaymasterAndData(args: { ### Parameters - The userOp and options +The userOp and options #### Type ```ts let args: { - chain: Readonly; + chain: Readonly; client: ThirdwebClient; entrypointAddress?: string; paymasterOverride?: ( @@ -46006,7 +46907,7 @@ let returnType: { ## getUserOpGasFees - Get the gas fees of a user operation. +Get the gas fees of a user operation. ### Example @@ -46026,7 +46927,7 @@ function getUserOpGasFees(args: { ### Parameters - The options for getting the gas price of a user operation. +The options for getting the gas price of a user operation. #### Type @@ -46040,12 +46941,62 @@ let args: { options: BundlerOptions }; let returnType: Promise; ``` - The gas price of the user operation. +The gas price of the user operation. +--- + +## getUserOpHash + +Get the hash of a user operation. + +### Example + +```ts +import { getUserOpHash } from "thirdweb/wallets/smart"; + +const userOp = await createUnsignedUserOp(...); +const userOpHash = await getUserOpHash({ + client, + userOp, + chain, +}); +``` + +```ts +function getUserOpHash(args: { + chain: Readonly; + client: ThirdwebClient; + entrypointAddress?: string; + userOp: UserOperationV06 | UserOperationV07; +}): Promise<`0x${string}`>; +``` + +### Parameters + +The options for getting the user operation hash + +#### Type + +```ts +let args: { + chain: Readonly; + client: ThirdwebClient; + entrypointAddress?: string; + userOp: UserOperationV06 | UserOperationV07; +}; +``` + +### Returns + +```ts +let returnType: Promise<`0x${string}`>; +``` + +* The user operation hash --- ## getUserOpReceipt - Get the receipt of a user operation. +Get the receipt of a user operation. ### Example @@ -46062,12 +47013,12 @@ const receipt = await getUserOpReceipt({ ```ts function getUserOpReceipt( args: BundlerOptions & { userOpHash: `0x${string}` }, -): Promise; +): Promise; ``` ### Parameters - The options for getting the receipt of a user operation. +The options for getting the receipt of a user operation. #### Type @@ -46099,12 +47050,12 @@ let returnType: { }; ``` - The receipt of the user operation. +The receipt of the user operation. --- ## getUserOpReceiptRaw - Get the receipt of a user operation. +Get the receipt of a user operation. ### Example @@ -46121,12 +47072,12 @@ const receipt = await getUserOpReceiptRaw({ ```ts function getUserOpReceiptRaw( args: BundlerOptions & { userOpHash: `0x${string}` }, -): Promise; +): Promise; ``` ### Parameters - The options for getting the receipt of a user operation. +The options for getting the receipt of a user operation. #### Type @@ -46137,19 +47088,19 @@ let args: BundlerOptions & { userOpHash: `0x${string}` }; ### Returns ```ts -let returnType: Promise; +let returnType: Promise; ``` - The raw receipt of the user operation. +The raw receipt of the user operation. --- ## predictAddress Deprecated - Use `predictSmartAccountAddress` instead. +Use `predictSmartAccountAddress` instead. - Predict the address of a smart account. +Predict the address of a smart account. ### Example @@ -46168,9 +47119,9 @@ function predictAddress(args: { accountAddress?: string; accountSalt?: string; adminAddress: string; - factoryContract: Readonly>; + factoryContract: Readonly; predictAddressOverride?: ( - factoryContract: Readonly>, + factoryContract: Readonly, admin: string, ) => Promise; }): Promise; @@ -46178,7 +47129,7 @@ function predictAddress(args: { ### Parameters - The options for predicting the address of a smart account. +The options for predicting the address of a smart account. #### Type @@ -46187,9 +47138,9 @@ let args: { accountAddress?: string; accountSalt?: string; adminAddress: string; - factoryContract: Readonly>; + factoryContract: Readonly; predictAddressOverride?: ( - factoryContract: Readonly>, + factoryContract: Readonly, admin: string, ) => Promise; }; @@ -46201,12 +47152,12 @@ let args: { let returnType: Promise; ``` - The predicted address of the smart account. +The predicted address of the smart account. --- ## predictSmartAccountAddress - Predict the address of a smart account. +Predict the address of a smart account. ### Example @@ -46224,7 +47175,7 @@ const predictedAddress = await predictSmartAccountAddress({ function predictSmartAccountAddress(args: { accountSalt?: string; adminAddress: string; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; factoryAddress?: string; }): Promise; @@ -46232,7 +47183,7 @@ function predictSmartAccountAddress(args: { ### Parameters - The options for predicting the address of a smart account. +The options for predicting the address of a smart account. #### Type @@ -46240,7 +47191,7 @@ function predictSmartAccountAddress(args: { let args: { accountSalt?: string; adminAddress: string; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; factoryAddress?: string; }; @@ -46252,12 +47203,68 @@ let args: { let returnType: Promise; ``` - The predicted address of the smart account. +The predicted address of the smart account. +--- + +## prepareUserOp + +Prepare a user operation for signing. + +### Example + +```ts +import { prepareUserOp } from "thirdweb/wallets/smart"; + +const userOp = await prepareUserOp({ + transactions, + adminAccount, + client, + smartWalletOptions, +}); +``` + +You can then sign the user operation with signUserOp(). and send it to the bundler with bundlerUserOp(). + +```ts +function prepareUserOp(options: { + adminAccount: Account; + client: ThirdwebClient; + isDeployedOverride?: boolean; + smartWalletOptions: SmartWalletOptions; + transactions: Array; + waitForDeployment?: boolean; +}): Promise; +``` + +### Parameters + +The options for preparing the user operation + +#### Type + +```ts +let options: { + adminAccount: Account; + client: ThirdwebClient; + isDeployedOverride?: boolean; + smartWalletOptions: SmartWalletOptions; + transactions: Array; + waitForDeployment?: boolean; +}; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +* The prepared user operation --- ## signUserOp - Sign a user operation. +Sign a user operation. ### Example @@ -46277,7 +47284,7 @@ const signedUserOp = await signUserOp({ ```ts function signUserOp(args: { adminAccount: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; entrypointAddress?: string; userOp: UserOperationV06 | UserOperationV07; @@ -46291,7 +47298,7 @@ function signUserOp(args: { ```ts let args: { adminAccount: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; entrypointAddress?: string; userOp: UserOperationV06 | UserOperationV07; @@ -46309,7 +47316,7 @@ let returnType: Promise; ## waitForUserOpReceipt - Wait for the user operation to be mined. +Wait for the user operation to be mined. ### Example @@ -46335,7 +47342,7 @@ function waitForUserOpReceipt( ### Parameters - The options and user operation hash +The options and user operation hash #### Type @@ -46378,17 +47385,17 @@ let returnType: { ## defineChain - Defines a chain with the given options. +Defines a chain with the given options. ### Example - Just pass the chain ID to connect to: +Just pass the chain ID to connect to: ```ts const chain = defineChain(1); ``` - Or pass your own RPC or custom values: +Or pass your own RPC or custom values: ```ts const chain = defineChain({ @@ -46404,32 +47411,32 @@ const chain = defineChain({ ```ts function defineChain( - options: number | ChainOptions | LegacyChain | Chain, -): Chain; + options: number | Chain | ChainOptions | LegacyChain, +): Readonly; ``` ### Parameters - The options for the chain. +The options for the chain. #### Type ```ts -let options: number | ChainOptions | LegacyChain | Chain; +let options: number | Chain | ChainOptions | LegacyChain; ``` ### Returns ```ts -let returnType: Readonly; +let returnType: Readonly; ``` - The defined chain. +The defined chain. --- ## getChainMetadata - Retrieves chain data for a given chain. +Retrieves chain data for a given chain. ### Example @@ -46440,19 +47447,17 @@ console.log(chainData); ``` ```ts -function getChainMetadata( - chain: Readonly, -): Promise; +function getChainMetadata(chain: Readonly): Promise; ``` ### Parameters - The chain object containing the chain ID. +The chain object containing the chain ID. #### Type ```ts -let chain: Readonly; +let chain: Readonly; ``` ### Returns @@ -46461,12 +47466,12 @@ let chain: Readonly; let returnType: { chain: string; chainId: number; ens?: { registry: string }; explorers?: Readonly>; faucets?: readonly Array; features?: Readonly>; icon?: Icon; infoURL?: string; name: string; nativeCurrency: { decimals: number; name: string; symbol: string }; networkId?: number; parent?: { bridges?: Readonly>; chain: string; type: string }; redFlags?: readonly Array; rpc: readonly Array; shortName: string; slip44?: number; slug: string; stackType: string; status?: string; testnet: boolean; title?: string } ``` - A Promise that resolves to the chain data. +A Promise that resolves to the chain data. --- ## getRpcUrlForChain - Retrieves the RPC URL for the specified chain. If a custom RPC URL is defined in the options, it will be used. Otherwise, a thirdweb RPC URL will be constructed using the chain ID and client ID. +Retrieves the RPC URL for the specified chain. If a custom RPC URL is defined in the options, it will be used. Otherwise, a thirdweb RPC URL will be constructed using the chain ID and client ID. ### Example @@ -46482,7 +47487,7 @@ function getRpcUrlForChain(options: GetRpcUrlForChainOptions): string; ### Parameters - The options object containing the chain and client information. +The options object containing the chain and client information. #### Type @@ -46496,16 +47501,16 @@ let options: GetRpcUrlForChainOptions; let returnType: string; ``` - The RPC URL for the specified chain. +The RPC URL for the specified chain. --- ## ChainIcon - This component tries to resolve the icon of a given chain, then return an image. +This component tries to resolve the icon of a given chain, then return an image. ### Example -#### Basic usage +#### Basic usage ```tsx import { ChainProvider, ChainIcon } from "thirdweb/react"; @@ -46515,21 +47520,21 @@ import { ChainProvider, ChainIcon } from "thirdweb/react"; ; ``` - Result: An `` component with the src of the icon +Result: An `` component with the src of the icon ```html ``` -#### Override the icon with the `iconResolver` prop +#### Override the icon with the `iconResolver` prop - If you already have the icon url, you can skip the network requests and pass it directly to the ChainIcon +If you already have the icon url, you can skip the network requests and pass it directly to the ChainIcon ```tsx ; ``` - You can also pass in your own custom (async) function that retrieves the icon url +You can also pass in your own custom (async) function that retrieves the icon url ```tsx const getIcon = async () => { @@ -46540,21 +47545,21 @@ const getIcon = async () => { ; ``` -#### Show a loading sign while the icon is being loaded +#### Show a loading sign while the icon is being loaded ```tsx } />; ``` -#### Fallback to a dummy image if the chain icon fails to resolve +#### Fallback to a dummy image if the chain icon fails to resolve ```tsx } />; ``` -#### Usage with queryOptions +#### Usage with queryOptions - ChainIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic +ChainIcon uses useQuery() from tanstack query internally. It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic ```tsx ; @@ -46569,7 +47574,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" | "step" | "page" | "location" | "date",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" | "tree" | "listbox",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",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 : "eager" | "lazy",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -46578,16 +47583,16 @@ let __namedParameters: {about : string,accessKey : string,alt : string,aria-acti let returnType: null | Element; ``` - an `` with the src of the chain icon +an `` with the src of the chain icon --- ## ChainName - This component fetches then shows the name of a chain. It inherits all the attributes of a HTML `` component, hence you can style it just like how you would style a normal `` +This component fetches then shows the name of a chain. 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 +#### Basic usage ```tsx import { ChainProvider, ChainName } from "thirdweb/react"; @@ -46598,15 +47603,15 @@ import { ethereum } from "thirdweb/chains"; ; ``` - Result: +Result: ```html Ethereum Mainnet ``` -#### Custom name resolver +#### Custom name resolver - By default ChainName will call the thirdweb API to retrieve the chain name. However if you have a different way to fetch the name, you can pass the function to the `nameResolver` prop. Note: nameResolver should either be a string or a function (async) that returns a string. +By default ChainName will call the thirdweb API to retrieve the chain name. However if you have a different way to fetch the name, you can pass the function to the `nameResolver` prop. Note: nameResolver should either be a string or a function (async) that returns a string. ```tsx async function fetchNameMethod() { @@ -46617,15 +47622,15 @@ async function fetchNameMethod() { ; ``` - Alternatively you can also pass in a string directly: +Alternatively you can also pass in a string directly: ```tsx ; ``` -#### Format the name (capitalize, truncate, etc.) +#### Format the name (capitalize, truncate, etc.) - The ChainName component accepts a `formatFn` which takes in a string and outputs a string The function is used to modify the name of the chain +The ChainName component accepts a `formatFn` which takes in a string and outputs a string The function is used to modify the name of the chain ```tsx const concatStr = (str: string):string => str + "Network" @@ -46635,13 +47640,13 @@ const concatStr = (str: string):string => str + "Network" ``` - Result: +Result: ```html Ethereum Mainnet Network ``` -#### Show a loading sign when the name is being fetched +#### Show a loading sign when the name is being fetched ```tsx import { ChainProvider, ChainName } from "thirdweb/react"; @@ -46651,7 +47656,7 @@ import { ChainProvider, ChainName } from "thirdweb/react"; ; ``` -#### Fallback to something when the name fails to resolve +#### Fallback to something when the name fails to resolve ```tsx @@ -46659,9 +47664,9 @@ import { ChainProvider, ChainName } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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 @@ -46693,12 +47698,10 @@ let returnType: null | Element; ## isZkSyncChain - Checks whether the given chain is part of the zksync stack +Checks whether the given chain is part of the zksync stack ```ts -function isZkSyncChain( - chain: Readonly, -): Promise; +function isZkSyncChain(chain: Readonly): Promise; ``` ### Parameters @@ -46706,7 +47709,7 @@ function isZkSyncChain( #### Type ```ts -let chain: Readonly; +let chain: Readonly; ``` ### Returns @@ -46720,7 +47723,7 @@ let returnType: Promise; ## checkVerificationStatus - Checks the verification status of a contract. +Checks the verification status of a contract. ### Example @@ -46742,7 +47745,7 @@ function checkVerificationStatus( ### Parameters - The options for checking the verification status. +The options for checking the verification status. #### Type @@ -46756,12 +47759,12 @@ let options: CheckVerificationStatusOptions; let returnType: Promise; ``` - A promise that resolves with the verification status data. +A promise that resolves with the verification status data. --- ## fetchPublishedContract - Fetches the published contract based on the provided options. +Fetches the published contract based on the provided options. ### Example @@ -46788,7 +47791,7 @@ function fetchPublishedContract( ### Parameters - The options for fetching the published contract. +The options for fetching the published contract. #### Type @@ -46808,12 +47811,12 @@ let returnType: Promise<{ }>; ``` - The published contract. +The published contract. --- ## getBytecode - Retrieves the bytecode of a contract. +Retrieves the bytecode of a contract. ### Example @@ -46823,33 +47826,31 @@ const bytecode = await getBytecode(contract); ``` ```ts -function getBytecode( - contract: Readonly>, -): Promise; +function getBytecode(contract: Readonly): Promise<`0x${string}`>; ``` ### Parameters - The ThirdwebContract instance. +The ThirdwebContract instance. #### Type ```ts -let contract: Readonly>; +let contract: Readonly; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - A Promise that resolves to the bytecode of the contract. +A Promise that resolves to the bytecode of the contract. --- ## getCompilerMetadata - Down the compiled metadata from thirdweb contract api and format it +Down the compiled metadata from thirdweb contract api and format it ### Example @@ -46866,7 +47867,7 @@ const metadata = await getCompilerMetadata(contract); ```ts function getCompilerMetadata( - contract: Readonly>, + contract: Readonly, ): Promise; ``` @@ -46875,7 +47876,7 @@ function getCompilerMetadata( #### Type ```ts -let contract: Readonly>; +let contract: Readonly; ``` ### Returns @@ -46884,12 +47885,12 @@ let contract: Readonly>; let returnType: Promise; ``` - The compiler metadata for the contract +The compiler metadata for the contract --- ## getContract - Creates a Thirdweb contract by combining the Thirdweb client and contract options. +Creates a Thirdweb contract by combining the Thirdweb client and contract options. ### Example @@ -46909,32 +47910,32 @@ const contract = getContract({ ```ts function getContract( - options: ContractOptions, -): ThirdwebContract; + options: ContractOptions, +): Readonly>; ``` ### Parameters - The options for creating the contract. +The options for creating the contract. #### Type ```ts -let options: ContractOptions; +let options: ContractOptions; ``` ### Returns ```ts -let returnType: ThirdwebContract; +let returnType: Readonly>; ``` - The Thirdweb contract. +The Thirdweb contract. --- ## prepareMethod - Prepares a method for usage by converting it into a prepared method object. +Prepares a method for usage by converting it into a prepared method object. ### Example @@ -46950,7 +47951,7 @@ function prepareMethod(method: TMethod): PreparedMethod; ### Parameters - The method to prepare. +The method to prepare. #### Type @@ -46964,12 +47965,12 @@ let method: TMethod; let returnType: PreparedMethod; ``` - The prepared method object. +The prepared method object. --- ## resolveAbiFromBytecode - Resolves the ABI (Application Binary Interface) from the bytecode of a contract. +Resolves the ABI (Application Binary Interface) from the bytecode of a contract. ### Example @@ -46988,18 +47989,18 @@ const abi = await resolveAbiFromBytecode(myContract); ```ts function resolveAbiFromBytecode( - contract: Readonly>, + contract: Readonly>, ): Promise; ``` ### Parameters - The ThirdwebContract instance. +The ThirdwebContract instance. #### Type ```ts -let contract: Readonly>; +let contract: Readonly>; ``` ### Returns @@ -47008,12 +48009,12 @@ let contract: Readonly>; let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)> ``` - The resolved ABI as a generic type. +The resolved ABI as a generic type. --- ## resolveAbiFromContractApi - Resolves the ABI (Application Binary Interface) for a contract from the contract API. +Resolves the ABI (Application Binary Interface) for a contract from the contract API. ### Example @@ -47032,22 +48033,22 @@ const abi = await resolveAbiFromContractApi(myContract); ```ts function resolveAbiFromContractApi( - contract: Readonly>, + contract: Readonly>, contractApiBaseUrl: string, ): Promise; ``` ### Parameters - The ThirdwebContract instance representing the contract. +The ThirdwebContract instance representing the contract. #### Type ```ts -let contract: Readonly>; +let contract: Readonly>; ``` - The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi". +The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi". #### Type @@ -47061,12 +48062,12 @@ let contractApiBaseUrl: string; let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)> ``` - A promise that resolves to the ABI of the contract. +A promise that resolves to the ABI of the contract. --- ## resolveCompositeAbi - Resolves the ABI for a contract based on its bytecode. If the contract follows the plugin-pattern or dynamic pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the base router pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the diamond pattern, it resolves the ABIs for the facets and merges them with the root ABI. +Resolves the ABI for a contract based on its bytecode. If the contract follows the plugin-pattern or dynamic pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the base router pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the diamond pattern, it resolves the ABIs for the facets and merges them with the root ABI. ### Example @@ -47085,25 +48086,23 @@ const abi = await resolveCompositeAbiFromBytecode(myContract); ```ts function resolveCompositeAbi( - contract: Readonly>, + contract: Readonly, rootAbi?: Abi, - resolveSubAbi?: ( - contract: Readonly>, - ) => Promise, + resolveSubAbi?: (contract: Readonly) => Promise, ): Promise; ``` ### Parameters - The contract for which to resolve the ABI. +The contract for which to resolve the ABI. #### Type ```ts -let contract: Readonly>; +let contract: Readonly; ``` - The root ABI to use for the contract. If not provided, it resolves the ABI from the contract's bytecode. +The root ABI to use for the contract. If not provided, it resolves the ABI from the contract's bytecode. #### Type @@ -47111,14 +48110,12 @@ let contract: Readonly>; let rootAbi: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)> ``` - A function to resolve the ABI for a sub-contract. If not provided, it uses the default ABI resolution logic. +A function to resolve the ABI for a sub-contract. If not provided, it uses the default ABI resolution logic. #### Type ```ts -let resolveSubAbi: ( - contract: Readonly>, -) => Promise; +let resolveSubAbi: (contract: Readonly) => Promise; ``` ### Returns @@ -47127,12 +48124,12 @@ let resolveSubAbi: ( let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)> ``` - The resolved ABI for the contract. +The resolved ABI for the contract. --- ## resolveContractAbi - Resolves the ABI (Application Binary Interface) for a given contract. If the ABI is already cached, it returns the cached value. Otherwise, it tries to resolve the ABI from the contract's API. If that fails, it resolves the ABI from the contract's bytecode. +Resolves the ABI (Application Binary Interface) for a given contract. If the ABI is already cached, it returns the cached value. Otherwise, it tries to resolve the ABI from the contract's API. If that fails, it resolves the ABI from the contract's bytecode. ### Example @@ -47151,22 +48148,22 @@ const abi = await resolveContractAbi(myContract); ```ts function resolveContractAbi( - contract: Readonly>, + contract: Readonly>, contractApiBaseUrl: string, ): Promise; ``` ### Parameters - The contract for which to resolve the ABI. +The contract for which to resolve the ABI. #### Type ```ts -let contract: Readonly>; +let contract: Readonly>; ``` - The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi". +The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi". #### Type @@ -47180,12 +48177,12 @@ let contractApiBaseUrl: string; let returnType: Promise; ``` - A promise that resolves to the ABI of the contract. +A promise that resolves to the ABI of the contract. --- ## verifyContract - Verifies a contract by performing the following steps: +Verifies a contract by performing the following steps: * Resolves the implementation of the contract. * Extracts the IPFS URI from the contract bytecode. @@ -47218,7 +48215,7 @@ function verifyContract( ### Parameters - The options for contract verification. +The options for contract verification. #### Type @@ -47232,20 +48229,20 @@ let options: VerifyContractOptions; let returnType: Promise>; ``` - A promise that resolves to the verification result. +A promise that resolves to the verification result. --- ## getInitializeTransaction - Prepares the initialization transaction for a contract deployment +Prepares the initialization transaction for a contract deployment ```ts function getInitializeTransaction(options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; deployMetadata: FetchDeployMetadataResult; - implementationContract: Readonly>; + implementationContract: Readonly; initializeParams?: Record; modules?: Array<{ deployMetadata: FetchDeployMetadataResult; @@ -47258,17 +48255,17 @@ function getInitializeTransaction(options: { ### Parameters - The options for generating the initialize transaction +The options for generating the initialize transaction #### Type ```ts let options: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; deployMetadata: FetchDeployMetadataResult; - implementationContract: Readonly>; + implementationContract: Readonly; initializeParams?: Record; modules?: Array<{ deployMetadata: FetchDeployMetadataResult; @@ -47286,18 +48283,18 @@ let returnType: Readonly & { }; ``` - The prepared transaction for contract initialization +The prepared transaction for contract initialization --- ## getOrDeployInfraForPublishedContract - Gets or deploys the infrastructure contracts needed for a published contract deployment +Gets or deploys the infrastructure contracts needed for a published contract deployment ```ts function getOrDeployInfraForPublishedContract( args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; } & { constructorParams?: Record; @@ -47306,21 +48303,21 @@ function getOrDeployInfraForPublishedContract( version?: string; }, ): Promise<{ - cloneFactoryContract: ThirdwebContract; - implementationContract: ThirdwebContract; + cloneFactoryContract: Readonly; + implementationContract: Readonly; }>; ``` ### Parameters - The arguments object +The arguments object #### Type ```ts let args: { account: Account; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; } & { constructorParams?: Record; @@ -47333,10 +48330,13 @@ let args: { ### Returns ```ts -let returnType: Readonly>; +let returnType: Promise<{ + cloneFactoryContract: Readonly; + implementationContract: Readonly; +}>; ``` - An object containing: +An object containing: * cloneFactoryContract: The factory contract used for creating clones * implementationContract: The deployed implementation contract @@ -47344,48 +48344,174 @@ let returnType: Readonly>; ## getContractEvents - Retrieves events from a contract based on the provided options. +Get contract events ### Example ```ts -import { getContractEvents } from "thirdweb"; -const events = await getContractEvents({ - contract: myContract, - fromBlock: 123456n, - toBlock: 123456n, - events: [preparedEvent, preparedEvent2], +import { Insight } from "thirdweb"; + +const events = await Insight.getContractEvents({ + client, + chains: [sepolia], + contractAddress: "0x1234567890123456789012345678901234567890", + event: transferEvent(), + decodeLogs: true, }); ``` ```ts -function getContractEvents( - options: GetContractEventsOptions, -): Promise>; +function getContractEvents(options: { + chains: Array>; + client: ThirdwebClient; + contractAddress: string; + decodeLogs?: boolean; + event?: PreparedEvent; + queryOptions?: Omit< + | undefined + | { + aggregate?: unknown; + chain?: unknown; + decode?: null | boolean; + filter_block_hash?: string; + filter_block_number?: null | number; + filter_block_number_gt?: null | number; + filter_block_number_gte?: null | number; + filter_block_number_lt?: null | number; + filter_block_number_lte?: null | number; + filter_block_timestamp?: null | number; + filter_block_timestamp_gt?: null | number; + filter_block_timestamp_gte?: null | number; + filter_block_timestamp_lt?: null | number; + filter_block_timestamp_lte?: null | number; + filter_log_index?: null | number; + filter_log_index_gt?: null | number; + filter_log_index_gte?: null | number; + filter_log_index_lt?: null | number; + filter_log_index_lte?: null | number; + filter_topic_0?: string; + filter_topic_1?: string; + filter_topic_2?: string; + filter_topic_3?: string; + filter_transaction_hash?: string; + filter_transaction_index?: null | number; + filter_transaction_index_gt?: null | number; + filter_transaction_index_gte?: null | number; + filter_transaction_index_lt?: null | number; + filter_transaction_index_lte?: null | number; + group_by?: unknown; + limit?: number; + page?: null | number; + sort_by?: string; + sort_order?: "asc" | "desc"; + }, + "chain" | "decode" + >; +}): Promise< + Array<{ + address: string; + block_hash: string; + block_number: string; + block_timestamp: string; + chain_id: number; + data: string; + decoded?: { + indexed_params: {}; + name: string; + non_indexed_params: {}; + signature: string; + }; + log_index: number; + topics: Array; + transaction_hash: string; + transaction_index: number; + }> +>; ``` ### Parameters - The options for retrieving events. - #### Type ```ts -let options: GetContractEventsOptions; +let options: { + chains: Array>; + client: ThirdwebClient; + contractAddress: string; + decodeLogs?: boolean; + event?: PreparedEvent; + queryOptions?: Omit< + | undefined + | { + aggregate?: unknown; + chain?: unknown; + decode?: null | boolean; + filter_block_hash?: string; + filter_block_number?: null | number; + filter_block_number_gt?: null | number; + filter_block_number_gte?: null | number; + filter_block_number_lt?: null | number; + filter_block_number_lte?: null | number; + filter_block_timestamp?: null | number; + filter_block_timestamp_gt?: null | number; + filter_block_timestamp_gte?: null | number; + filter_block_timestamp_lt?: null | number; + filter_block_timestamp_lte?: null | number; + filter_log_index?: null | number; + filter_log_index_gt?: null | number; + filter_log_index_gte?: null | number; + filter_log_index_lt?: null | number; + filter_log_index_lte?: null | number; + filter_topic_0?: string; + filter_topic_1?: string; + filter_topic_2?: string; + filter_topic_3?: string; + filter_transaction_hash?: string; + filter_transaction_index?: null | number; + filter_transaction_index_gt?: null | number; + filter_transaction_index_gte?: null | number; + filter_transaction_index_lt?: null | number; + filter_transaction_index_lte?: null | number; + group_by?: unknown; + limit?: number; + page?: null | number; + sort_by?: string; + sort_order?: "asc" | "desc"; + }, + "chain" | "decode" + >; +}; ``` ### Returns ```ts -let returnType: ParseEventLogsResult; +let returnType: Promise< + Array<{ + address: string; + block_hash: string; + block_number: string; + block_timestamp: string; + chain_id: number; + data: string; + decoded?: { + indexed_params: {}; + name: string; + non_indexed_params: {}; + signature: string; + }; + log_index: number; + topics: Array; + transaction_hash: string; + transaction_index: number; + }> +>; ``` - - A promise that resolves to an array of parsed event logs. Note: toBlock and fromBlock are both inclusive. --- ## parseEventLogs - Parses logs and returns the corresponding events. +Parses logs and returns the corresponding events. ### Example @@ -47405,7 +48531,7 @@ function parseEventLogs( ### Parameters - The options for parsing logs. +The options for parsing logs. #### Type @@ -47419,12 +48545,12 @@ let options: ParseEventLogsOptions; let returnType: ParseEventLogsResult; ``` - The parsed events. +The parsed events. --- ## prepareEvent - Prepares an event by parsing the signature, generating the event hash, and encoding the event topics. +Prepares an event by parsing the signature, generating the event hash, and encoding the event topics. ### Example @@ -47443,7 +48569,7 @@ function prepareEvent( ### Parameters - The options for preparing the event. +The options for preparing the event. #### Type @@ -47457,16 +48583,16 @@ let options: PrepareEventOptions; let returnType: PreparedEvent>; ``` - The prepared event object. +The prepared event object. --- ## watchContractEvents - Listens for contract events from the blockchain. +Listens for contract events from the blockchain. ### Example -#### Listen to all events for a contract +#### Listen to all events for a contract ```ts import { watchContractEvents } from "thirdweb"; @@ -47478,7 +48604,7 @@ const unwatch = watchContractEvents({ }); ``` -#### Listen to specific events for a contract +#### Listen to specific events for a contract ```ts import { prepareEvent, watchContractEvents } from "thirdweb"; @@ -47496,31 +48622,33 @@ const events = await watchContractEvents({ ```ts function watchContractEvents(options: { - contract: Readonly>; + contract: Readonly>; events?: abiEvents; latestBlockNumber?: bigint; onEvents: ( events: ParseEventLogsResult, ) => void; strict?: TStrict; + useIndexer?: boolean; }): () => void; ``` ### Parameters - The options for retrieving contract events. +The options for retrieving contract events. #### Type ```ts let options: { - contract: Readonly>; + contract: Readonly>; events?: abiEvents; latestBlockNumber?: bigint; onEvents: ( events: ParseEventLogsResult, ) => void; strict?: TStrict; + useIndexer?: boolean; }; ``` @@ -47530,12 +48658,12 @@ let options: { let returnType: () => void; ``` - The unwatch function. +The unwatch function. --- ## resolveMethod - Resolves and returns the ABI function with the specified method name. Throws an error if the function is not found in the ABI. +Resolves and returns the ABI function with the specified method name. Throws an error if the function is not found in the ABI. ### Example @@ -47554,13 +48682,13 @@ const tx = prepareContractCall({ function resolveMethod( method: string, ): ( - contract: Readonly>, + contract: Readonly>, ) => Promise; ``` ### Parameters - The name of the method to resolve. +The name of the method to resolve. #### Type @@ -47572,16 +48700,16 @@ let method: string; ```ts let returnType: ( - contract: Readonly>, + contract: Readonly>, ) => Promise; ``` - The resolved ABI function. +The resolved ABI function. --- ## detectMethod - Detects if the specified method is present in the contract bytecode. +Detects if the specified method is present in the contract bytecode. ### Example @@ -47599,7 +48727,7 @@ function detectMethod(options: DetectExtensionOptions): boolean; ### Parameters - The options for detecting the extension. +The options for detecting the extension. #### Type @@ -47613,12 +48741,12 @@ let options: DetectExtensionOptions; let returnType: boolean; ``` - A promise that resolves to a boolean indicating if the extension is detected. +A promise that resolves to a boolean indicating if the extension is detected. --- ## isContractDeployed - Checks if a contract is deployed by verifying its bytecode. +Checks if a contract is deployed by verifying its bytecode. ### Example @@ -47632,19 +48760,17 @@ console.log(isDeployed); ``` ```ts -function isContractDeployed( - contract: Readonly>, -): Promise; +function isContractDeployed(contract: Readonly): Promise; ``` ### Parameters - The contract to check. +The contract to check. #### Type ```ts -let contract: Readonly>; +let contract: Readonly; ``` ### Returns @@ -47653,52 +48779,52 @@ let contract: Readonly>; let returnType: Promise; ``` - A promise that resolves to a boolean indicating whether the contract is deployed or not. +A promise that resolves to a boolean indicating whether the contract is deployed or not. --- ## resolveImplementation - Resolves the implementation address and bytecode for a given proxy contract. +Resolves the implementation address and bytecode for a given proxy contract. ### Example ```ts -import { resolveImplementation } from "thirdweb"; +import { resolveImplementation } from "thirdweb/utils"; const implementation = await resolveImplementation(contract); ``` ```ts function resolveImplementation( - contract: Readonly>, -): Promise<{ address: string; bytecode: Hex }>; + contract: Readonly>, +): Promise<{ address: string; bytecode: `0x${string}` }>; ``` ### Parameters - The contract to resolve the implementation for. +The contract to resolve the implementation for. #### Type ```ts -let contract: Readonly>; +let contract: Readonly>; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<{ address: string; bytecode: `0x${string}` }>; ``` - A promise that resolves to an object containing the implementation address and bytecode. +A promise that resolves to an object containing the implementation address and bytecode. --- # Transactions --- ## getApprovalForTransaction - When dealing with transactions that involve ERC20 tokens (Airdropping ERC20, buy NFTs with ERC20, etc.) you often have to do a pre-check to see if the targeted contract has the sufficient allowance to "take" the ERC20 tokens from the caller's wallet. +When dealing with transactions that involve ERC20 tokens (Airdropping ERC20, buy NFTs with ERC20, etc.) you often have to do a pre-check to see if the targeted contract has the sufficient allowance to "take" the ERC20 tokens from the caller's wallet. - This extension is a handy method that checks for the allowance and requests to approve for more if current allowance is insufficient +This extension is a handy method that checks for the allowance and requests to approve for more if current allowance is insufficient ### Example @@ -47731,12 +48857,12 @@ async function buyNFT() { ```ts function getApprovalForTransaction( options: GetApprovalForTransactionParams, -): Promise; +): Promise; ``` ### Parameters - GetApprovalForTransactionParams +GetApprovalForTransactionParams #### Type @@ -47753,12 +48879,12 @@ let returnType: Readonly & { }; ``` - a PreparedTransaction +a PreparedTransaction --- ## createContractQuery - Creates a `useQuery` hook for a contract call. +Creates a `useQuery` hook for a contract call. ### Example @@ -47775,15 +48901,15 @@ function createContractQuery( options: BaseTransactionOptions, ) => Promise, ): ( - options: BaseTransactionOptions & { - queryOptions?: Partial<{ enabled: boolean }>; - }, + options: { + contract: Readonly>; + } & opts & { queryOptions?: Partial<{ enabled: boolean }> }, ) => UseQueryResult; ``` ### Parameters - A function that performs the contract function call and returns the result. +A function that performs the contract function call and returns the result. #### Type @@ -47797,18 +48923,18 @@ let readCall: ( ```ts let returnType: ( - options: BaseTransactionOptions & { - queryOptions?: Partial<{ enabled: boolean }>; - }, + options: { + contract: Readonly>; + } & opts & { queryOptions?: Partial<{ enabled: boolean }> }, ) => UseQueryResult; ``` - An object containing the created `useRead` hook. +An object containing the created `useRead` hook. --- ## encode - Encodes a transaction object into a hexadecimal string representation of the encoded data. +Encodes a transaction object into a hexadecimal string representation of the encoded data. ### Example @@ -47820,12 +48946,12 @@ const encodedData = await encode(transaction); ```ts function encode( transaction: PreparedTransaction, -): Promise; +): Promise<`0x${string}`>; ``` ### Parameters - The transaction object to encode. +The transaction object to encode. #### Type @@ -47836,15 +48962,15 @@ let transaction: PreparedTransaction; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - A promise that resolves to the encoded data as a hexadecimal string. +A promise that resolves to the encoded data as a hexadecimal string. --- ## estimateGas - Estimates the gas required to execute a transaction. The gas is returned as a `bigint` and in gwei units. +Estimates the gas required to execute a transaction. The gas is returned as a `bigint` and in gwei units. ### Example @@ -47857,14 +48983,12 @@ const gas = await estimateGas({ ``` ```ts -function estimateGas( - options: EstimateGasOptions, -): Promise; +function estimateGas(options: EstimateGasOptions): Promise; ``` ### Parameters - The options for estimating gas. +The options for estimating gas. #### Type @@ -47880,15 +49004,15 @@ let options: Prettify< ### Returns ```ts -let returnType: bigint; +let returnType: Promise; ``` - A promise that resolves to the estimated gas as a bigint. +A promise that resolves to the estimated gas as a bigint. --- ## estimateGasCost - Estimate the gas cost of a transaction in ether and wei. +Estimate the gas cost of a transaction in ether and wei. ### Example @@ -47926,11 +49050,11 @@ let returnType: { ether: string; wei: bigint }; ## prepareContractCall - Prepares a contract call by resolving the ABI function, parameters and encoded data. Optionally specify other properties such as value or gas price. +Prepares a contract call by resolving the ABI function, parameters and encoded data. Optionally specify other properties such as value or gas price. ### Example -#### Usage with a human-readable method signature: +#### Usage with a human-readable method signature: ```ts import { prepareContractCall } from "thirdweb"; @@ -47942,7 +49066,7 @@ const transaction = prepareContractCall({ }); ``` -#### Usage with explicit gas price and/or value: +#### Usage with explicit gas price and/or value: ```ts import { prepareContractCall } from "thirdweb"; @@ -47958,13 +49082,13 @@ const transaction = prepareContractCall({ }); ``` -#### Usage with ERC20 value: +#### Usage with ERC20 value: - For transactions that transfer ERC20 tokens, you can specify the value as the amount of tokens to transfer. +For transactions that transfer ERC20 tokens, you can specify the value as the amount of tokens to transfer. - You can use this in conjuction with the [getApprovalForTransaction](https://portal.thirdweb.com/references/typescript/v5/getApprovalForTransaction) function to easily create approval transactions for ERC20 tokens. +You can use this in conjuction with the [getApprovalForTransaction](https://portal.thirdweb.com/references/typescript/v5/getApprovalForTransaction) function to easily create approval transactions for ERC20 tokens. - This value will also be read by the react hooks and UI components to present to total cost to the user. +This value will also be read by the react hooks and UI components to present to total cost to the user. ```ts import { prepareContractCall } from "thirdweb"; @@ -47981,7 +49105,7 @@ const transaction = prepareContractCall({ }); ``` -#### Usage with a JSON ABI function object: +#### Usage with a JSON ABI function object: ```ts import { prepareContractCall } from "thirdweb"; @@ -48002,7 +49126,7 @@ const transaction = prepareContractCall({ }); ``` -#### Usage with the ABI defined on the contract: +#### Usage with the ABI defined on the contract: ```ts import { getContract, prepareContractCall } from "thirdweb"; @@ -48017,7 +49141,7 @@ const transaction = prepareContractCall({ }); ``` -#### Passing extra call data to the transaction +#### Passing extra call data to the transaction ```ts import { getContract, prepareContractCall } from "thirdweb"; @@ -48046,7 +49170,7 @@ function prepareContractCall( ### Parameters - The options for preparing the contract call. +The options for preparing the contract call. #### Type @@ -48068,12 +49192,12 @@ let returnType: PreparedTransaction< >; ``` - A promise that resolves to the prepared transaction. +A promise that resolves to the prepared transaction. --- ## prepareTransaction - Prepares a transaction with the given options. +Prepares a transaction with the given options. ### Example @@ -48098,7 +49222,7 @@ function prepareTransaction( ### Parameters - The options for preparing the transaction. +The options for preparing the transaction. #### Type @@ -48111,7 +49235,7 @@ let options: { >; ``` - Additional information about the ABI function. +Additional information about the ABI function. #### Type @@ -48129,20 +49253,20 @@ let returnType: PreparedTransaction< >; ``` - The prepared transaction. +The prepared transaction. --- ## readContract -#### Reads state from a deployed smart contract. +#### Reads state from a deployed smart contract. - Use this for raw read calls from a contract, but you can also use read [ extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) for predefined methods for common standards. +Use this for raw read calls from a contract, but you can also use read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) for predefined methods for common standards. ### Example -#### Raw contract call (recommended) +#### Raw contract call (recommended) - You can read from any contract by using the solidity signature of the function you want to call. +You can read from any contract by using the solidity signature of the function you want to call. ```ts import { getContract } from "thirdweb"; @@ -48162,13 +49286,13 @@ const { data, isLoading } = useReadContract({ }); ``` - Note that this is type safe, the params types will be enforced based on the signature. +Note that this is type safe, the params types will be enforced based on the signature. -#### Raw contract call with `resolveMethod` +#### Raw contract call with `resolveMethod` - If you don't have the solidity signature of the function you want to call, you can use the `resolveMethod` helper to resolve the method from any deployed contract. +If you don't have the solidity signature of the function you want to call, you can use the `resolveMethod` helper to resolve the method from any deployed contract. - Note that this is not type safe, and will also have a 1 time overhead of resolving the contract ABI. +Note that this is not type safe, and will also have a 1 time overhead of resolving the contract ABI. ```ts import { getContract, resolveMethod } from "thirdweb"; @@ -48196,7 +49320,7 @@ function readContract( ### Parameters - The transaction options. +The transaction options. #### Type @@ -48214,16 +49338,16 @@ let returnType: outputs extends { length: 0 } : AbiParametersToPrimitiveTypes; ``` - A promise that resolves with the result of the read call. +A promise that resolves with the result of the read call. --- ## sendAndConfirmTransaction - Sends a transaction using the provided wallet. +Sends a transaction using the provided wallet. ### Example -#### Basic usage +#### Basic usage ```ts import { sendAndConfirmTransaction } from "thirdweb"; @@ -48234,7 +49358,7 @@ const transactionReceipt = await sendAndConfirmTransaction({ }); ``` -#### Gasless usage with [ thirdweb Engine](https://portal.thirdweb.com/engine) +#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine) ```ts const transactionReceipt = await sendAndConfirmTransaction({ @@ -48249,7 +49373,7 @@ const transactionReceipt = await sendAndConfirmTransaction({ }); ``` -#### Gasless usage with OpenZeppelin +#### Gasless usage with OpenZeppelin ```ts const transactionReceipt = await sendAndConfirmTransaction({ @@ -48271,7 +49395,7 @@ function sendAndConfirmTransaction( ### Parameters - The options for sending the transaction. +The options for sending the transaction. #### Type @@ -48307,12 +49431,12 @@ let returnType: { }; ``` - A promise that resolves to the confirmed transaction receipt. +A promise that resolves to the confirmed transaction receipt. --- ## sendBatchTransaction - Sends a batch transaction using the provided options. +Sends a batch transaction using the provided options. ### Example @@ -48328,12 +49452,17 @@ const waitForReceiptOptions = await sendBatchTransaction({ ```ts function sendBatchTransaction( options: SendBatchTransactionOptions, -): Promise; +): Promise<{ + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}>; ``` ### Parameters - The options for sending the batch transaction. +The options for sending the batch transaction. #### Type @@ -48344,30 +49473,29 @@ let options: { }; ``` -### Returns - -```ts -let returnType: Prettify< - SendTransactionResult & { - chain: Chain; - client: ThirdwebClient; - maxBlocksWaitTime?: number; - } ->; +### Returns + +```ts +let returnType: Promise<{ + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}>; ``` - A promise that resolves to the options for waiting for the receipt of the first transaction in the batch. +A promise that resolves to the options for waiting for the receipt of the first transaction in the batch. --- ## sendTransaction - Sends a transaction using the provided account. +Sends a transaction using the provided account. - You can send a transaction with a [ prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall) , a [ prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction) , or using a write [ Extension](https://portal.thirdweb.com/typescript/v5/extensions/use) . +You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/typescript/v5/extensions/use). ### Example -#### Using a prepared contract call +#### Using a prepared contract call ```ts import { @@ -48395,7 +49523,7 @@ const { transactionHash } = await sendTransaction({ }); ``` -#### Using a write extension +#### Using a write extension ```ts import { sendTransaction, getContract } from "thirdweb"; @@ -48424,7 +49552,7 @@ const { transactionHash } = await sendTransaction({ }); ``` -#### Using a prepared transaction +#### Using a prepared transaction ```ts import { @@ -48452,9 +49580,9 @@ const { transactionHash } = await sendTransaction({ }); ``` -#### Send an EIP-7702 Transaction +#### Send an EIP-7702 Transaction - _Note: This feature is in beta and is subject to breaking changes_ +_Note: This feature is in beta and is subject to breaking changes_ ```ts import { @@ -48487,7 +49615,7 @@ const { transactionHash } = await sendTransaction({ }); ``` -#### Gasless usage with [ thirdweb Engine](https://portal.thirdweb.com/engine) +#### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine) ```ts const { transactionHash } = await sendTransaction({ @@ -48502,7 +49630,7 @@ const { transactionHash } = await sendTransaction({ }); ``` -#### Gasless usage with OpenZeppelin +#### Gasless usage with OpenZeppelin ```ts const { transactionHash } = await sendTransaction({ @@ -48519,12 +49647,17 @@ const { transactionHash } = await sendTransaction({ ```ts function sendTransaction( options: SendTransactionOptions, -): Promise; +): Promise<{ + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}>; ``` ### Parameters - The options for sending the transaction. +The options for sending the transaction. #### Type @@ -48539,21 +49672,20 @@ let options: { ### Returns ```ts -let returnType: Prettify< - SendTransactionResult & { - chain: Chain; - client: ThirdwebClient; - maxBlocksWaitTime?: number; - } ->; +let returnType: Promise<{ + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}>; ``` - A promise that resolves to the transaction result. +A promise that resolves to the transaction result. --- ## serializeTransaction - Serializes a legacy, EIP-1559, EIP-2930, EIP-4844, or EIP-7702 transaction object. +Serializes a legacy, EIP-1559, EIP-2930, EIP-4844, or EIP-7702 transaction object. ### Example @@ -48571,12 +49703,12 @@ const serializedTransaction = serializeTransaction({ ```ts function serializeTransaction( options: SerializeTransactionOptions, -): Hex; +): `0x${string}`; ``` ### Parameters - The serialization options. +The serialization options. #### Type @@ -48592,26 +49724,33 @@ let options: { ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The serialized transaction. +The serialized transaction. --- ## signAuthorization - Sign the given EIP-7702 authorization object. +Sign the given EIP-7702 authorization object. ```ts function signAuthorization(options: { account: Account; request: AuthorizationRequest; -}): Promise; +}): Promise<{ + address: string; + chainId: number; + nonce: bigint; + r: bigint; + s: bigint; + yParity: number; +}>; ``` ### Parameters - The options for `signAuthorization`Refer to the type [SignAuthorizationOptions](https://portal.thirdweb.com/references/typescript/v5/SignAuthorizationOptions) +The options for `signAuthorization`Refer to the type [SignAuthorizationOptions](https://portal.thirdweb.com/references/typescript/v5/SignAuthorizationOptions) #### Type @@ -48622,10 +49761,17 @@ let options: { account: Account; request: AuthorizationRequest }; ### Returns ```ts -let returnType: ox__Authorization.ListSigned[number]; +let returnType: Promise<{ + address: string; + chainId: number; + nonce: bigint; + r: bigint; + s: bigint; + yParity: number; +}>; ``` - The signed authorization object +The signed authorization object ```ts import { signAuthorization } from "thirdweb"; @@ -48643,7 +49789,7 @@ const authorization = await signAuthorization({ ## signTransaction - Signs a transaction to be sent to a node. +Signs a transaction to be sent to a node. ### Example @@ -48658,155 +49804,956 @@ signTransaction({ ``` ```ts -function signTransaction(options: SignTransactionOptions): Hex; +function signTransaction( + options: SignTransactionOptions, +): `0x${string}`; +``` + +### Parameters + +The options for signing. + +#### Type + +```ts +let options: { + privateKey: Hex; + transaction: SerializableTransaction; +}; +``` + +### Returns + +```ts +let returnType: `0x${string}`; +``` + +The signed transaction as a hex string +--- + +## simulateTransaction + +Simulates the execution of a transaction. + +### Example + +```ts +import { simulateTransaction } from "thirdweb"; +const result = await simulateTransaction({ + transaction, +}); +``` + +```ts +function simulateTransaction( + options: SimulateOptions, +): Promise; +``` + +### Parameters + +The options for simulating the transaction. + +#### Type + +```ts +let options: SimulateOptions; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the result of the simulation. +--- + +## toSerializableTransaction + +Converts a prepared transaction to a transaction with populated options. + +### Example + +```ts +import { + prepareTransaction, + toSerializableTransaction, +} from "thirdweb"; + +const transaction = await prepareTransaction({ + transaction: { + to: "0x...", + value: 100, + }, +}); +const finalTx = await toSerializableTransaction({ + transaction, +}); + +account.sendTransaction(finalTx); +``` + +```ts +function toSerializableTransaction( + options: ToSerializableTransactionOptions, +): Promise< + | { + accessList: undefined | AccessList; + authorizationList: + | undefined + | Array<{ + address: string; + chainId: number; + nonce: bigint; + r: bigint; + s: bigint; + yParity: number; + }>; + chainId: number; + data: `0x${string}`; + gas: bigint; + gasPrice?: undefined; + maxFeePerGas?: bigint; + maxPriorityFeePerGas?: bigint; + nonce: undefined | number; + to: undefined | string; + type: undefined | TransactionType; + value: undefined | bigint; + } + | { + accessList: undefined | AccessList; + authorizationList: + | undefined + | Array<{ + address: string; + chainId: number; + nonce: bigint; + r: bigint; + s: bigint; + yParity: number; + }>; + chainId: number; + data: `0x${string}`; + gas: bigint; + gasPrice?: bigint; + maxFeePerGas?: undefined; + maxPriorityFeePerGas?: undefined; + nonce: undefined | number; + to: undefined | string; + type: undefined | TransactionType; + value: undefined | bigint; + } +>; +``` + +### Parameters + +The transaction and additional options for conversion + +#### Type + +```ts +let options: { + from?: string | Account; + transaction: PreparedTransaction; +}; +``` + +### Returns + +```ts +let returnType: Promise< + | { + accessList: undefined | AccessList; + authorizationList: + | undefined + | Array<{ + address: string; + chainId: number; + nonce: bigint; + r: bigint; + s: bigint; + yParity: number; + }>; + chainId: number; + data: `0x${string}`; + gas: bigint; + gasPrice?: undefined; + maxFeePerGas?: bigint; + maxPriorityFeePerGas?: bigint; + nonce: undefined | number; + to: undefined | string; + type: undefined | TransactionType; + value: undefined | bigint; + } + | { + accessList: undefined | AccessList; + authorizationList: + | undefined + | Array<{ + address: string; + chainId: number; + nonce: bigint; + r: bigint; + s: bigint; + yParity: number; + }>; + chainId: number; + data: `0x${string}`; + gas: bigint; + gasPrice?: bigint; + maxFeePerGas?: undefined; + maxPriorityFeePerGas?: undefined; + nonce: undefined | number; + to: undefined | string; + type: undefined | TransactionType; + value: undefined | bigint; + } +>; +``` + +A serializable transaction for inspection or submission to an account. + +For easier transaction sending, sendTransaction +--- + +## waitForReceipt + +Waits for the transaction receipt of a given transaction hash on a specific contract. + +### Example + +```ts +import { waitForReceipt } from "thirdweb"; +const receipt = await waitForReceipt({ + client, + chain, + transactionHash: "0x123...", +}); +``` + +```ts +function waitForReceipt(options: { + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}): Promise; +``` + +### Parameters + +The options for waiting for the receipt. By default, it's 100 blocks. + +#### Type + +```ts +let options: { + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}; +``` + +### Returns + +```ts +let returnType: { + blobGasPrice?: quantity; + blobGasUsed?: quantity; + blockHash: Hash; + blockNumber: quantity; + contractAddress: Address | null | undefined; + cumulativeGasUsed: quantity; + effectiveGasPrice: quantity; + from: Address; + gasUsed: quantity; + logs: Array>; + logsBloom: Hex; + root?: Hash; + status: status; + to: Address | null; + transactionHash: Hash; + transactionIndex: index; + type: type; +}; +``` + +A promise that resolves with the transaction receipt. +--- + +## getTransactionStore + +Retrieve the transaction store for a given address. + +### Example + +```ts +import { getTransactionStore } from "thirdweb/transaction"; + +const store = getTransactionStore("0x..."); +store.subscribe((transactions) => { + console.log(transactions); +}); +``` + +```ts +function getTransactionStore( + address: string, +): Store>; +``` + +### Parameters + +The address to retrieve the transaction store for. + +#### Type + +```ts +let address: string; +``` + +### Returns + +```ts +let returnType: Store>; +``` + +A store of transactions for the given account to subscribe to. +--- +# Insight +--- + +## getContractEvents + +Get contract events + +### Example + +```ts +import { Insight } from "thirdweb"; + +const events = await Insight.getContractEvents({ + client, + chains: [sepolia], + contractAddress: "0x1234567890123456789012345678901234567890", + event: transferEvent(), + decodeLogs: true, +}); +``` + +```ts +function getContractEvents(options: { + chains: Array>; + client: ThirdwebClient; + contractAddress: string; + decodeLogs?: boolean; + event?: PreparedEvent; + queryOptions?: Omit< + | undefined + | { + aggregate?: unknown; + chain?: unknown; + decode?: null | boolean; + filter_block_hash?: string; + filter_block_number?: null | number; + filter_block_number_gt?: null | number; + filter_block_number_gte?: null | number; + filter_block_number_lt?: null | number; + filter_block_number_lte?: null | number; + filter_block_timestamp?: null | number; + filter_block_timestamp_gt?: null | number; + filter_block_timestamp_gte?: null | number; + filter_block_timestamp_lt?: null | number; + filter_block_timestamp_lte?: null | number; + filter_log_index?: null | number; + filter_log_index_gt?: null | number; + filter_log_index_gte?: null | number; + filter_log_index_lt?: null | number; + filter_log_index_lte?: null | number; + filter_topic_0?: string; + filter_topic_1?: string; + filter_topic_2?: string; + filter_topic_3?: string; + filter_transaction_hash?: string; + filter_transaction_index?: null | number; + filter_transaction_index_gt?: null | number; + filter_transaction_index_gte?: null | number; + filter_transaction_index_lt?: null | number; + filter_transaction_index_lte?: null | number; + group_by?: unknown; + limit?: number; + page?: null | number; + sort_by?: string; + sort_order?: "asc" | "desc"; + }, + "chain" | "decode" + >; +}): Promise< + Array<{ + address: string; + block_hash: string; + block_number: string; + block_timestamp: string; + chain_id: number; + data: string; + decoded?: { + indexed_params: {}; + name: string; + non_indexed_params: {}; + signature: string; + }; + log_index: number; + topics: Array; + transaction_hash: string; + transaction_index: number; + }> +>; +``` + +### Parameters + +#### Type + +```ts +let options: { + chains: Array>; + client: ThirdwebClient; + contractAddress: string; + decodeLogs?: boolean; + event?: PreparedEvent; + queryOptions?: Omit< + | undefined + | { + aggregate?: unknown; + chain?: unknown; + decode?: null | boolean; + filter_block_hash?: string; + filter_block_number?: null | number; + filter_block_number_gt?: null | number; + filter_block_number_gte?: null | number; + filter_block_number_lt?: null | number; + filter_block_number_lte?: null | number; + filter_block_timestamp?: null | number; + filter_block_timestamp_gt?: null | number; + filter_block_timestamp_gte?: null | number; + filter_block_timestamp_lt?: null | number; + filter_block_timestamp_lte?: null | number; + filter_log_index?: null | number; + filter_log_index_gt?: null | number; + filter_log_index_gte?: null | number; + filter_log_index_lt?: null | number; + filter_log_index_lte?: null | number; + filter_topic_0?: string; + filter_topic_1?: string; + filter_topic_2?: string; + filter_topic_3?: string; + filter_transaction_hash?: string; + filter_transaction_index?: null | number; + filter_transaction_index_gt?: null | number; + filter_transaction_index_gte?: null | number; + filter_transaction_index_lt?: null | number; + filter_transaction_index_lte?: null | number; + group_by?: unknown; + limit?: number; + page?: null | number; + sort_by?: string; + sort_order?: "asc" | "desc"; + }, + "chain" | "decode" + >; +}; +``` + +### Returns + +```ts +let returnType: Promise< + Array<{ + address: string; + block_hash: string; + block_number: string; + block_timestamp: string; + chain_id: number; + data: string; + decoded?: { + indexed_params: {}; + name: string; + non_indexed_params: {}; + signature: string; + }; + log_index: number; + topics: Array; + transaction_hash: string; + transaction_index: number; + }> +>; +``` +--- + +## getContractNFTs + +Get all NFTs from a contract + +### Example + +```ts +import { Insight } from "thirdweb"; + +const nfts = await Insight.getContractNFTs({ + client, + chains: [sepolia], + contractAddress: "0x1234567890123456789012345678901234567890", +}); +``` + +```ts +function getContractNFTs(args: { + chains: Array>; + client: ThirdwebClient; + contractAddress: string; + includeMetadata?: boolean; + includeOwners?: boolean; + queryOptions?: Omit< + | undefined + | { + chain?: unknown; + include_owners?: "false" | "true"; + limit?: number; + page?: null | number; + }, + "chain" + >; +}): Promise>; +``` + +### Parameters + +#### Type + +```ts +let args: { + chains: Array>; + client: ThirdwebClient; + contractAddress: string; + includeMetadata?: boolean; + includeOwners?: boolean; + queryOptions?: Omit< + | undefined + | { + chain?: unknown; + include_owners?: "false" | "true"; + limit?: number; + page?: null | number; + }, + "chain" + >; +}; +``` + +### Returns + +```ts +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; +``` +--- + +## getNFT + +Get NFT metadata by contract address and token id + +### Example + +```ts +import { Insight } from "thirdweb"; + +const nft = await Insight.getNFT({ + client, + chain: sepolia, + contractAddress: "0x1234567890123456789012345678901234567890", + tokenId: 1n, +}); +``` + +```ts +function getNFT(args: { + chain: Readonly; + client: ThirdwebClient; + contractAddress: string; + includeOwners?: boolean; + queryOptions?: { + chain?: unknown; + include_owners?: "false" | "true"; + }; + tokenId: string | number | bigint; +}): Promise; +``` + +### Parameters + +#### Type + +```ts +let args: { + chain: Readonly; + client: ThirdwebClient; + contractAddress: string; + includeOwners?: boolean; + queryOptions?: { + chain?: unknown; + include_owners?: "false" | "true"; + }; + tokenId: string | number | bigint; +}; +``` + +### Returns + +```ts +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; +``` +--- + +## getOwnedNFTs + +Get NFTs owned by an address + +### Example + +```ts +import { Insight } from "thirdweb"; + +const nfts = await Insight.getOwnedNFTs({ + client, + chains: [sepolia], + ownerAddress: "0x1234567890123456789012345678901234567890", +}); +``` + +```ts +function getOwnedNFTs(args: { + chains: Array>; + client: ThirdwebClient; + includeMetadata?: boolean; + ownerAddress: string; + queryOptions?: Omit< + { + chain?: unknown; + limit?: number; + owner_address: string; + page?: null | number; + }, + "chain" | "owner_address" + >; +}): Promise>; ``` ### Parameters - The options for signing. - #### Type ```ts -let options: { - privateKey: Hex; - transaction: SerializableTransaction; +let args: { + chains: Array>; + client: ThirdwebClient; + includeMetadata?: boolean; + ownerAddress: string; + queryOptions?: Omit< + { + chain?: unknown; + limit?: number; + owner_address: string; + page?: null | number; + }, + "chain" | "owner_address" + >; }; ``` ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + tokenAddress: string; + tokenURI: string; + type: "ERC721"; + } + | { + chainId: number; + id: bigint; + metadata: NFTMetadata; + owner: string | null; + supply: bigint; + tokenAddress: string; + tokenURI: string; + type: "ERC1155"; + }; ``` - - The signed transaction as a hex string --- -## simulateTransaction +## getOwnedTokens - Simulates the execution of a transaction. +Get ERC20 tokens owned by an address ### Example ```ts -import { simulateTransaction } from "thirdweb"; -const result = await simulateTransaction({ - transaction, +import { Insight } from "thirdweb"; + +const tokens = await Insight.getOwnedTokens({ + client, + chains: [sepolia], + ownerAddress: "0x1234567890123456789012345678901234567890", }); ``` ```ts -function simulateTransaction( - options: SimulateOptions, -): Promise; +function getOwnedTokens(args: { + chains: Array>; + client: ThirdwebClient; + ownerAddress: string; + queryOptions?: { + chain?: unknown; + include_spam?: "false" | "true"; + limit?: number; + metadata?: "false" | "true"; + page?: null | number; + }; +}): Promise>; ``` ### Parameters - The options for simulating the transaction. - #### Type ```ts -let options: SimulateOptions; +let args: { + chains: Array>; + client: ThirdwebClient; + ownerAddress: string; + queryOptions?: { + chain?: unknown; + include_spam?: "false" | "true"; + limit?: number; + metadata?: "false" | "true"; + page?: null | number; + }; +}; ``` ### Returns ```ts -let returnType: Promise; +let returnType: { + chainId: number; + decimals: number; + displayValue: string; + name: string; + symbol: string; + tokenAddress: string; + value: bigint; +}; ``` - - A promise that resolves to the result of the simulation. --- -## toSerializableTransaction +## getTransactions - Converts a prepared transaction to a transaction with populated options. +Get transactions for a wallet ### Example ```ts -import { - prepareTransaction, - toSerializableTransaction, -} from "thirdweb"; +import { Insight } from "thirdweb"; -const transaction = await prepareTransaction({ - transaction: { - to: "0x...", - value: 100, - }, -}); -const finalTx = await toSerializableTransaction({ - transaction, +const transactions = await Insight.getTransactions({ + client, + walletAddress: "0x1234567890123456789012345678901234567890", + chains: [sepolia], }); - -account.sendTransaction(finalTx); ``` ```ts -function toSerializableTransaction( - options: ToSerializableTransactionOptions, -): Promise< - | { - accessList: undefined | AccessList; - authorizationList: - | undefined - | Array<{ - address: string; - chainId: number; - nonce: bigint; - r: bigint; - s: bigint; - yParity: number; - }>; - chainId: number; - data: `0x${string}`; - gas: bigint; - gasPrice?: undefined; - maxFeePerGas?: bigint; - maxPriorityFeePerGas?: bigint; - nonce: undefined | number; - to: undefined | string; - value: undefined | bigint; - } - | { - accessList: undefined | AccessList; - authorizationList: - | undefined - | Array<{ - address: string; - chainId: number; - nonce: bigint; - r: bigint; - s: bigint; - yParity: number; - }>; - chainId: number; - data: `0x${string}`; - gas: bigint; - gasPrice?: bigint; - maxFeePerGas?: undefined; - maxPriorityFeePerGas?: undefined; - nonce: undefined | number; - to: undefined | string; - value: undefined | bigint; - } +function getTransactions(args: { + chains: Array>; + client: ThirdwebClient; + queryOptions?: { + aggregate?: unknown; + chain?: unknown; + decode?: null | boolean; + filter_block_hash?: string; + filter_block_number?: null | number; + filter_block_number_gt?: null | number; + filter_block_number_gte?: null | number; + filter_block_number_lt?: null | number; + filter_block_number_lte?: null | number; + filter_block_timestamp?: null | number; + filter_block_timestamp_gt?: null | number; + filter_block_timestamp_gte?: null | number; + filter_block_timestamp_lt?: null | number; + filter_block_timestamp_lte?: null | number; + filter_function_selector?: string; + filter_gas?: null | number; + filter_gas_gt?: null | number; + filter_gas_gte?: null | number; + filter_gas_lt?: null | number; + filter_gas_lte?: null | number; + filter_gas_price?: null | number; + filter_gas_price_gt?: null | number; + filter_gas_price_gte?: null | number; + filter_gas_price_lt?: null | number; + filter_gas_price_lte?: null | number; + filter_hash?: string; + filter_transaction_index?: null | number; + filter_transaction_index_gt?: null | number; + filter_transaction_index_gte?: null | number; + filter_transaction_index_lt?: null | number; + filter_transaction_index_lte?: null | number; + filter_value?: null | number; + filter_value_gt?: null | number; + filter_value_gte?: null | number; + filter_value_lt?: null | number; + filter_value_lte?: null | number; + group_by?: unknown; + limit?: number; + page?: null | number; + sort_by?: string; + sort_order?: "asc" | "desc"; + }; + walletAddress: string; +}): Promise< + Array<{ + access_list_json?: string; + blob_gas_price?: number; + blob_gas_used?: number; + block_hash: string; + block_number: string; + block_timestamp: string; + chain_id: number; + 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; + from_address: string; + function_selector: string; + gas: number; + gas_price: number; + gas_used?: number; + hash: string; + logs_bloom?: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + nonce: number; + r: number; + s: number; + status?: number; + to_address: string; + transaction_index: number; + transaction_type: number; + v: number; + value: number; + }> >; ``` ### Parameters - The transaction and additional options for conversion - #### Type ```ts -let options: { - from?: string | Account; - transaction: PreparedTransaction; +let args: { + chains: Array>; + client: ThirdwebClient; + queryOptions?: { + aggregate?: unknown; + chain?: unknown; + decode?: null | boolean; + filter_block_hash?: string; + filter_block_number?: null | number; + filter_block_number_gt?: null | number; + filter_block_number_gte?: null | number; + filter_block_number_lt?: null | number; + filter_block_number_lte?: null | number; + filter_block_timestamp?: null | number; + filter_block_timestamp_gt?: null | number; + filter_block_timestamp_gte?: null | number; + filter_block_timestamp_lt?: null | number; + filter_block_timestamp_lte?: null | number; + filter_function_selector?: string; + filter_gas?: null | number; + filter_gas_gt?: null | number; + filter_gas_gte?: null | number; + filter_gas_lt?: null | number; + filter_gas_lte?: null | number; + filter_gas_price?: null | number; + filter_gas_price_gt?: null | number; + filter_gas_price_gte?: null | number; + filter_gas_price_lt?: null | number; + filter_gas_price_lte?: null | number; + filter_hash?: string; + filter_transaction_index?: null | number; + filter_transaction_index_gt?: null | number; + filter_transaction_index_gte?: null | number; + filter_transaction_index_lt?: null | number; + filter_transaction_index_lte?: null | number; + filter_value?: null | number; + filter_value_gt?: null | number; + filter_value_gte?: null | number; + filter_value_lt?: null | number; + filter_value_lte?: null | number; + group_by?: unknown; + limit?: number; + page?: null | number; + sort_by?: string; + sort_order?: "asc" | "desc"; + }; + walletAddress: string; }; ``` @@ -48814,169 +50761,165 @@ let options: { ```ts let returnType: Promise< - | { - accessList: undefined | AccessList; - authorizationList: - | undefined - | Array<{ - address: string; - chainId: number; - nonce: bigint; - r: bigint; - s: bigint; - yParity: number; - }>; - chainId: number; - data: `0x${string}`; - gas: bigint; - gasPrice?: undefined; - maxFeePerGas?: bigint; - maxPriorityFeePerGas?: bigint; - nonce: undefined | number; - to: undefined | string; - value: undefined | bigint; - } - | { - accessList: undefined | AccessList; - authorizationList: - | undefined - | Array<{ - address: string; - chainId: number; - nonce: bigint; - r: bigint; - s: bigint; - yParity: number; - }>; - chainId: number; - data: `0x${string}`; - gas: bigint; - gasPrice?: bigint; - maxFeePerGas?: undefined; - maxPriorityFeePerGas?: undefined; - nonce: undefined | number; - to: undefined | string; - value: undefined | bigint; - } ->; -``` - - A serializable transaction for inspection or submission to an account. - - For easier transaction sending, sendTransaction ---- - -## waitForReceipt - - Waits for the transaction receipt of a given transaction hash on a specific contract. - -### Example - -```ts -import { waitForReceipt } from "thirdweb"; -const receipt = await waitForReceipt({ + Array<{ + access_list_json?: string; + blob_gas_price?: number; + blob_gas_used?: number; + block_hash: string; + block_number: string; + block_timestamp: string; + chain_id: number; + 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; + from_address: string; + function_selector: string; + gas: number; + gas_price: number; + gas_used?: number; + hash: string; + logs_bloom?: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + nonce: number; + r: number; + s: number; + status?: number; + to_address: string; + transaction_index: number; + transaction_type: number; + v: number; + value: number; + }> +>; +``` +--- +# Engine +--- + +## getTransactionStatus + +Get the execution status of a transaction. + +### Example + +```ts +import { Engine } from "thirdweb"; + +const executionResult = await Engine.getTransactionStatus({ client, - chain, - transactionHash: "0x123...", + transactionId, }); +console.log(executionResult.status); ``` ```ts -function waitForReceipt(options: { - chain: Readonly; +function getTransactionStatus(args: { client: ThirdwebClient; - maxBlocksWaitTime?: number; - readonly transactionHash: `0x${string}`; -}): Promise; + transactionId: string; +}): Promise; ``` ### Parameters - The options for waiting for the receipt. By default, it's 100 blocks. +The arguments for the transaction. #### Type ```ts -let options: { - chain: Readonly; - client: ThirdwebClient; - maxBlocksWaitTime?: number; - readonly transactionHash: `0x${string}`; -}; +let args: { client: ThirdwebClient; transactionId: string }; ``` ### Returns ```ts -let returnType: { - blobGasPrice?: quantity; - blobGasUsed?: quantity; - blockHash: Hash; - blockNumber: quantity; - contractAddress: Address | null | undefined; - cumulativeGasUsed: quantity; - effectiveGasPrice: quantity; - from: Address; - gasUsed: quantity; - logs: Array>; - logsBloom: Hex; - root?: Hash; - status: status; - to: Address | null; - transactionHash: Hash; - transactionIndex: index; - type: type; -}; +let returnType: Prettify< + ExecutionResult4337Serialized & { + cancelledAt: string | null; + chain: Chain; + confirmedAt: string | null; + createdAt: string; + from: string | undefined; + id: string; + } +>; ``` +--- - A promise that resolves with the transaction receipt. +## ServerWallet + +```ts +type ServerWallet = Account & { + enqueueTransaction: (args: { + simulate?: boolean; + transaction: PreparedTransaction; + }) => Promise<{ transactionId: string }>; +}; +``` --- -## getTransactionStore +## waitForTransactionHash - Retrieve the transaction store for a given address. +Wait for a transaction to be submitted onchain and return the transaction hash. ### Example ```ts -import { getTransactionStore } from "thirdweb/transaction"; +import { Engine } from "thirdweb"; -const store = getTransactionStore("0x..."); -store.subscribe((transactions) => { - console.log(transactions); +const { transactionHash } = await Engine.waitForTransactionHash({ + client, + transactionId, // the transaction id returned from enqueueTransaction }); ``` ```ts -function getTransactionStore( - address: string, -): Store>; +function waitForTransactionHash(args: { + client: ThirdwebClient; + timeoutInSeconds?: number; + transactionId: string; +}): Promise<{ + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}>; ``` ### Parameters - The address to retrieve the transaction store for. +The arguments for the transaction. #### Type ```ts -let address: string; +let args: { + client: ThirdwebClient; + timeoutInSeconds?: number; + transactionId: string; +}; ``` ### Returns ```ts -let returnType: Store>; +let returnType: Promise<{ + chain: Readonly; + client: ThirdwebClient; + maxBlocksWaitTime?: number; + readonly transactionHash: `0x${string}`; +}>; ``` - - A store of transactions for the given account to subscribe to. --- # Nebula --- ## chat - Chat with Nebula. +Chat with Nebula. ### Example @@ -48993,7 +50936,7 @@ const response = await Nebula.chat({ }); ``` - Multi message prompt: +Multi message prompt: ```ts const response = await Nebula.chat({ @@ -49009,7 +50952,7 @@ const response = await Nebula.chat({ }); ``` - Extracting and sending transactions from a chat response: +Extracting and sending transactions from a chat response: ```ts const response = await Nebula.chat({ ... }); @@ -49025,7 +50968,7 @@ function chat(input: Input): Promise; ### Parameters - The input for the chat. +The input for the chat. #### Type @@ -49060,12 +51003,12 @@ let returnType: { }; ``` - The chat response. This API is in early access and might change in the future. +The chat response. This API is in early access and might change in the future. --- ## execute - Execute a transaction based on a prompt. +Execute a transaction based on a prompt. ### Example @@ -49085,7 +51028,7 @@ const result = await Nebula.execute({ }); ``` - Multi message prompt: +Multi message prompt: ```ts Nebula.execute({ @@ -49114,7 +51057,7 @@ function execute( ### Parameters - The input for the transaction. +The input for the transaction. #### Type @@ -49128,14 +51071,14 @@ let input: Input & { account: Account }; let returnType: Promise; ``` - The transaction hash. This API is in early access and might change in the future. +The transaction hash. This API is in early access and might change in the future. --- # Social API --- ## getSocialProfiles - Fetches the wallet's available social profiles. +Fetches the wallet's available social profiles. ### Example @@ -49156,7 +51099,7 @@ function getSocialProfiles(args: { ### Parameters - The arguments to use when fetching the social profiles. +The arguments to use when fetching the social profiles. #### Type @@ -49176,14 +51119,14 @@ let returnType: { }; ``` - A promise resolving to the array of social profiles for the given address. +A promise resolving to the array of social profiles for the given address. --- # Auth --- ## createAuth - Creates an authentication object with the given options. +Creates an authentication object with the given options. ### Example @@ -49211,9 +51154,7 @@ const jwt = await auth.generateJWT({ payload: verifiedPayload }); ```ts function createAuth(options: AuthOptions): { - generateJWT: ( - params: GenerateJWTParams, - ) => Promise; + generateJWT: (params: GenerateJWTParams) => Promise; generatePayload: ( __namedParameters: GenerateLoginPayloadParams, ) => Promise; @@ -49226,7 +51167,7 @@ function createAuth(options: AuthOptions): { ### Parameters - The options for creating the authentication object. +The options for creating the authentication object. #### Type @@ -49260,9 +51201,7 @@ let options: { ```ts let returnType: { - generateJWT: ( - params: GenerateJWTParams, - ) => Promise; + generateJWT: (params: GenerateJWTParams) => Promise; generatePayload: ( __namedParameters: GenerateLoginPayloadParams, ) => Promise; @@ -49273,11 +51212,13 @@ let returnType: { }; ``` - The created authentication object. +The created authentication object. --- ## isErc6492Signature +Determines if a signature is compatible with [ERC6492](https://eips.ethereum.org/EIPS/eip-6492) + ### Example ```ts @@ -49294,7 +51235,7 @@ function isErc6492Signature(signature: `0x${string}`): boolean; ### Parameters - The signature to check for ERC6492 compatibility +The signature to check for ERC6492 compatibility #### Type @@ -49308,11 +51249,13 @@ let signature: `0x${string}`; let returnType: boolean; ``` - True if the signature is compatible with ERC6492, false otherwise +True if the signature is compatible with ERC6492, false otherwise --- ## parseErc6492Signature +Parses a serialized (Hex) [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492) signature. If the signature is not in ERC-6492 format, the original signature is returned. + ### Example ```ts @@ -49331,7 +51274,7 @@ function parseErc6492Signature( ### Parameters - The signature to parse +The signature to parse #### Type @@ -49345,11 +51288,13 @@ let signature: `0x${string}`; let returnType: OneOf; ``` - ParseErc6492SignatureReturnType The parsed (or original) signature +ParseErc6492SignatureReturnType The parsed (or original) signature --- ## serializeErc6492Signature +Serializes a signature for use with [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492). The signature must be generated by a signer for an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Account Factory account with counterfactual deployment addresses. + ### Example ```ts @@ -49366,7 +51311,7 @@ const serializedSignature = serializeErc6492Signature({ ```ts function serializeErc6492Signature( __namedParameters: Erc6492Signature, -): Hex; +): `0x${string}`; ``` ### Parameters @@ -49380,15 +51325,15 @@ let __namedParameters: { address: string; data: Hex; signature: Hex }; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The serialized signature +The serialized signature --- ## signLoginPayload - Signs the login payload using the provided account. +Signs the login payload using the provided account. ### Example @@ -49409,7 +51354,7 @@ function signLoginPayload( ### Parameters - The options for signing the login payload. +The options for signing the login payload. #### Type @@ -49435,11 +51380,13 @@ let returnType: { }; ``` - An object containing the signature and the payload. +An object containing the signature and the payload. --- ## verifyContractWalletSignature +Verifies a contract wallet signature using [ERC-6942](https://eips.ethereum.org/EIPS/eip-6942) Signature Validation for Predeploy Contracts. This function will validate signatures for both deployed and undeployed smart accounts of all signature types. + ### Example ```ts @@ -49461,7 +51408,7 @@ function verifyContractWalletSignature(__namedParameters: { verificationCalldata: `0x${string}`; }; address: string; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; message: Message; signature: string | Uint8Array; @@ -49479,7 +51426,7 @@ let __namedParameters: { verificationCalldata: `0x${string}`; }; address: string; - chain: Readonly; + chain: Readonly; client: ThirdwebClient; message: Message; signature: string | Uint8Array; @@ -49492,12 +51439,12 @@ let __namedParameters: { let returnType: Promise; ``` - A boolean indicating whether the signature is valid. +A boolean indicating whether the signature is valid. --- ## verifyEOASignature - Verifies the signature of a message using an Ethereum account's EOA (Externally Owned Account). +Verifies the signature of a message using an Ethereum account's EOA (Externally Owned Account). ### Example @@ -49519,7 +51466,7 @@ function verifyEOASignature( ### Parameters - The options for verifying the signature. +The options for verifying the signature. #### Type @@ -49537,14 +51484,14 @@ let options: { let returnType: Promise; ``` - A boolean indicating whether the signature is valid. +A boolean indicating whether the signature is valid. --- ## verifySignature - Verifies the signature based on the provided options. Handles smart contract wallet signatures and EOA signatures. _IMPORTANT: in order to check smart contract signatures, a chain and client must be provided. Or, you can use the `verifyContractWalletSignature` function directly if all signatures will be from smart accounts._ +Verifies the signature based on the provided options. Handles smart contract wallet signatures and EOA signatures._IMPORTANT: in order to check smart contract signatures, a chain and client must be provided. Or, you can use the `verifyContractWalletSignature` function directly if all signatures will be from smart accounts._ - verifyContractWalletSignature +verifyContractWalletSignature ### Example @@ -49578,7 +51525,7 @@ function verifySignature(options: { ### Parameters - The options for signature verification. +The options for signature verification. #### Type @@ -49603,11 +51550,13 @@ let options: { let returnType: Promise; ``` - A boolean indicating whether the signature is valid or not. +A boolean indicating whether the signature is valid or not. --- ## verifyTypedData +Verify am [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data signature. This function is interoperable with all wallet types (smart accounts or EOAs). + ### Example ```ts @@ -49669,12 +51618,12 @@ let __namedParameters: VerifyTypedDataParams; let returnType: Promise; ``` - A promise that resolves to `true` if the signature is valid, or `false` otherwise. +A promise that resolves to `true` if the signature is valid, or `false` otherwise. --- ## decodeJWT - Decodes a JSON Web Token (JWT) and returns the decoded payload and signature. +Decodes a JSON Web Token (JWT) and returns the decoded payload and signature. ### Example @@ -49693,7 +51642,7 @@ function decodeJWT(jwt: string): { ### Parameters - The JWT string to decode. +The JWT string to decode. #### Type @@ -49707,12 +51656,12 @@ let jwt: string; let returnType: { payload: JWTPayload; signature: `0x${string}` }; ``` - An object containing the decoded payload and signature. +An object containing the decoded payload and signature. --- ## encodeJWT - Builds a JSON Web Token (JWT) using the provided options. +Builds a JSON Web Token (JWT) using the provided options. ### Example @@ -49742,7 +51691,7 @@ function encodeJWT(options: EncodeJWTParams): Promise; ### Parameters - The options for building the JWT. +The options for building the JWT. #### Type @@ -49756,12 +51705,12 @@ let options: EncodeJWTParams; let returnType: Promise; ``` - The generated JWT. +The generated JWT. --- ## refreshJWT - Refreshes a JSON Web Token (JWT) by encoding a new payload with updated expiration time. +Refreshes a JSON Web Token (JWT) by encoding a new payload with updated expiration time. ### Example @@ -49781,7 +51730,7 @@ function refreshJWT(options: RefreshJWTParams): Promise; ### Parameters - The options for refreshing the JWT. +The options for refreshing the JWT. #### Type @@ -49799,18 +51748,18 @@ let options: { let returnType: Promise; ``` - A Promise that resolves to the refreshed JWT. +A Promise that resolves to the refreshed JWT. --- # NFT --- ## NFTDescription - This component fetches and displays an NFT's description. It inherits all the attributes of a ``so you can style it just like how you would style a `` element. +This component fetches and displays an NFT's description. It inherits all the attributes of a ``so you can style it just like how you would style a `` element. ### Example -#### Basic usage +#### Basic usage ```tsx import { NFTProvider, NFTDescription } from "thirdweb/react"; @@ -49820,7 +51769,7 @@ import { NFTProvider, NFTDescription } from "thirdweb/react"; ; ``` -#### Show a loading sign while the description is being fetched +#### Show a loading sign while the description is being fetched ```tsx import { NFTProvider, NFTDescription } from "thirdweb/react"; @@ -49830,7 +51779,7 @@ import { NFTProvider, NFTDescription } from "thirdweb/react"; ; ``` -#### Show something in case the description failed to resolve +#### Show something in case the description failed to resolve ```tsx import { NFTProvider, NFTDescription } from "thirdweb/react"; @@ -49842,7 +51791,7 @@ import { NFTProvider, NFTDescription } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery (tanstack-query) +#### Custom query options for useQuery (tanstack-query) ```tsx import { NFTProvider, NFTDescription } from "thirdweb/react"; @@ -49852,15 +51801,15 @@ import { NFTProvider, NFTDescription } from "thirdweb/react"; ; ``` -#### Override the description with the `descriptionResolver` prop +#### Override the description with the `descriptionResolver` prop - If you already have the url, you can skip the network requests and pass it directly to the NFTDescription +If you already have the url, you can skip the network requests and pass it directly to the NFTDescription ```tsx ; ``` - You can also pass in your own custom (async) function that retrieves the description +You can also pass in your own custom (async) function that retrieves the description ```tsx const getDescription = async () => { @@ -49882,7 +51831,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" | "step" | "page" | "location" | "date",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" | "tree" | "listbox",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",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -49891,16 +51840,16 @@ let __namedParameters: {about : string,accessKey : string,aria-activedescendant let returnType: null | Element; ``` - A `` element containing the description of the NFT +A `` element containing the description of the NFT --- ## 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. +This component fetches and displays an NFT's media. It uses thirdweb [MediaRenderer](https://portal.thirdweb.com/refernces/typescript/v5/MediaRenderer) under the hood so you can style it just like how you would style a MediaRenderer. ### Example -#### Basic usage +#### Basic usage ```tsx import { NFTProvider, NFTMedia } from "thirdweb/react"; @@ -49910,7 +51859,7 @@ import { NFTProvider, NFTMedia } from "thirdweb/react"; ; ``` -#### Show a loading sign while the media is being fetched +#### Show a loading sign while the media is being fetched ```tsx import { NFTProvider, NFTMedia } from "thirdweb/react"; @@ -49920,7 +51869,7 @@ import { NFTProvider, NFTMedia } from "thirdweb/react"; ; ``` -#### Show something in case the media failed to resolve +#### Show something in case the media failed to resolve ```tsx import { NFTProvider, NFTMedia } from "thirdweb/react"; @@ -49930,7 +51879,7 @@ import { NFTProvider, NFTMedia } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery (tanstack-query) +#### Custom query options for useQuery (tanstack-query) ```tsx import { NFTProvider, NFTMedia } from "thirdweb/react"; @@ -49940,17 +51889,17 @@ import { NFTProvider, NFTMedia } from "thirdweb/react"; ; ``` -#### Basic stylings +#### Basic stylings - You can style NFTMedia with the `style` and `className` props. +You can style NFTMedia with the `style` and `className` props. ```tsx ; ``` -#### Override the media with the `mediaResolver` prop +#### Override the media with the `mediaResolver` prop - If you already have the url, you can skip the network requests and pass it directly to the NFTMedia +If you already have the url, you can skip the network requests and pass it directly to the NFTMedia ```tsx ; ``` - You can also pass in your own custom (async) function that retrieves the media url +You can also pass in your own custom (async) function that retrieves the media url ```tsx const getMedia = async () => { @@ -50005,16 +51954,16 @@ let __namedParameters: Omit< let returnType: null | Element; ``` - A MediaRenderer component +A MediaRenderer component --- ## 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. +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. ### Example -#### Basic usage +#### Basic usage ```tsx import { NFTProvider, NFTName } from "thirdweb/react"; @@ -50024,7 +51973,7 @@ import { NFTProvider, NFTName } from "thirdweb/react"; ; ``` -#### Show a loading sign while the name is being fetched +#### Show a loading sign while the name is being fetched ```tsx import { NFTProvider, NFTName } from "thirdweb/react"; @@ -50034,7 +51983,7 @@ import { NFTProvider, NFTName } from "thirdweb/react"; ; ``` -#### Show something in case the name failed to resolve +#### Show something in case the name failed to resolve ```tsx import { NFTProvider, NFTName } from "thirdweb/react"; @@ -50044,7 +51993,7 @@ import { NFTProvider, NFTName } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery (tanstack-query) +#### Custom query options for useQuery (tanstack-query) ```tsx import { NFTProvider, NFTName } from "thirdweb/react"; @@ -50054,15 +52003,15 @@ import { NFTProvider, NFTName } from "thirdweb/react"; ; ``` -#### Override the name with the `nameResolver` prop +#### Override the name with the `nameResolver` prop - If you already have the name, you can skip the network requests and pass it directly to the NFTName +If you already have the name, you can skip the network requests and pass it directly to the NFTName ```tsx ; ``` - You can also pass in your own custom (async) function that retrieves the name +You can also pass in your own custom (async) function that retrieves the name ```tsx const getName = async () => { @@ -50082,7 +52031,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" | "step" | "page" | "location" | "date",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" | "tree" | "listbox",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",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -50091,20 +52040,20 @@ let __namedParameters: {about : string,accessKey : string,aria-activedescendant let returnType: null | Element; ``` - A `` element containing the name of the NFT +A `` element containing the name of the NFT --- # Buy Crypto --- ## convertCryptoToFiat - Get a price of a token (using tokenAddress + chainId) in fiat. Only USD is supported at the moment. +Get a price of a token (using tokenAddress + chainId) in fiat. Only USD is supported at the moment. ### Example -#### Basic usage +#### Basic usage - For native token (non-ERC20), you should use NATIVE\_TOKEN\_ADDRESS as the value for `tokenAddress` +For native token (non-ERC20), you should use NATIVE\_TOKEN\_ADDRESS as the value for `tokenAddress` ```ts import { convertCryptoToFiat } from "thirdweb/pay"; @@ -50146,16 +52095,16 @@ let options: { let returnType: Promise<{ result: number }>; ``` - a number representing the price (in selected fiat) of "x" token, with "x" being the `fromAmount` . +a number representing the price (in selected fiat) of "x" token, with "x" being the `fromAmount`. --- ## convertFiatToCrypto - Convert a fiat value to a token. Currently only USD is supported. +Convert a fiat value to a token. Currently only USD is supported. ### Example -#### Basic usage +#### Basic usage ```ts import { convertFiatToCrypto } from "thirdweb/pay"; @@ -50172,7 +52121,7 @@ const result = await convertFiatToCrypto({ }); ``` - Result: `{ result: 0.0000057 }` +Result: `{ result: 0.0000057 }` ```ts function convertFiatToCrypto( @@ -50203,9 +52152,9 @@ let returnType: Promise<{ result: number }>; ## getBuyHistory - Get Buy transaction history for a given wallet address. +Get Buy transaction history for a given wallet address. - This includes both "Buy with Cryto" and "Buy with Fiat" transactions +This includes both "Buy with Cryto" and "Buy with Fiat" transactions ### Example @@ -50229,7 +52178,7 @@ function getBuyHistory( ### Parameters - Object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams) +Object of type [BuyHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyHistoryParams) #### Type @@ -50257,7 +52206,9 @@ let returnType: { ## getBuyWithCryptoHistory - Gets the History of purchases for a given wallet address +Deprecated + +Gets the History of purchases for a given wallet address ### Example @@ -50284,7 +52235,7 @@ function getBuyWithCryptoHistory( ### Parameters - Object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams) +Object of type [BuyWithCryptoHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryParams) #### Type @@ -50306,14 +52257,16 @@ let returnType: { }; ``` - Object of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData) +Object of type [BuyWithCryptoHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoHistoryData) --- ## 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. +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. +Once you have the quote, you can use `prepareTransaction` and prepare the transaction for submission. ### Example @@ -50342,7 +52295,7 @@ function getBuyWithCryptoQuote( ### Parameters - object of type [GetBuyWithCryptoQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoQuoteParams) +object of type [GetBuyWithCryptoQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoQuoteParams) #### Type @@ -50354,6 +52307,7 @@ let params: { fromTokenAddress: string; intentId?: string; maxSlippageBPS?: number; + paymentLinkId?: string; purchaseData?: object; toAddress: string; toChainId: number; @@ -50368,7 +52322,7 @@ let params: { ```ts let returnType: { - approval?: PrepareTransactionOptions; + approvalData?: QuoteApprovalInfo; client: ThirdwebClient; paymentTokens: Array; processingFees: Array; @@ -50398,12 +52352,16 @@ let returnType: { }; ``` - 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. +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 - Gets the status of a buy with crypto transaction +Deprecated + +use Bridge.status instead + +Gets the status of a buy with crypto transaction ### Example @@ -50447,12 +52405,13 @@ function getBuyWithCryptoStatus( ### Parameters - Object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) +Object of type [BuyWithCryptoTransaction](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransaction) #### Type ```ts let buyWithCryptoTransaction: { + chainId: number; client: ThirdwebClient; transactionHash: string; }; @@ -50478,14 +52437,16 @@ let returnType: }; ``` - Object of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) +Object of type [BuyWithCryptoStatus](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoStatus) --- ## 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. +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. +Once you have the quote, you can use `prepareTransaction` and prepare the transaction for submission. ### Example @@ -50514,7 +52475,7 @@ function getBuyWithCryptoTransfer( ### Parameters - object of type [GetBuyWithCryptoTransferParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoTransferParams) +object of type [GetBuyWithCryptoTransferParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithCryptoTransferParams) #### Type @@ -50523,7 +52484,9 @@ let params: { amount: string; chainId: number; client: ThirdwebClient; + feePayer?: "sender" | "receiver"; fromAddress: string; + paymentLinkId?: string; purchaseData?: object; toAddress: string; tokenAddress: string; @@ -50534,7 +52497,7 @@ let params: { ```ts let returnType: { - approval?: PrepareTransactionOptions; + approvalData?: QuoteApprovalInfo; client: ThirdwebClient; estimatedGasCostUSDCents: number; fromAddress: string; @@ -50545,12 +52508,14 @@ let returnType: { }; ``` - Object of type [BuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransfer) which contains the information about the transfer +Object of type [BuyWithCryptoTransfer](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoTransfer) which contains the information about the transfer --- ## getBuyWithFiatHistory - Get the "Buy with fiat" transaction history for a given wallet address +Deprecated + +Get the "Buy with fiat" transaction history for a given wallet address ### Example @@ -50577,7 +52542,7 @@ function getBuyWithFiatHistory( ### Parameters - Object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams) +Object of type [BuyWithFiatHistoryParams](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryParams) #### Type @@ -50599,41 +52564,41 @@ let returnType: { }; ``` - Object of type [BuyWithFiatHistoryData](https://portal.thirdweb.com/references/typescript/v5/BuyWithFiatHistoryData) +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. +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 +#### 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 +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 +#### 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. +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. +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 +#### 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. +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) . +`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 +#### 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) . +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. +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: +Get a quote for buying 10 USDC on polygon chain (chainId: 137) with USD fiat currency: ```ts import { getBuyWithFiatQuote } from "thirdweb/pay"; @@ -50659,7 +52624,7 @@ function getBuyWithFiatQuote( ### Parameters - object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams) +object of type [GetBuyWithFiatQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatQuoteParams) #### Type @@ -50668,9 +52633,10 @@ let params: { client: ThirdwebClient; fromAddress: string; fromAmount?: string; - fromCurrencySymbol: "USD" | "CAD" | "GBP" | "EUR" | "JPY"; + fromCurrencySymbol: CurrencyMeta["shorthand"]; isTestMode?: boolean; maxSlippageBPS?: number; + paymentLinkId?: string; preferredProvider?: FiatProvider; purchaseData?: object; toAddress: string; @@ -50701,19 +52667,6 @@ let returnType: { currencySymbol: string; decimals: number; }; - gasToken?: { - amount: string; - amountUSDCents: number; - amountWei: string; - token: { - chainId: number; - decimals: number; - name: string; - priceUSDCents: number; - symbol: string; - tokenAddress: string; - }; - }; intentId: string; maxSlippageBPS: number; onRampLink: string; @@ -50721,14 +52674,7 @@ let returnType: { amount: string; amountUSDCents: number; amountWei: string; - token: { - chainId: number; - decimals: number; - name: string; - priceUSDCents: number; - symbol: string; - tokenAddress: string; - }; + token: PayTokenInfo; }; processingFees: Array<{ amount: string; @@ -50737,42 +52683,44 @@ let returnType: { decimals: number; feeType: "ON_RAMP" | "NETWORK"; }>; + provider: FiatProvider; + routingToken?: { + amount: string; + amountUSDCents: number; + amountWei: string; + token: PayTokenInfo; + }; toAddress: string; toAmountMin: string; toAmountMinWei: string; - toToken: { - chainId: number; - decimals: number; - name?: string; - priceUSDCents?: number; - symbol?: string; - tokenAddress: 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. +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 - 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` +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.. +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. +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 +##### 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. +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 +#### 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. +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) . +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. +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 @@ -50790,7 +52738,6 @@ const fiatStatus = await getBuyWithFiatStatus({ }); // when the fiatStatus.status is "ON_RAMP_TRANSFER_COMPLETED" - the process is complete -// when the fiatStatus.status is "CRYPTO_SWAP_REQUIRED" - start the swap process ``` ```ts @@ -50801,7 +52748,7 @@ function getBuyWithFiatStatus( ### Parameters - Object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatStatusParams) +Object of type [GetBuyWithFiatStatusParams](https://portal.thirdweb.com/references/typescript/v5/GetBuyWithFiatStatusParams) #### Type @@ -50847,15 +52794,7 @@ let returnType: | "NONE" | "PENDING_PAYMENT" | "PAYMENT_FAILED" - | "PENDING_ON_RAMP_TRANSFER" - | "ON_RAMP_TRANSFER_IN_PROGRESS" - | "ON_RAMP_TRANSFER_COMPLETED" - | "ON_RAMP_TRANSFER_FAILED" - | "CRYPTO_SWAP_REQUIRED" - | "CRYPTO_SWAP_COMPLETED" - | "CRYPTO_SWAP_FALLBACK" - | "CRYPTO_SWAP_IN_PROGRESS" - | "CRYPTO_SWAP_FAILED"; + | "ON_RAMP_TRANSFER_COMPLETED"; toAddress: string; }; ``` @@ -50863,15 +52802,17 @@ let returnType: ## 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. +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. +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 +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. +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 @@ -50906,7 +52847,7 @@ function getPostOnRampQuote( ### Parameters - object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams) +object of type [GetPostOnRampQuoteParams](https://portal.thirdweb.com/references/typescript/v5/GetPostOnRampQuoteParams) #### Type @@ -50914,6 +52855,7 @@ function getPostOnRampQuote( let params: { buyWithFiatStatus: BuyWithFiatStatus; client: ThirdwebClient; + paymentLinkId?: string; }; ``` @@ -50921,7 +52863,7 @@ let params: { ```ts let returnType: { - approval?: PrepareTransactionOptions; + approvalData?: QuoteApprovalInfo; client: ThirdwebClient; paymentTokens: Array; processingFees: Array; @@ -50951,16 +52893,18 @@ let returnType: { }; ``` - 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. +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 - Check if a Swap is required after on-ramp when buying a token with fiat currency. +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 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. +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( @@ -50970,7 +52914,7 @@ function isSwapRequiredPostOnramp( ### 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. +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 @@ -50992,11 +52936,11 @@ let returnType: boolean; ## TokenIcon - This component tries to resolve the icon of a given token, then return an image. +This component tries to resolve the icon of a given token, then return an image. ### Example -#### Basic usage +#### Basic usage ```tsx import { TokenProvider, TokenIcon } from "thirdweb/react"; @@ -51010,21 +52954,21 @@ import { TokenProvider, TokenIcon } from "thirdweb/react"; ; ``` - Result: An `` component with the src of the icon +Result: An `` component with the src of the icon ```html ``` -#### Override the icon with the `iconResolver` prop +#### 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 +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 +You can also pass in your own custom (async) function that retrieves the icon url ```tsx const getIcon = async () => { @@ -51035,21 +52979,21 @@ const getIcon = async () => { ; ``` -#### Show a loading sign while the icon is being loaded +#### Show a loading sign while the icon is being loaded ```tsx } />; ``` -#### Fallback to a dummy image if the token icon fails to resolve +#### Fallback to a dummy image if the token icon fails to resolve ```tsx } />; ``` -#### Usage with queryOptions +#### 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 +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 ; @@ -51064,7 +53008,7 @@ function TokenIcon(__namedParameters: TokenIconProps): 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" | "step" | "page" | "location" | "date",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" | "tree" | "listbox",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",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 : "eager" | "lazy",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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 @@ -51073,16 +53017,16 @@ let __namedParameters: {about : string,accessKey : string,alt : string,aria-acti let returnType: null | Element; ``` - an `` with the src of the token icon +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 `` +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 +#### Basic usage ```tsx import { TokenProvider, TokenName } from "thirdweb/react"; @@ -51093,15 +53037,15 @@ import { ethereum } from "thirdweb/chains"; ; ``` - Result: +Result: ```html Ether ``` -#### Custom name resolver +#### 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. +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() { @@ -51112,15 +53056,15 @@ async function fetchNameMethod() { ; ``` - Alternatively you can also pass in a string directly: +Alternatively you can also pass in a string directly: ```tsx ; ``` -#### Format the name (capitalize, truncate, etc.) +#### 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 +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" @@ -51128,13 +53072,13 @@ const concatStr = (str: string):string => str + "Token" ``` - Result: +Result: ```html Ether Token ``` -#### Show a loading sign when the name is being fetched +#### Show a loading sign when the name is being fetched ```tsx import { TokenProvider, TokenName } from "thirdweb/react"; @@ -51144,7 +53088,7 @@ import { TokenProvider, TokenName } from "thirdweb/react"; ; ``` -#### Fallback to something when the name fails to resolve +#### Fallback to something when the name fails to resolve ```tsx @@ -51152,9 +53096,9 @@ import { TokenProvider, TokenName } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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 @@ -51186,11 +53130,11 @@ 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 `` +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 +#### Basic usage ```tsx import { TokenProvider, TokenSymbol } from "thirdweb/react"; @@ -51201,15 +53145,15 @@ import { ethereum } from "thirdweb/chains"; ; ``` - Result: +Result: ```html ETH ``` -#### Custom symbol resolver +#### 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. +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() { @@ -51220,15 +53164,15 @@ async function getSymbol() { ; ``` - Alternatively, you can pass in a string directly: +Alternatively, you can pass in a string directly: ```tsx ; ``` -#### Format the symbol (capitalize, truncate, etc.) +#### 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 +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" @@ -51236,13 +53180,13 @@ const concatStr = (str: string):string => str + "Token" ``` - Result: +Result: ```html Ether Token ``` -#### Show a loading sign when the symbol is being fetched +#### Show a loading sign when the symbol is being fetched ```tsx import { TokenProvider, TokenSymbol } from "thirdweb/react"; @@ -51252,7 +53196,7 @@ import { TokenProvider, TokenSymbol } from "thirdweb/react"; ; ``` -#### Fallback to something when the symbol fails to resolve +#### Fallback to something when the symbol fails to resolve ```tsx @@ -51260,9 +53204,9 @@ import { TokenProvider, TokenSymbol } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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} +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 @@ -51298,13 +53242,17 @@ let returnType: null | Element; ## 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: +Download a file from IPFS: ```ts import { download } from "thirdweb/storage"; -import { createThirdwebClient } from "@thirdweb-dev/sdk"; +import { createThirdwebClient } from "thirdweb"; const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); @@ -51314,11 +53262,11 @@ const file = await download({ }); ``` - Download a file from Arweave: +Download a file from Arweave: ```ts import { download } from "thirdweb/storage"; -import { createThirdwebClient } from "@thirdweb-dev/sdk"; +import { createThirdwebClient } from "thirdweb"; const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); @@ -51328,11 +53276,11 @@ const file = await download({ }); ``` - Download a file from HTTP: +Download a file from HTTP: ```ts import { download } from "thirdweb/storage"; -import { createThirdwebClient } from "@thirdweb-dev/sdk"; +import { createThirdwebClient } from "thirdweb"; const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); @@ -51352,7 +53300,7 @@ function download(options: { ### Parameters - The download options. +The download options. #### Type @@ -51370,12 +53318,12 @@ let options: { let returnType: Promise; ``` - Asynchronously returns the network response from fetching the file. +Asynchronously returns the network response from fetching the file. --- ## resolveArweaveScheme - Resolves the scheme of a given Arweave URI and returns the corresponding URL. +Resolves the scheme of a given Arweave URI and returns the corresponding URL. ### Example @@ -51392,7 +53340,7 @@ function resolveArweaveScheme( ### Parameters - The options object containing the Arweave URI +The options object containing the Arweave URI #### Type @@ -51406,12 +53354,12 @@ let options: { gatewayUrl?: string; uri: string }; let returnType: string; ``` - The resolved URL +The resolved URL --- ## resolveScheme - Resolves the scheme of a given URI and returns the corresponding URL. If the URI starts with "ipfs://", it constructs a URL using the IPFS client ID and the IPFS gateway. If the URI starts with "http", it returns the URI as is. Otherwise, it throws an error indicating an invalid URI scheme. +Resolves the scheme of a given URI and returns the corresponding URL. If the URI starts with "ipfs://", it constructs a URL using the IPFS client ID and the IPFS gateway. If the URI starts with "http", it returns the URI as is. Otherwise, it throws an error indicating an invalid URI scheme. ### Example @@ -51429,7 +53377,7 @@ function resolveScheme(options: ResolveSchemeOptions): string; ### Parameters - The options object containing the URI and the IPFS client. +The options object containing the URI and the IPFS client. #### Type @@ -51443,12 +53391,12 @@ let options: { client: ThirdwebClient; uri: string }; let returnType: string; ``` - The resolved URL. +The resolved URL. --- ## unpin - Unpins a file from IPFS. For security purposes, this method requires a secret key to be set in the ThirdwebClient instance. +Unpins a file from IPFS. For security purposes, this method requires a secret key to be set in the ThirdwebClient instance. ### Example @@ -51467,7 +53415,7 @@ function unpin(options: UnpinOptions): Promise; ### Parameters - The options for unpinning the file. +The options for unpinning the file. #### Type @@ -51484,11 +53432,11 @@ let returnType: Promise; ## upload - Uploads files based on the provided options. +Uploads files based on the provided options. ### Example -#### Uploading JSON objects +#### Uploading JSON objects ```ts import { upload } from "thirdweb/storage"; @@ -51505,7 +53453,7 @@ const uri = await upload({ }); ``` -#### Uploading files +#### Uploading files ```ts import { upload } from "thirdweb/storage"; @@ -51523,7 +53471,7 @@ function upload( ### Parameters - The upload options. +The upload options. #### Type @@ -51537,12 +53485,12 @@ let options: UploadOptions; let returnType: Promise>; ``` - A promise that resolves to the uploaded file URI or URIs (when passing multiple files). +A promise that resolves to the uploaded file URI or URIs (when passing multiple files). --- ## uploadMobile - Batch upload arbitrary file or JSON data using the configured decentralized storage system. Automatically uploads any file data within JSON objects and replaces them with hashes. +Batch upload arbitrary file or JSON data using the configured decentralized storage system. Automatically uploads any file data within JSON objects and replaces them with hashes. ### Example @@ -51578,7 +53526,7 @@ function uploadMobile( ### Parameters - Options to pass through to the storage uploader class +Options to pass through to the storage uploader class #### Type @@ -51592,14 +53540,14 @@ let options: InternalUploadMobileOptions & { client: ThirdwebClient }; let returnType: Promise>; ``` - The URIs of the uploaded data +The URIs of the uploaded data --- # RPC --- ## eth\_blockNumber - Retrieves the current block number from the Ethereum blockchain. +Retrieves the current block number from the Ethereum blockchain. ### Example @@ -51645,7 +53593,7 @@ function eth_blockNumber( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -51687,12 +53635,12 @@ let request: EIP1193RequestFn< let returnType: Promise; ``` - A promise that resolves to the current block number as a bigint. +A promise that resolves to the current block number as a bigint. --- ## eth\_call - Executes a call or a transaction on the Ethereum network. +Executes a call or a transaction on the Ethereum network. ### Example @@ -51741,12 +53689,12 @@ function eth_call( blockTag?: BlockTag | undefined; stateOverrides?: StateOverride; }, -): Promise; +): Promise<`0x${string}`>; ``` ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -51782,7 +53730,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for the call or transaction. +The parameters for the call or transaction. #### Type @@ -51797,15 +53745,15 @@ let params: Partial & { ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - A promise that resolves to the result of the call or transaction. +A promise that resolves to the result of the call or transaction. --- ## eth\_estimateGas - Estimates the gas required to execute a transaction on the Ethereum network. +Estimates the gas required to execute a transaction on the Ethereum network. ### Example @@ -51855,204 +53803,7 @@ function eth_estimateGas( ### Parameters - The EIP1193 request function. - -#### Type - -```ts -let request: EIP1193RequestFn< - [ - { - Method: "web3_clientVersion"; - Parameters?: undefined; - ReturnType: string; - }, - { - Method: "web3_sha3"; - Parameters: [data: `0x${string}`]; - ReturnType: string; - }, - { - Method: "net_listening"; - Parameters?: undefined; - ReturnType: boolean; - }, - { - Method: "net_peerCount"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - { - Method: "net_version"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - ] ->; -``` - - The transaction request object. - -#### Type - -```ts -let transactionRequest: RpcTransactionRequest; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - A promise that resolves to the estimated gas as a bigint. ---- - -## eth\_gasPrice - - Retrieves the current gas price from the Ethereum network. - -### Example - -```ts -import { getRpcClient, eth_gasPrice } from "thirdweb/rpc"; -const rpcRequest = getRpcClient({ client, chain }); -const gasPrice = await eth_gasPrice(rpcRequest); -``` - -```ts -function eth_gasPrice( - request: EIP1193RequestFn< - [ - { - Method: "web3_clientVersion"; - Parameters?: undefined; - ReturnType: string; - }, - { - Method: "web3_sha3"; - Parameters: [data: `0x${string}`]; - ReturnType: string; - }, - { - Method: "net_listening"; - Parameters?: undefined; - ReturnType: boolean; - }, - { - Method: "net_peerCount"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - { - Method: "net_version"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - ] - >, -): Promise; -``` - -### Parameters - - The EIP1193 request function. - -#### Type - -```ts -let request: EIP1193RequestFn< - [ - { - Method: "web3_clientVersion"; - Parameters?: undefined; - ReturnType: string; - }, - { - Method: "web3_sha3"; - Parameters: [data: `0x${string}`]; - ReturnType: string; - }, - { - Method: "net_listening"; - Parameters?: undefined; - ReturnType: boolean; - }, - { - Method: "net_peerCount"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - { - Method: "net_version"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - ] ->; -``` - -### Returns - -```ts -let returnType: Promise; -``` - - A promise that resolves to the gas price as a bigint. ---- - -## eth\_getBalance - - Retrieves the balance of the specified Ethereum address. - -### Example - -```ts -import { getRpcClient, eth_getBalance } from "thirdweb/rpc"; -const rpcRequest = getRpcClient({ client, chain }); -const balance = await eth_getBalance(rpcRequest, { - address: "0x...", -}); -``` - -```ts -function eth_getBalance( - request: EIP1193RequestFn< - [ - { - Method: "web3_clientVersion"; - Parameters?: undefined; - ReturnType: string; - }, - { - Method: "web3_sha3"; - Parameters: [data: `0x${string}`]; - ReturnType: string; - }, - { - Method: "net_listening"; - Parameters?: undefined; - ReturnType: boolean; - }, - { - Method: "net_peerCount"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - { - Method: "net_version"; - Parameters?: undefined; - ReturnType: `0x${string}`; - }, - ] - >, - params: GetBalanceParams, -): Promise; -``` - -### Parameters - - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52088,12 +53839,12 @@ let request: EIP1193RequestFn< >; ``` - The parameters for retrieving the balance. +The transaction request object. #### Type ```ts -let params: { address: string }; +let transactionRequest: RpcTransactionRequest; ``` ### Returns @@ -52102,26 +53853,23 @@ let params: { address: string }; let returnType: Promise; ``` - A promise that resolves to the balance of the address in wei as bigint. +A promise that resolves to the estimated gas as a bigint. --- -## eth\_getBlockByHash +## eth\_gasPrice - Retrieves a block by its hash. +Retrieves the current gas price from the Ethereum network. ### Example ```ts -import { getRpcClient, eth_getBlockByHash } from "thirdweb/rpc"; +import { getRpcClient, eth_gasPrice } from "thirdweb/rpc"; const rpcRequest = getRpcClient({ client, chain }); -const block = await eth_getBlockByHash(rpcRequest, { - blockHash: "0x...", - includeTransactions: true, -}); +const gasPrice = await eth_gasPrice(rpcRequest); ``` ```ts -function eth_getBlockByHash( +function eth_gasPrice( request: EIP1193RequestFn< [ { @@ -52151,13 +53899,12 @@ function eth_getBlockByHash( }, ] >, - params: GetBlockByHashParams, -): Promise>; +): Promise; ``` ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52191,44 +53938,33 @@ let request: EIP1193RequestFn< }, ] >; -``` - - The parameters for the block retrieval. - -#### Type - -```ts -let params: GetBlockByHashParams; ``` ### Returns ```ts -let returnType: Promise< - GetBlockReturnType ->; +let returnType: Promise; ``` - A promise that resolves to the retrieved block. +A promise that resolves to the gas price as a bigint. --- -## eth\_getBlockByNumber +## eth\_getBalance - Retrieves a block by its number or tag from the Ethereum blockchain. +Retrieves the balance of the specified Ethereum address. ### Example ```ts -import { getRpcClient, eth_getBlockByNumber } from "thirdweb/rpc"; +import { getRpcClient, eth_getBalance } from "thirdweb/rpc"; const rpcRequest = getRpcClient({ client, chain }); -const block = await eth_getBlockByNumber(rpcRequest, { - blockNumber: 123456, - includeTransactions: true, +const balance = await eth_getBalance(rpcRequest, { + address: "0x...", }); ``` ```ts -function eth_getBlockByNumber( +function eth_getBalance( request: EIP1193RequestFn< [ { @@ -52258,15 +53994,87 @@ function eth_getBlockByNumber( }, ] >, - params: GetBlockParameters, -): Promise< - GetBlockReturnType + params: GetBalanceParams, +): Promise; +``` + +### Parameters + +The EIP1193 request function. + +#### Type + +```ts +let request: EIP1193RequestFn< + [ + { + Method: "web3_clientVersion"; + Parameters?: undefined; + ReturnType: string; + }, + { + Method: "web3_sha3"; + Parameters: [data: `0x${string}`]; + ReturnType: string; + }, + { + Method: "net_listening"; + Parameters?: undefined; + ReturnType: boolean; + }, + { + Method: "net_peerCount"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + { + Method: "net_version"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + ] >; ``` +The parameters for retrieving the balance. + +#### Type + +```ts +let params: { address: string }; +``` + +### Returns + +```ts +let returnType: Promise; +``` + +A promise that resolves to the balance of the address in wei as bigint. +--- + +## eth\_getBlockByHash + +Retrieves a block by its hash. + +### Example + +```ts +import { getRpcClient, eth_getBlockByHash } from "thirdweb/rpc"; +const rpcRequest = getRpcClient({ client, chain }); +const block = await eth_getBlockByHash(rpcRequest, { + blockHash: "0x...", + includeTransactions: true, +}); +``` + +```ts +function eth_getBlockByHash(request: EIP1193RequestFn<[{ Method: "web3_clientVersion"; Parameters?: undefined; ReturnType: string }, { Method: "web3_sha3"; Parameters: [data: `0x${string}`]; ReturnType: string }, { Method: "net_listening"; Parameters?: undefined; ReturnType: boolean }, { Method: "net_peerCount"; Parameters?: undefined; ReturnType: `0x${string}` }, { Method: "net_version"; Parameters?: undefined; ReturnType: `0x${string}` }]>, params: GetBlockByHashParams) : Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: `0x${string}`; logsBloom: `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: `0x${string}`; number: bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array; withdrawalsRoot?: `0x${string}` }> +``` + ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52302,28 +54110,100 @@ let request: EIP1193RequestFn< >; ``` - The parameters for retrieving the block. +The parameters for the block retrieval. #### Type ```ts -let params: GetBlockParameters; +let params: GetBlockByHashParams; ``` ### Returns ```ts -let returnType: Promise< - GetBlockReturnType +let returnType: Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: `0x${string}`; logsBloom: `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: `0x${string}`; number: bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: `0x${string}`; blockNumber: bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array; withdrawalsRoot?: `0x${string}` }> +``` + +A promise that resolves to the retrieved block. +--- + +## eth\_getBlockByNumber + +Retrieves a block by its number or tag from the Ethereum blockchain. + +### Example + +```ts +import { getRpcClient, eth_getBlockByNumber } from "thirdweb/rpc"; +const rpcRequest = getRpcClient({ client, chain }); +const block = await eth_getBlockByNumber(rpcRequest, { + blockNumber: 123456, + includeTransactions: true, +}); +``` + +```ts +function eth_getBlockByNumber(request: EIP1193RequestFn<[{ Method: "web3_clientVersion"; Parameters?: undefined; ReturnType: string }, { Method: "web3_sha3"; Parameters: [data: `0x${string}`]; ReturnType: string }, { Method: "net_listening"; Parameters?: undefined; ReturnType: boolean }, { Method: "net_peerCount"; Parameters?: undefined; ReturnType: `0x${string}` }, { Method: "net_version"; Parameters?: undefined; ReturnType: `0x${string}` }]>, params: GetBlockParameters) : Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: TBlockTag extends "pending" ? null : `0x${string}`; logsBloom: TBlockTag extends "pending" ? null : `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: TBlockTag extends "pending" ? null : `0x${string}`; number: TBlockTag extends "pending" ? null : bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array; withdrawalsRoot?: `0x${string}` }> +``` + +### Parameters + +The EIP1193 request function. + +#### Type + +```ts +let request: EIP1193RequestFn< + [ + { + Method: "web3_clientVersion"; + Parameters?: undefined; + ReturnType: string; + }, + { + Method: "web3_sha3"; + Parameters: [data: `0x${string}`]; + ReturnType: string; + }, + { + Method: "net_listening"; + Parameters?: undefined; + ReturnType: boolean; + }, + { + Method: "net_peerCount"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + { + Method: "net_version"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + ] >; ``` - A promise that resolves to the requested block. +The parameters for retrieving the block. + +#### Type + +```ts +let params: GetBlockParameters; +``` + +### Returns + +```ts +let returnType: Promise<{ baseFeePerGas: null | bigint; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: `0x${string}`; gasLimit: bigint; gasUsed: bigint; hash: TBlockTag extends "pending" ? null : `0x${string}`; logsBloom: TBlockTag extends "pending" ? null : `0x${string}`; miner: string; mixHash: `0x${string}`; nonce: TBlockTag extends "pending" ? null : `0x${string}`; number: TBlockTag extends "pending" ? null : bigint; parentBeaconBlockRoot?: `0x${string}`; parentHash: `0x${string}`; receiptsRoot: `0x${string}`; sealFields: Array<`0x${string}`>; sha3Uncles: `0x${string}`; size: bigint; stateRoot: `0x${string}`; timestamp: bigint; totalDifficulty: null | bigint; transactions: TIncludeTransactions extends true ? Array<({ accessList?: undefined; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId?: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "legacy"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity?: undefined }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice: bigint; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip2930"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip1559"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList?: undefined; blobVersionedHashes: readonly Array<`0x${string}`>; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip4844"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number }) | ({ accessList: AccessList; authorizationList: SignedAuthorizationList; blobVersionedHashes?: undefined; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}`; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint; chainId: number; from: string; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; input: `0x${string}`; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; to: null | string; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number; type: "eip7702"; typeHex: null | (`0x${string}`); v: bigint; value: bigint; yParity: number })> : Array<`0x${string}`>; transactionsRoot: `0x${string}`; uncles: Array<`0x${string}`>; withdrawals?: Array; withdrawalsRoot?: `0x${string}` }> +``` + +A promise that resolves to the requested block. --- ## eth\_getCode - Retrieves the bytecode of a smart contract at the specified address. +Retrieves the bytecode of a smart contract at the specified address. ### Example @@ -52367,12 +54247,12 @@ function eth_getCode( ] >, params: GetCodeParams, -): Promise; +): Promise<`0x${string}`>; ``` ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52408,7 +54288,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for the eth\_getCode method. +The parameters for the eth\_getCode method. #### Type @@ -52419,15 +54299,15 @@ let params: GetCodeParams; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - A promise that resolves to the bytecode of the smart contract. +A promise that resolves to the bytecode of the smart contract. --- ## eth\_getLogs - Retrieves logs from the Ethereum blockchain based on the specified parameters. +Retrieves logs from the Ethereum blockchain based on the specified parameters. ### Example @@ -52478,7 +54358,7 @@ function eth_getLogs( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52514,7 +54394,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for retrieving logs. +The parameters for retrieving logs. #### Type @@ -52528,12 +54408,12 @@ let params: GetLogsParams; let returnType: Promise>; ``` - A promise that resolves to the retrieved logs. +A promise that resolves to the retrieved logs. --- ## eth\_getStorageAt - Retrieves the value stored at a specific position in the storage of a contract. +Retrieves the value stored at a specific position in the storage of a contract. ### Example @@ -52578,12 +54458,12 @@ function eth_getStorageAt( ] >, params: GetStorageAtParams, -): Promise; +): Promise<`0x${string}`>; ``` ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52619,7 +54499,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for the eth\_getStorageAt method. +The parameters for the eth\_getStorageAt method. #### Type @@ -52630,15 +54510,15 @@ let params: GetStorageAtParams; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - A promise that resolves to the value stored at the specified position. +A promise that resolves to the value stored at the specified position. --- ## eth\_getTransactionByHash - Retrieves a transaction by its hash. +Retrieves a transaction by its hash. ### Example @@ -52687,7 +54567,7 @@ function eth_getTransactionByHash( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52723,7 +54603,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for retrieving the transaction. +The parameters for retrieving the transaction. #### Type @@ -52734,15 +54614,17 @@ let params: GetTransactionByHashParameters; ### Returns ```ts -let returnType: Promise; +let returnType: NonNullable< + GetV1WalletsByWalletAddressTransactionsResponse["data"] +>[number]; ``` - A promise that resolves to the transaction. +A promise that resolves to the transaction. --- ## eth\_getTransactionCount - Retrieves the transaction count (nonce) for a given Ethereum address. +Retrieves the transaction count (nonce) for a given Ethereum address. ### Example @@ -52791,7 +54673,7 @@ function eth_getTransactionCount( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52827,7 +54709,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for retrieving the transaction count. +The parameters for retrieving the transaction count. #### Type @@ -52841,12 +54723,12 @@ let params: GetTransactionCountParameters; let returnType: Promise; ``` - A promise that resolves to the transaction count as a number. +A promise that resolves to the transaction count as a number. --- ## eth\_getTransactionReceipt - Retrieves the transaction receipt for a given transaction hash. Throws an error if the receipt is not found. +Retrieves the transaction receipt for a given transaction hash. Throws an error if the receipt is not found. ### Example @@ -52901,7 +54783,7 @@ function eth_getTransactionReceipt( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -52937,7 +54819,7 @@ let request: EIP1193RequestFn< >; ``` - The parameters for retrieving the transaction receipt. +The parameters for retrieving the transaction receipt. #### Type @@ -52969,12 +54851,12 @@ let returnType: { }; ``` - A promise that resolves to the transaction receipt. +A promise that resolves to the transaction receipt. --- ## eth\_maxPriorityFeePerGas - Retrieves the maximum priority fee per gas from the Ethereum network. +Retrieves the maximum priority fee per gas from the Ethereum network. ### Example @@ -53021,7 +54903,7 @@ function eth_maxPriorityFeePerGas( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -53063,12 +54945,12 @@ let request: EIP1193RequestFn< let returnType: Promise; ``` - A promise that resolves to a bigint representing the maximum priority fee per gas. +A promise that resolves to a bigint representing the maximum priority fee per gas. --- ## eth\_sendRawTransaction - Sends a raw transaction to the Ethereum network. +Sends a raw transaction to the Ethereum network. ### Example @@ -53118,7 +55000,7 @@ function eth_sendRawTransaction( ### Parameters - The EIP1193 request function. +The EIP1193 request function. #### Type @@ -53154,7 +55036,7 @@ let request: EIP1193RequestFn< >; ``` - The signed transaction in hex format. +The signed transaction in hex format. #### Type @@ -53168,12 +55050,12 @@ let signedTransaction: `0x${string}`; let returnType: Promise<`0x${string}`>; ``` - A promise that resolves to the transaction hash. +A promise that resolves to the transaction hash. --- ## getRpcClient - Returns an RPC request that can be used to make JSON-RPC requests. +Returns an RPC request that can be used to make JSON-RPC requests. ### Example @@ -53190,48 +55072,88 @@ const blockNumber = await rpcRequest({ ```ts function getRpcClient( - options: Readonly<{ - chain: Readonly; - client: ThirdwebClient; - config?: { - batchTimeoutMs?: number; - maxBatchSize?: number; - requestTimeoutMs?: number; - }; - }>, -): EIP1193RequestFn; + options: Readonly, +): EIP1193RequestFn< + [ + { + Method: "web3_clientVersion"; + Parameters?: undefined; + ReturnType: string; + }, + { + Method: "web3_sha3"; + Parameters: [data: `0x${string}`]; + ReturnType: string; + }, + { + Method: "net_listening"; + Parameters?: undefined; + ReturnType: boolean; + }, + { + Method: "net_peerCount"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + { + Method: "net_version"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + ] +>; ``` ### Parameters - The RPC options. +The RPC options. #### Type ```ts -let options: Readonly<{ - chain: Readonly; - client: ThirdwebClient; - config?: { - batchTimeoutMs?: number; - maxBatchSize?: number; - requestTimeoutMs?: number; - }; -}>; +let options: Readonly; ``` ### Returns ```ts -let returnType: EIP1193RequestFn; +let returnType: EIP1193RequestFn< + [ + { + Method: "web3_clientVersion"; + Parameters?: undefined; + ReturnType: string; + }, + { + Method: "web3_sha3"; + Parameters: [data: `0x${string}`]; + ReturnType: string; + }, + { + Method: "net_listening"; + Parameters?: undefined; + ReturnType: boolean; + }, + { + Method: "net_peerCount"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + { + Method: "net_version"; + Parameters?: undefined; + ReturnType: `0x${string}`; + }, + ] +>; ``` - The RPC request function. +The RPC request function. --- ## watchBlockNumber - Watches the block number for a specific chain. +Watches the block number for a specific chain. ### Example @@ -53258,7 +55180,7 @@ function watchBlockNumber(opts: WatchBlockNumberOptions): () => void; ### Parameters - The options for watching the block number. +The options for watching the block number. #### Type @@ -53279,24 +55201,24 @@ let opts: { let returnType: () => void; ``` - The unwatch function. +The unwatch function. --- # Theme --- ## darkTheme - Create a custom dark theme object by using the default dark theme as a base and applying overrides. +Create a custom dark theme object by using the default dark theme as a base and applying overrides. ### Example -#### Get the default dark theme +#### Get the default dark theme ```ts const defaultDarkTheme = darkTheme(); ``` -#### Create a custom dark theme +#### Create a custom dark theme ```ts const customTheme = darkTheme({ @@ -53312,7 +55234,7 @@ function darkTheme(overrides?: ThemeOverrides): Theme; ### Parameters - The overrides to apply to the default dark theme. +The overrides to apply to the default dark theme. #### Type @@ -53362,22 +55284,22 @@ let returnType: { }; ``` - Theme object +Theme object --- ## lightTheme - Create a custom light theme object by using the default dark theme as a base and applying overrides. +Create a custom light theme object by using the default dark theme as a base and applying overrides. ### Example -#### Get the default light theme +#### Get the default light theme ```ts const defaultLightTheme = lightTheme(); ``` -#### Create a custom light theme +#### Create a custom light theme ```ts const customTheme = lightTheme({ @@ -53393,7 +55315,7 @@ function lightTheme(overrides?: ThemeOverrides): Theme; ### Parameters - The overrides to apply to the default light theme. +The overrides to apply to the default light theme. #### Type @@ -53443,14 +55365,14 @@ let returnType: { }; ``` - Theme object +Theme object --- # Utils --- ## getContractPublisher - Returns the default publisher contract on polygon +Returns the default publisher contract on polygon ```ts function getContractPublisher( @@ -53478,7 +55400,7 @@ let returnType: Readonly>; ## getDefaultToken - Get the default token for a given chain and symbol +Get the default token for a given chain and symbol ### Example @@ -53491,7 +55413,7 @@ const token = getDefaultToken(ethereum, "USDC"); ```ts function getDefaultToken( - chain: Readonly, + chain: Readonly, symbol: | "WETH" | "USDT" @@ -53507,15 +55429,15 @@ function getDefaultToken( ### Parameters - The chain to get the token for +The chain to get the token for #### Type ```ts -let chain: Readonly; +let chain: Readonly; ``` - The symbol of the token to get +The symbol of the token to get #### Type @@ -53538,14 +55460,14 @@ let symbol: let returnType: undefined | TokenInfo; ``` - The default token for the given chain and symbol +The default token for the given chain and symbol --- ## getLastAuthProvider - Retrieves the last authentication provider used from local storage. +Retrieves the last authentication provider used from local storage. - This function is designed to work only in a browser environment. +This function is designed to work only in a browser environment. ### Example @@ -53589,12 +55511,12 @@ let returnType: Promise< >; ``` - A promise that resolves to the last authentication provider strategy used, or `null` if none is found. +A promise that resolves to the last authentication provider strategy used, or `null` if none is found. --- ## boolToBytes - Converts a boolean value to a Uint8Array of bytes. +Converts a boolean value to a Uint8Array of bytes. ### Example @@ -53613,7 +55535,7 @@ function boolToBytes( ### Parameters - The boolean value to convert. +The boolean value to convert. #### Type @@ -53621,7 +55543,7 @@ function boolToBytes( let value: boolean; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -53635,12 +55557,12 @@ let opts: Options; let returnType: Uint8Array; ``` - The Uint8Array of bytes representing the boolean value. +The Uint8Array of bytes representing the boolean value. --- ## boolToHex - Converts a boolean value to a hexadecimal string representation. +Converts a boolean value to a hexadecimal string representation. ### Example @@ -53651,12 +55573,12 @@ console.log(hex); // "0x01" ``` ```ts -function boolToHex(value: boolean, opts: Options): Hex; +function boolToHex(value: boolean, opts: Options): `0x${string}`; ``` ### Parameters - The boolean value to convert. +The boolean value to convert. #### Type @@ -53664,7 +55586,7 @@ function boolToHex(value: boolean, opts: Options): Hex; let value: boolean; ``` - Optional options for the conversion. +Optional options for the conversion. #### Type @@ -53675,15 +55597,15 @@ let opts: Options; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The hexadecimal string representation of the boolean value. +The hexadecimal string representation of the boolean value. --- ## bytesToBigInt - Converts a Uint8Array of bytes to a bigint. +Converts a Uint8Array of bytes to a bigint. ### Example @@ -53696,22 +55618,22 @@ console.log(bigInt); // 420n ```ts function bytesToBigInt( - bytes: Uint8Array, + bytes: Uint8Array, opts: BytesToBigIntOpts, ): bigint; ``` ### Parameters - The Uint8Array of bytes to convert. +The Uint8Array of bytes to convert. #### Type ```ts -let bytes: Uint8Array; +let bytes: Uint8Array; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -53725,12 +55647,12 @@ let opts: { signed?: boolean; size?: number }; let returnType: bigint; ``` - The converted bigint. +The converted bigint. --- ## bytesToBool - Converts a byte array to a boolean value. +Converts a byte array to a boolean value. ### Example @@ -53742,23 +55664,20 @@ console.log(bool); // true ``` ```ts -function bytesToBool( - bytes_: Uint8Array, - opts: Options, -): boolean; +function bytesToBool(bytes_: Uint8Array, opts: Options): boolean; ``` ### Parameters - The byte array to convert. +The byte array to convert. #### Type ```ts -let bytes_: Uint8Array; +let bytes_: Uint8Array; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -53772,12 +55691,12 @@ let opts: Options; let returnType: boolean; ``` - The boolean value converted from the byte array. +The boolean value converted from the byte array. --- ## bytesToNumber - Converts a Uint8Array of bytes to a number. +Converts a Uint8Array of bytes to a number. ### Example @@ -53790,22 +55709,22 @@ console.log(number); // 420 ```ts function bytesToNumber( - bytes: Uint8Array, + bytes: Uint8Array, opts: BytesToBigIntOpts, ): number; ``` ### Parameters - The Uint8Array of bytes to convert. +The Uint8Array of bytes to convert. #### Type ```ts -let bytes: Uint8Array; +let bytes: Uint8Array; ``` - Optional configuration options. +Optional configuration options. #### Type @@ -53819,12 +55738,12 @@ let opts: { signed?: boolean; size?: number }; let returnType: number; ``` - The converted number. +The converted number. --- ## bytesToString - Converts an array of bytes to a string using UTF-8 encoding. +Converts an array of bytes to a string using UTF-8 encoding. ### Example @@ -53836,23 +55755,20 @@ console.log(string); // "Hello" ``` ```ts -function bytesToString( - bytes_: Uint8Array, - opts: Options, -): string; +function bytesToString(bytes_: Uint8Array, opts: Options): string; ``` ### Parameters - The array of bytes to convert. +The array of bytes to convert. #### Type ```ts -let bytes_: Uint8Array; +let bytes_: Uint8Array; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -53866,20 +55782,20 @@ let opts: Options; let returnType: string; ``` - The resulting string. +The resulting string. --- ## concatHex - Concatenates an array of hexadecimal values into a single hexadecimal value. +Concatenates an array of hexadecimal values into a single hexadecimal value. ```ts -function concatHex(values: readonly Array<`0x${string}`>) : Hex +function concatHex(values: readonly Array<`0x${string}`>) : `0x${string}` ``` ### Parameters - An array of hexadecimal values to concatenate. +An array of hexadecimal values to concatenate. #### Type @@ -53890,15 +55806,15 @@ let values: readonly Array<`0x${string}`> ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The concatenated hexadecimal value. +The concatenated hexadecimal value. --- ## fromBytes - Converts a Uint8Array to the specified type. +Converts a Uint8Array to the specified type. ### Example @@ -53911,22 +55827,22 @@ console.log(number); // 420 ```ts function fromBytes( - bytes: Uint8Array, + bytes: Uint8Array, toOrOpts: FromBytesParameters, ): FromBytesReturnType; ``` ### Parameters - The Uint8Array to convert. +The Uint8Array to convert. #### Type ```ts -let bytes: Uint8Array; +let bytes: Uint8Array; ``` - The target type or conversion options. +The target type or conversion options. #### Type @@ -53940,12 +55856,12 @@ let toOrOpts: FromBytesParameters; let returnType: FromBytesReturnType; ``` - The converted value of the specified type. +The converted value of the specified type. --- ## fromGwei - Converts the specified number from gwei to wei. +Converts the specified number from gwei to wei. ### Example @@ -53961,7 +55877,7 @@ function fromGwei(gwei: string): bigint; ### Parameters - The number of gwei to convert. +The number of gwei to convert. #### Type @@ -53975,12 +55891,12 @@ let gwei: string; let returnType: bigint; ``` - The converted value in wei. +The converted value in wei. --- ## fromHex - Converts a hexadecimal string to the specified type. +Converts a hexadecimal string to the specified type. ### Example @@ -53999,7 +55915,7 @@ function fromHex( ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54007,7 +55923,7 @@ function fromHex( let hex: `0x${string}`; ``` - The target type or conversion options. +The target type or conversion options. #### Type @@ -54021,12 +55937,12 @@ let toOrOpts: FromHexParameters; let returnType: FromHexReturnType; ``` - The converted value of the specified type. +The converted value of the specified type. --- ## getAddress - Retrieves the address after performing validation and checksumming. +Retrieves the address after performing validation and checksumming. ### Example @@ -54038,12 +55954,12 @@ getAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); ``` ```ts -function getAddress(address: string): Address; +function getAddress(address: string): `0x${string}`; ``` ### Parameters - The address to be validated and checksummed. +The address to be validated and checksummed. #### Type @@ -54057,12 +55973,12 @@ let address: string; let returnType: `0x${string}`; ``` - The validated and checksummed address. +The validated and checksummed address. --- ## getGasPrice - Retrieves the gas price for a transaction on a specific chain. +Retrieves the gas price for a transaction on a specific chain. ### Example @@ -54094,12 +56010,12 @@ let options: { let returnType: Promise; ``` - A promise that resolves to the gas price as a bigint. +A promise that resolves to the gas price as a bigint. --- ## hexToBigInt - Converts a hexadecimal string to a BigInt. +Converts a hexadecimal string to a BigInt. ### Example @@ -54115,7 +56031,7 @@ function hexToBigInt(hex: `0x${string}`, opts: Options): bigint; ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54123,7 +56039,7 @@ function hexToBigInt(hex: `0x${string}`, opts: Options): bigint; let hex: `0x${string}`; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -54137,12 +56053,12 @@ let opts: Options; let returnType: bigint; ``` - The BigInt representation of the hexadecimal string. +The BigInt representation of the hexadecimal string. --- ## hexToBool - Converts a hexadecimal string to a boolean value. +Converts a hexadecimal string to a boolean value. ### Example @@ -54158,7 +56074,7 @@ function hexToBool(hex: `0x${string}`, opts: Options): boolean; ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54166,7 +56082,7 @@ function hexToBool(hex: `0x${string}`, opts: Options): boolean; let hex: `0x${string}`; ``` - Optional options for the conversion. +Optional options for the conversion. #### Type @@ -54180,12 +56096,12 @@ let opts: Options; let returnType: boolean; ``` - The boolean value corresponding to the hexadecimal string. +The boolean value corresponding to the hexadecimal string. --- ## hexToBytes - Converts a hexadecimal string to a Uint8Array of bytes. +Converts a hexadecimal string to a Uint8Array of bytes. ### Example @@ -54201,7 +56117,7 @@ function hexToBytes(hex_: `0x${string}`, opts: Options): Uint8Array; ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54209,7 +56125,7 @@ function hexToBytes(hex_: `0x${string}`, opts: Options): Uint8Array; let hex_: `0x${string}`; ``` - Options for converting the hexadecimal string. +Options for converting the hexadecimal string. #### Type @@ -54223,12 +56139,12 @@ let opts: Options; let returnType: Uint8Array; ``` - The Uint8Array of bytes. +The Uint8Array of bytes. --- ## hexToNumber - Converts a hexadecimal string to a number. +Converts a hexadecimal string to a number. ### Example @@ -54244,7 +56160,7 @@ function hexToNumber(hex: `0x${string}`, opts: Options): number; ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54252,7 +56168,7 @@ function hexToNumber(hex: `0x${string}`, opts: Options): number; let hex: `0x${string}`; ``` - Optional options for the conversion. +Optional options for the conversion. #### Type @@ -54266,12 +56182,12 @@ let opts: Options; let returnType: number; ``` - The converted number. +The converted number. --- ## hexToString - Converts a hexadecimal string to a UTF-8 string. +Converts a hexadecimal string to a UTF-8 string. ### Example @@ -54287,7 +56203,7 @@ function hexToString(hex: `0x${string}`, opts: Options): string; ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54295,7 +56211,7 @@ function hexToString(hex: `0x${string}`, opts: Options): string; let hex: `0x${string}`; ``` - The options for the conversion. +The options for the conversion. #### Type @@ -54309,12 +56225,12 @@ let opts: Options; let returnType: string; ``` - The UTF-8 string representation of the hexadecimal string. +The UTF-8 string representation of the hexadecimal string. --- ## hexToUint8Array - Converts a hexadecimal string to a Uint8Array. +Converts a hexadecimal string to a Uint8Array. ### Example @@ -54333,7 +56249,7 @@ function hexToUint8Array( ### Parameters - The hexadecimal string to convert. +The hexadecimal string to convert. #### Type @@ -54341,7 +56257,7 @@ function hexToUint8Array( let hex: `0x${string}`; ``` - Options for the conversion. +Options for the conversion. #### Type @@ -54355,12 +56271,12 @@ let opts: Options; let returnType: Uint8Array; ``` - The Uint8Array representation of the hexadecimal string. +The Uint8Array representation of the hexadecimal string. --- ## isAddress - Checks if a given string is a valid address. +Checks if a given string is a valid address. ### Example @@ -54377,7 +56293,7 @@ function isAddress(address: string): address is `0x${string}`; ### Parameters - The address to check. +The address to check. #### Type @@ -54391,12 +56307,12 @@ let address: string; let returnType: address is (`0x${string}`) ``` - True if the address is valid, false otherwise. +True if the address is valid, false otherwise. --- ## isHex - Checks if a value is a valid hexadecimal string. +Checks if a value is a valid hexadecimal string. ### Example @@ -54415,7 +56331,7 @@ function isHex( ### Parameters - The value to be checked. +The value to be checked. #### Type @@ -54423,7 +56339,7 @@ function isHex( let value: unknown; ``` - Optional configuration for the validation. +Optional configuration for the validation. #### Type @@ -54437,12 +56353,12 @@ let options: Options; let returnType: value is (`0x${string}`) ``` - True if the value is a valid hexadecimal string, false otherwise. +True if the value is a valid hexadecimal string, false otherwise. --- ## keccak256 - Calculates the Keccak-256 hash of the given value. +Calculates the Keccak-256 hash of the given value. ### Example @@ -54460,7 +56376,7 @@ function keccak256( ### Parameters - The value to hash, either as a hexadecimal string or a Uint8Array. +The value to hash, either as a hexadecimal string or a Uint8Array. #### Type @@ -54468,7 +56384,7 @@ function keccak256( let value: `0x${string}` | Uint8Array; ``` - The desired output format of the hash (optional). Defaults to 'hex'. +The desired output format of the hash (optional). Defaults to 'hex'. #### Type @@ -54482,12 +56398,12 @@ let to: TTo; let returnType: Keccak256Hash; ``` - The Keccak-256 hash of the value in the specified format. +The Keccak-256 hash of the value in the specified format. --- ## numberToBytes - Converts a number to bytes. +Converts a number to bytes. ### Example @@ -54506,7 +56422,7 @@ function numberToBytes( ### Parameters - The number to convert. +The number to convert. #### Type @@ -54514,7 +56430,7 @@ function numberToBytes( let value: number | bigint; ``` - Options for converting the number to hex. +Options for converting the number to hex. #### Type @@ -54528,12 +56444,12 @@ let opts: Options; let returnType: Uint8Array; ``` - The bytes representation of the number. +The bytes representation of the number. --- ## numberToHex - Converts a number or bigint to a hexadecimal string. +Converts a number or bigint to a hexadecimal string. ### Example @@ -54544,12 +56460,15 @@ console.log(hex); // "0x1a4" ``` ```ts -function numberToHex(value_: number | bigint, opts: Options): Hex; +function numberToHex( + value_: number | bigint, + opts: Options, +): `0x${string}`; ``` ### Parameters - The number or bigint value to convert. +The number or bigint value to convert. #### Type @@ -54557,7 +56476,7 @@ function numberToHex(value_: number | bigint, opts: Options): Hex; let value_: number | bigint; ``` - Optional configuration options. +Optional configuration options. #### Type @@ -54568,15 +56487,15 @@ let opts: Options; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The hexadecimal representation of the input value. +The hexadecimal representation of the input value. --- ## padHex - Pads a hexadecimal string with zeros to a specified size. +Pads a hexadecimal string with zeros to a specified size. ### Example @@ -54595,7 +56514,7 @@ function padHex( ### Parameters - The hexadecimal string to pad. +The hexadecimal string to pad. #### Type @@ -54603,7 +56522,7 @@ function padHex( let hex_: `0x${string}`; ``` - The padding options. +The padding options. #### Type @@ -54617,12 +56536,12 @@ let options: PadOptions; let returnType: `0x${string}`; ``` - The padded hexadecimal string. +The padded hexadecimal string. --- ## sha256 - Calculates the SHA256 hash of the given value. +Calculates the SHA256 hash of the given value. ### Example @@ -54640,7 +56559,7 @@ function sha256( ### Parameters - The value to hash. It can be either a hexadecimal string or a Uint8Array. +The value to hash. It can be either a hexadecimal string or a Uint8Array. #### Type @@ -54648,7 +56567,7 @@ function sha256( let value: `0x${string}` | Uint8Array; ``` - (Optional) The desired output format of the hash. Defaults to 'hex'. +(Optional) The desired output format of the hash. Defaults to 'hex'. #### Type @@ -54662,12 +56581,12 @@ let to: TTo; let returnType: Sha256Hash; ``` - The SHA256 hash of the value in the specified format. +The SHA256 hash of the value in the specified format. --- ## stringToBytes - Converts a string to an array of bytes. +Converts a string to an array of bytes. ### Example @@ -54686,7 +56605,7 @@ function stringToBytes( ### Parameters - The string to convert. +The string to convert. #### Type @@ -54694,7 +56613,7 @@ function stringToBytes( let value: string; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -54708,12 +56627,12 @@ let opts: { size?: number }; let returnType: Uint8Array; ``` - The array of bytes representing the string. +The array of bytes representing the string. --- ## stringToHex - Converts a string to its hexadecimal representation. +Converts a string to its hexadecimal representation. ### Example @@ -54724,12 +56643,12 @@ console.log(hex); // "0x48656c6c6f2c20776f726c6421" ``` ```ts -function stringToHex(value_: string, opts: Options): Hex; +function stringToHex(value_: string, opts: Options): `0x${string}`; ``` ### Parameters - The string to convert to hexadecimal. +The string to convert to hexadecimal. #### Type @@ -54737,7 +56656,7 @@ function stringToHex(value_: string, opts: Options): Hex; let value_: string; ``` - Options for the conversion. +Options for the conversion. #### Type @@ -54748,15 +56667,15 @@ let opts: Options; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The hexadecimal representation of the input string. +The hexadecimal representation of the input string. --- ## toBytes - Converts a value to an array of bytes. +Converts a value to an array of bytes. ### Example @@ -54775,7 +56694,7 @@ function toBytes( ### Parameters - The value to convert. +The value to convert. #### Type @@ -54783,7 +56702,7 @@ function toBytes( let value: string | number | bigint | boolean; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -54797,12 +56716,12 @@ let opts: { size?: number }; let returnType: Uint8Array; ``` - The array of bytes representing the value. +The array of bytes representing the value. --- ## toEther - Converts a value from wei to ether. +Converts a value from wei to ether. ### Example @@ -54818,7 +56737,7 @@ function toEther(wei: bigint): string; ### Parameters - The value in wei to be converted. +The value in wei to be converted. #### Type @@ -54832,12 +56751,12 @@ let wei: bigint; let returnType: string; ``` - The converted value in ether. +The converted value in ether. --- ## toHex - Converts a value to its hexadecimal representation. +Converts a value to its hexadecimal representation. ### Example @@ -54856,12 +56775,12 @@ function toHex( | boolean | Uint8Array, opts: ToHexParameters, -): Hex; +): `0x${string}`; ``` ### Parameters - The value to convert to hexadecimal. +The value to convert to hexadecimal. #### Type @@ -54874,7 +56793,7 @@ let value: | Uint8Array; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -54885,15 +56804,15 @@ let opts: { size?: number }; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The hexadecimal representation of the value. +The hexadecimal representation of the value. --- ## toTokens - Converts a given number of units to a string representation with a specified number of decimal places. +Converts a given number of units to a string representation with a specified number of decimal places. ### Example @@ -54909,7 +56828,7 @@ function toTokens(units: bigint, decimals: number): string; ### Parameters - The number of units to convert. +The number of units to convert. #### Type @@ -54917,7 +56836,7 @@ function toTokens(units: bigint, decimals: number): string; let units: bigint; ``` - The number of decimal places to include in the string representation. +The number of decimal places to include in the string representation. #### Type @@ -54931,12 +56850,12 @@ let decimals: number; let returnType: string; ``` - The string representation of the converted units. +The string representation of the converted units. --- ## toUnits - Converts a string representation of a number with decimal places to a BigInt representation. +Converts a string representation of a number with decimal places to a BigInt representation. ### Example @@ -54952,7 +56871,7 @@ function toUnits(tokens: string, decimals: number): bigint; ### Parameters - The string representation of the number, including the integer and fraction parts. +The string representation of the number, including the integer and fraction parts. #### Type @@ -54960,7 +56879,7 @@ function toUnits(tokens: string, decimals: number): bigint; let tokens: string; ``` - The number of decimal places to include in the BigInt representation. +The number of decimal places to include in the BigInt representation. #### Type @@ -54974,12 +56893,12 @@ let decimals: number; let returnType: bigint; ``` - The BigInt representation of the number. +The BigInt representation of the number. --- ## toWei - Converts the specified number of tokens to Wei. +Converts the specified number of tokens to Wei. ### Example @@ -54995,7 +56914,7 @@ function toWei(tokens: string): bigint; ### Parameters - The number of tokens to convert. +The number of tokens to convert. #### Type @@ -55009,12 +56928,12 @@ let tokens: string; let returnType: bigint; ``` - The converted value in Wei. +The converted value in Wei. --- ## uint8ArrayToHex - Converts an array of bytes to a hexadecimal string. +Converts an array of bytes to a hexadecimal string. ### Example @@ -55030,22 +56949,22 @@ console.log(hex); // "0x48656c6c6f2c20776f726c64" ```ts function uint8ArrayToHex( - value: Uint8Array, + value: Uint8Array, opts: Options, -): Hex; +): `0x${string}`; ``` ### Parameters - The array of bytes to convert. +The array of bytes to convert. #### Type ```ts -let value: Uint8Array; +let value: Uint8Array; ``` - Optional parameters for the conversion. +Optional parameters for the conversion. #### Type @@ -55056,15 +56975,15 @@ let opts: Options; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The hexadecimal string representation of the bytes. +The hexadecimal string representation of the bytes. --- ## checksumAddress - Calculates the checksum address for the given address. +Calculates the checksum address for the given address. ### Example @@ -55076,12 +56995,12 @@ checksumAddress("0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"); ``` ```ts -function checksumAddress(address: string): Address; +function checksumAddress(address: string): `0x${string}`; ``` ### Parameters - The address to calculate the checksum for. +The address to calculate the checksum for. #### Type @@ -55095,12 +57014,12 @@ let address: string; let returnType: `0x${string}`; ``` - The checksum address. +The checksum address. --- ## computeDeploymentAddress - Computes the deployment address for a contract based on the given options. +Computes the deployment address for a contract based on the given options. ### Example @@ -55122,7 +57041,7 @@ function computeDeploymentAddress( ### Parameters - The options for computing the deployment address. +The options for computing the deployment address. #### Type @@ -55136,12 +57055,12 @@ let options: ComputeDeploymentAddressOptions; let returnType: string; ``` - The computed deployment address. +The computed deployment address. --- ## decodeError - Decodes an error. +Decodes an error. ### Example @@ -55154,20 +57073,20 @@ const error = await decodeError({ contract, data }); ```ts function decodeError(options: { - contract: Readonly>; + contract: Readonly>; data: `0x${string}`; }): Promise; ``` ### Parameters - The options object. +The options object. #### Type ```ts let options: { - contract: Readonly>; + contract: Readonly>; data: `0x${string}`; }; ``` @@ -55178,12 +57097,12 @@ let options: { let returnType: Promise; ``` - The decoded error. +The decoded error. --- ## decodeFunctionData - Decodes the data of a function call. +Decodes the data of a function call. ### Example @@ -55196,7 +57115,7 @@ const decodedData = await decodeFunctionData({ contract, data }); ```ts function decodeFunctionData(options: { - contract: Readonly>; + contract: Readonly>; data: `0x${string}`; }): Promise< ReturnType, undefined, AbiFunction>> @@ -55205,13 +57124,13 @@ function decodeFunctionData(options: { ### Parameters - The options object. +The options object. #### Type ```ts let options: { - contract: Readonly>; + contract: Readonly>; data: `0x${string}`; }; ``` @@ -55224,12 +57143,12 @@ let returnType: Promise< >; ``` - The decoded data. +The decoded data. --- ## decodeFunctionResult - Decodes the result of a function call. +Decodes the result of a function call. ### Example @@ -55242,7 +57161,7 @@ const result = await decodeFunctionResult({ contract, data }); ```ts function decodeFunctionResult(options: { - contract: Readonly>; + contract: Readonly>; data: `0x${string}`; }): Promise< ReturnType< @@ -55254,13 +57173,13 @@ function decodeFunctionResult(options: { ### Parameters - The options object. +The options object. #### Type ```ts let options: { - contract: Readonly>; + contract: Readonly>; data: `0x${string}`; }; ``` @@ -55276,12 +57195,12 @@ let returnType: Promise< >; ``` - The decoded result. +The decoded result. --- ## encodeAbiParameters - Encodes the given ABI parameters and values into a hexadecimal string. +Encodes the given ABI parameters and values into a hexadecimal string. ### Example @@ -55299,12 +57218,12 @@ console.log(data); ``` ```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) : Hex +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 ABI parameters. +The ABI parameters. #### Type @@ -55312,7 +57231,7 @@ function encodeAbiParameters(params: TParams, values: TParams extends readonly A let params: TParams; ``` - The corresponding values for the ABI parameters. +The corresponding values for the ABI parameters. #### Type @@ -55323,7 +57242,7 @@ let values: TParams extends readonly Array ? {[key in string | num ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` * The encoded ABI parameters as a hexadecimal string. @@ -55331,7 +57250,7 @@ let returnType: ox__Hex.Hex; ## ensureBytecodePrefix - Ensures that the given bytecode has the correct prefix. If the bytecode already starts with "0x", it is returned as is. Otherwise, the prefix "0x" is added to the bytecode. +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 @@ -55344,12 +57263,12 @@ console.log(prefixedBytecode); ``` ```ts -function ensureBytecodePrefix(bytecode: string): Hex; +function ensureBytecodePrefix(bytecode: string): `0x${string}`; ``` ### Parameters - The bytecode to ensure the prefix for. +The bytecode to ensure the prefix for. #### Type @@ -55360,15 +57279,15 @@ let bytecode: string; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The bytecode with the correct prefix. +The bytecode with the correct prefix. --- ## extractIPFSUri - Extracts the IPFS URI from the given bytecode. +Extracts the IPFS URI from the given bytecode. ### Example @@ -55381,12 +57300,12 @@ console.log(ipfsHash); ``` ```ts -function extractIPFSUri(bytecode: string): string | undefined; +function extractIPFSUri(bytecode: string): undefined | string; ``` ### Parameters - The bytecode to extract the IPFS URI from. +The bytecode to extract the IPFS URI from. #### Type @@ -55397,15 +57316,15 @@ let bytecode: string; ### Returns ```ts -let returnType: string | undefined; +let returnType: undefined | string; ``` - The IPFS URI if found, otherwise undefined. +The IPFS URI if found, otherwise undefined. --- ## extractMinimalProxyImplementationAddress - Extracts the implementation address from a given bytecode string if it matches any of the known minimal proxy patterns. +Extracts the implementation address from a given bytecode string if it matches any of the known minimal proxy patterns. ### Example @@ -55419,12 +57338,12 @@ const implementationAddress = ```ts function extractMinimalProxyImplementationAddress( bytecode: string, -): string | undefined; +): undefined | string; ``` ### Parameters - The bytecode string to extract the implementation address from. +The bytecode string to extract the implementation address from. #### Type @@ -55435,15 +57354,15 @@ let bytecode: string; ### Returns ```ts -let returnType: string | undefined; +let returnType: undefined | string; ``` - The implementation address as a string if a match is found, otherwise undefined. +The implementation address as a string if a match is found, otherwise undefined. --- ## formatNumber - Round up a number to a certain decimal place +Round up a number to a certain decimal place ### Example @@ -55479,7 +57398,7 @@ let returnType: number; ## getClaimParams - Get the claim parameters for a given drop +Get the claim parameters for a given drop ### Example @@ -55517,7 +57436,7 @@ function getClaimParams( ### Parameters - The options for getting the claim parameters +The options for getting the claim parameters #### Type @@ -55555,12 +57474,12 @@ let returnType: Promise<{ }>; ``` - The claim parameters +The claim parameters --- ## getInitBytecodeWithSalt - Generates the initialization bytecode with salt for a contract deployment. +Generates the initialization bytecode with salt for a contract deployment. ### Example @@ -55576,12 +57495,12 @@ const initBytecodeWithSalt = getInitBytecodeWithSalt({ ```ts function getInitBytecodeWithSalt( options: GetInitiBytecodeWithSaltOptions, -): Hex; +): `0x${string}`; ``` ### Parameters - The options for generating the initialization bytecode. +The options for generating the initialization bytecode. #### Type @@ -55592,15 +57511,15 @@ let options: GetInitiBytecodeWithSaltOptions; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The initialization bytecode with salt. +The initialization bytecode with salt. --- ## getSaltHash - Calculates the salt hash for a given bytecode. +Calculates the salt hash for a given bytecode. ### Example @@ -55610,12 +57529,12 @@ const saltHash = getSaltHash(bytecode); ``` ```ts -function getSaltHash(bytecode: string): Hex; +function getSaltHash(bytecode: string): `0x${string}`; ``` ### Parameters - The bytecode to calculate the salt hash for. +The bytecode to calculate the salt hash for. #### Type @@ -55626,15 +57545,15 @@ let bytecode: string; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The salt hash of the bytecode. +The salt hash of the bytecode. --- ## hashMessage - Ethereum Signed Message hashing +Ethereum Signed Message hashing ### Example @@ -55652,7 +57571,7 @@ function hashMessage( ### Parameters - The message to hash, either as a string, a Uint8Array, or an object with a `raw` property containing a Uint8Array. +The message to hash, either as a string, a Uint8Array, or an object with a `raw` property containing a Uint8Array. #### Type @@ -55660,7 +57579,7 @@ function hashMessage( let message: SignableMessage; ``` - The desired output format of the hash (optional). Defaults to 'hex'. +The desired output format of the hash (optional). Defaults to 'hex'. #### Type @@ -55674,12 +57593,12 @@ let to_: TTo; let returnType: HashMessage; ``` - The Ethereum Signed Message hash of the message in the specified format. +The Ethereum Signed Message hash of the message in the specified format. --- ## isEIP155Enforced - Checks whether EIP-155 is enforced by sending a random transaction of legacy type (pre-EIP-155) and parsing the error message. +Checks whether EIP-155 is enforced by sending a random transaction of legacy type (pre-EIP-155) and parsing the error message. ### Example @@ -55696,7 +57615,7 @@ function isEIP155Enforced( ### Parameters - The options for checking EIP-155 enforcement. +The options for checking EIP-155 enforcement. #### Type @@ -55710,12 +57629,12 @@ let options: IsEIP155EnforcedOptions; let returnType: Promise; ``` - A promise that resolves to a boolean indicating whether EIP-155 is enforced. +A promise that resolves to a boolean indicating whether EIP-155 is enforced. --- ## keccakId - Calculates the keccak ID of the given input. +Calculates the keccak ID of the given input. ### Example @@ -55725,12 +57644,12 @@ const keccakId = keccackId(input); ``` ```ts -function keccakId(input: string): Hex; +function keccakId(input: string): `0x${string}`; ``` ### Parameters - The input value to calculate the keccak ID for. +The input value to calculate the keccak ID for. #### Type @@ -55741,15 +57660,15 @@ let input: string; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The keccak ID as a Hex string. +The keccak ID as a Hex string. --- ## max - Returns the maximum of two BigInt values. +Returns the maximum of two BigInt values. ### Example @@ -55764,7 +57683,7 @@ function max(a: bigint, b: bigint): bigint; ### Parameters - The first BigInt value. +The first BigInt value. #### Type @@ -55772,7 +57691,7 @@ function max(a: bigint, b: bigint): bigint; let a: bigint; ``` - The second BigInt value. +The second BigInt value. #### Type @@ -55786,12 +57705,12 @@ let b: bigint; let returnType: bigint; ``` - The larger of the two BigInt values. +The larger of the two BigInt values. --- ## min - Returns the minimum of two BigInt values. +Returns the minimum of two BigInt values. ### Example @@ -55806,7 +57725,7 @@ function min(a: bigint, b: bigint): bigint; ### Parameters - The first BigInt value. +The first BigInt value. #### Type @@ -55814,7 +57733,7 @@ function min(a: bigint, b: bigint): bigint; let a: bigint; ``` - The second BigInt value. +The second BigInt value. #### Type @@ -55828,14 +57747,14 @@ let b: bigint; let returnType: bigint; ``` - The smaller of the two BigInt values. +The smaller of the two BigInt values. --- ## parseAbiParams - Converts an array of parameter values to their respective types based on the provided type array. +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. +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 @@ -55862,7 +57781,7 @@ function parseAbiParams( ### Parameters - An array of type strings indicating the expected types of the values, following Solidity type conventions (e.g., "address", "uint256", "bool"). +An array of type strings indicating the expected types of the values, following Solidity type conventions (e.g., "address", "uint256", "bool"). #### Type @@ -55870,7 +57789,7 @@ function parseAbiParams( let constructorParamTypes: Array; ``` - An array of values to be converted according to the types. +An array of values to be converted according to the types. #### Type @@ -55889,7 +57808,7 @@ let returnType: Array; ## resolveSignature - Resolves a signature by converting a hexadecimal string into a function or event signature. +Resolves a signature by converting a hexadecimal string into a function or event signature. ### Example @@ -55903,14 +57822,14 @@ console.log(res); function resolveSignature( hexSig: string, ): Promise<{ - event: EventString | null; - function: FunctionString | null; + event: null | `event ${string}`; + function: null | `function ${string}`; }>; ``` ### Parameters - The hexadecimal signature to resolve. +The hexadecimal signature to resolve. #### Type @@ -55922,17 +57841,17 @@ let hexSig: string; ```ts let returnType: Promise<{ - event: EventString | null; - function: FunctionString | null; + event: null | `event ${string}`; + function: null | `function ${string}`; }>; ``` - A promise that resolves to an object containing the function and event signatures. +A promise that resolves to an object containing the function and event signatures. --- ## resolveSignatures - Resolves the signatures of the given hexadecimal signatures. +Resolves the signatures of the given hexadecimal signatures. ### Example @@ -55946,14 +57865,14 @@ console.log(res); function resolveSignatures( hexSigs: Array, ): Promise<{ - events: Array; - functions: Array; + events: Array<`event ${string}`>; + functions: Array<`function ${string}`>; }>; ``` ### Parameters - An array of hexadecimal signatures. +An array of hexadecimal signatures. #### Type @@ -55965,17 +57884,17 @@ let hexSigs: Array; ```ts let returnType: Promise<{ - events: Array; - functions: Array; + events: Array<`event ${string}`>; + functions: Array<`function ${string}`>; }>; ``` - A promise that resolves to an object containing the resolved functions and events. +A promise that resolves to an object containing the resolved functions and events. --- ## shortenAddress - Checksums and formats an address if valid. Note this function does not check if the provided address is an ENS. +Checksums and formats an address if valid. Note this function does not check if the provided address is an ENS. ### Example @@ -55992,7 +57911,7 @@ function shortenAddress(address: string, length: number): string; ### Parameters - The address to shorten. +The address to shorten. #### Type @@ -56000,7 +57919,7 @@ function shortenAddress(address: string, length: number): string; let address: string; ``` - The number of characters to keep from the start and end of the address. +The number of characters to keep from the start and end of the address. #### Type @@ -56014,12 +57933,12 @@ let length: number; let returnType: string; ``` - The shortened address. +The shortened address. --- ## shortenHex - Shortens a hexadecimal string without performing any validation or checksumming. +Shortens a hexadecimal string without performing any validation or checksumming. ### Example @@ -56036,7 +57955,7 @@ function shortenHex(hex: string, length: number): string; ### Parameters - The hexadecimal string to shorten. +The hexadecimal string to shorten. #### Type @@ -56044,7 +57963,7 @@ function shortenHex(hex: string, length: number): string; let hex: string; ``` - The number of characters to keep from the start and end of the string. +The number of characters to keep from the start and end of the string. #### Type @@ -56058,12 +57977,12 @@ let length: number; let returnType: string; ``` - The shortened hexadecimal string. +The shortened hexadecimal string. --- ## shortenLargeNumber - Shorten the string for large value Mainly used for Examples: 10\_000 -> 10k 1\_000\_000 -> 1M 1\_000\_000\_000 -> 1B +Shorten the string for large value Mainly used for Examples: 10\_000 -> 10k 1\_000\_000 -> 1M 1\_000\_000\_000 -> 1B ### Example @@ -56093,7 +58012,7 @@ let returnType: string; ## sign - Generates the signature for the provided transaction hash. +Generates the signature for the provided transaction hash. ### Example @@ -56117,7 +58036,7 @@ function sign(options: SignOptions): { ### Parameters - The options for signing. +The options for signing. #### Type @@ -56136,12 +58055,12 @@ let returnType: { }; ``` - The transaction signature. +The transaction signature. --- ## signatureToHex - Converts a signature to a hex string. +Converts a signature to a hex string. ### Example @@ -56168,12 +58087,12 @@ function signatureToHex(signature: { s: `0x${string}`; v?: number | bigint | `0x${string}`; yParity?: number | bigint | `0x${string}`; -}): Hex; +}): `0x${string}`; ``` ### Parameters - The signature to convert. +The signature to convert. #### Type @@ -56189,17 +58108,17 @@ let signature: { ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The hex string representation of the signature. +The hex string representation of the signature. --- ## signMessage ### Signature#1 - Signs a string message with a given private key. +Signs a string message with a given private key. #### Example @@ -56212,12 +58131,12 @@ signMessage({ ``` ```ts -function signMessage(options: SignMessageOptions): Hex; +function signMessage(options: SignMessageOptions): `0x${string}`; ``` #### Parameters - The options for signing. +The options for signing. ##### Type @@ -56228,14 +58147,14 @@ let options: { message: Message; privateKey: Hex }; #### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The signature as a hex string +The signature as a hex string ### Signature#2 - Signs a string message with a given account. +Signs a string message with a given account. #### Example @@ -56251,12 +58170,12 @@ await signMessage({ function signMessage(options: { account: Account; message: Message; -}): Promise; +}): Promise<`0x${string}`>; ``` #### Parameters - The options for signing. +The options for signing. ##### Type @@ -56267,15 +58186,15 @@ let options: { account: Account; message: Message }; #### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: Promise<`0x${string}`>; ``` - The signature as a hex string +The signature as a hex string --- ## signTypedData - Signs a typed data object with a given private key according to EIP712. +Signs a typed data object with a given private key according to EIP712. ### Example @@ -56290,12 +58209,12 @@ signTypedData({ ```ts function signTypedData( options: SignTypedDataOptions, -): Hex; +): `0x${string}`; ``` ### Parameters - The typed data is passed within options alongside the private key +The typed data is passed within options alongside the private key #### Type @@ -56306,17 +58225,17 @@ let options: SignTypedDataOptions; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` - The signature as a hex string +The signature as a hex string --- ## stringify - Stringify a JSON object and convert all bigint values to string +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. +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 @@ -56360,18 +58279,174 @@ let space: string | number; let returnType: string; ``` - An object with all bigint values converted to string +An object with all bigint values converted to string --- # Miscellaneous --- +## installPublishedExtension + +Install a published extension on a dynamic contract + +### Example + +```ts +import { installPublishedExtension } from "thirdweb/dynamic-contracts"; +const transaction = installPublishedExtension({ + client, + chain, + account, + contract, + extensionName: "MyExtension", + publisherAddress: "0x...", +}); +await sendTransaction({ transaction, account }); +``` + +```ts +function installPublishedExtension( + options: InstallPublishedExtensionOptions, +): PreparedTransaction; +``` + +### Parameters + +The options for installing a published extension + +#### Type + +```ts +let options: { + account: Account; + constructorParams?: Record; + contract: ThirdwebContract; + extensionName: string; + publisher?: string; + version?: string; +}; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +A prepared transaction to send +--- + +## uninstallExtension + +Uninstall an extension on a dynamic contract + +### Example + +```ts +import { uninstallExtension } from "thirdweb/dynamic-contracts"; +const transaction = uninstallExtension({ + client, + chain, + account, + contract, + extensionName: "MyExtension", +}); +await sendTransaction({ transaction, account }); +``` + +```ts +function uninstallExtension( + options: UninstallExtensionOptions, +): PreparedTransaction; +``` + +### Parameters + +The options for uninstalling an extension + +#### Type + +```ts +let options: { + account: Account; + contract: ThirdwebContract; + extensionName: string; +}; +``` + +### Returns + +```ts +let returnType: PreparedTransaction< + any, + AbiFunction, + PrepareTransactionOptions +>; +``` + +A prepared transaction to send +--- + +## activateStylusContract + +Activate a stylus contract by calling ArbWasm Precompile + +### Example + +```ts +import { activateStylusContract } from "thirdweb/stylus"; +const transaction = activateStylusContract({ + client, + chain, + contractAddress, +}); +await sendTransaction({ transaction, account }); +``` + +```ts +function activateStylusContract( + options: ActivateStylusContractOptions, +): Promise< + PreparedTransaction +>; +``` + +### Parameters + +The options for activating the contract + +#### Type + +```ts +let options: { + chain: Chain; + client: ThirdwebClient; + contractAddress: string; +}; +``` + +### Returns + +```ts +let returnType: Readonly & { + __contract?: ThirdwebContract; + __preparedMethod?: () => Promise>; +}; +``` + +A prepared transaction to send +--- + ## 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 `` +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 `` ### Example -#### Basic usage +#### Basic usage ```tsx import { WalletProvider, WalletName } from "thirdweb/react"; @@ -56381,13 +58456,13 @@ import { WalletProvider, WalletName } from "thirdweb/react"; ; ``` - Result: +Result: ```html MetaMask ``` -#### Show a loading sign when the name is being fetched +#### Show a loading sign when the name is being fetched ```tsx import { WalletProvider, WalletName } from "thirdweb/react"; @@ -56397,7 +58472,7 @@ import { WalletProvider, WalletName } from "thirdweb/react"; ; ``` -#### Fallback to something when the name fails to resolve +#### Fallback to something when the name fails to resolve ```tsx @@ -56405,9 +58480,9 @@ import { WalletProvider, WalletName } from "thirdweb/react"; ; ``` -#### Custom query options for useQuery +#### Custom query options for useQuery - This component uses `@tanstack-query` 's useQuery internally. You can use the `queryOptions` prop for more fine-grained control +This component uses `@tanstack-query`'s useQuery internally. You can use the `queryOptions` prop for more fine-grained control ```tsx ),dir : string,draggable : Booleanish,enterKeyHint : "search" | "done" | "next" | "send" | "enter" | "go" | "previous",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,onResize : ReactEventHandler,onResizeCapture : ReactEventHandler,onScroll : UIEventHandler,onScrollCapture : 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,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" | "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} ``` ### Returns @@ -56445,10 +58520,7 @@ let returnType: null | Element; ## decodeAbiParameters ```ts -function decodeAbiParameters( - params: params, - data: `0x${string}` | ByteArray, -): DecodeAbiParametersReturnType; +function decodeAbiParameters(params: params, data: (`0x${string}`) | (ByteArray)) : {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType ? params : Array[key], AbiParameterKind>}[key]} ``` ### Parameters @@ -56468,7 +58540,7 @@ let data: `0x${string}` | ByteArray; ### Returns ```ts -let returnType: DecodeAbiParametersReturnType; +let returnType: {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType ? params : Array[key], AbiParameterKind>}[key]} ``` --- @@ -56478,7 +58550,7 @@ let returnType: DecodeAbiParametersReturnType; function encodePacked( types: packedAbiTypes, values: EncodePackedValues, -): Hex; +): `0x${string}`; ``` ### Parameters @@ -56498,7 +58570,7 @@ let values: EncodePackedValues; ### Returns ```ts -let returnType: ox__Hex.Hex; +let returnType: `0x${string}`; ``` --- @@ -56525,7 +58597,7 @@ let returnType: value is (ByteArray) ## isValidENSName - Checks if a string is a valid ENS name. It does not check if the ENS name is currently registered or resolves to an address - it only validates the string format. +Checks if a string is a valid ENS name. It does not check if the ENS name is currently registered or resolves to an address - it only validates the string format. ### Example @@ -56541,7 +58613,7 @@ function isValidENSName(name: string): boolean; ### Parameters - The ENS name to check. +The ENS name to check. #### Type @@ -56556,9 +58628,51 @@ let returnType: boolean; ``` --- +## setServiceKey + +```ts +function setServiceKey(key: null | string): void; +``` + +### Parameters + +#### Type + +```ts +let key: null | string; +``` + +### Returns + +```ts +let returnType: void; +``` +--- + +## setThirdwebDomains + +```ts +function setThirdwebDomains(DomainOverrides: DomainOverrides): void; +``` + +### Parameters + +#### Type + +```ts +let DomainOverrides: DomainOverrides; +``` + +### Returns + +```ts +let returnType: void; +``` +--- + ## toEventSelector - Returns the hash (of the function/event signature) for a given event or function definition. +Returns the hash (of the function/event signature) for a given event or function definition. ```ts function toEventSelector( @@ -56602,65 +58716,114 @@ let returnType: `0x${string}`; ``` --- -## AutoConnect +## getInstalledWallets + +Get All currently installed wallets. Uses EIP-6963 to discover installed browser extension wallets. + +```ts +function getInstalledWallets(): Array; +``` + +### Returns - AutoConnect last connected wallet on page reload or revisit. Note: If you are using `ConnectButton` or `ConnectEmbed` components, You don't need to use this component as it is already included. +```ts +let returnType: Array; +``` - This is useful if you are manually connecting the wallets using the [useConnect](https://portal.thirdweb.com/references/typescript/v5/useConnect) hook and want to auto connect the last connected wallets on page reload or revisit. +a list of installed wallets +--- - You can also use the [useAutoConnect](https://portal.thirdweb.com/references/typescript/v5/useAutoConnect) hook to achieve the same result. +## randomPrivateKey - To check if the wallet in in the process of auto connecting, you can use the [useIsAutoConnecting](https://portal.thirdweb.com/references/typescript/v5/useIsAutoConnecting) hook. +Generates a random ECDSA private key on the secp256k1 curve. ### Example -```tsx -import { AutoConnect } from "thirdweb/react"; -import { createWallet, inAppWallet } from "thirdweb/wallets"; - -// list of wallets that your app uses -const wallets = [ - inAppWallet(), - createWallet("io.metamask"), - createWallet("me.rainbow"), -]; +```ts +import { Secp256k1 } from "ox"; -function Example() { - return ( - - ); -} +const privateKey = Secp256k1.randomPrivateKey(); ``` ```ts -function AutoConnect(props: AutoConnectProps): Element; +function randomPrivateKey(options?: Options): ReturnType; ``` ### Parameters - Object of type `AutoConnectProps` . Refer to [AutoConnectProps](https://portal.thirdweb.com/references/typescript/v5/AutoConnectProps) +The options to generate the private key. #### Type ```ts -let props: { - accountAbstraction?: SmartWalletOptions; - appMetadata?: AppMetadata; - chain?: Chain; +let options: Options; +``` + +### Returns + +```ts +let returnType: ReturnType; +``` + +The generated private key. +--- + +## create7702MinimalAccount + +```ts +function create7702MinimalAccount(args: { + adminAccount: Account; client: ThirdwebClient; - onConnect?: (wallet: Wallet) => void; - onTimeout?: () => void; - timeout?: number; - wallets?: Array; + sponsorGas?: boolean; +}): Account; +``` + +### Parameters + +#### Type + +```ts +let args: { + adminAccount: Account; + client: ThirdwebClient; + sponsorGas?: boolean; }; ``` ### Returns ```ts -let returnType: Element; +let returnType: { + address: Address; + estimateGas?: (tx: PreparedTransaction) => Promise; + onTransactionRequested?: ( + transaction: PreparedTransaction, + ) => Promise; + sendBatchTransaction?: ( + txs: Array, + ) => Promise; + sendRawTransaction?: ( + tx: SendRawTransactionOptions, + ) => Promise; + sendTransaction: ( + tx: SendTransactionOption, + ) => Promise; + signAuthorization?: ( + authorization: AuthorizationRequest, + ) => Promise; + signMessage: ({ + message, + originalMessage, + chainId, + }: { + chainId?: number; + message: SignableMessage; + originalMessage?: string; + }) => Promise; + signTransaction?: (tx: SerializableTransaction) => Promise; + signTypedData: ( + _typedData: ox__TypedData.Definition, + ) => Promise; + watchAsset?: (asset: WatchAssetParams) => Promise; +}; ``` diff --git a/apps/portal/public/llms.txt b/apps/portal/public/llms.txt index b3a26d149d4..d143a72e8f4 100644 --- a/apps/portal/public/llms.txt +++ b/apps/portal/public/llms.txt @@ -10,7 +10,8 @@ * [AccountBlobbie](https://portal.thirdweb.com/references/typescript/v5/AccountBlobbie): A wrapper for the Blobbie component * [AccountProvider](https://portal.thirdweb.com/references/typescript/v5/AccountProvider): A React context provider component that supplies Account-related data to its child components. * [Blobbie](https://portal.thirdweb.com/references/typescript/v5/Blobbie): A unique gradient avatar based on the provided address. -* [WalletProvider](https://portal.thirdweb.com/references/typescript/v5/WalletProvider): /\*\* +* [SocialIcon](https://portal.thirdweb.com/references/typescript/v5/SocialIcon): Social auth provider icon +* [WalletProvider](https://portal.thirdweb.com/references/typescript/v5/WalletProvider): A React context provider component that supplies Wallet-related data to its child components. --- # Wallet Connection * [AutoConnectProps](https://portal.thirdweb.com/references/typescript/v5/AutoConnect): Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options. @@ -32,31 +33,35 @@ # 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): Embed a prebuilt UI for funding wallets, purchases or transactions with crypto or fiat. --- **React Hooks** --- # Extensions --- ## EIP5792 -* [useCallsStatus](https://portal.thirdweb.com/references/typescript/v5/eip5792/useCallsStatus): A hook to get a call bundle's current status according to [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) . -* [useCapabilities](https://portal.thirdweb.com/references/typescript/v5/eip5792/useCapabilities): A hook to get the current wallet's capabilities according to [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) . -* [useSendCalls](https://portal.thirdweb.com/references/typescript/v5/eip5792/useSendCalls): A hook to send [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions. +* [EIP5792.useCapabilities](https://portal.thirdweb.com/references/typescript/v5/eip5792/useCapabilities): A hook to get the current wallet's capabilities according to [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792). +* [EIP5792.useSendAndConfirmCalls](https://portal.thirdweb.com/references/typescript/v5/eip5792/useSendAndConfirmCalls): A hook to send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be batched and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions. +* [EIP5792.useSendCalls](https://portal.thirdweb.com/references/typescript/v5/eip5792/useSendCalls): A hook to send [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) calls to a wallet. This hook works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792\. Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions. +* [EIP5792.useWaitForCallsReceipt](https://portal.thirdweb.com/references/typescript/v5/eip5792/useWaitForCallsReceipt): A hook to wait for the receipt of eip5792 calls. --- ## ENS -* [useEnsAvatar](https://portal.thirdweb.com/references/typescript/v5/ens/useEnsAvatar): Get the ENS avatar for an ENS name -* [useEnsName](https://portal.thirdweb.com/references/typescript/v5/ens/useEnsName): Get the ENS name and avatar for an address +* [ENS.useEnsAvatar](https://portal.thirdweb.com/references/typescript/v5/ens/useEnsAvatar): Get the ENS avatar for an ENS name +* [ENS.useEnsName](https://portal.thirdweb.com/references/typescript/v5/ens/useEnsName): Get the ENS name and avatar for an address --- # Wallets -* [useLinkProfile](https://portal.thirdweb.com/references/typescript/v5/useLinkProfile): Links a web2 or web3 profile to the connected in-app or ecosystem account. _When a profile is linked to the account, that profile can then be used to sign into the same account._ +* [useAuthToken](https://portal.thirdweb.com/references/typescript/v5/useAuthToken): A hook that returns the authentication token (JWT) for the currently active wallet. This token can be used to authorize API calls to your backend server. +* [useLinkProfile](https://portal.thirdweb.com/references/typescript/v5/useLinkProfile): Links a web2 or web3 profile to the connected in-app or ecosystem account._When a profile is linked to the account, that profile can then be used to sign into the same account._ * [useNetworkSwitcherModal](https://portal.thirdweb.com/references/typescript/v5/useNetworkSwitcherModal): Hook to open the Wallet Network Switcher Modal that shows allows users to switch to different network. * [useProfiles](https://portal.thirdweb.com/references/typescript/v5/useProfiles): Retrieves all linked profiles of the connected in-app or ecosystem account. -* [useUnlinkProfile](https://portal.thirdweb.com/references/typescript/v5/useUnlinkProfile): Unlinks a web2 or web3 profile currently connected in-app or ecosystem account. _When a profile is unlinked from the account, it will no longer be able to be used to sign into the account._ +* [useUnlinkProfile](https://portal.thirdweb.com/references/typescript/v5/useUnlinkProfile): Unlinks a web2 or web3 profile currently connected in-app or ecosystem account._When a profile is unlinked from the account, it will no longer be able to be used to sign into the account._ * [useWalletBalance](https://portal.thirdweb.com/references/typescript/v5/useWalletBalance): Fetch the balance of a wallet in native currency or for a specific token. Leave `tokenAddress` undefined to fetch the native token balance. * [useWalletDetailsModal](https://portal.thirdweb.com/references/typescript/v5/useWalletDetailsModal): Hook to open the Wallet Details Modal that shows various information about the connected wallet and allows users to perform various actions like sending funds, receiving funds, switching networks, Buying tokens, etc. * [useWalletImage](https://portal.thirdweb.com/references/typescript/v5/useWalletImage): Returns the wallet icon for the provided wallet id. @@ -114,859 +119,868 @@ # Extensions --- ## EIP1193 -* [fromProvider](https://portal.thirdweb.com/references/typescript/v5/eip1193/fromProvider): Creates a Thirdweb wallet from an EIP-1193 compatible provider. -* [toProvider](https://portal.thirdweb.com/references/typescript/v5/eip1193/toProvider): Converts a Thirdweb wallet into an EIP-1193 compatible provider. +* [EIP1193.fromProvider](https://portal.thirdweb.com/references/typescript/v5/eip1193/fromProvider): Creates a Thirdweb wallet from an EIP-1193 compatible provider. +* [EIP1193.toProvider](https://portal.thirdweb.com/references/typescript/v5/eip1193/toProvider): Converts a Thirdweb wallet into an EIP-1193 compatible provider. --- ## DEPLOY -* [prepareDirectDeployTransaction](https://portal.thirdweb.com/references/typescript/v5/deploy/prepareDirectDeployTransaction): Prepares a direct deploy transaction with ABI. -* [computePublishedContractAddress](https://portal.thirdweb.com/references/typescript/v5/deploy/computePublishedContractAddress): Predicts the implementation address of any published contract -* [deployContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployContract): Deploy a contract on a given chain -* [deployERC1155Contract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployERC1155Contract): Deploys an thirdweb ERC1155 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. -* [deployERC20Contract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployERC20Contract): Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. -* [deployERC721Contract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployERC721Contract): Deploys an thirdweb ERC721 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. -* [deployPackContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployPackContract): Deploy a thirdweb Pack contract -* [deployPublishedContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployPublishedContract): Deploy an instance of a published contract on a given chain -* [deploySplitContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deploySplitContract): Deploys a thirdweb [Split contract](https://thirdweb.com/thirdweb.eth/Split)On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. -* [prepareDeterministicDeployTransaction](https://portal.thirdweb.com/references/typescript/v5/deploy/prepareDeterministicDeployTransaction): Deploy a contract deterministically - will maintain the same address across chains. This is meant to be used with published contracts configured with the 'direct deploy' method. Under the hood, this uses a keyless transaction with a common create2 factory. +* [DEPLOY.prepareDirectDeployTransaction](https://portal.thirdweb.com/references/typescript/v5/deploy/prepareDirectDeployTransaction): Prepares a direct deploy transaction with ABI. +* [DEPLOY.computePublishedContractAddress](https://portal.thirdweb.com/references/typescript/v5/deploy/computePublishedContractAddress): Predicts the implementation address of any published contract +* [DEPLOY.deployContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployContract): Deploy a contract on a given chain +* [DEPLOY.deployERC1155Contract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployERC1155Contract): Deploys an thirdweb ERC1155 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +* [DEPLOY.deployERC20Contract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployERC20Contract): Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +* [DEPLOY.deployERC721Contract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployERC721Contract): Deploys an thirdweb ERC721 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +* [DEPLOY.deployPackContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployPackContract): \[Pack contract is incompatible with Pectra update. Support for this contract is being removed in next release.\] +* [DEPLOY.deployPublishedContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deployPublishedContract): Deploy an instance of a published contract on a given chain +* [DEPLOY.deploySplitContract](https://portal.thirdweb.com/references/typescript/v5/deploy/deploySplitContract): Deploys a thirdweb [Split contract](https://thirdweb.com/thirdweb.eth/Split)On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. +* [DEPLOY.prepareDeterministicDeployTransaction](https://portal.thirdweb.com/references/typescript/v5/deploy/prepareDeterministicDeployTransaction): Deploy a contract deterministically - will maintain the same address across chains. This is meant to be used with published contracts configured with the 'direct deploy' method. Under the hood, this uses a keyless transaction with a common create2 factory. +--- +## MARKETPLACE +* [MARKETPLACE.deployMarketplaceContract](https://portal.thirdweb.com/references/typescript/v5/marketplace/deployMarketplaceContract): Deploys a marketplace contract. +* [MARKETPLACE.acceptedOfferEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/acceptedOfferEvent): Creates an event object for the AcceptedOffer event. +* [MARKETPLACE.acceptOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/acceptOffer): Accepts an offer after performing necessary checks and validations. Throws an error if the offer is not active, the offeror's balance is insufficient, or the offeror's allowance is insufficient. +* [MARKETPLACE.approveBuyerForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/approveBuyerForListing): Prepares a transaction to call the "approveBuyerForListing" function on the contract. +* [MARKETPLACE.approveCurrencyForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/approveCurrencyForListing): Prepares a transaction to call the "approveCurrencyForListing" function on the contract. +* [MARKETPLACE.auctionClosedEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/auctionClosedEvent): Creates an event object for the AuctionClosed event. +* [MARKETPLACE.bidInAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/bidInAuction): Places a bid in an English auction. +* [MARKETPLACE.buyerApprovedForListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyerApprovedForListingEvent): Creates an event object for the BuyerApprovedForListing event. +* [MARKETPLACE.buyFromListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyFromListing): Buys a listing from the marketplace. +* [MARKETPLACE.buyoutAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyoutAuction): Buys out an English auction. +* [MARKETPLACE.cancelAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelAuction): Cancels an auction by providing the necessary options. +* [MARKETPLACE.cancelledAuctionEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelledAuctionEvent): Creates an event object for the CancelledAuction event. +* [MARKETPLACE.cancelledListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelledListingEvent): Creates an event object for the CancelledListing event. +* [MARKETPLACE.cancelledOfferEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelledOfferEvent): Creates an event object for the CancelledOffer event. +* [MARKETPLACE.cancelListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelListing): Prepares a transaction to call the "cancelListing" function on the contract. +* [MARKETPLACE.cancelOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelOffer): Prepares a transaction to call the "cancelOffer" function on the contract. +* [MARKETPLACE.collectAuctionPayout](https://portal.thirdweb.com/references/typescript/v5/marketplace/collectAuctionPayout): Prepares a transaction to call the "collectAuctionPayout" function on the contract. +* [MARKETPLACE.collectAuctionTokens](https://portal.thirdweb.com/references/typescript/v5/marketplace/collectAuctionTokens): Prepares a transaction to call the "collectAuctionTokens" function on the contract. +* [MARKETPLACE.createAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/createAuction): Creates an auction. +* [MARKETPLACE.createListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/createListing): Creates a direct listing. +* [MARKETPLACE.currencyApprovedForListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/currencyApprovedForListingEvent): Creates an event object for the CurrencyApprovedForListing event. +* [MARKETPLACE.currencyPriceForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/currencyPriceForListing): Retrieves the currency price for a listing. +* [MARKETPLACE.executeSale](https://portal.thirdweb.com/references/typescript/v5/marketplace/executeSale): Executes a sale for an English auction. +* [MARKETPLACE.getAllAuctions](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllAuctions): Retrieves all auctions based on the provided options. +* [MARKETPLACE.getAllListings](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllListings): Retrieves all direct listings based on the provided options. +* [MARKETPLACE.getAllOffers](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllOffers): Retrieves all offers based on the provided options. +* [MARKETPLACE.getAllValidAuctions](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllValidAuctions): Retrieves all valid auctions based on the provided options. +* [MARKETPLACE.getAllValidListings](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllValidListings): Retrieves all valid direct listings based on the provided options. +* [MARKETPLACE.getAllValidOffers](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllValidOffers): Retrieves all valid offers based on the provided options. +* [MARKETPLACE.getAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAuction): Retrieves an auction listing based on the provided options. +* [MARKETPLACE.getListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/getListing): Retrieves a direct listing based on the provided options. +* [MARKETPLACE.getOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/getOffer): Retrieves an offer based on the provided options. +* [MARKETPLACE.getWinningBid](https://portal.thirdweb.com/references/typescript/v5/marketplace/getWinningBid): Retrieves the winning bid information for a given auction. +* [MARKETPLACE.isBidInAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isBidInAuctionSupported): Checks if the `bidInAuction` method is supported by the given contract. +* [MARKETPLACE.isBuyerApprovedForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/isBuyerApprovedForListing): Checks if the buyer is approved for a listing. +* [MARKETPLACE.isBuyFromListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isBuyFromListingSupported): Checks if the `buyFromListing` method is supported by the given contract. +* [MARKETPLACE.isCancelAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCancelAuctionSupported): Checks if the `cancelAuction` method is supported by the given contract. +* [MARKETPLACE.isCancelListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCancelListingSupported): Checks if the `cancelListing` method is supported by the given contract. +* [MARKETPLACE.isCreateAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCreateAuctionSupported): Checks if the `createAuction` method is supported by the given contract. +* [MARKETPLACE.isCreateListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCreateListingSupported): Checks if the `createListing` method is supported by the given contract. +* [MARKETPLACE.isCurrencyApprovedForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCurrencyApprovedForListing): Calls the "isCurrencyApprovedForListing" function on the contract. +* [MARKETPLACE.isGetAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isGetAuctionSupported): Checks if the `getAuction` method is supported by the given contract. +* [MARKETPLACE.isGetListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isGetListingSupported): Checks if the `isGetListingSupported` method is supported by the given contract. +* [MARKETPLACE.isGetWinningBidSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isGetWinningBidSupported): Checks if the `getWinningBid` method is supported by the given contract. +* [MARKETPLACE.isNewWinningBid](https://portal.thirdweb.com/references/typescript/v5/marketplace/isNewWinningBid): Calls the "isNewWinningBid" function on the contract. +* [MARKETPLACE.makeOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/makeOffer): Makes an offer for any asset (ERC721 or ERC1155). +* [MARKETPLACE.newAuctionEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newAuctionEvent): Creates an event object for the NewAuction event. +* [MARKETPLACE.newBidEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newBidEvent): Creates an event object for the NewBid event. +* [MARKETPLACE.newListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newListingEvent): Creates an event object for the NewListing event. +* [MARKETPLACE.newOfferEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newOfferEvent): Creates an event object for the NewOffer event. +* [MARKETPLACE.newSaleEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newSaleEvent): Creates an event object for the NewSale event. +* [MARKETPLACE.totalAuctions](https://portal.thirdweb.com/references/typescript/v5/marketplace/totalAuctions): Calls the "totalAuctions" function on the contract. +* [MARKETPLACE.totalListings](https://portal.thirdweb.com/references/typescript/v5/marketplace/totalListings): Calls the "totalListings" function on the contract. +* [MARKETPLACE.totalOffers](https://portal.thirdweb.com/references/typescript/v5/marketplace/totalOffers): Calls the "totalOffers" function on the contract. +* [MARKETPLACE.updatedListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/updatedListingEvent): Creates an event object for the UpdatedListing event. +* [MARKETPLACE.updateListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/updateListing): Updates an existing direct listing. --- ## AIRDROP -* [airdropERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC1155): Prepares a transaction to call the "airdropERC1155" function on the contract. -* [airdropERC1155WithSignature](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC1155WithSignature): Prepares a transaction to call the "airdropERC1155WithSignature" function on the contract. -* [airdropERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC20): Prepares a transaction to call the "airdropERC20" function on the contract. -* [airdropERC20WithSignature](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC20WithSignature): Prepares a transaction to call the "airdropERC20WithSignature" function on the contract. -* [airdropERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC721): Prepares a transaction to call the "airdropERC721" function on the contract. -* [airdropERC721WithSignature](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC721WithSignature): Prepares a transaction to call the "airdropERC721WithSignature" function on the contract. -* [airdropNativeToken](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropNativeToken): Prepares a transaction to call the "airdropNativeToken" function on the contract. -* [claimERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/claimERC1155): Claim airdrop of ERC1155 tokens for allowlisted addresses. (Pull based airdrop) -* [claimERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/claimERC20): Claim airdrop of ERC20 tokens for allowlisted addresses. (Pull based airdrop) -* [claimERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/claimERC721): Claim airdrop of ERC721 tokens for allowlisted addresses. (Pull based airdrop) -* [fetchProofsERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/fetchProofsERC1155): Retrieves the claim merkle proof for the provided address. -* [fetchProofsERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/fetchProofsERC20): Retrieves the claim merkle proof for the provided address. -* [fetchProofsERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/fetchProofsERC721): Retrieves the claim merkle proof for the provided address. -* [generateAirdropSignatureERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateAirdropSignatureERC1155): Generates the req and signature for sending ERC1155 airdrop. -* [generateAirdropSignatureERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateAirdropSignatureERC20): Generates the req and signature for sending ERC20 airdrop. -* [generateAirdropSignatureERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateAirdropSignatureERC721): Generates the req and signature for sending ERC721 airdrop. -* [generateMerkleTreeInfoERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateMerkleTreeInfoERC1155): Generate merkle tree for a given snapshot. -* [generateMerkleTreeInfoERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateMerkleTreeInfoERC20): Generate merkle tree for a given snapshot. -* [generateMerkleTreeInfoERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateMerkleTreeInfoERC721): Generate merkle tree for a given snapshot. -* [isClaimed](https://portal.thirdweb.com/references/typescript/v5/airdrop/isClaimed): Calls the "isClaimed" function on the contract. -* [saveSnapshot](https://portal.thirdweb.com/references/typescript/v5/airdrop/saveSnapshot): Generate merkle tree for a given snapshot and save the info on-chain. -* [setMerkleRoot](https://portal.thirdweb.com/references/typescript/v5/airdrop/setMerkleRoot): Prepares a transaction to call the "setMerkleRoot" function on the contract. -* [tokenConditionId](https://portal.thirdweb.com/references/typescript/v5/airdrop/tokenConditionId): Calls the "tokenConditionId" function on the contract. -* [tokenMerkleRoot](https://portal.thirdweb.com/references/typescript/v5/airdrop/tokenMerkleRoot): Calls the "tokenMerkleRoot" function on the contract. +* [AIRDROP.airdropERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC1155): Prepares a transaction to call the "airdropERC1155" function on the contract. +* [AIRDROP.airdropERC1155WithSignature](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC1155WithSignature): Prepares a transaction to call the "airdropERC1155WithSignature" function on the contract. +* [AIRDROP.airdropERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC20): Prepares a transaction to call the "airdropERC20" function on the contract. +* [AIRDROP.airdropERC20WithSignature](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC20WithSignature): Prepares a transaction to call the "airdropERC20WithSignature" function on the contract. +* [AIRDROP.airdropERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC721): Prepares a transaction to call the "airdropERC721" function on the contract. +* [AIRDROP.airdropERC721WithSignature](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropERC721WithSignature): Prepares a transaction to call the "airdropERC721WithSignature" function on the contract. +* [AIRDROP.airdropNativeToken](https://portal.thirdweb.com/references/typescript/v5/airdrop/airdropNativeToken): Prepares a transaction to call the "airdropNativeToken" function on the contract. +* [AIRDROP.claimERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/claimERC1155): Claim airdrop of ERC1155 tokens for allowlisted addresses. (Pull based airdrop) +* [AIRDROP.claimERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/claimERC20): Claim airdrop of ERC20 tokens for allowlisted addresses. (Pull based airdrop) +* [AIRDROP.claimERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/claimERC721): Claim airdrop of ERC721 tokens for allowlisted addresses. (Pull based airdrop) +* [AIRDROP.fetchProofsERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/fetchProofsERC1155): Retrieves the claim merkle proof for the provided address. +* [AIRDROP.fetchProofsERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/fetchProofsERC20): Retrieves the claim merkle proof for the provided address. +* [AIRDROP.fetchProofsERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/fetchProofsERC721): Retrieves the claim merkle proof for the provided address. +* [AIRDROP.generateAirdropSignatureERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateAirdropSignatureERC1155): Generates the req and signature for sending ERC1155 airdrop. +* [AIRDROP.generateAirdropSignatureERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateAirdropSignatureERC20): Generates the req and signature for sending ERC20 airdrop. +* [AIRDROP.generateAirdropSignatureERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateAirdropSignatureERC721): Generates the req and signature for sending ERC721 airdrop. +* [AIRDROP.generateMerkleTreeInfoERC1155](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateMerkleTreeInfoERC1155): Generate merkle tree for a given snapshot. +* [AIRDROP.generateMerkleTreeInfoERC20](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateMerkleTreeInfoERC20): Generate merkle tree for a given snapshot. +* [AIRDROP.generateMerkleTreeInfoERC721](https://portal.thirdweb.com/references/typescript/v5/airdrop/generateMerkleTreeInfoERC721): Generate merkle tree for a given snapshot. +* [AIRDROP.isClaimed](https://portal.thirdweb.com/references/typescript/v5/airdrop/isClaimed): Calls the "isClaimed" function on the contract. +* [AIRDROP.saveSnapshot](https://portal.thirdweb.com/references/typescript/v5/airdrop/saveSnapshot): Generate merkle tree for a given snapshot and save the info on-chain. +* [AIRDROP.setMerkleRoot](https://portal.thirdweb.com/references/typescript/v5/airdrop/setMerkleRoot): Prepares a transaction to call the "setMerkleRoot" function on the contract. +* [AIRDROP.tokenConditionId](https://portal.thirdweb.com/references/typescript/v5/airdrop/tokenConditionId): Calls the "tokenConditionId" function on the contract. +* [AIRDROP.tokenMerkleRoot](https://portal.thirdweb.com/references/typescript/v5/airdrop/tokenMerkleRoot): Calls the "tokenMerkleRoot" function on the contract. --- ## COMMON -* [contractURI](https://portal.thirdweb.com/references/typescript/v5/common/contractURI): Calls the "contractURI" function on the contract. -* [getContractMetadata](https://portal.thirdweb.com/references/typescript/v5/common/getContractMetadata): Retrieves the contract metadata including name and symbol. -* [getDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/common/getDefaultRoyaltyInfo): Calls the "getDefaultRoyaltyInfo" function on the contract. -* [getPlatformFeeInfo](https://portal.thirdweb.com/references/typescript/v5/common/getPlatformFeeInfo): Calls the "getPlatformFeeInfo" function on the contract. -* [getRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/common/getRoyaltyInfoForToken): Calls the "getRoyaltyInfoForToken" function on the contract. -* [isGetContractMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetContractMetadataSupported): Checks if the `contractURI` method is supported by the given contract. -* [isGetDefaultRoyaltyInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetDefaultRoyaltyInfoSupported): Checks if the `getDefaultRoyaltyInfo` method is supported by the given contract. -* [isGetPlatformFeeInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetPlatformFeeInfoSupported): Checks if the `getPlatformFeeInfo` method is supported by the given contract. -* [isGetRoyaltyInfoForTokenSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetRoyaltyInfoForTokenSupported): Checks if the `getRoyaltyInfoForToken` method is supported by the given contract. -* [isMulticallSupported](https://portal.thirdweb.com/references/typescript/v5/common/isMulticallSupported): Checks if the `multicall` method is supported by the given contract. -* [isNameSupported](https://portal.thirdweb.com/references/typescript/v5/common/isNameSupported): Checks if the `name` method is supported by the given contract. -* [isOwnerSupported](https://portal.thirdweb.com/references/typescript/v5/common/isOwnerSupported): Checks if the `owner` method is supported by the given contract. -* [isPrimarySaleRecipientSupported](https://portal.thirdweb.com/references/typescript/v5/common/isPrimarySaleRecipientSupported): Checks if the `primarySaleRecipient` method is supported by the given contract. -* [isSetContractURISupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetContractURISupported): Checks if the `setContractURI` method is supported by the given contract. -* [isSetDefaultRoyaltyInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetDefaultRoyaltyInfoSupported): Checks if the `setDefaultRoyaltyInfo` method is supported by the given contract. -* [isSetPlatformFeeInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetPlatformFeeInfoSupported): Checks if the `setPlatformFeeInfo` method is supported by the given contract. -* [isSetPrimarySaleRecipientSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetPrimarySaleRecipientSupported): Checks if the `setPrimarySaleRecipient` method is supported by the given contract. -* [isSetRoyaltyInfoForTokenSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetRoyaltyInfoForTokenSupported): Checks if the `setRoyaltyInfoForToken` method is supported by the given contract. -* [isSymbolSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSymbolSupported): Checks if the `symbol` method is supported by the given contract. -* [multicall](https://portal.thirdweb.com/references/typescript/v5/common/multicall): Prepares a transaction to call the "multicall" function on the contract. -* [name](https://portal.thirdweb.com/references/typescript/v5/common/name): Retrieves the name associated with the given contract. -* [owner](https://portal.thirdweb.com/references/typescript/v5/common/owner): Calls the "owner" function on the contract. -* [ownerUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/common/ownerUpdatedEvent): Creates an event object for the OwnerUpdated event. -* [primarySaleRecipient](https://portal.thirdweb.com/references/typescript/v5/common/primarySaleRecipient): Calls the "primarySaleRecipient" function on the contract. -* [setContractMetadata](https://portal.thirdweb.com/references/typescript/v5/common/setContractMetadata): Sets the metadata for a contract. -* [setContractURI](https://portal.thirdweb.com/references/typescript/v5/common/setContractURI): Prepares a transaction to call the "setContractURI" function on the contract. -* [setDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/common/setDefaultRoyaltyInfo): Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. -* [setOwner](https://portal.thirdweb.com/references/typescript/v5/common/setOwner): Prepares a transaction to call the "setOwner" function on the contract. -* [setPlatformFeeInfo](https://portal.thirdweb.com/references/typescript/v5/common/setPlatformFeeInfo): Prepares a transaction to call the "setPlatformFeeInfo" function on the contract. -* [setPrimarySaleRecipient](https://portal.thirdweb.com/references/typescript/v5/common/setPrimarySaleRecipient): Prepares a transaction to call the "setPrimarySaleRecipient" function on the contract. -* [setRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/common/setRoyaltyInfoForToken): Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. -* [symbol](https://portal.thirdweb.com/references/typescript/v5/common/symbol): Retrieves the name associated with the given contract. +* [COMMON.contractURI](https://portal.thirdweb.com/references/typescript/v5/common/contractURI): Calls the "contractURI" function on the contract. +* [COMMON.getContractMetadata](https://portal.thirdweb.com/references/typescript/v5/common/getContractMetadata): Retrieves the contract metadata including name and symbol. +* [COMMON.getDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/common/getDefaultRoyaltyInfo): Calls the "getDefaultRoyaltyInfo" function on the contract. +* [COMMON.getPlatformFeeInfo](https://portal.thirdweb.com/references/typescript/v5/common/getPlatformFeeInfo): Calls the "getPlatformFeeInfo" function on the contract. +* [COMMON.getRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/common/getRoyaltyInfoForToken): Calls the "getRoyaltyInfoForToken" function on the contract. +* [COMMON.isGetContractMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetContractMetadataSupported): Checks if the `contractURI` method is supported by the given contract. +* [COMMON.isGetDefaultRoyaltyInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetDefaultRoyaltyInfoSupported): Checks if the `getDefaultRoyaltyInfo` method is supported by the given contract. +* [COMMON.isGetPlatformFeeInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetPlatformFeeInfoSupported): Checks if the `getPlatformFeeInfo` method is supported by the given contract. +* [COMMON.isGetRoyaltyInfoForTokenSupported](https://portal.thirdweb.com/references/typescript/v5/common/isGetRoyaltyInfoForTokenSupported): Checks if the `getRoyaltyInfoForToken` method is supported by the given contract. +* [COMMON.isMulticallSupported](https://portal.thirdweb.com/references/typescript/v5/common/isMulticallSupported): Checks if the `multicall` method is supported by the given contract. +* [COMMON.isNameSupported](https://portal.thirdweb.com/references/typescript/v5/common/isNameSupported): Checks if the `name` method is supported by the given contract. +* [COMMON.isOwnerSupported](https://portal.thirdweb.com/references/typescript/v5/common/isOwnerSupported): Checks if the `owner` method is supported by the given contract. +* [COMMON.isPrimarySaleRecipientSupported](https://portal.thirdweb.com/references/typescript/v5/common/isPrimarySaleRecipientSupported): Checks if the `primarySaleRecipient` method is supported by the given contract. +* [COMMON.isSetContractURISupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetContractURISupported): Checks if the `setContractURI` method is supported by the given contract. +* [COMMON.isSetDefaultRoyaltyInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetDefaultRoyaltyInfoSupported): Checks if the `setDefaultRoyaltyInfo` method is supported by the given contract. +* [COMMON.isSetPlatformFeeInfoSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetPlatformFeeInfoSupported): Checks if the `setPlatformFeeInfo` method is supported by the given contract. +* [COMMON.isSetPrimarySaleRecipientSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetPrimarySaleRecipientSupported): Checks if the `setPrimarySaleRecipient` method is supported by the given contract. +* [COMMON.isSetRoyaltyInfoForTokenSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSetRoyaltyInfoForTokenSupported): Checks if the `setRoyaltyInfoForToken` method is supported by the given contract. +* [COMMON.isSymbolSupported](https://portal.thirdweb.com/references/typescript/v5/common/isSymbolSupported): Checks if the `symbol` method is supported by the given contract. +* [COMMON.multicall](https://portal.thirdweb.com/references/typescript/v5/common/multicall): Prepares a transaction to call the "multicall" function on the contract. +* [COMMON.name](https://portal.thirdweb.com/references/typescript/v5/common/name): Retrieves the name associated with the given contract. +* [COMMON.owner](https://portal.thirdweb.com/references/typescript/v5/common/owner): Calls the "owner" function on the contract. +* [COMMON.ownerUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/common/ownerUpdatedEvent): Creates an event object for the OwnerUpdated event. +* [COMMON.primarySaleRecipient](https://portal.thirdweb.com/references/typescript/v5/common/primarySaleRecipient): Calls the "primarySaleRecipient" function on the contract. +* [COMMON.setContractMetadata](https://portal.thirdweb.com/references/typescript/v5/common/setContractMetadata): Sets the metadata for a contract. +* [COMMON.setContractURI](https://portal.thirdweb.com/references/typescript/v5/common/setContractURI): Prepares a transaction to call the "setContractURI" function on the contract. +* [COMMON.setDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/common/setDefaultRoyaltyInfo): Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. +* [COMMON.setOwner](https://portal.thirdweb.com/references/typescript/v5/common/setOwner): Prepares a transaction to call the "setOwner" function on the contract. +* [COMMON.setPlatformFeeInfo](https://portal.thirdweb.com/references/typescript/v5/common/setPlatformFeeInfo): Prepares a transaction to call the "setPlatformFeeInfo" function on the contract. +* [COMMON.setPrimarySaleRecipient](https://portal.thirdweb.com/references/typescript/v5/common/setPrimarySaleRecipient): Prepares a transaction to call the "setPrimarySaleRecipient" function on the contract. +* [COMMON.setRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/common/setRoyaltyInfoForToken): Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. +* [COMMON.symbol](https://portal.thirdweb.com/references/typescript/v5/common/symbol): Retrieves the name associated with the given contract. --- ## ENS -* [parseNftUri](https://portal.thirdweb.com/references/typescript/v5/ens/parseNftUri): Parses an NFT URI. -* [parseAvatarRecord](https://portal.thirdweb.com/references/typescript/v5/ens/parseAvatarRecord): Parses an ENS or similar avatar record. Supports NFT URIs, IPFS scheme, and HTTPS URIs. -* [resolveAddress](https://portal.thirdweb.com/references/typescript/v5/ens/resolveAddress): Resolves an ENS name to an Ethereum address. -* [resolveAvatar](https://portal.thirdweb.com/references/typescript/v5/ens/resolveAvatar): Resolves an ENS name to the avatar URL. -* [resolveL2Name](https://portal.thirdweb.com/references/typescript/v5/ens/resolveL2Name): Resolves the L2 name for a specified address. -* [resolveName](https://portal.thirdweb.com/references/typescript/v5/ens/resolveName): Resolves the primary name for a specified address. -* [resolveText](https://portal.thirdweb.com/references/typescript/v5/ens/resolveText): Resolves an ENS name and key to the specified record. +* [ENS.parseNftUri](https://portal.thirdweb.com/references/typescript/v5/ens/parseNftUri): Parses an NFT URI. +* [ENS.parseAvatarRecord](https://portal.thirdweb.com/references/typescript/v5/ens/parseAvatarRecord): Parses an ENS or similar avatar record. Supports NFT URIs, IPFS scheme, and HTTPS URIs. +* [ENS.resolveAddress](https://portal.thirdweb.com/references/typescript/v5/ens/resolveAddress): Resolves an ENS name to an Ethereum address. +* [ENS.resolveAvatar](https://portal.thirdweb.com/references/typescript/v5/ens/resolveAvatar): Resolves an ENS name to the avatar URL. +* [ENS.resolveL2Name](https://portal.thirdweb.com/references/typescript/v5/ens/resolveL2Name): Resolves the L2 name for a specified address. +* [ENS.resolveName](https://portal.thirdweb.com/references/typescript/v5/ens/resolveName): Resolves the primary name for a specified address. +* [ENS.resolveText](https://portal.thirdweb.com/references/typescript/v5/ens/resolveText): Resolves an ENS name and key to the specified record. --- ## ERC1155 -* [approvalForAllEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/approvalForAllEvent): Creates an event object for the ApprovalForAll event. -* [balanceOf](https://portal.thirdweb.com/references/typescript/v5/erc1155/balanceOf): Calls the "balanceOf" function on the contract. -* [balanceOfBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/balanceOfBatch): Calls the "balanceOfBatch" function on the contract. -* [batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. -* [burn](https://portal.thirdweb.com/references/typescript/v5/erc1155/burn): Prepares a transaction to call the "burn" function on the contract. -* [burnBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/burnBatch): Prepares a transaction to call the "burnBatch" function on the contract. -* [claimTo](https://portal.thirdweb.com/references/typescript/v5/erc1155/claimTo): Claim ERC1155 NFTs to a specified address -* [createPack](https://portal.thirdweb.com/references/typescript/v5/erc1155/createPack): Prepares a transaction to call the "createPack" function on the contract. -* [encodeSafeTransferFrom](https://portal.thirdweb.com/references/typescript/v5/erc1155/encodeSafeTransferFrom): Encodes the "safeTransferFrom" function into a Hex string with its parameters. -* [freezeMetadata](https://portal.thirdweb.com/references/typescript/v5/erc1155/freezeMetadata): Prepares a transaction to call the "freezeMetadata" function on the contract. -* [generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/erc1155/generateMintSignature): Generates the payload and signature for minting an ERC1155 token. -* [getActiveClaimCondition](https://portal.thirdweb.com/references/typescript/v5/erc1155/getActiveClaimCondition): Retrieves the active claim condition. -* [getClaimConditionById](https://portal.thirdweb.com/references/typescript/v5/erc1155/getClaimConditionById): Calls the "getClaimConditionById" function on the contract. -* [getClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc1155/getClaimConditions): Retrieves all claim conditions. -* [getNFT](https://portal.thirdweb.com/references/typescript/v5/erc1155/getNFT): Retrieves information about a specific ERC1155 non-fungible token (NFT). -* [getNFTs](https://portal.thirdweb.com/references/typescript/v5/erc1155/getNFTs): Retrieves an array of NFTs ("ERC1155") based on the provided options. -* [getOwnedNFTs](https://portal.thirdweb.com/references/typescript/v5/erc1155/getOwnedNFTs): Retrieves the owned ERC1155 NFTs for a given wallet address. -* [getOwnedTokenIds](https://portal.thirdweb.com/references/typescript/v5/erc1155/getOwnedTokenIds): Retrieves the owned ERC1155 tokenIds & the owned balance of each tokenId for a given wallet address. -* [isApprovedForAll](https://portal.thirdweb.com/references/typescript/v5/erc1155/isApprovedForAll): Calls the "isApprovedForAll" function on the contract. -* [isBurnSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isBurnSupported): Checks if the `burn` method is supported by the given contract. -* [isClaimToSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isClaimToSupported): Checks if the `claimTo` method is supported by the given contract. -* [isERC1155](https://portal.thirdweb.com/references/typescript/v5/erc1155/isERC1155): Check if a contract supports the ERC1155 interface. -* [isGetActiveClaimConditionSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetActiveClaimConditionSupported): Checks if the `getActiveClaimCondition` method is supported by the given contract. -* [isGetClaimConditionByIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetClaimConditionByIdSupported): Checks if the `getClaimConditionById` method is supported by the given contract. -* [isGetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetClaimConditionsSupported): Checks if the `getClaimConditions` method is supported by the given contract. -* [isGetNFTsSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetNFTsSupported): Checks if the `getNFTs` method is supported by the given contract. -* [isGetNFTSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetNFTSupported): Checks if the `uri` method is supported by the given contract. -* [isLazyMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isLazyMintSupported): Checks if the `lazyMint` method is supported by the given contract. -* [isMintAdditionalSupplyToSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isMintAdditionalSupplyToSupported): Checks if the `mintAdditionalSupplyTo` method is supported by the given contract. -* [isMintToSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isMintToSupported): Checks if the `mintTo` method is supported by the given contract. -* [isNextTokenIdToMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isNextTokenIdToMintSupported): Checks if the `nextTokenIdToMint` method is supported by the given contract. -* [isResetClaimEligibilitySupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isResetClaimEligibilitySupported): Checks if the `resetClaimEligibility` method is supported by the given contract. -* [isSetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isSetClaimConditionsSupported): Checks if the `setClaimConditions` method is supported by the given contract. -* [isTotalSupplySupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isTotalSupplySupported): Checks if the `totalSupply` method is supported by the given contract. -* [isUpdateTokenURISupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isUpdateTokenURISupported): Checks if the `setTokenURI` method is supported by the given contract. -* [lazyMint](https://portal.thirdweb.com/references/typescript/v5/erc1155/lazyMint): Lazily mints ERC1155 tokens. -* [metadataFrozenEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/metadataFrozenEvent): Creates an event object for the MetadataFrozen event. -* [metadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/metadataUpdateEvent): Creates an event object for the MetadataUpdate event. -* [mintAdditionalSupplyTo](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintAdditionalSupplyTo): Mints a "supply" number of additional ERC1155 tokens to the specified "to" address. -* [mintAdditionalSupplyToBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintAdditionalSupplyToBatch): This extension batches multiple `mintAdditionalSupplyToBatch` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. -* [mintTo](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintTo): Mints a "supply" number of new ERC1155 tokens to the specified "to" address. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. -* [mintToBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintToBatch): This extension batches multiple `mintTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. -* [mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintWithSignature): Mints a new ERC1155 token with the given minter signature -* [nextTokenId](https://portal.thirdweb.com/references/typescript/v5/erc1155/nextTokenId): Calls the "nextTokenId" function on the contract. -* [nextTokenIdToMint](https://portal.thirdweb.com/references/typescript/v5/erc1155/nextTokenIdToMint): Calls the "nextTokenIdToMint" function on the contract. -* [openPack](https://portal.thirdweb.com/references/typescript/v5/erc1155/openPack): Prepares a transaction to call the "openPack" function on the contract. -* [packCreatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/packCreatedEvent): Creates an event object for the PackCreated event. -* [packOpenedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/packOpenedEvent): Creates an event object for the PackOpened event. -* [packUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/packUpdatedEvent): Creates an event object for the PackUpdated event. -* [resetClaimEligibility](https://portal.thirdweb.com/references/typescript/v5/erc1155/resetClaimEligibility): Reset the claim eligibility for all users. -* [safeBatchTransferFrom](https://portal.thirdweb.com/references/typescript/v5/erc1155/safeBatchTransferFrom): Prepares a transaction to call the "safeBatchTransferFrom" function on the contract. -* [safeTransferFrom](https://portal.thirdweb.com/references/typescript/v5/erc1155/safeTransferFrom): Prepares a transaction to call the "safeTransferFrom" function on the contract. -* [setApprovalForAll](https://portal.thirdweb.com/references/typescript/v5/erc1155/setApprovalForAll): Prepares a transaction to call the "setApprovalForAll" function on the contract. -* [setClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc1155/setClaimConditions): Set the claim conditions for a ERC1155 drop -* [setTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI): Prepares a transaction to call the "setTokenURI" function on the contract. -* [tokensClaimedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/tokensClaimedEvent): Creates an event object for the TokensClaimed event. -* [tokensLazyMintedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/tokensLazyMintedEvent): Creates an event object for the TokensLazyMinted event. -* [tokensMintedWithSignatureEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/tokensMintedWithSignatureEvent): Creates an event object for the TokensMintedWithSignature event. -* [totalSupply](https://portal.thirdweb.com/references/typescript/v5/erc1155/totalSupply): Calls the "totalSupply" function on the contract. -* [transferBatchEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/transferBatchEvent): Creates an event object for the TransferBatch event. -* [transferSingleEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/transferSingleEvent): Creates an event object for the TransferSingle event. -* [updateMetadata](https://portal.thirdweb.com/references/typescript/v5/erc1155/updateMetadata): Update the metadata of the single token in an Edition Drop (DropERC1155) collection For Edition contracts, use `setTokenURI` -* [updateTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc1155/updateTokenURI): This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI) , which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput) , upload that content to IPFS and pass the IPFS URI (of said `NFTInput` ) to the underlying `setTokenURI` method. -* [uri](https://portal.thirdweb.com/references/typescript/v5/erc1155/uri): Calls the "uri" function on the contract. +* [ERC1155.approvalForAllEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/approvalForAllEvent): Creates an event object for the ApprovalForAll event. +* [ERC1155.balanceOf](https://portal.thirdweb.com/references/typescript/v5/erc1155/balanceOf): Calls the "balanceOf" function on the contract. +* [ERC1155.balanceOfBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/balanceOfBatch): Calls the "balanceOfBatch" function on the contract. +* [ERC1155.batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. +* [ERC1155.burn](https://portal.thirdweb.com/references/typescript/v5/erc1155/burn): Prepares a transaction to call the "burn" function on the contract. +* [ERC1155.burnBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/burnBatch): Prepares a transaction to call the "burnBatch" function on the contract. +* [ERC1155.canClaim](https://portal.thirdweb.com/references/typescript/v5/erc1155/canClaim): Check if a user can claim a drop. This method is only available on the `DropERC1155` contract. +* [ERC1155.claimCondition](https://portal.thirdweb.com/references/typescript/v5/erc1155/claimCondition): Calls the "claimCondition" function on the contract. +* [ERC1155.claimTo](https://portal.thirdweb.com/references/typescript/v5/erc1155/claimTo): Claim ERC1155 NFTs to a specified address This method is only available on the `DropERC1155` contract. +* [ERC1155.createPack](https://portal.thirdweb.com/references/typescript/v5/erc1155/createPack): Prepares a transaction to call the "createPack" function on the contract. +* [ERC1155.encodeSafeTransferFrom](https://portal.thirdweb.com/references/typescript/v5/erc1155/encodeSafeTransferFrom): Encodes the "safeTransferFrom" function into a Hex string with its parameters. +* [ERC1155.freezeMetadata](https://portal.thirdweb.com/references/typescript/v5/erc1155/freezeMetadata): Prepares a transaction to call the "freezeMetadata" function on the contract. +* [ERC1155.generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/erc1155/generateMintSignature): Generates the payload and signature for minting an ERC1155 token. +* [ERC1155.getActiveClaimCondition](https://portal.thirdweb.com/references/typescript/v5/erc1155/getActiveClaimCondition): Retrieves the active claim condition. This method is only available on the `DropERC1155` contract. +* [ERC1155.getClaimConditionById](https://portal.thirdweb.com/references/typescript/v5/erc1155/getClaimConditionById): Calls the "getClaimConditionById" function on the contract. +* [ERC1155.getClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc1155/getClaimConditions): Retrieves all claim conditions. This method is only available on the `DropERC1155` contract. +* [ERC1155.getNFT](https://portal.thirdweb.com/references/typescript/v5/erc1155/getNFT): Retrieves information about a specific ERC1155 non-fungible token (NFT). +* [ERC1155.getNFTs](https://portal.thirdweb.com/references/typescript/v5/erc1155/getNFTs): Retrieves an array of NFTs ("ERC1155") based on the provided options. +* [ERC1155.getOwnedNFTs](https://portal.thirdweb.com/references/typescript/v5/erc1155/getOwnedNFTs): Retrieves the owned ERC1155 NFTs for a given wallet address. +* [ERC1155.getOwnedTokenIds](https://portal.thirdweb.com/references/typescript/v5/erc1155/getOwnedTokenIds): Retrieves the owned ERC1155 tokenIds & the owned balance of each tokenId for a given wallet address. +* [ERC1155.isApprovedForAll](https://portal.thirdweb.com/references/typescript/v5/erc1155/isApprovedForAll): Calls the "isApprovedForAll" function on the contract. +* [ERC1155.isBurnSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isBurnSupported): Checks if the `burn` method is supported by the given contract. +* [ERC1155.isClaimToSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isClaimToSupported): Checks if the `claimTo` method is supported by the given contract. +* [ERC1155.isERC1155](https://portal.thirdweb.com/references/typescript/v5/erc1155/isERC1155): Check if a contract supports the ERC1155 interface. +* [ERC1155.isGetActiveClaimConditionSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetActiveClaimConditionSupported): Checks if the `getActiveClaimCondition` method is supported by the given contract. +* [ERC1155.isGetClaimConditionByIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetClaimConditionByIdSupported): Checks if the `getClaimConditionById` method is supported by the given contract. +* [ERC1155.isGetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetClaimConditionsSupported): Checks if the `getClaimConditions` method is supported by the given contract. +* [ERC1155.isGetNFTsSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetNFTsSupported): Checks if the `getNFTs` method is supported by the given contract. +* [ERC1155.isGetNFTSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isGetNFTSupported): Checks if the `uri` method is supported by the given contract. +* [ERC1155.isLazyMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isLazyMintSupported): Checks if the `lazyMint` method is supported by the given contract. +* [ERC1155.isMintAdditionalSupplyToSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isMintAdditionalSupplyToSupported): Checks if the `mintAdditionalSupplyTo` method is supported by the given contract. +* [ERC1155.isMintToSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isMintToSupported): Checks if the `mintTo` method is supported by the given contract. +* [ERC1155.isNextTokenIdToMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isNextTokenIdToMintSupported): Checks if the `nextTokenIdToMint` method is supported by the given contract. +* [ERC1155.isResetClaimEligibilitySupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isResetClaimEligibilitySupported): Checks if the `resetClaimEligibility` method is supported by the given contract. +* [ERC1155.isSetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isSetClaimConditionsSupported): Checks if the `setClaimConditions` method is supported by the given contract. +* [ERC1155.isTotalSupplySupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isTotalSupplySupported): Checks if the `totalSupply` method is supported by the given contract. +* [ERC1155.isUpdateTokenURISupported](https://portal.thirdweb.com/references/typescript/v5/erc1155/isUpdateTokenURISupported): Checks if the `setTokenURI` method is supported by the given contract. +* [ERC1155.lazyMint](https://portal.thirdweb.com/references/typescript/v5/erc1155/lazyMint): Lazily mints ERC1155 tokens. This method is only available on the `DropERC1155` contract. +* [ERC1155.metadataFrozenEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/metadataFrozenEvent): Creates an event object for the MetadataFrozen event. +* [ERC1155.metadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/metadataUpdateEvent): Creates an event object for the MetadataUpdate event. +* [ERC1155.mintAdditionalSupplyTo](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintAdditionalSupplyTo): Mints a "supply" number of additional ERC1155 tokens to the specified "to" address. This method is only available on the `TokenERC1155` contract. +* [ERC1155.mintAdditionalSupplyToBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintAdditionalSupplyToBatch): This extension batches multiple `mintAdditionalSupplyToBatch` extensions into one single multicall. This method is only available on the `TokenERC1155` contract. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. +* [ERC1155.mintTo](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintTo): Mints a "supply" number of new ERC1155 tokens to the specified "to" address. This method is only available on the `TokenERC1155` contract. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. +* [ERC1155.mintToBatch](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintToBatch): This extension batches multiple `mintTo` extensions into one single multicall. This method is only available on the `TokenERC1155` contract. Keep in mind that there is a limit of how many NFTs you can mint per transaction. This limit varies depends on the network that you are transacting on. +* [ERC1155.mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/erc1155/mintWithSignature): Mints a new ERC1155 token with the given minter signature This method is only available on the `TokenERC1155` contract. +* [ERC1155.nextTokenId](https://portal.thirdweb.com/references/typescript/v5/erc1155/nextTokenId): Calls the "nextTokenId" function on the contract. +* [ERC1155.nextTokenIdToMint](https://portal.thirdweb.com/references/typescript/v5/erc1155/nextTokenIdToMint): Calls the "nextTokenIdToMint" function on the contract. +* [ERC1155.openPack](https://portal.thirdweb.com/references/typescript/v5/erc1155/openPack): Prepares a transaction to call the "openPack" function on the contract. +* [ERC1155.packCreatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/packCreatedEvent): Creates an event object for the PackCreated event. +* [ERC1155.packOpenedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/packOpenedEvent): Creates an event object for the PackOpened event. +* [ERC1155.packUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/packUpdatedEvent): Creates an event object for the PackUpdated event. +* [ERC1155.resetClaimEligibility](https://portal.thirdweb.com/references/typescript/v5/erc1155/resetClaimEligibility): Reset the claim eligibility for all users. This method is only available on the `DropERC1155` contract. +* [ERC1155.safeBatchTransferFrom](https://portal.thirdweb.com/references/typescript/v5/erc1155/safeBatchTransferFrom): Prepares a transaction to call the "safeBatchTransferFrom" function on the contract. +* [ERC1155.safeTransferFrom](https://portal.thirdweb.com/references/typescript/v5/erc1155/safeTransferFrom): Prepares a transaction to call the "safeTransferFrom" function on the contract. +* [ERC1155.setApprovalForAll](https://portal.thirdweb.com/references/typescript/v5/erc1155/setApprovalForAll): Prepares a transaction to call the "setApprovalForAll" function on the contract. +* [ERC1155.setClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc1155/setClaimConditions): Set the claim conditions for a ERC1155 drop This method is only available on the `DropERC1155` contract. +* [ERC1155.setTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI): Prepares a transaction to call the "setTokenURI" function on the contract. +* [ERC1155.tokensClaimedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/tokensClaimedEvent): Creates an event object for the TokensClaimed event. +* [ERC1155.tokensLazyMintedEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/tokensLazyMintedEvent): Creates an event object for the TokensLazyMinted event. +* [ERC1155.tokensMintedWithSignatureEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/tokensMintedWithSignatureEvent): Creates an event object for the TokensMintedWithSignature event. +* [ERC1155.totalSupply](https://portal.thirdweb.com/references/typescript/v5/erc1155/totalSupply): Calls the "totalSupply" function on the contract. +* [ERC1155.transferBatchEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/transferBatchEvent): Creates an event object for the TransferBatch event. +* [ERC1155.transferSingleEvent](https://portal.thirdweb.com/references/typescript/v5/erc1155/transferSingleEvent): Creates an event object for the TransferSingle event. +* [ERC1155.updateMetadata](https://portal.thirdweb.com/references/typescript/v5/erc1155/updateMetadata): Update the metadata of the single token in an Edition Drop (DropERC1155) collection For Edition contracts, use `setTokenURI` +* [ERC1155.updateTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc1155/updateTokenURI): This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc1155/setTokenURI), which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput), upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method. This method is only available on the `TokenERC1155` contract. +* [ERC1155.uri](https://portal.thirdweb.com/references/typescript/v5/erc1155/uri): Calls the "uri" function on the contract. --- ## ERC721 -* [isUpdateMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isUpdateMetadataSupported): Checks if the `updateMetadata` method is supported by the given contract. -* [isGetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetClaimConditionsSupported): Checks if the `getClaimConditions` method is supported by the given contract. -* [approvalEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/approvalEvent): Creates an event object for the Approval event. -* [approvalForAllEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/approvalForAllEvent): Creates an event object for the ApprovalForAll event. -* [approve](https://portal.thirdweb.com/references/typescript/v5/erc721/approve): Prepares a transaction to call the "approve" function on the contract. -* [balanceOf](https://portal.thirdweb.com/references/typescript/v5/erc721/balanceOf): Calls the "balanceOf" function on the contract. -* [burn](https://portal.thirdweb.com/references/typescript/v5/erc721/burn): Prepares a transaction to call the "burn" function on the contract. -* [claimConditionsUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/claimConditionsUpdatedEvent): Creates an event object for the ClaimConditionsUpdated event. -* [claimTo](https://portal.thirdweb.com/references/typescript/v5/erc721/claimTo): Claim ERC721 NFTs to a specified address -* [claimToBatch](https://portal.thirdweb.com/references/typescript/v5/erc721/claimToBatch): This extension batches multiple `claimTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can claim per transaction. This limit varies depends on the network that you are transacting on. -* [createDelayedRevealBatch](https://portal.thirdweb.com/references/typescript/v5/erc721/createDelayedRevealBatch): Creates a batch of encrypted NFTs that can be revealed at a later time. -* [generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/erc721/generateMintSignature): Generates the payload and signature for minting an ERC721 token. -* [getActiveClaimCondition](https://portal.thirdweb.com/references/typescript/v5/erc721/getActiveClaimCondition): Retrieves the active claim condition. -* [getActiveClaimConditionId](https://portal.thirdweb.com/references/typescript/v5/erc721/getActiveClaimConditionId): Calls the "getActiveClaimConditionId" function on the contract. -* [getAllOwners](https://portal.thirdweb.com/references/typescript/v5/erc721/getAllOwners): Retrieves the owners of all ERC721 tokens within a specified range. -* [getBatchesToReveal](https://portal.thirdweb.com/references/typescript/v5/erc721/getBatchesToReveal): Retrieves the batches available to reveal in an NFT contract. -* [getClaimConditionById](https://portal.thirdweb.com/references/typescript/v5/erc721/getClaimConditionById): Calls the "getClaimConditionById" function on the contract. -* [getClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc721/getClaimConditions): Retrieves all claim conditions. -* [getNFT](https://portal.thirdweb.com/references/typescript/v5/erc721/getNFT): Retrieves information about a specific ERC721 non-fungible token (NFT). -* [getNFTs](https://portal.thirdweb.com/references/typescript/v5/erc721/getNFTs): Retrieves an array of NFTs ("ERC721") based on the provided options. -* [getOwnedNFTs](https://portal.thirdweb.com/references/typescript/v5/erc721/getOwnedNFTs): Retrieves the owned NFTs for a given owner. This extension only works with ERC721 contracts that support the [tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method -* [getOwnedTokenIds](https://portal.thirdweb.com/references/typescript/v5/erc721/getOwnedTokenIds): Retrieves the token IDs owned by a specific address. -* [getTotalClaimedSupply](https://portal.thirdweb.com/references/typescript/v5/erc721/getTotalClaimedSupply): Retrieves the total claimed supply of ERC721 tokens. -* [getTotalUnclaimedSupply](https://portal.thirdweb.com/references/typescript/v5/erc721/getTotalUnclaimedSupply): Retrieves the total unclaimed supply of ERC721 tokens. -* [isApprovedForAll](https://portal.thirdweb.com/references/typescript/v5/erc721/isApprovedForAll): Calls the "isApprovedForAll" function on the contract. -* [isBurnSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isBurnSupported): Checks if the `burn` method is supported by the given contract. -* [isClaimToSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isClaimToSupported): Checks if the `claimTo` method is supported by the given contract. -* [isCreateDelayedRevealBatchSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isCreateDelayedRevealBatchSupported): Checks if the `createDelayedRevealBatch` method is supported by the given contract. -* [isERC721](https://portal.thirdweb.com/references/typescript/v5/erc721/isERC721): Check if a contract supports the ERC721 interface. -* [isGetActiveClaimConditionIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetActiveClaimConditionIdSupported): Checks if the `getActiveClaimConditionId` method is supported by the given contract. -* [isGetActiveClaimConditionSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetActiveClaimConditionSupported): Checks if the `getActiveClaimCondition` method is supported by the given contract. -* [isGetBatchesToRevealSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetBatchesToRevealSupported): Checks if the `getBatchesToReveal` method is supported by the given contract. -* [isGetClaimConditionByIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetClaimConditionByIdSupported): Checks if the `getClaimConditionById` method is supported by the given contract. -* [isGetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetClaimConditionsSupported-2): Checks if the `getClaimConditions` method is supported by the given contract. -* [isGetNFTsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetNFTsSupported): Checks if the `getNFTs` method is supported by the given contract. -* [isGetNFTSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetNFTSupported): Checks if the `tokenURI` method is supported by the given contract. -* [isLazyMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isLazyMintSupported): Checks if the `lazyMint` method is supported by the given contract. -* [isMintToSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isMintToSupported): Checks if the `mintTo` method is supported by the given contract. -* [isNextTokenIdToMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isNextTokenIdToMintSupported): Checks if the `nextTokenIdToMint` method is supported by the given contract. -* [isResetClaimEligibilitySupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isResetClaimEligibilitySupported): Checks if the `resetClaimEligibility` method is supported by the given contract. -* [isRevealSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isRevealSupported): Checks if the `reveal` method is supported by the given contract. -* [isSetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isSetClaimConditionsSupported): Checks if the `setClaimConditions` method is supported by the given contract. -* [isSetSharedMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isSetSharedMetadataSupported): Checks if the `setSharedMetadata` method is supported by the given contract. -* [isSharedMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isSharedMetadataSupported): Checks if the `sharedMetadata` method is supported by the given contract. -* [isTotalSupplySupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isTotalSupplySupported): Checks if the `totalSupply` method is supported by the given contract. -* [isUpdateMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isUpdateMetadataSupported-2): Checks if the `updateMetadata` method is supported by the given contract. -* [isUpdateTokenURISupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isUpdateTokenURISupported): Checks if the `setTokenURI` method is supported by the given contract. -* [lazyMint](https://portal.thirdweb.com/references/typescript/v5/erc721/lazyMint): Lazily mints ERC721 tokens. -* [mintTo](https://portal.thirdweb.com/references/typescript/v5/erc721/mintTo): Mints a new ERC721 token and assigns it to the specified address. If the `nft` parameter is a string, it will be used as the token URI. If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI. -* [mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/erc721/mintWithSignature): Mints a new ERC721 token with the given minter signature -* [nextTokenIdToMint](https://portal.thirdweb.com/references/typescript/v5/erc721/nextTokenIdToMint): Calls the "nextTokenIdToMint" function on the contract. -* [ownerOf](https://portal.thirdweb.com/references/typescript/v5/erc721/ownerOf): Calls the "ownerOf" function on the contract. -* [resetClaimEligibility](https://portal.thirdweb.com/references/typescript/v5/erc721/resetClaimEligibility): Reset the claim eligibility for all users. -* [reveal](https://portal.thirdweb.com/references/typescript/v5/erc721/reveal): Reveals a previously lazy minted batch of NFTs. -* [setApprovalForAll](https://portal.thirdweb.com/references/typescript/v5/erc721/setApprovalForAll): Prepares a transaction to call the "setApprovalForAll" function on the contract. -* [setClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc721/setClaimConditions): Set the claim conditions for a ERC721 drop -* [setSharedMetadata](https://portal.thirdweb.com/references/typescript/v5/erc721/setSharedMetadata): Sets the shared metadata for a OpenEdition contract. -* [setTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI): Prepares a transaction to call the "setTokenURI" function on the contract. -* [sharedMetadata](https://portal.thirdweb.com/references/typescript/v5/erc721/sharedMetadata): Calls the "sharedMetadata" function on the contract. -* [sharedMetadataUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/sharedMetadataUpdatedEvent): Creates an event object for the SharedMetadataUpdated event. -* [startTokenId](https://portal.thirdweb.com/references/typescript/v5/erc721/startTokenId): Calls the "startTokenId" function on the contract. -* [tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex): Calls the "tokenOfOwnerByIndex" function on the contract. -* [tokensClaimedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensClaimedEvent): Creates an event object for the TokensClaimed event. -* [tokensLazyMintedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensLazyMintedEvent): Creates an event object for the TokensLazyMinted event. -* [tokensMintedWithSignatureEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensMintedWithSignatureEvent): Creates an event object for the TokensMintedWithSignature event. -* [tokensOfOwner](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensOfOwner): Calls the "tokensOfOwner" function on the contract. -* [tokenURI](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenURI): Calls the "tokenURI" function on the contract. -* [tokenURIRevealedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenURIRevealedEvent): Creates an event object for the TokenURIRevealed event. -* [totalSupply](https://portal.thirdweb.com/references/typescript/v5/erc721/totalSupply): Calls the "totalSupply" function on the contract. -* [transferEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/transferEvent): Creates an event object for the Transfer event. -* [transferFrom](https://portal.thirdweb.com/references/typescript/v5/erc721/transferFrom): Prepares a transaction to call the "transferFrom" function on the contract. -* [updateMetadata](https://portal.thirdweb.com/references/typescript/v5/erc721/updateMetadata): Update the metadata of the single token in an NFT Drop (DropERC721) collection For NFT Collection, please use `setTokenURI` -* [updateTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc721/updateTokenURI): This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI) , which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput) , upload that content to IPFS and pass the IPFS URI (of said `NFTInput` ) to the underlying `setTokenURI` method. +* [ERC721.isUpdateMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isUpdateMetadataSupported): Checks if the `updateMetadata` method is supported by the given contract. +* [ERC721.isGetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetClaimConditionsSupported): Checks if the `getClaimConditions` method is supported by the given contract. +* [ERC721.approvalEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/approvalEvent): Creates an event object for the Approval event. +* [ERC721.approvalForAllEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/approvalForAllEvent): Creates an event object for the ApprovalForAll event. +* [ERC721.approve](https://portal.thirdweb.com/references/typescript/v5/erc721/approve): Prepares a transaction to call the "approve" function on the contract. +* [ERC721.balanceOf](https://portal.thirdweb.com/references/typescript/v5/erc721/balanceOf): Calls the "balanceOf" function on the contract. +* [ERC721.burn](https://portal.thirdweb.com/references/typescript/v5/erc721/burn): Prepares a transaction to call the "burn" function on the contract. +* [ERC721.canClaim](https://portal.thirdweb.com/references/typescript/v5/erc721/canClaim): Check if a user can claim a drop. +* [ERC721.claimConditionsUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/claimConditionsUpdatedEvent): Creates an event object for the ClaimConditionsUpdated event. +* [ERC721.claimTo](https://portal.thirdweb.com/references/typescript/v5/erc721/claimTo): Claim ERC721 NFTs to a specified address This method is only available on the `DropERC721` contract. +* [ERC721.claimToBatch](https://portal.thirdweb.com/references/typescript/v5/erc721/claimToBatch): This extension batches multiple `claimTo` extensions into one single multicall. Keep in mind that there is a limit of how many NFTs you can claim per transaction. This limit varies depends on the network that you are transacting on. This method is only available on the `DropERC721` contract. +* [ERC721.createDelayedRevealBatch](https://portal.thirdweb.com/references/typescript/v5/erc721/createDelayedRevealBatch): Creates a batch of encrypted NFTs that can be revealed at a later time. This method is only available on the `DropERC721` contract. +* [ERC721.generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/erc721/generateMintSignature): Generates the payload and signature for minting an ERC721 token. +* [ERC721.getActiveClaimCondition](https://portal.thirdweb.com/references/typescript/v5/erc721/getActiveClaimCondition): Retrieves the active claim condition. This method is only available on the `DropERC721` contract. +* [ERC721.getActiveClaimConditionId](https://portal.thirdweb.com/references/typescript/v5/erc721/getActiveClaimConditionId): Calls the "getActiveClaimConditionId" function on the contract. +* [ERC721.getAllOwners](https://portal.thirdweb.com/references/typescript/v5/erc721/getAllOwners): Retrieves the owners of all ERC721 tokens within a specified range. +* [ERC721.getApproved](https://portal.thirdweb.com/references/typescript/v5/erc721/getApproved): Calls the "getApproved" function on the contract. +* [ERC721.getBatchesToReveal](https://portal.thirdweb.com/references/typescript/v5/erc721/getBatchesToReveal): Retrieves the batches available to reveal in an NFT contract. +* [ERC721.getClaimConditionById](https://portal.thirdweb.com/references/typescript/v5/erc721/getClaimConditionById): Calls the "getClaimConditionById" function on the contract. +* [ERC721.getClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc721/getClaimConditions): Retrieves all claim conditions. +* [ERC721.getNFT](https://portal.thirdweb.com/references/typescript/v5/erc721/getNFT): Retrieves information about a specific ERC721 non-fungible token (NFT). +* [ERC721.getNFTs](https://portal.thirdweb.com/references/typescript/v5/erc721/getNFTs): Retrieves an array of NFTs ("ERC721") based on the provided options. +* [ERC721.getOwnedNFTs](https://portal.thirdweb.com/references/typescript/v5/erc721/getOwnedNFTs): Retrieves the owned NFTs for a given owner. This extension only works with ERC721 contracts that support the [tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method +* [ERC721.getOwnedTokenIds](https://portal.thirdweb.com/references/typescript/v5/erc721/getOwnedTokenIds): Retrieves the token IDs owned by a specific address. +* [ERC721.getTotalClaimedSupply](https://portal.thirdweb.com/references/typescript/v5/erc721/getTotalClaimedSupply): Retrieves the total claimed supply of ERC721 tokens. +* [ERC721.getTotalUnclaimedSupply](https://portal.thirdweb.com/references/typescript/v5/erc721/getTotalUnclaimedSupply): Retrieves the total unclaimed supply of ERC721 tokens. +* [ERC721.isApprovedForAll](https://portal.thirdweb.com/references/typescript/v5/erc721/isApprovedForAll): Calls the "isApprovedForAll" function on the contract. +* [ERC721.isBurnSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isBurnSupported): Checks if the `burn` method is supported by the given contract. +* [ERC721.isClaimToSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isClaimToSupported): Checks if the `claimTo` method is supported by the given contract. +* [ERC721.isCreateDelayedRevealBatchSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isCreateDelayedRevealBatchSupported): Checks if the `createDelayedRevealBatch` method is supported by the given contract. +* [ERC721.isERC721](https://portal.thirdweb.com/references/typescript/v5/erc721/isERC721): Check if a contract supports the ERC721 interface. +* [ERC721.isGetActiveClaimConditionIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetActiveClaimConditionIdSupported): Checks if the `getActiveClaimConditionId` method is supported by the given contract. +* [ERC721.isGetActiveClaimConditionSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetActiveClaimConditionSupported): Checks if the `getActiveClaimCondition` method is supported by the given contract. This method is only available on the `DropERC721` contract. +* [ERC721.isGetApprovedSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetApprovedSupported): Checks if the `getApproved` method is supported by the given contract. +* [ERC721.isGetBatchesToRevealSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetBatchesToRevealSupported): Checks if the `getBatchesToReveal` method is supported by the given contract. +* [ERC721.isGetClaimConditionByIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetClaimConditionByIdSupported): Checks if the `getClaimConditionById` method is supported by the given contract. +* [ERC721.isGetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetClaimConditionsSupported-2): Checks if the `getClaimConditions` method is supported by the given contract. +* [ERC721.isGetNFTsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetNFTsSupported): Checks if the `getNFTs` method is supported by the given contract. +* [ERC721.isGetNFTSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isGetNFTSupported): Checks if the `tokenURI` method is supported by the given contract. +* [ERC721.isLazyMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isLazyMintSupported): Checks if the `lazyMint` method is supported by the given contract. +* [ERC721.isMintToSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isMintToSupported): Checks if the `mintTo` method is supported by the given contract. +* [ERC721.isNextTokenIdToMintSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isNextTokenIdToMintSupported): Checks if the `nextTokenIdToMint` method is supported by the given contract. +* [ERC721.isResetClaimEligibilitySupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isResetClaimEligibilitySupported): Checks if the `resetClaimEligibility` method is supported by the given contract. +* [ERC721.isRevealSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isRevealSupported): Checks if the `reveal` method is supported by the given contract. +* [ERC721.isSetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isSetClaimConditionsSupported): Checks if the `setClaimConditions` method is supported by the given contract. +* [ERC721.isSetSharedMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isSetSharedMetadataSupported): Checks if the `setSharedMetadata` method is supported by the given contract. +* [ERC721.isSharedMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isSharedMetadataSupported): Checks if the `sharedMetadata` method is supported by the given contract. +* [ERC721.isTokenByIndexSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isTokenByIndexSupported): Checks if the `tokenByIndex` method is supported by the given contract. +* [ERC721.isTotalSupplySupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isTotalSupplySupported): Checks if the `totalSupply` method is supported by the given contract. +* [ERC721.isUpdateMetadataSupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isUpdateMetadataSupported-2): Checks if the `updateMetadata` method is supported by the given contract. +* [ERC721.isUpdateTokenURISupported](https://portal.thirdweb.com/references/typescript/v5/erc721/isUpdateTokenURISupported): Checks if the `setTokenURI` method is supported by the given contract. +* [ERC721.lazyMint](https://portal.thirdweb.com/references/typescript/v5/erc721/lazyMint): Lazily mints ERC721 tokens. This method is only available on the `DropERC721` contract. +* [ERC721.mintTo](https://portal.thirdweb.com/references/typescript/v5/erc721/mintTo): Mints a new ERC721 token and assigns it to the specified address. This method is only available on the `TokenERC721` contract. +* [ERC721.mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/erc721/mintWithSignature): Mints a new ERC721 token with the given minter signature This method is only available on the `TokenERC721` contract. +* [ERC721.nextTokenIdToMint](https://portal.thirdweb.com/references/typescript/v5/erc721/nextTokenIdToMint): Calls the "nextTokenIdToMint" function on the contract. +* [ERC721.ownerOf](https://portal.thirdweb.com/references/typescript/v5/erc721/ownerOf): Calls the "ownerOf" function on the contract. +* [ERC721.resetClaimEligibility](https://portal.thirdweb.com/references/typescript/v5/erc721/resetClaimEligibility): Reset the claim eligibility for all users. This method is only available on the `DropERC721` contract. +* [ERC721.reveal](https://portal.thirdweb.com/references/typescript/v5/erc721/reveal): Reveals a previously lazy minted batch of NFTs. This method is only available on the `DropERC721` contract. +* [ERC721.setApprovalForAll](https://portal.thirdweb.com/references/typescript/v5/erc721/setApprovalForAll): Prepares a transaction to call the "setApprovalForAll" function on the contract. +* [ERC721.setClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc721/setClaimConditions): Set the claim conditions for a ERC721 drop This method is only available on the `DropERC721` contract. +* [ERC721.setSharedMetadata](https://portal.thirdweb.com/references/typescript/v5/erc721/setSharedMetadata): Sets the shared metadata for a OpenEdition contract. +* [ERC721.setTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI): Prepares a transaction to call the "setTokenURI" function on the contract. +* [ERC721.sharedMetadata](https://portal.thirdweb.com/references/typescript/v5/erc721/sharedMetadata): Calls the "sharedMetadata" function on the contract. +* [ERC721.sharedMetadataUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/sharedMetadataUpdatedEvent): Creates an event object for the SharedMetadataUpdated event. +* [ERC721.startTokenId](https://portal.thirdweb.com/references/typescript/v5/erc721/startTokenId): Calls the "startTokenId" function on the contract. +* [ERC721.tokenOfOwnerByIndex](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex): Calls the "tokenOfOwnerByIndex" function on the contract. +* [ERC721.tokensClaimedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensClaimedEvent): Creates an event object for the TokensClaimed event. +* [ERC721.tokensLazyMintedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensLazyMintedEvent): Creates an event object for the TokensLazyMinted event. +* [ERC721.tokensMintedWithSignatureEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensMintedWithSignatureEvent): Creates an event object for the TokensMintedWithSignature event. +* [ERC721.tokensOfOwner](https://portal.thirdweb.com/references/typescript/v5/erc721/tokensOfOwner): Calls the "tokensOfOwner" function on the contract. +* [ERC721.tokenURI](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenURI): Calls the "tokenURI" function on the contract. +* [ERC721.tokenURIRevealedEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenURIRevealedEvent): Creates an event object for the TokenURIRevealed event. +* [ERC721.totalSupply](https://portal.thirdweb.com/references/typescript/v5/erc721/totalSupply): Calls the "totalSupply" function on the contract. +* [ERC721.transferEvent](https://portal.thirdweb.com/references/typescript/v5/erc721/transferEvent): Creates an event object for the Transfer event. +* [ERC721.transferFrom](https://portal.thirdweb.com/references/typescript/v5/erc721/transferFrom): Prepares a transaction to call the "transferFrom" function on the contract. +* [ERC721.updateMetadata](https://portal.thirdweb.com/references/typescript/v5/erc721/updateMetadata): Update the metadata of the single token in an NFT Drop (DropERC721) collection For NFT Collection, please use `setTokenURI` +* [ERC721.updateTokenURI](https://portal.thirdweb.com/references/typescript/v5/erc721/updateTokenURI): This function is an abstracted layer of the [setTokenURI extension](https://portal.thirdweb.com/references/typescript/v5/erc721/setTokenURI), which means it uses `setTokenURI` under the hood. While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [NFTInput](https://portal.thirdweb.com/references/typescript/v5/NFTInput), upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method. --- ## ERC1271 -* [checkContractWalletSignature](https://portal.thirdweb.com/references/typescript/v5/erc1271/checkContractWalletSignature): Use `verifySignature` instead -* [checkContractWalletSignedTypedData](https://portal.thirdweb.com/references/typescript/v5/erc1271/checkContractWalletSignedTypedData): Use `verifyTypedData` instead +* [ERC1271.checkContractWalletSignature](https://portal.thirdweb.com/references/typescript/v5/erc1271/checkContractWalletSignature): Use `verifySignature` instead +* [ERC1271.checkContractWalletSignedTypedData](https://portal.thirdweb.com/references/typescript/v5/erc1271/checkContractWalletSignedTypedData): Use `verifyTypedData` instead --- ## ERC20 -* [allowance](https://portal.thirdweb.com/references/typescript/v5/erc20/allowance): Calls the "allowance" function on the contract. -* [approvalEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/approvalEvent): Creates an event object for the Approval event. -* [approve](https://portal.thirdweb.com/references/typescript/v5/erc20/approve): Approves the spending of tokens by a specific address. -* [balanceOf](https://portal.thirdweb.com/references/typescript/v5/erc20/balanceOf): Calls the "balanceOf" function on the contract. -* [burn](https://portal.thirdweb.com/references/typescript/v5/erc20/burn): Prepares a transaction to call the "burn" function on the contract. -* [burnFrom](https://portal.thirdweb.com/references/typescript/v5/erc20/burnFrom): Prepares a transaction to call the "burnFrom" function on the contract. -* [claimConditionsUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/claimConditionsUpdatedEvent): Creates an event object for the ClaimConditionsUpdated event. -* [claimTo](https://portal.thirdweb.com/references/typescript/v5/erc20/claimTo): Claim ERC20 NFTs to a specified address -* [decimals](https://portal.thirdweb.com/references/typescript/v5/erc20/decimals): Retrieves the number of decimal places for a given ERC20 contract. -* [delegate](https://portal.thirdweb.com/references/typescript/v5/erc20/delegate): Prepares a transaction to call the "delegate" function on the contract. -* [delegates](https://portal.thirdweb.com/references/typescript/v5/erc20/delegates): Calls the "delegates" function on the contract. -* [deposit](https://portal.thirdweb.com/references/typescript/v5/erc20/deposit): Calls the "deposit" function on the contract (useful to wrap ETH). -* [generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/erc20/generateMintSignature): Generates the payload and signature for minting an ERC20 token. -* [getActiveClaimCondition](https://portal.thirdweb.com/references/typescript/v5/erc20/getActiveClaimCondition): Retrieves the active claim condition. -* [getActiveClaimConditionId](https://portal.thirdweb.com/references/typescript/v5/erc20/getActiveClaimConditionId): Calls the "getActiveClaimConditionId" function on the contract. -* [getBalance](https://portal.thirdweb.com/references/typescript/v5/erc20/getBalance): Retrieves the balance of an ERC20 token for a specific address. -* [getClaimConditionById](https://portal.thirdweb.com/references/typescript/v5/erc20/getClaimConditionById): Calls the "getClaimConditionById" function on the contract. -* [getClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc20/getClaimConditions): Retrieves all claim conditions. -* [getCurrencyMetadata](https://portal.thirdweb.com/references/typescript/v5/erc20/getCurrencyMetadata): Retrieves the metadata of a currency. -* [isClaimToSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isClaimToSupported): Checks if the `claimTo` method is supported by the given contract. -* [isERC20](https://portal.thirdweb.com/references/typescript/v5/erc20/isERC20): Check if a contract is an ERC20 token. -* [isGetActiveClaimConditionIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isGetActiveClaimConditionIdSupported): Checks if the `getActiveClaimConditionId` method is supported by the given contract. -* [isGetActiveClaimConditionSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isGetActiveClaimConditionSupported): Checks if the `getActiveClaimCondition` method is supported by the given contract. -* [isGetClaimConditionByIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isGetClaimConditionByIdSupported): Checks if the `getClaimConditionById` method is supported by the given contract. -* [isMintToSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isMintToSupported): Checks if the `mintTo` method is supported by the given contract. -* [isResetClaimEligibilitySupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isResetClaimEligibilitySupported): Checks if the `resetClaimEligibility` method is supported by the given contract. -* [isSetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isSetClaimConditionsSupported): Checks if the `setClaimConditions` method is supported by the given contract. -* [mintTo](https://portal.thirdweb.com/references/typescript/v5/erc20/mintTo): Mints a specified amount of tokens to a given address. -* [mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/erc20/mintWithSignature): Mints a new ERC20 token with the given minter signature -* [resetClaimEligibility](https://portal.thirdweb.com/references/typescript/v5/erc20/resetClaimEligibility): Reset the claim eligibility for all users. -* [setClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc20/setClaimConditions): Set the claim conditions for a ERC20 drop -* [tokensClaimedEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/tokensClaimedEvent): Creates an event object for the TokensClaimed event. -* [tokensMintedEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/tokensMintedEvent): Creates an event object for the TokensMinted event. -* [tokensMintedWithSignatureEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/tokensMintedWithSignatureEvent): Creates an event object for the TokensMintedWithSignature event. -* [totalSupply](https://portal.thirdweb.com/references/typescript/v5/erc20/totalSupply): Calls the "totalSupply" function on the contract. -* [transfer](https://portal.thirdweb.com/references/typescript/v5/erc20/transfer): Transfers ERC20 tokens from the sender's address to the specified recipient address. -* [transferBatch](https://portal.thirdweb.com/references/typescript/v5/erc20/transferBatch): Transfers a batch of ERC20 tokens from the sender's address to the specified recipient address. -* [transferEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/transferEvent): Creates an event object for the Transfer event. -* [transferFrom](https://portal.thirdweb.com/references/typescript/v5/erc20/transferFrom): Transfers a specified amount of tokens from one address to another address on the ERC20 contract. -* [withdraw](https://portal.thirdweb.com/references/typescript/v5/erc20/withdraw): Prepares a transaction to call the "withdraw" function on the contract. +* [ERC20.allowance](https://portal.thirdweb.com/references/typescript/v5/erc20/allowance): Calls the "allowance" function on the contract. +* [ERC20.approvalEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/approvalEvent): Creates an event object for the Approval event. +* [ERC20.approve](https://portal.thirdweb.com/references/typescript/v5/erc20/approve): Approves the spending of tokens by a specific address. +* [ERC20.balanceOf](https://portal.thirdweb.com/references/typescript/v5/erc20/balanceOf): Calls the "balanceOf" function on the contract. +* [ERC20.burn](https://portal.thirdweb.com/references/typescript/v5/erc20/burn): Prepares a transaction to call the "burn" function on the contract. +* [ERC20.burnFrom](https://portal.thirdweb.com/references/typescript/v5/erc20/burnFrom): Prepares a transaction to call the "burnFrom" function on the contract. +* [ERC20.canClaim](https://portal.thirdweb.com/references/typescript/v5/erc20/canClaim): Check if a user can claim a drop. This method is only available on the `DropERC20` contract. +* [ERC20.claimConditionsUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/claimConditionsUpdatedEvent): Creates an event object for the ClaimConditionsUpdated event. +* [ERC20.claimTo](https://portal.thirdweb.com/references/typescript/v5/erc20/claimTo): Claim ERC20 NFTs to a specified address This method is only available on the `DropERC20` contract. +* [ERC20.decimals](https://portal.thirdweb.com/references/typescript/v5/erc20/decimals): Retrieves the number of decimal places for a given ERC20 contract. +* [ERC20.delegate](https://portal.thirdweb.com/references/typescript/v5/erc20/delegate): Prepares a transaction to call the "delegate" function on the contract. +* [ERC20.delegates](https://portal.thirdweb.com/references/typescript/v5/erc20/delegates): Calls the "delegates" function on the contract. +* [ERC20.deposit](https://portal.thirdweb.com/references/typescript/v5/erc20/deposit): Calls the "deposit" function on the contract (useful to wrap ETH). +* [ERC20.generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/erc20/generateMintSignature): Generates the payload and signature for minting an ERC20 token. +* [ERC20.getActiveClaimCondition](https://portal.thirdweb.com/references/typescript/v5/erc20/getActiveClaimCondition): Retrieves the active claim condition. This method is only available on the `DropERC20` contract. +* [ERC20.getActiveClaimConditionId](https://portal.thirdweb.com/references/typescript/v5/erc20/getActiveClaimConditionId): Calls the "getActiveClaimConditionId" function on the contract. +* [ERC20.getBalance](https://portal.thirdweb.com/references/typescript/v5/erc20/getBalance): Retrieves the balance of an ERC20 token for a specific address. +* [ERC20.getClaimConditionById](https://portal.thirdweb.com/references/typescript/v5/erc20/getClaimConditionById): Calls the "getClaimConditionById" function on the contract. +* [ERC20.getClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc20/getClaimConditions): Retrieves all claim conditions. This method is only available on the `DropERC20` contract. +* [ERC20.getCurrencyMetadata](https://portal.thirdweb.com/references/typescript/v5/erc20/getCurrencyMetadata): Retrieves the metadata of a currency. +* [ERC20.isClaimToSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isClaimToSupported): Checks if the `claimTo` method is supported by the given contract. +* [ERC20.isERC20](https://portal.thirdweb.com/references/typescript/v5/erc20/isERC20): Check if a contract is an ERC20 token. +* [ERC20.isGetActiveClaimConditionIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isGetActiveClaimConditionIdSupported): Checks if the `getActiveClaimConditionId` method is supported by the given contract. +* [ERC20.isGetActiveClaimConditionSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isGetActiveClaimConditionSupported): Checks if the `getActiveClaimCondition` method is supported by the given contract. +* [ERC20.isGetClaimConditionByIdSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isGetClaimConditionByIdSupported): Checks if the `getClaimConditionById` method is supported by the given contract. +* [ERC20.isMintToSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isMintToSupported): Checks if the `mintTo` method is supported by the given contract. +* [ERC20.isResetClaimEligibilitySupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isResetClaimEligibilitySupported): Checks if the `resetClaimEligibility` method is supported by the given contract. +* [ERC20.isSetClaimConditionsSupported](https://portal.thirdweb.com/references/typescript/v5/erc20/isSetClaimConditionsSupported): Checks if the `setClaimConditions` method is supported by the given contract. +* [ERC20.mintTo](https://portal.thirdweb.com/references/typescript/v5/erc20/mintTo): Mints a specified amount of tokens to a given address. This method is only available on the `TokenERC20` contract. +* [ERC20.mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/erc20/mintWithSignature): Mints a new ERC20 token with the given minter signature This method is only available on the `TokenERC20` contract. +* [ERC20.resetClaimEligibility](https://portal.thirdweb.com/references/typescript/v5/erc20/resetClaimEligibility): Reset the claim eligibility for all users. This method is only available on the `DropERC20` contract. +* [ERC20.setClaimConditions](https://portal.thirdweb.com/references/typescript/v5/erc20/setClaimConditions): Set the claim conditions for a ERC20 drop This method is only available on the `DropERC20` contract. +* [ERC20.tokensClaimedEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/tokensClaimedEvent): Creates an event object for the TokensClaimed event. +* [ERC20.tokensMintedEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/tokensMintedEvent): Creates an event object for the TokensMinted event. +* [ERC20.tokensMintedWithSignatureEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/tokensMintedWithSignatureEvent): Creates an event object for the TokensMintedWithSignature event. +* [ERC20.totalSupply](https://portal.thirdweb.com/references/typescript/v5/erc20/totalSupply): Calls the "totalSupply" function on the contract. +* [ERC20.transfer](https://portal.thirdweb.com/references/typescript/v5/erc20/transfer): Transfers ERC20 tokens from the sender's address to the specified recipient address. +* [ERC20.transferBatch](https://portal.thirdweb.com/references/typescript/v5/erc20/transferBatch): Transfers a batch of ERC20 tokens from the sender's address to the specified recipient address. +* [ERC20.transferEvent](https://portal.thirdweb.com/references/typescript/v5/erc20/transferEvent): Creates an event object for the Transfer event. +* [ERC20.transferFrom](https://portal.thirdweb.com/references/typescript/v5/erc20/transferFrom): Transfers a specified amount of tokens from one address to another address on the ERC20 contract. +* [ERC20.withdraw](https://portal.thirdweb.com/references/typescript/v5/erc20/withdraw): Prepares a transaction to call the "withdraw" function on the contract. --- ## ERC4337 -* [accountDeployedEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/accountDeployedEvent): Creates an event object for the AccountDeployed event. -* [addAdmin](https://portal.thirdweb.com/references/typescript/v5/erc4337/addAdmin): Adds admin permissions for a specified address. -* [addSessionKey](https://portal.thirdweb.com/references/typescript/v5/erc4337/addSessionKey): Adds session key permissions for a specified address. -* [adminUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/adminUpdatedEvent): Creates an event object for the AdminUpdated event. -* [createAccount](https://portal.thirdweb.com/references/typescript/v5/erc4337/createAccount): Prepares a transaction to call the "createAccount" function on the contract. -* [getAccounts](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAccounts): Calls the "getAccounts" function on the contract. -* [getAccountsOfSigner](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAccountsOfSigner): Calls the "getAccountsOfSigner" function on the contract. -* [getAllAccounts](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllAccounts): Calls the "getAllAccounts" function on the contract. -* [getAllActiveSigners](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllActiveSigners): Calls the "getAllActiveSigners" function on the contract. -* [getAllAdmins](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllAdmins): Calls the "getAllAdmins" function on the contract. -* [getAllSigners](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllSigners): Calls the "getAllSigners" function on the contract. -* [getPermissionsForSigner](https://portal.thirdweb.com/references/typescript/v5/erc4337/getPermissionsForSigner): Calls the "getPermissionsForSigner" function on the contract. -* [getUserOpHash](https://portal.thirdweb.com/references/typescript/v5/erc4337/getUserOpHash): Calls the "getUserOpHash" function on the contract. -* [isAccountDeployed](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAccountDeployed): Adds admin permissions for a specified address. -* [isActiveSigner](https://portal.thirdweb.com/references/typescript/v5/erc4337/isActiveSigner): Calls the "isActiveSigner" function on the contract. -* [isAddAdminSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAddAdminSupported): Checks if the `isAddAdminSupported` method is supported by the given contract. -* [isAddSessionKeySupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAddSessionKeySupported): Checks if the `isAddSessionKeySupported` method is supported by the given contract. -* [isAdmin](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAdmin): Calls the "isAdmin" function on the contract. -* [isCreateAccountSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isCreateAccountSupported): Checks if the `createAccount` method is supported by the given contract. -* [isGetAccountsOfSignerSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAccountsOfSignerSupported): Checks if the `getAccountsOfSigner` method is supported by the given contract. -* [isGetAccountsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAccountsSupported): Checks if the `getAccounts` method is supported by the given contract. -* [isGetAllAccountsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllAccountsSupported): Checks if the `getAllAccounts` method is supported by the given contract. -* [isGetAllActiveSignersSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllActiveSignersSupported): Checks if the `getAllActiveSigners` method is supported by the given contract. -* [isGetAllAdminsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllAdminsSupported): Checks if the `getAllAdmins` method is supported by the given contract. -* [isGetAllSignersSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllSignersSupported): Checks if the `getAllSigners` method is supported by the given contract. -* [isIsAccountDeployedSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isIsAccountDeployedSupported): Checks if the `getAddress` method is supported by the given contract. -* [isIsActiveSignerSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isIsActiveSignerSupported): Checks if the `isActiveSigner` method is supported by the given contract. -* [isIsAdminSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isIsAdminSupported): Checks if the `isAdmin` method is supported by the given contract. -* [isRegistered](https://portal.thirdweb.com/references/typescript/v5/erc4337/isRegistered): Calls the "isRegistered" function on the contract. -* [isRemoveAdminSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isRemoveAdminSupported): Checks if the `isRemoveAdminSupported` method is supported by the given contract. -* [isRemoveSessionKeySupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isRemoveSessionKeySupported): Checks if the `isRemoveSessionKeySupported` method is supported by the given contract. -* [isTotalAccountsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isTotalAccountsSupported): Checks if the `totalAccounts` method is supported by the given contract. -* [isValidateUserOpSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isValidateUserOpSupported): Checks if the `validateUserOp` method is supported by the given contract. -* [predictAccountAddress](https://portal.thirdweb.com/references/typescript/v5/erc4337/predictAccountAddress): Calls the "getAddress" function on the contract. -* [removeAdmin](https://portal.thirdweb.com/references/typescript/v5/erc4337/removeAdmin): Removes admin permissions for a specified address. -* [removeSessionKey](https://portal.thirdweb.com/references/typescript/v5/erc4337/removeSessionKey): Removes session key permissions for a specified address. -* [signerPermissionsUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/signerPermissionsUpdatedEvent): Creates an event object for the SignerPermissionsUpdated event. -* [simulateHandleOp](https://portal.thirdweb.com/references/typescript/v5/erc4337/simulateHandleOp): Prepares a transaction to call the "simulateHandleOp" function on the contract. -* [totalAccounts](https://portal.thirdweb.com/references/typescript/v5/erc4337/totalAccounts): Calls the "totalAccounts" function on the contract. -* [userOperationEventEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/userOperationEventEvent): Creates an event object for the UserOperationEvent event. -* [userOperationRevertReasonEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/userOperationRevertReasonEvent): Creates an event object for the UserOperationRevertReason event. +* [ERC4337.accountDeployedEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/accountDeployedEvent): Creates an event object for the AccountDeployed event. +* [ERC4337.addAdmin](https://portal.thirdweb.com/references/typescript/v5/erc4337/addAdmin): Adds admin permissions for a specified address. +* [ERC4337.addSessionKey](https://portal.thirdweb.com/references/typescript/v5/erc4337/addSessionKey): Adds session key permissions for a specified address. +* [ERC4337.adminUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/adminUpdatedEvent): Creates an event object for the AdminUpdated event. +* [ERC4337.createAccount](https://portal.thirdweb.com/references/typescript/v5/erc4337/createAccount): Prepares a transaction to call the "createAccount" function on the contract. +* [ERC4337.getAccounts](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAccounts): Calls the "getAccounts" function on the contract. +* [ERC4337.getAccountsOfSigner](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAccountsOfSigner): Calls the "getAccountsOfSigner" function on the contract. +* [ERC4337.getAllAccounts](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllAccounts): Calls the "getAllAccounts" function on the contract. +* [ERC4337.getAllActiveSigners](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllActiveSigners): Calls the "getAllActiveSigners" function on the contract. +* [ERC4337.getAllAdmins](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllAdmins): Calls the "getAllAdmins" function on the contract. +* [ERC4337.getAllSigners](https://portal.thirdweb.com/references/typescript/v5/erc4337/getAllSigners): Calls the "getAllSigners" function on the contract. +* [ERC4337.getPermissionsForSigner](https://portal.thirdweb.com/references/typescript/v5/erc4337/getPermissionsForSigner): Calls the "getPermissionsForSigner" function on the contract. +* [ERC4337.getUserOpHash](https://portal.thirdweb.com/references/typescript/v5/erc4337/getUserOpHash): Calls the "getUserOpHash" function on the contract. +* [ERC4337.isAccountDeployed](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAccountDeployed): Adds admin permissions for a specified address. +* [ERC4337.isActiveSigner](https://portal.thirdweb.com/references/typescript/v5/erc4337/isActiveSigner): Calls the "isActiveSigner" function on the contract. +* [ERC4337.isAddAdminSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAddAdminSupported): Checks if the `isAddAdminSupported` method is supported by the given contract. +* [ERC4337.isAddSessionKeySupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAddSessionKeySupported): Checks if the `isAddSessionKeySupported` method is supported by the given contract. +* [ERC4337.isAdmin](https://portal.thirdweb.com/references/typescript/v5/erc4337/isAdmin): Calls the "isAdmin" function on the contract. +* [ERC4337.isCreateAccountSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isCreateAccountSupported): Checks if the `createAccount` method is supported by the given contract. +* [ERC4337.isGetAccountsOfSignerSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAccountsOfSignerSupported): Checks if the `getAccountsOfSigner` method is supported by the given contract. +* [ERC4337.isGetAccountsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAccountsSupported): Checks if the `getAccounts` method is supported by the given contract. +* [ERC4337.isGetAllAccountsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isGetAllAccountsSupported): Checks if the `getAllAccounts` method is supported by the given contract. +* [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.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. +* [ERC4337.isTotalAccountsSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isTotalAccountsSupported): Checks if the `totalAccounts` method is supported by the given contract. +* [ERC4337.isValidateUserOpSupported](https://portal.thirdweb.com/references/typescript/v5/erc4337/isValidateUserOpSupported): Checks if the `validateUserOp` method is supported by the given contract. +* [ERC4337.predictAccountAddress](https://portal.thirdweb.com/references/typescript/v5/erc4337/predictAccountAddress): Calls the "getAddress" function on the contract. +* [ERC4337.removeAdmin](https://portal.thirdweb.com/references/typescript/v5/erc4337/removeAdmin): Removes admin permissions for a specified address. +* [ERC4337.removeSessionKey](https://portal.thirdweb.com/references/typescript/v5/erc4337/removeSessionKey): Removes session key permissions for a specified address. +* [ERC4337.shouldUpdateSessionKey](https://portal.thirdweb.com/references/typescript/v5/erc4337/shouldUpdateSessionKey): Checks if the session key should be updated. +* [ERC4337.signerPermissionsUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/signerPermissionsUpdatedEvent): Creates an event object for the SignerPermissionsUpdated event. +* [ERC4337.simulateHandleOp](https://portal.thirdweb.com/references/typescript/v5/erc4337/simulateHandleOp): Prepares a transaction to call the "simulateHandleOp" function on the contract. +* [ERC4337.totalAccounts](https://portal.thirdweb.com/references/typescript/v5/erc4337/totalAccounts): Calls the "totalAccounts" function on the contract. +* [ERC4337.userOperationEventEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/userOperationEventEvent): Creates an event object for the UserOperationEvent event. +* [ERC4337.userOperationRevertReasonEvent](https://portal.thirdweb.com/references/typescript/v5/erc4337/userOperationRevertReasonEvent): Creates an event object for the UserOperationRevertReason event. --- ## ERC4626 -* [asset](https://portal.thirdweb.com/references/typescript/v5/erc4626/asset): Calls the "asset" function on the contract. -* [convertToAssets](https://portal.thirdweb.com/references/typescript/v5/erc4626/convertToAssets): Calls the "convertToAssets" function on the contract. -* [convertToShares](https://portal.thirdweb.com/references/typescript/v5/erc4626/convertToShares): Calls the "convertToShares" function on the contract. -* [deposit](https://portal.thirdweb.com/references/typescript/v5/erc4626/deposit): Prepares a transaction to call the "deposit" function on the contract. -* [depositEvent](https://portal.thirdweb.com/references/typescript/v5/erc4626/depositEvent): Creates an event object for the Deposit event. -* [maxDeposit](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxDeposit): Calls the "maxDeposit" function on the contract. -* [maxMint](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxMint): Calls the "maxMint" function on the contract. -* [maxRedeem](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxRedeem): Calls the "maxRedeem" function on the contract. -* [maxWithdraw](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxWithdraw): Calls the "maxWithdraw" function on the contract. -* [mint](https://portal.thirdweb.com/references/typescript/v5/erc4626/mint): Prepares a transaction to call the "mint" function on the contract. -* [previewDeposit](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewDeposit): Calls the "previewDeposit" function on the contract. -* [previewMint](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewMint): Calls the "previewMint" function on the contract. -* [previewRedeem](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewRedeem): Calls the "previewRedeem" function on the contract. -* [previewWithdraw](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewWithdraw): Calls the "previewWithdraw" function on the contract. -* [redeem](https://portal.thirdweb.com/references/typescript/v5/erc4626/redeem): Prepares a transaction to call the "redeem" function on the contract. -* [totalAssets](https://portal.thirdweb.com/references/typescript/v5/erc4626/totalAssets): Calls the "totalAssets" function on the contract. -* [withdraw](https://portal.thirdweb.com/references/typescript/v5/erc4626/withdraw): Prepares a transaction to call the "withdraw" function on the contract. -* [withdrawEvent](https://portal.thirdweb.com/references/typescript/v5/erc4626/withdrawEvent): Creates an event object for the Withdraw event. +* [ERC4626.asset](https://portal.thirdweb.com/references/typescript/v5/erc4626/asset): Calls the "asset" function on the contract. +* [ERC4626.convertToAssets](https://portal.thirdweb.com/references/typescript/v5/erc4626/convertToAssets): Calls the "convertToAssets" function on the contract. +* [ERC4626.convertToShares](https://portal.thirdweb.com/references/typescript/v5/erc4626/convertToShares): Calls the "convertToShares" function on the contract. +* [ERC4626.deposit](https://portal.thirdweb.com/references/typescript/v5/erc4626/deposit): Prepares a transaction to call the "deposit" function on the contract. +* [ERC4626.depositEvent](https://portal.thirdweb.com/references/typescript/v5/erc4626/depositEvent): Creates an event object for the Deposit event. +* [ERC4626.maxDeposit](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxDeposit): Calls the "maxDeposit" function on the contract. +* [ERC4626.maxMint](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxMint): Calls the "maxMint" function on the contract. +* [ERC4626.maxRedeem](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxRedeem): Calls the "maxRedeem" function on the contract. +* [ERC4626.maxWithdraw](https://portal.thirdweb.com/references/typescript/v5/erc4626/maxWithdraw): Calls the "maxWithdraw" function on the contract. +* [ERC4626.mint](https://portal.thirdweb.com/references/typescript/v5/erc4626/mint): Prepares a transaction to call the "mint" function on the contract. +* [ERC4626.previewDeposit](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewDeposit): Calls the "previewDeposit" function on the contract. +* [ERC4626.previewMint](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewMint): Calls the "previewMint" function on the contract. +* [ERC4626.previewRedeem](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewRedeem): Calls the "previewRedeem" function on the contract. +* [ERC4626.previewWithdraw](https://portal.thirdweb.com/references/typescript/v5/erc4626/previewWithdraw): Calls the "previewWithdraw" function on the contract. +* [ERC4626.redeem](https://portal.thirdweb.com/references/typescript/v5/erc4626/redeem): Prepares a transaction to call the "redeem" function on the contract. +* [ERC4626.totalAssets](https://portal.thirdweb.com/references/typescript/v5/erc4626/totalAssets): Calls the "totalAssets" function on the contract. +* [ERC4626.withdraw](https://portal.thirdweb.com/references/typescript/v5/erc4626/withdraw): Prepares a transaction to call the "withdraw" function on the contract. +* [ERC4626.withdrawEvent](https://portal.thirdweb.com/references/typescript/v5/erc4626/withdrawEvent): Creates an event object for the Withdraw event. --- ## FARCASTER -* [addSigner](https://portal.thirdweb.com/references/typescript/v5/farcaster/addSigner): Adds farcaster signer for the given account. -* [addSignerFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/addSignerFor): Adds farcaster signer for a given user. Helpful if you want to cover the gas fee for a user. -* [createEd25519Keypair](https://portal.thirdweb.com/references/typescript/v5/farcaster/createEd25519Keypair): Generates an Ed25519 keypair to be used as an account signer. -* [encodeSignedKeyRequestMetadata](https://portal.thirdweb.com/references/typescript/v5/farcaster/encodeSignedKeyRequestMetadata): Encodes the signed key request metadata into a hexadecimal string. This function takes in the request signer's address, the key request signature, the request Fid, and the deadline, and returns the encoded ABI parameters as a hexadecimal string. It's used to prepare the metadata for transactions involving signed key requests. -* [getAddData](https://portal.thirdweb.com/references/typescript/v5/farcaster/getAddData): Prepares the data required for signing an Add message according to EIP-712. -* [getBundler](https://portal.thirdweb.com/references/typescript/v5/farcaster/getBundler): Retrieves the Bundler contract. -* [getFid](https://portal.thirdweb.com/references/typescript/v5/farcaster/getFid): Retrieves the current fid for an account. -* [getIdGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/getIdGateway): Retrieves the IdGateway contract. -* [getIdRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/getIdRegistry): Retrieves the IdRegistry contract. -* [getKeyGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/getKeyGateway): Retrieves the KeyGateway contract. -* [getKeyRequestData](https://portal.thirdweb.com/references/typescript/v5/farcaster/getKeyRequestData): Prepares the data required for signing a key request using EIP-712 typed data signing. This includes the domain, types, primary type, and the message to be signed. -* [getNonce](https://portal.thirdweb.com/references/typescript/v5/farcaster/getNonce): Retrieves the current key gateway nonce for an account. -* [getRegisterData](https://portal.thirdweb.com/references/typescript/v5/farcaster/getRegisterData): Constructs the data required for signing a register message in the Farcaster ID Gateway. This includes the EIP-712 domain, types, and the message to be signed. -* [getRegistrationPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getRegistrationPrice): Retrieves the current cost to register a Farcaster fid in wei. -* [getSignedKeyRequestMetadata](https://portal.thirdweb.com/references/typescript/v5/farcaster/getSignedKeyRequestMetadata): Generates the signed key request metadata to add a signer to an account. This function can either sign a new key request using an account object or use an existing key request signature. It prepares the metadata necessary for transactions involving signed key requests. -* [getStoragePrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getStoragePrice): Retrieves the current cost to register a Farcaster fid in wei. -* [getStorageRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/getStorageRegistry): Retrieves the StorageRegistry contract. -* [getUsdRegistrationPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getUsdRegistrationPrice): Retrieves the current cost to register a Farcaster fid in USD. -* [getUsdStoragePrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getUsdStoragePrice): Retrieves the current cost to register a Farcaster fid in USD. -* [registerFid](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerFid): Registers a Farcaster fid for the given wallet. -* [registerFidAndSigner](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerFidAndSigner): Registers a Farcaster fid and signer for the given wallet using the provided app account. -* [rentStorage](https://portal.thirdweb.com/references/typescript/v5/farcaster/rentStorage): Rent storage for the provided farcaster fid. -* [signAdd](https://portal.thirdweb.com/references/typescript/v5/farcaster/signAdd): Signs an Add message using the account's signTypedData method. -* [signKeyRequest](https://portal.thirdweb.com/references/typescript/v5/farcaster/signKeyRequest): Signs a key request message using EIP-712 typed data signing. This function prepares the data for signing, signs it with the provided account, and returns the signature. -* [signRegister](https://portal.thirdweb.com/references/typescript/v5/farcaster/signRegister): Signs the register message for Farcaster ID Gateway. -* [idGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/idGateway): Calls the "idGateway" function on the contract. -* [keyGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyGateway): Calls the "keyGateway" function on the contract. -* [price](https://portal.thirdweb.com/references/typescript/v5/farcaster/price): Calls the "price" function on the contract. -* [register](https://portal.thirdweb.com/references/typescript/v5/farcaster/register): Prepares a transaction to call the "register" function on the contract. -* [idRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/idRegistry): Calls the "idRegistry" function on the contract. -* [price](https://portal.thirdweb.com/references/typescript/v5/farcaster/price-2): Calls the "price" function on the contract. -* [register](https://portal.thirdweb.com/references/typescript/v5/farcaster/register-2): Prepares a transaction to call the "register" function on the contract. -* [REGISTER_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/REGISTER_TYPEHASH): Calls the "REGISTER\_TYPEHASH" function on the contract. -* [registerFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerFor): Prepares a transaction to call the "registerFor" function on the contract. -* [setStorageRegistryEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setStorageRegistryEvent): Creates an event object for the SetStorageRegistry event. -* [storageRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/storageRegistry): Calls the "storageRegistry" function on the contract. -* [adminResetEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/adminResetEvent): Creates an event object for the AdminReset event. -* [CHANGE_RECOVERY_ADDRESS_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/CHANGE_RECOVERY_ADDRESS_TYPEHASH): Calls the "CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH" function on the contract. -* [changeRecoveryAddress](https://portal.thirdweb.com/references/typescript/v5/farcaster/changeRecoveryAddress): Prepares a transaction to call the "changeRecoveryAddress" function on the contract. -* [changeRecoveryAddressEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/changeRecoveryAddressEvent): Creates an event object for the ChangeRecoveryAddress event. -* [custodyOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/custodyOf): Calls the "custodyOf" function on the contract. -* [freezeIdGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/freezeIdGatewayEvent): Creates an event object for the FreezeIdGateway event. -* [gatewayFrozen](https://portal.thirdweb.com/references/typescript/v5/farcaster/gatewayFrozen): Calls the "gatewayFrozen" function on the contract. -* [idCounter](https://portal.thirdweb.com/references/typescript/v5/farcaster/idCounter): Calls the "idCounter" function on the contract. -* [idGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/idGateway-2): Calls the "idGateway" function on the contract. -* [idOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/idOf): Calls the "idOf" function on the contract. -* [recover](https://portal.thirdweb.com/references/typescript/v5/farcaster/recover): Prepares a transaction to call the "recover" function on the contract. -* [recoverEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/recoverEvent): Creates an event object for the Recover event. -* [recoverFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/recoverFor): Prepares a transaction to call the "recoverFor" function on the contract. -* [recoveryOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/recoveryOf): Calls the "recoveryOf" function on the contract. -* [registerEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerEvent): Creates an event object for the Register event. -* [setIdCounterEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setIdCounterEvent): Creates an event object for the SetIdCounter event. -* [setIdGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setIdGatewayEvent): Creates an event object for the SetIdGateway event. -* [transfer](https://portal.thirdweb.com/references/typescript/v5/farcaster/transfer): Prepares a transaction to call the "transfer" function on the contract. -* [TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH): Calls the "TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH" function on the contract. -* [TRANSFER_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/TRANSFER_TYPEHASH): Calls the "TRANSFER\_TYPEHASH" function on the contract. -* [transferAndChangeRecovery](https://portal.thirdweb.com/references/typescript/v5/farcaster/transferAndChangeRecovery): Prepares a transaction to call the "transferAndChangeRecovery" function on the contract. -* [transferEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/transferEvent): Creates an event object for the Transfer event. -* [transferFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/transferFor): Prepares a transaction to call the "transferFor" function on the contract. -* [verifyFidSignature](https://portal.thirdweb.com/references/typescript/v5/farcaster/verifyFidSignature): Calls the "verifyFidSignature" function on the contract. -* [add](https://portal.thirdweb.com/references/typescript/v5/farcaster/add): Prepares a transaction to call the "add" function on the contract. -* [ADD_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/ADD_TYPEHASH): Calls the "ADD\_TYPEHASH" function on the contract. -* [addFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/addFor): Prepares a transaction to call the "addFor" function on the contract. -* [keyRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyRegistry): Calls the "keyRegistry" function on the contract. -* [nonces](https://portal.thirdweb.com/references/typescript/v5/farcaster/nonces): Calls the "nonces" function on the contract. -* [addEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/addEvent): Creates an event object for the Add event. -* [adminResetEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/adminResetEvent-2): Creates an event object for the AdminReset event. -* [freezeKeyGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/freezeKeyGatewayEvent): Creates an event object for the FreezeKeyGateway event. -* [gatewayFrozen](https://portal.thirdweb.com/references/typescript/v5/farcaster/gatewayFrozen-2): Calls the "gatewayFrozen" function on the contract. -* [idRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/idRegistry-2): Calls the "idRegistry" function on the contract. -* [keyAt](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyAt): Calls the "keyAt" function on the contract. -* [keyDataOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyDataOf): Calls the "keyDataOf" function on the contract. -* [keyGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyGateway-2): Calls the "keyGateway" function on the contract. -* [keysOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/keysOf): Calls the "keysOf" function on the contract. -* [maxKeysPerFid](https://portal.thirdweb.com/references/typescript/v5/farcaster/maxKeysPerFid): Calls the "maxKeysPerFid" function on the contract. -* [remove](https://portal.thirdweb.com/references/typescript/v5/farcaster/remove): Prepares a transaction to call the "remove" function on the contract. -* [REMOVE_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/REMOVE_TYPEHASH): Calls the "REMOVE\_TYPEHASH" function on the contract. -* [removeEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/removeEvent): Creates an event object for the Remove event. -* [removeFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/removeFor): Prepares a transaction to call the "removeFor" function on the contract. -* [setIdRegistryEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setIdRegistryEvent): Creates an event object for the SetIdRegistry event. -* [setKeyGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setKeyGatewayEvent): Creates an event object for the SetKeyGateway event. -* [setMaxKeysPerFidEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setMaxKeysPerFidEvent): Creates an event object for the SetMaxKeysPerFid event. -* [setValidatorEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setValidatorEvent): Creates an event object for the SetValidator event. -* [totalKeys](https://portal.thirdweb.com/references/typescript/v5/farcaster/totalKeys): Calls the "totalKeys" function on the contract. -* [batchRent](https://portal.thirdweb.com/references/typescript/v5/farcaster/batchRent): Prepares a transaction to call the "batchRent" function on the contract. -* [deprecationTimestamp](https://portal.thirdweb.com/references/typescript/v5/farcaster/deprecationTimestamp): Calls the "deprecationTimestamp" function on the contract. -* [maxUnits](https://portal.thirdweb.com/references/typescript/v5/farcaster/maxUnits): Calls the "maxUnits" function on the contract. -* [price](https://portal.thirdweb.com/references/typescript/v5/farcaster/price-3): Calls the "price" function on the contract. -* [rent](https://portal.thirdweb.com/references/typescript/v5/farcaster/rent): Prepares a transaction to call the "rent" function on the contract. -* [rentedUnits](https://portal.thirdweb.com/references/typescript/v5/farcaster/rentedUnits): Calls the "rentedUnits" function on the contract. -* [unitPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/unitPrice): Calls the "unitPrice" function on the contract. -* [usdUnitPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/usdUnitPrice): Calls the "usdUnitPrice" function on the contract. +* [FARCASTER.addSigner](https://portal.thirdweb.com/references/typescript/v5/farcaster/addSigner): Adds farcaster signer for the given account. +* [FARCASTER.addSignerFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/addSignerFor): Adds farcaster signer for a given user. Helpful if you want to cover the gas fee for a user. +* [FARCASTER.createEd25519Keypair](https://portal.thirdweb.com/references/typescript/v5/farcaster/createEd25519Keypair): Generates an Ed25519 keypair to be used as an account signer. +* [FARCASTER.encodeSignedKeyRequestMetadata](https://portal.thirdweb.com/references/typescript/v5/farcaster/encodeSignedKeyRequestMetadata): Encodes the signed key request metadata into a hexadecimal string. This function takes in the request signer's address, the key request signature, the request Fid, and the deadline, and returns the encoded ABI parameters as a hexadecimal string. It's used to prepare the metadata for transactions involving signed key requests. +* [FARCASTER.getAddData](https://portal.thirdweb.com/references/typescript/v5/farcaster/getAddData): Prepares the data required for signing an Add message according to EIP-712. +* [FARCASTER.getBundler](https://portal.thirdweb.com/references/typescript/v5/farcaster/getBundler): Retrieves the Bundler contract. +* [FARCASTER.getFid](https://portal.thirdweb.com/references/typescript/v5/farcaster/getFid): Retrieves the current fid for an account. +* [FARCASTER.getIdGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/getIdGateway): Retrieves the IdGateway contract. +* [FARCASTER.getIdRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/getIdRegistry): Retrieves the IdRegistry contract. +* [FARCASTER.getKeyGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/getKeyGateway): Retrieves the KeyGateway contract. +* [FARCASTER.getKeyRequestData](https://portal.thirdweb.com/references/typescript/v5/farcaster/getKeyRequestData): Prepares the data required for signing a key request using EIP-712 typed data signing. This includes the domain, types, primary type, and the message to be signed. +* [FARCASTER.getNonce](https://portal.thirdweb.com/references/typescript/v5/farcaster/getNonce): Retrieves the current key gateway nonce for an account. +* [FARCASTER.getRegisterData](https://portal.thirdweb.com/references/typescript/v5/farcaster/getRegisterData): Constructs the data required for signing a register message in the Farcaster ID Gateway. This includes the EIP-712 domain, types, and the message to be signed. +* [FARCASTER.getRegistrationPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getRegistrationPrice): Retrieves the current cost to register a Farcaster fid in wei. +* [FARCASTER.getSignedKeyRequestMetadata](https://portal.thirdweb.com/references/typescript/v5/farcaster/getSignedKeyRequestMetadata): Generates the signed key request metadata to add a signer to an account. This function can either sign a new key request using an account object or use an existing key request signature. It prepares the metadata necessary for transactions involving signed key requests. +* [FARCASTER.getStoragePrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getStoragePrice): Retrieves the current cost to register a Farcaster fid in wei. +* [FARCASTER.getStorageRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/getStorageRegistry): Retrieves the StorageRegistry contract. +* [FARCASTER.getUsdRegistrationPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getUsdRegistrationPrice): Retrieves the current cost to register a Farcaster fid in USD. +* [FARCASTER.getUsdStoragePrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/getUsdStoragePrice): Retrieves the current cost to register a Farcaster fid in USD. +* [FARCASTER.registerFid](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerFid): Registers a Farcaster fid for the given wallet. +* [FARCASTER.registerFidAndSigner](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerFidAndSigner): Registers a Farcaster fid and signer for the given wallet using the provided app account. +* [FARCASTER.rentStorage](https://portal.thirdweb.com/references/typescript/v5/farcaster/rentStorage): Rent storage for the provided farcaster fid. +* [FARCASTER.signAdd](https://portal.thirdweb.com/references/typescript/v5/farcaster/signAdd): Signs an Add message using the account's signTypedData method. +* [FARCASTER.signKeyRequest](https://portal.thirdweb.com/references/typescript/v5/farcaster/signKeyRequest): Signs a key request message using EIP-712 typed data signing. This function prepares the data for signing, signs it with the provided account, and returns the signature. +* [FARCASTER.signRegister](https://portal.thirdweb.com/references/typescript/v5/farcaster/signRegister): Signs the register message for Farcaster ID Gateway. +* [FARCASTER.idGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/idGateway): Calls the "idGateway" function on the contract. +* [FARCASTER.keyGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyGateway): Calls the "keyGateway" function on the contract. +* [FARCASTER.price](https://portal.thirdweb.com/references/typescript/v5/farcaster/price): Calls the "price" function on the contract. +* [FARCASTER.register](https://portal.thirdweb.com/references/typescript/v5/farcaster/register): Prepares a transaction to call the "register" function on the contract. +* [FARCASTER.idRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/idRegistry): Calls the "idRegistry" function on the contract. +* [FARCASTER.price](https://portal.thirdweb.com/references/typescript/v5/farcaster/price-2): Calls the "price" function on the contract. +* [FARCASTER.register](https://portal.thirdweb.com/references/typescript/v5/farcaster/register-2): Prepares a transaction to call the "register" function on the contract. +* [FARCASTER.REGISTER_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/REGISTER_TYPEHASH): Calls the "REGISTER\_TYPEHASH" function on the contract. +* [FARCASTER.registerFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerFor): Prepares a transaction to call the "registerFor" function on the contract. +* [FARCASTER.setStorageRegistryEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setStorageRegistryEvent): Creates an event object for the SetStorageRegistry event. +* [FARCASTER.storageRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/storageRegistry): Calls the "storageRegistry" function on the contract. +* [FARCASTER.adminResetEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/adminResetEvent): Creates an event object for the AdminReset event. +* [FARCASTER.CHANGE_RECOVERY_ADDRESS_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/CHANGE_RECOVERY_ADDRESS_TYPEHASH): Calls the "CHANGE\_RECOVERY\_ADDRESS\_TYPEHASH" function on the contract. +* [FARCASTER.changeRecoveryAddress](https://portal.thirdweb.com/references/typescript/v5/farcaster/changeRecoveryAddress): Prepares a transaction to call the "changeRecoveryAddress" function on the contract. +* [FARCASTER.changeRecoveryAddressEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/changeRecoveryAddressEvent): Creates an event object for the ChangeRecoveryAddress event. +* [FARCASTER.custodyOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/custodyOf): Calls the "custodyOf" function on the contract. +* [FARCASTER.freezeIdGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/freezeIdGatewayEvent): Creates an event object for the FreezeIdGateway event. +* [FARCASTER.gatewayFrozen](https://portal.thirdweb.com/references/typescript/v5/farcaster/gatewayFrozen): Calls the "gatewayFrozen" function on the contract. +* [FARCASTER.idCounter](https://portal.thirdweb.com/references/typescript/v5/farcaster/idCounter): Calls the "idCounter" function on the contract. +* [FARCASTER.idGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/idGateway-2): Calls the "idGateway" function on the contract. +* [FARCASTER.idOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/idOf): Calls the "idOf" function on the contract. +* [FARCASTER.recover](https://portal.thirdweb.com/references/typescript/v5/farcaster/recover): Prepares a transaction to call the "recover" function on the contract. +* [FARCASTER.recoverEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/recoverEvent): Creates an event object for the Recover event. +* [FARCASTER.recoverFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/recoverFor): Prepares a transaction to call the "recoverFor" function on the contract. +* [FARCASTER.recoveryOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/recoveryOf): Calls the "recoveryOf" function on the contract. +* [FARCASTER.registerEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/registerEvent): Creates an event object for the Register event. +* [FARCASTER.setIdCounterEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setIdCounterEvent): Creates an event object for the SetIdCounter event. +* [FARCASTER.setIdGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setIdGatewayEvent): Creates an event object for the SetIdGateway event. +* [FARCASTER.transfer](https://portal.thirdweb.com/references/typescript/v5/farcaster/transfer): Prepares a transaction to call the "transfer" function on the contract. +* [FARCASTER.TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH): Calls the "TRANSFER\_AND\_CHANGE\_RECOVERY\_TYPEHASH" function on the contract. +* [FARCASTER.TRANSFER_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/TRANSFER_TYPEHASH): Calls the "TRANSFER\_TYPEHASH" function on the contract. +* [FARCASTER.transferAndChangeRecovery](https://portal.thirdweb.com/references/typescript/v5/farcaster/transferAndChangeRecovery): Prepares a transaction to call the "transferAndChangeRecovery" function on the contract. +* [FARCASTER.transferEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/transferEvent): Creates an event object for the Transfer event. +* [FARCASTER.transferFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/transferFor): Prepares a transaction to call the "transferFor" function on the contract. +* [FARCASTER.verifyFidSignature](https://portal.thirdweb.com/references/typescript/v5/farcaster/verifyFidSignature): Calls the "verifyFidSignature" function on the contract. +* [FARCASTER.add](https://portal.thirdweb.com/references/typescript/v5/farcaster/add): Prepares a transaction to call the "add" function on the contract. +* [FARCASTER.ADD_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/ADD_TYPEHASH): Calls the "ADD\_TYPEHASH" function on the contract. +* [FARCASTER.addFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/addFor): Prepares a transaction to call the "addFor" function on the contract. +* [FARCASTER.keyRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyRegistry): Calls the "keyRegistry" function on the contract. +* [FARCASTER.nonces](https://portal.thirdweb.com/references/typescript/v5/farcaster/nonces): Calls the "nonces" function on the contract. +* [FARCASTER.addEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/addEvent): Creates an event object for the Add event. +* [FARCASTER.adminResetEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/adminResetEvent-2): Creates an event object for the AdminReset event. +* [FARCASTER.freezeKeyGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/freezeKeyGatewayEvent): Creates an event object for the FreezeKeyGateway event. +* [FARCASTER.gatewayFrozen](https://portal.thirdweb.com/references/typescript/v5/farcaster/gatewayFrozen-2): Calls the "gatewayFrozen" function on the contract. +* [FARCASTER.idRegistry](https://portal.thirdweb.com/references/typescript/v5/farcaster/idRegistry-2): Calls the "idRegistry" function on the contract. +* [FARCASTER.keyAt](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyAt): Calls the "keyAt" function on the contract. +* [FARCASTER.keyDataOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyDataOf): Calls the "keyDataOf" function on the contract. +* [FARCASTER.keyGateway](https://portal.thirdweb.com/references/typescript/v5/farcaster/keyGateway-2): Calls the "keyGateway" function on the contract. +* [FARCASTER.keysOf](https://portal.thirdweb.com/references/typescript/v5/farcaster/keysOf): Calls the "keysOf" function on the contract. +* [FARCASTER.maxKeysPerFid](https://portal.thirdweb.com/references/typescript/v5/farcaster/maxKeysPerFid): Calls the "maxKeysPerFid" function on the contract. +* [FARCASTER.remove](https://portal.thirdweb.com/references/typescript/v5/farcaster/remove): Prepares a transaction to call the "remove" function on the contract. +* [FARCASTER.REMOVE_TYPEHASH](https://portal.thirdweb.com/references/typescript/v5/farcaster/REMOVE_TYPEHASH): Calls the "REMOVE\_TYPEHASH" function on the contract. +* [FARCASTER.removeEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/removeEvent): Creates an event object for the Remove event. +* [FARCASTER.removeFor](https://portal.thirdweb.com/references/typescript/v5/farcaster/removeFor): Prepares a transaction to call the "removeFor" function on the contract. +* [FARCASTER.setIdRegistryEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setIdRegistryEvent): Creates an event object for the SetIdRegistry event. +* [FARCASTER.setKeyGatewayEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setKeyGatewayEvent): Creates an event object for the SetKeyGateway event. +* [FARCASTER.setMaxKeysPerFidEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setMaxKeysPerFidEvent): Creates an event object for the SetMaxKeysPerFid event. +* [FARCASTER.setValidatorEvent](https://portal.thirdweb.com/references/typescript/v5/farcaster/setValidatorEvent): Creates an event object for the SetValidator event. +* [FARCASTER.totalKeys](https://portal.thirdweb.com/references/typescript/v5/farcaster/totalKeys): Calls the "totalKeys" function on the contract. +* [FARCASTER.batchRent](https://portal.thirdweb.com/references/typescript/v5/farcaster/batchRent): Prepares a transaction to call the "batchRent" function on the contract. +* [FARCASTER.deprecationTimestamp](https://portal.thirdweb.com/references/typescript/v5/farcaster/deprecationTimestamp): Calls the "deprecationTimestamp" function on the contract. +* [FARCASTER.maxUnits](https://portal.thirdweb.com/references/typescript/v5/farcaster/maxUnits): Calls the "maxUnits" function on the contract. +* [FARCASTER.price](https://portal.thirdweb.com/references/typescript/v5/farcaster/price-3): Calls the "price" function on the contract. +* [FARCASTER.rent](https://portal.thirdweb.com/references/typescript/v5/farcaster/rent): Prepares a transaction to call the "rent" function on the contract. +* [FARCASTER.rentedUnits](https://portal.thirdweb.com/references/typescript/v5/farcaster/rentedUnits): Calls the "rentedUnits" function on the contract. +* [FARCASTER.unitPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/unitPrice): Calls the "unitPrice" function on the contract. +* [FARCASTER.usdUnitPrice](https://portal.thirdweb.com/references/typescript/v5/farcaster/usdUnitPrice): Calls the "usdUnitPrice" function on the contract. --- ## LENS -* [exists](https://portal.thirdweb.com/references/typescript/v5/lens/exists): Calls the "exists" function on the contract. -* [getContentURI](https://portal.thirdweb.com/references/typescript/v5/lens/getContentURI): Calls the "getContentURI" function on the contract. -* [getDefaultHandle](https://portal.thirdweb.com/references/typescript/v5/lens/getDefaultHandle): Calls the "getDefaultHandle" function on the contract. -* [getFollowData](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowData): Calls the "getFollowData" function on the contract. -* [getFollowerCount](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowerCount): Calls the "getFollowerCount" function on the contract. -* [getFollowerProfileId](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowerProfileId): Calls the "getFollowerProfileId" function on the contract. -* [getFollowTokenId](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowTokenId): Calls the "getFollowTokenId" function on the contract. -* [getFullProfile](https://portal.thirdweb.com/references/typescript/v5/lens/getFullProfile): Return the profile data _with Lens handle_ and optional join date -* [getHandle](https://portal.thirdweb.com/references/typescript/v5/lens/getHandle): Calls the "getHandle" function on the contract. -* [getHandleFromProfileId](https://portal.thirdweb.com/references/typescript/v5/lens/getHandleFromProfileId): Return the Lens handle of a profile in the format: lens/@`` -* [getHandleTokenURIContract](https://portal.thirdweb.com/references/typescript/v5/lens/getHandleTokenURIContract): Calls the "getHandleTokenURIContract" function on the contract. -* [getLocalName](https://portal.thirdweb.com/references/typescript/v5/lens/getLocalName): Calls the "getLocalName" function on the contract. -* [getModuleTypes](https://portal.thirdweb.com/references/typescript/v5/lens/getModuleTypes): Calls the "getModuleTypes" function on the contract. -* [getOriginalFollowTimestamp](https://portal.thirdweb.com/references/typescript/v5/lens/getOriginalFollowTimestamp): Calls the "getOriginalFollowTimestamp" function on the contract. -* [getProfile](https://portal.thirdweb.com/references/typescript/v5/lens/getProfile): Calls the "getProfile" function on the contract. -* [getProfileIdAllowedToRecover](https://portal.thirdweb.com/references/typescript/v5/lens/getProfileIdAllowedToRecover): Calls the "getProfileIdAllowedToRecover" function on the contract. -* [getProfileIdByHandleHash](https://portal.thirdweb.com/references/typescript/v5/lens/getProfileIdByHandleHash): Calls the "getProfileIdByHandleHash" function on the contract. -* [getProfileMetadata](https://portal.thirdweb.com/references/typescript/v5/lens/getProfileMetadata): Download user lens profile from Arweave This method does NOT give you the user handle & join-time - consider using `getFullProfileData` instead It is useful & cost efficient if you only want to get user's name, bio, picture, coverPicture etc. -* [getPublication](https://portal.thirdweb.com/references/typescript/v5/lens/getPublication): Calls the "getPublication" function on the contract. -* [getTokenId](https://portal.thirdweb.com/references/typescript/v5/lens/getTokenId): Calls the "getTokenId" function on the contract. -* [isErc20CurrencyRegistered](https://portal.thirdweb.com/references/typescript/v5/lens/isErc20CurrencyRegistered): Calls the "isErc20CurrencyRegistered" function on the contract. -* [isFollowing](https://portal.thirdweb.com/references/typescript/v5/lens/isFollowing): Calls the "isFollowing" function on the contract. -* [isModuleRegistered](https://portal.thirdweb.com/references/typescript/v5/lens/isModuleRegistered): Calls the "isModuleRegistered" function on the contract. -* [isModuleRegisteredAs](https://portal.thirdweb.com/references/typescript/v5/lens/isModuleRegisteredAs): Calls the "isModuleRegisteredAs" function on the contract. -* [mintTimestampOf](https://portal.thirdweb.com/references/typescript/v5/lens/mintTimestampOf): Calls the "mintTimestampOf" function on the contract. -* [mintTimestampOfFollowNFT](https://portal.thirdweb.com/references/typescript/v5/lens/mintTimestampOfFollowNFT): Calls the "mintTimestampOf" function on the contract. -* [nonces](https://portal.thirdweb.com/references/typescript/v5/lens/nonces): Calls the "nonces" function on the contract. -* [resolve](https://portal.thirdweb.com/references/typescript/v5/lens/resolve): Calls the "resolve" function on the contract. -* [resolveAddress](https://portal.thirdweb.com/references/typescript/v5/lens/resolveAddress): Take in a Lens handle or local-name and return the wallet address behind that handle/local-name. For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name -* [tokenDataOf](https://portal.thirdweb.com/references/typescript/v5/lens/tokenDataOf): Calls the "tokenDataOf" function on the contract. ---- -## MARKETPLACE -* [acceptedOfferEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/acceptedOfferEvent): Creates an event object for the AcceptedOffer event. -* [acceptOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/acceptOffer): Accepts an offer after performing necessary checks and validations. Throws an error if the offer is not active, the offeror's balance is insufficient, or the offeror's allowance is insufficient. -* [approveBuyerForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/approveBuyerForListing): Prepares a transaction to call the "approveBuyerForListing" function on the contract. -* [approveCurrencyForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/approveCurrencyForListing): Prepares a transaction to call the "approveCurrencyForListing" function on the contract. -* [auctionClosedEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/auctionClosedEvent): Creates an event object for the AuctionClosed event. -* [bidInAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/bidInAuction): Places a bid in an English auction. -* [buyerApprovedForListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyerApprovedForListingEvent): Creates an event object for the BuyerApprovedForListing event. -* [buyFromListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyFromListing): Buys a listing from the marketplace. -* [buyoutAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/buyoutAuction): Buys out an English auction. -* [cancelAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelAuction): Cancels an auction by providing the necessary options. -* [cancelledAuctionEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelledAuctionEvent): Creates an event object for the CancelledAuction event. -* [cancelledListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelledListingEvent): Creates an event object for the CancelledListing event. -* [cancelledOfferEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelledOfferEvent): Creates an event object for the CancelledOffer event. -* [cancelListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelListing): Prepares a transaction to call the "cancelListing" function on the contract. -* [cancelOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/cancelOffer): Prepares a transaction to call the "cancelOffer" function on the contract. -* [collectAuctionPayout](https://portal.thirdweb.com/references/typescript/v5/marketplace/collectAuctionPayout): Prepares a transaction to call the "collectAuctionPayout" function on the contract. -* [collectAuctionTokens](https://portal.thirdweb.com/references/typescript/v5/marketplace/collectAuctionTokens): Prepares a transaction to call the "collectAuctionTokens" function on the contract. -* [createAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/createAuction): Creates an auction. -* [createListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/createListing): Creates a direct listing. -* [currencyApprovedForListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/currencyApprovedForListingEvent): Creates an event object for the CurrencyApprovedForListing event. -* [currencyPriceForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/currencyPriceForListing): Retrieves the currency price for a listing. -* [executeSale](https://portal.thirdweb.com/references/typescript/v5/marketplace/executeSale): Executes a sale for an English auction. -* [getAllAuctions](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllAuctions): Retrieves all auctions based on the provided options. -* [getAllListings](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllListings): Retrieves all direct listings based on the provided options. -* [getAllOffers](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllOffers): Retrieves all offers based on the provided options. -* [getAllValidAuctions](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllValidAuctions): Retrieves all valid auctions based on the provided options. -* [getAllValidListings](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllValidListings): Retrieves all valid direct listings based on the provided options. -* [getAllValidOffers](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAllValidOffers): Retrieves all valid offers based on the provided options. -* [getAuction](https://portal.thirdweb.com/references/typescript/v5/marketplace/getAuction): Retrieves an auction listing based on the provided options. -* [getListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/getListing): Retrieves a direct listing based on the provided options. -* [getOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/getOffer): Retrieves an offer based on the provided options. -* [getWinningBid](https://portal.thirdweb.com/references/typescript/v5/marketplace/getWinningBid): Retrieves the winning bid information for a given auction. -* [isBidInAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isBidInAuctionSupported): Checks if the `bidInAuction` method is supported by the given contract. -* [isBuyerApprovedForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/isBuyerApprovedForListing): Checks if the buyer is approved for a listing. -* [isBuyFromListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isBuyFromListingSupported): Checks if the `buyFromListing` method is supported by the given contract. -* [isCancelAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCancelAuctionSupported): Checks if the `cancelAuction` method is supported by the given contract. -* [isCancelListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCancelListingSupported): Checks if the `cancelListing` method is supported by the given contract. -* [isCreateAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCreateAuctionSupported): Checks if the `createAuction` method is supported by the given contract. -* [isCreateListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCreateListingSupported): Checks if the `createListing` method is supported by the given contract. -* [isCurrencyApprovedForListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/isCurrencyApprovedForListing): Calls the "isCurrencyApprovedForListing" function on the contract. -* [isGetAuctionSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isGetAuctionSupported): Checks if the `getAuction` method is supported by the given contract. -* [isGetListingSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isGetListingSupported): Checks if the `isGetListingSupported` method is supported by the given contract. -* [isGetWinningBidSupported](https://portal.thirdweb.com/references/typescript/v5/marketplace/isGetWinningBidSupported): Checks if the `getWinningBid` method is supported by the given contract. -* [isNewWinningBid](https://portal.thirdweb.com/references/typescript/v5/marketplace/isNewWinningBid): Calls the "isNewWinningBid" function on the contract. -* [makeOffer](https://portal.thirdweb.com/references/typescript/v5/marketplace/makeOffer): Makes an offer for any asset (ERC721 or ERC1155). -* [newAuctionEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newAuctionEvent): Creates an event object for the NewAuction event. -* [newBidEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newBidEvent): Creates an event object for the NewBid event. -* [newListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newListingEvent): Creates an event object for the NewListing event. -* [newOfferEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newOfferEvent): Creates an event object for the NewOffer event. -* [newSaleEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/newSaleEvent): Creates an event object for the NewSale event. -* [totalAuctions](https://portal.thirdweb.com/references/typescript/v5/marketplace/totalAuctions): Calls the "totalAuctions" function on the contract. -* [totalListings](https://portal.thirdweb.com/references/typescript/v5/marketplace/totalListings): Calls the "totalListings" function on the contract. -* [totalOffers](https://portal.thirdweb.com/references/typescript/v5/marketplace/totalOffers): Calls the "totalOffers" function on the contract. -* [updatedListingEvent](https://portal.thirdweb.com/references/typescript/v5/marketplace/updatedListingEvent): Creates an event object for the UpdatedListing event. -* [updateListing](https://portal.thirdweb.com/references/typescript/v5/marketplace/updateListing): Updates an existing direct listing. +* [LENS.exists](https://portal.thirdweb.com/references/typescript/v5/lens/exists): Calls the "exists" function on the contract. +* [LENS.getContentURI](https://portal.thirdweb.com/references/typescript/v5/lens/getContentURI): Calls the "getContentURI" function on the contract. +* [LENS.getDefaultHandle](https://portal.thirdweb.com/references/typescript/v5/lens/getDefaultHandle): Calls the "getDefaultHandle" function on the contract. +* [LENS.getFollowData](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowData): Calls the "getFollowData" function on the contract. +* [LENS.getFollowerCount](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowerCount): Calls the "getFollowerCount" function on the contract. +* [LENS.getFollowerProfileId](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowerProfileId): Calls the "getFollowerProfileId" function on the contract. +* [LENS.getFollowTokenId](https://portal.thirdweb.com/references/typescript/v5/lens/getFollowTokenId): Calls the "getFollowTokenId" function on the contract. +* [LENS.getFullProfile](https://portal.thirdweb.com/references/typescript/v5/lens/getFullProfile): Return the profile data _with Lens handle_ and optional join date +* [LENS.getHandle](https://portal.thirdweb.com/references/typescript/v5/lens/getHandle): Calls the "getHandle" function on the contract. +* [LENS.getHandleFromProfileId](https://portal.thirdweb.com/references/typescript/v5/lens/getHandleFromProfileId): Return the Lens handle of a profile in the format: lens/@`` +* [LENS.getHandleTokenURIContract](https://portal.thirdweb.com/references/typescript/v5/lens/getHandleTokenURIContract): Calls the "getHandleTokenURIContract" function on the contract. +* [LENS.getLocalName](https://portal.thirdweb.com/references/typescript/v5/lens/getLocalName): Calls the "getLocalName" function on the contract. +* [LENS.getModuleTypes](https://portal.thirdweb.com/references/typescript/v5/lens/getModuleTypes): Calls the "getModuleTypes" function on the contract. +* [LENS.getOriginalFollowTimestamp](https://portal.thirdweb.com/references/typescript/v5/lens/getOriginalFollowTimestamp): Calls the "getOriginalFollowTimestamp" function on the contract. +* [LENS.getProfile](https://portal.thirdweb.com/references/typescript/v5/lens/getProfile): Calls the "getProfile" function on the contract. +* [LENS.getProfileIdAllowedToRecover](https://portal.thirdweb.com/references/typescript/v5/lens/getProfileIdAllowedToRecover): Calls the "getProfileIdAllowedToRecover" function on the contract. +* [LENS.getProfileIdByHandleHash](https://portal.thirdweb.com/references/typescript/v5/lens/getProfileIdByHandleHash): Calls the "getProfileIdByHandleHash" function on the contract. +* [LENS.getProfileMetadata](https://portal.thirdweb.com/references/typescript/v5/lens/getProfileMetadata): Download user lens profile from Arweave This method does NOT give you the user handle & join-time - consider using `getFullProfileData` instead It is useful & cost efficient if you only want to get user's name, bio, picture, coverPicture etc. +* [LENS.getPublication](https://portal.thirdweb.com/references/typescript/v5/lens/getPublication): Calls the "getPublication" function on the contract. +* [LENS.getTokenId](https://portal.thirdweb.com/references/typescript/v5/lens/getTokenId): Calls the "getTokenId" function on the contract. +* [LENS.isErc20CurrencyRegistered](https://portal.thirdweb.com/references/typescript/v5/lens/isErc20CurrencyRegistered): Calls the "isErc20CurrencyRegistered" function on the contract. +* [LENS.isFollowing](https://portal.thirdweb.com/references/typescript/v5/lens/isFollowing): Calls the "isFollowing" function on the contract. +* [LENS.isModuleRegistered](https://portal.thirdweb.com/references/typescript/v5/lens/isModuleRegistered): Calls the "isModuleRegistered" function on the contract. +* [LENS.isModuleRegisteredAs](https://portal.thirdweb.com/references/typescript/v5/lens/isModuleRegisteredAs): Calls the "isModuleRegisteredAs" function on the contract. +* [LENS.mintTimestampOf](https://portal.thirdweb.com/references/typescript/v5/lens/mintTimestampOf): Calls the "mintTimestampOf" function on the contract. +* [LENS.mintTimestampOfFollowNFT](https://portal.thirdweb.com/references/typescript/v5/lens/mintTimestampOfFollowNFT): Calls the "mintTimestampOf" function on the contract. +* [LENS.nonces](https://portal.thirdweb.com/references/typescript/v5/lens/nonces): Calls the "nonces" function on the contract. +* [LENS.resolve](https://portal.thirdweb.com/references/typescript/v5/lens/resolve): Calls the "resolve" function on the contract. +* [LENS.resolveAddress](https://portal.thirdweb.com/references/typescript/v5/lens/resolveAddress): Take in a Lens handle or local-name and return the wallet address behind that handle/local-name. For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name +* [LENS.tokenDataOf](https://portal.thirdweb.com/references/typescript/v5/lens/tokenDataOf): Calls the "tokenDataOf" function on the contract. --- ## MULTICALL3 -* [aggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/aggregate): Prepares a transaction to call the "aggregate" function on the contract. -* [aggregate3](https://portal.thirdweb.com/references/typescript/v5/multicall3/aggregate3): Prepares a transaction to call the "aggregate3" function on the contract. -* [aggregate3Value](https://portal.thirdweb.com/references/typescript/v5/multicall3/aggregate3Value): Prepares a transaction to call the "aggregate3Value" function on the contract. -* [blockAndAggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/blockAndAggregate): Prepares a transaction to call the "blockAndAggregate" function on the contract. -* [getBasefee](https://portal.thirdweb.com/references/typescript/v5/multicall3/getBasefee): Calls the "getBasefee" function on the contract. -* [getBlockHash](https://portal.thirdweb.com/references/typescript/v5/multicall3/getBlockHash): Calls the "getBlockHash" function on the contract. -* [getBlockNumber](https://portal.thirdweb.com/references/typescript/v5/multicall3/getBlockNumber): Calls the "getBlockNumber" function on the contract. -* [getChainId](https://portal.thirdweb.com/references/typescript/v5/multicall3/getChainId): Calls the "getChainId" function on the contract. -* [getCurrentBlockCoinbase](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockCoinbase): Calls the "getCurrentBlockCoinbase" function on the contract. -* [getCurrentBlockDifficulty](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockDifficulty): Calls the "getCurrentBlockDifficulty" function on the contract. -* [getCurrentBlockGasLimit](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockGasLimit): Calls the "getCurrentBlockGasLimit" function on the contract. -* [getCurrentBlockTimestamp](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockTimestamp): Calls the "getCurrentBlockTimestamp" function on the contract. -* [getEthBalance](https://portal.thirdweb.com/references/typescript/v5/multicall3/getEthBalance): Calls the "getEthBalance" function on the contract. -* [getLastBlockHash](https://portal.thirdweb.com/references/typescript/v5/multicall3/getLastBlockHash): Calls the "getLastBlockHash" function on the contract. -* [tryAggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/tryAggregate): Prepares a transaction to call the "tryAggregate" function on the contract. -* [tryBlockAndAggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/tryBlockAndAggregate): Prepares a transaction to call the "tryBlockAndAggregate" function on the contract. +* [MULTICALL3.aggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/aggregate): Prepares a transaction to call the "aggregate" function on the contract. +* [MULTICALL3.aggregate3](https://portal.thirdweb.com/references/typescript/v5/multicall3/aggregate3): Prepares a transaction to call the "aggregate3" function on the contract. +* [MULTICALL3.aggregate3Value](https://portal.thirdweb.com/references/typescript/v5/multicall3/aggregate3Value): Prepares a transaction to call the "aggregate3Value" function on the contract. +* [MULTICALL3.blockAndAggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/blockAndAggregate): Prepares a transaction to call the "blockAndAggregate" function on the contract. +* [MULTICALL3.getBasefee](https://portal.thirdweb.com/references/typescript/v5/multicall3/getBasefee): Calls the "getBasefee" function on the contract. +* [MULTICALL3.getBlockHash](https://portal.thirdweb.com/references/typescript/v5/multicall3/getBlockHash): Calls the "getBlockHash" function on the contract. +* [MULTICALL3.getBlockNumber](https://portal.thirdweb.com/references/typescript/v5/multicall3/getBlockNumber): Calls the "getBlockNumber" function on the contract. +* [MULTICALL3.getChainId](https://portal.thirdweb.com/references/typescript/v5/multicall3/getChainId): Calls the "getChainId" function on the contract. +* [MULTICALL3.getCurrentBlockCoinbase](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockCoinbase): Calls the "getCurrentBlockCoinbase" function on the contract. +* [MULTICALL3.getCurrentBlockDifficulty](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockDifficulty): Calls the "getCurrentBlockDifficulty" function on the contract. +* [MULTICALL3.getCurrentBlockGasLimit](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockGasLimit): Calls the "getCurrentBlockGasLimit" function on the contract. +* [MULTICALL3.getCurrentBlockTimestamp](https://portal.thirdweb.com/references/typescript/v5/multicall3/getCurrentBlockTimestamp): Calls the "getCurrentBlockTimestamp" function on the contract. +* [MULTICALL3.getEthBalance](https://portal.thirdweb.com/references/typescript/v5/multicall3/getEthBalance): Calls the "getEthBalance" function on the contract. +* [MULTICALL3.getLastBlockHash](https://portal.thirdweb.com/references/typescript/v5/multicall3/getLastBlockHash): Calls the "getLastBlockHash" function on the contract. +* [MULTICALL3.tryAggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/tryAggregate): Prepares a transaction to call the "tryAggregate" function on the contract. +* [MULTICALL3.tryBlockAndAggregate](https://portal.thirdweb.com/references/typescript/v5/multicall3/tryBlockAndAggregate): Prepares a transaction to call the "tryBlockAndAggregate" function on the contract. --- ## PACK -* [createNewPack](https://portal.thirdweb.com/references/typescript/v5/pack/createNewPack): Reference for createNewPack -* [createPack](https://portal.thirdweb.com/references/typescript/v5/pack/createPack): Prepares a transaction to call the "createPack" function on the contract. -* [getPackContents](https://portal.thirdweb.com/references/typescript/v5/pack/getPackContents): Calls the "getPackContents" function on the contract. -* [getTokenCountOfBundle](https://portal.thirdweb.com/references/typescript/v5/pack/getTokenCountOfBundle): Calls the "getTokenCountOfBundle" function on the contract. -* [openPack](https://portal.thirdweb.com/references/typescript/v5/pack/openPack): Prepares a transaction to call the "openPack" function on the contract. -* [packCreatedEvent](https://portal.thirdweb.com/references/typescript/v5/pack/packCreatedEvent): Creates an event object for the PackCreated event. -* [packOpenedEvent](https://portal.thirdweb.com/references/typescript/v5/pack/packOpenedEvent): Creates an event object for the PackOpened event. -* [packUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/pack/packUpdatedEvent): Creates an event object for the PackUpdated event. +* [PACK.createNewPack](https://portal.thirdweb.com/references/typescript/v5/pack/createNewPack): \[Pack contract is incompatible with Pectra update. Support for this contract is being removed in next release.\] +* [PACK.createPack](https://portal.thirdweb.com/references/typescript/v5/pack/createPack): Prepares a transaction to call the "createPack" function on the contract. +* [PACK.getPackContents](https://portal.thirdweb.com/references/typescript/v5/pack/getPackContents): Calls the "getPackContents" function on the contract. +* [PACK.getTokenCountOfBundle](https://portal.thirdweb.com/references/typescript/v5/pack/getTokenCountOfBundle): Calls the "getTokenCountOfBundle" function on the contract. +* [PACK.openPack](https://portal.thirdweb.com/references/typescript/v5/pack/openPack): Prepares a transaction to call the "openPack" function on the contract. +* [PACK.packCreatedEvent](https://portal.thirdweb.com/references/typescript/v5/pack/packCreatedEvent): Creates an event object for the PackCreated event. +* [PACK.packOpenedEvent](https://portal.thirdweb.com/references/typescript/v5/pack/packOpenedEvent): Creates an event object for the PackOpened event. +* [PACK.packUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/pack/packUpdatedEvent): Creates an event object for the PackUpdated event. --- ## PERMISSIONS -* [getAllRoleMembers](https://portal.thirdweb.com/references/typescript/v5/permissions/getAllRoleMembers): Retrieves all members of a specific role. -* [getRoleAdmin](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleAdmin): Gets the admin of a role. -* [getRoleHash](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleHash): Get a hex value of a smart contract role You need the hex value to interact with the smart contracts. -* [getRoleMember](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleMember): Retrieves a specific member of a specific role. -* [getRoleMemberCount](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleMemberCount): Retrieves the number of members of a specific role. -* [grantRole](https://portal.thirdweb.com/references/typescript/v5/permissions/grantRole): Grants a role to a target account. -* [hasRole](https://portal.thirdweb.com/references/typescript/v5/permissions/hasRole): Checks if the target account has the role. -* [isGetAllRoleMembersSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetAllRoleMembersSupported): Checks if the `getAllRoleMembers` method is supported by the given contract. -* [isGetRoleAdminSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetRoleAdminSupported): Checks if the `getRoleAdmin` method is supported by the given contract. -* [isGetRoleMemberCountSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetRoleMemberCountSupported): Checks if the `getRoleMemberCount` method is supported by the given contract. -* [isGetRoleMemberSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetRoleMemberSupported): Checks if the `getRoleMember` method is supported by the given contract. -* [isGrantRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGrantRoleSupported): Checks if the `grantRole` method is supported by the given contract. -* [isHasRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isHasRoleSupported): Checks if the `hasRole` method is supported by the given contract. -* [isRenounceRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isRenounceRoleSupported): Checks if the `renounceRole` method is supported by the given contract. -* [isRevokeRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isRevokeRoleSupported): Checks if the `revokeRole` method is supported by the given contract. -* [renounceRole](https://portal.thirdweb.com/references/typescript/v5/permissions/renounceRole): Lets the target account renounce the role. (The target account must be the sender of the transaction.) -* [revokeRole](https://portal.thirdweb.com/references/typescript/v5/permissions/revokeRole): Revokes a role from a target account. -* [roleAdminChangedEvent](https://portal.thirdweb.com/references/typescript/v5/permissions/roleAdminChangedEvent): Creates an event object for the RoleAdminChanged event. -* [roleGrantedEvent](https://portal.thirdweb.com/references/typescript/v5/permissions/roleGrantedEvent): Creates an event object for the RoleGranted event. -* [roleRevokedEvent](https://portal.thirdweb.com/references/typescript/v5/permissions/roleRevokedEvent): Creates an event object for the RoleRevoked event. +* [PERMISSIONS.getAllRoleMembers](https://portal.thirdweb.com/references/typescript/v5/permissions/getAllRoleMembers): Retrieves all members of a specific role. +* [PERMISSIONS.getRoleAdmin](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleAdmin): Gets the admin of a role. +* [PERMISSIONS.getRoleHash](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleHash): Get a hex value of a smart contract role You need the hex value to interact with the smart contracts. +* [PERMISSIONS.getRoleMember](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleMember): Retrieves a specific member of a specific role. +* [PERMISSIONS.getRoleMemberCount](https://portal.thirdweb.com/references/typescript/v5/permissions/getRoleMemberCount): Retrieves the number of members of a specific role. +* [PERMISSIONS.grantRole](https://portal.thirdweb.com/references/typescript/v5/permissions/grantRole): Grants a role to a target account. +* [PERMISSIONS.hasRole](https://portal.thirdweb.com/references/typescript/v5/permissions/hasRole): Checks if the target account has the role. +* [PERMISSIONS.isGetAllRoleMembersSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetAllRoleMembersSupported): Checks if the `getAllRoleMembers` method is supported by the given contract. +* [PERMISSIONS.isGetRoleAdminSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetRoleAdminSupported): Checks if the `getRoleAdmin` method is supported by the given contract. +* [PERMISSIONS.isGetRoleMemberCountSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetRoleMemberCountSupported): Checks if the `getRoleMemberCount` method is supported by the given contract. +* [PERMISSIONS.isGetRoleMemberSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGetRoleMemberSupported): Checks if the `getRoleMember` method is supported by the given contract. +* [PERMISSIONS.isGrantRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isGrantRoleSupported): Checks if the `grantRole` method is supported by the given contract. +* [PERMISSIONS.isHasRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isHasRoleSupported): Checks if the `hasRole` method is supported by the given contract. +* [PERMISSIONS.isRenounceRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isRenounceRoleSupported): Checks if the `renounceRole` method is supported by the given contract. +* [PERMISSIONS.isRevokeRoleSupported](https://portal.thirdweb.com/references/typescript/v5/permissions/isRevokeRoleSupported): Checks if the `revokeRole` method is supported by the given contract. +* [PERMISSIONS.renounceRole](https://portal.thirdweb.com/references/typescript/v5/permissions/renounceRole): Lets the target account renounce the role. (The target account must be the sender of the transaction.) +* [PERMISSIONS.revokeRole](https://portal.thirdweb.com/references/typescript/v5/permissions/revokeRole): Revokes a role from a target account. +* [PERMISSIONS.roleAdminChangedEvent](https://portal.thirdweb.com/references/typescript/v5/permissions/roleAdminChangedEvent): Creates an event object for the RoleAdminChanged event. +* [PERMISSIONS.roleGrantedEvent](https://portal.thirdweb.com/references/typescript/v5/permissions/roleGrantedEvent): Creates an event object for the RoleGranted event. +* [PERMISSIONS.roleRevokedEvent](https://portal.thirdweb.com/references/typescript/v5/permissions/roleRevokedEvent): Creates an event object for the RoleRevoked event. --- ## SPLIT -* [distribute](https://portal.thirdweb.com/references/typescript/v5/split/distribute): Prepares a transaction to call the "distribute" function on the contract. -* [distributeByToken](https://portal.thirdweb.com/references/typescript/v5/split/distributeByToken): This extension is similar to the `distribute` extension, however it require you to specify the token (address) that you want to distribute -* [getAllRecipientsAddresses](https://portal.thirdweb.com/references/typescript/v5/split/getAllRecipientsAddresses): Get the addresses of all recipients of a [thirdweb Split contract](https://thirdweb.com/thirdweb.eth/Split) -* [getAllRecipientsPercentages](https://portal.thirdweb.com/references/typescript/v5/split/getAllRecipientsPercentages): Get all the recipients of a Split contracts -* [getRecipientSplitPercentage](https://portal.thirdweb.com/references/typescript/v5/split/getRecipientSplitPercentage): Get the split percentage of a recipient -* [payee](https://portal.thirdweb.com/references/typescript/v5/split/payee): Calls the "payee" function on the contract. -* [payeeCount](https://portal.thirdweb.com/references/typescript/v5/split/payeeCount): Calls the "payeeCount" function on the contract. -* [releasable](https://portal.thirdweb.com/references/typescript/v5/split/releasable): Calls the "releasable" function on the contract. -* [releasableByToken](https://portal.thirdweb.com/references/typescript/v5/split/releasableByToken): Calls the "releasable" function on the contract. -* [release](https://portal.thirdweb.com/references/typescript/v5/split/release): Prepares a transaction to call the "release" function on the contract. -* [releaseByToken](https://portal.thirdweb.com/references/typescript/v5/split/releaseByToken): Similar to the `release` extension, however this one requires you to specify a tokenAddress to release -* [released](https://portal.thirdweb.com/references/typescript/v5/split/released): Calls the "released" function on the contract. -* [releasedByToken](https://portal.thirdweb.com/references/typescript/v5/split/releasedByToken): Calls the "released" function on the contract. Similar to the `released` extension, however this one requires you to specify a tokenAddress -* [shares](https://portal.thirdweb.com/references/typescript/v5/split/shares): Calls the "shares" function on the contract. -* [totalReleased](https://portal.thirdweb.com/references/typescript/v5/split/totalReleased): Calls the "totalReleased" function on the contract. -* [totalReleasedByToken](https://portal.thirdweb.com/references/typescript/v5/split/totalReleasedByToken): Calls the "totalReleased" function on the contract. Similar to the `release` extension, however this one requires you to specify a tokenAddress +* [SPLIT.distribute](https://portal.thirdweb.com/references/typescript/v5/split/distribute): Prepares a transaction to call the "distribute" function on the contract. +* [SPLIT.distributeByToken](https://portal.thirdweb.com/references/typescript/v5/split/distributeByToken): This extension is similar to the `distribute` extension, however it require you to specify the token (address) that you want to distribute +* [SPLIT.getAllRecipientsAddresses](https://portal.thirdweb.com/references/typescript/v5/split/getAllRecipientsAddresses): Get the addresses of all recipients of a [thirdweb Split contract](https://thirdweb.com/thirdweb.eth/Split) +* [SPLIT.getAllRecipientsPercentages](https://portal.thirdweb.com/references/typescript/v5/split/getAllRecipientsPercentages): Get all the recipients of a Split contracts +* [SPLIT.getRecipientSplitPercentage](https://portal.thirdweb.com/references/typescript/v5/split/getRecipientSplitPercentage): Get the split percentage of a recipient +* [SPLIT.payee](https://portal.thirdweb.com/references/typescript/v5/split/payee): Calls the "payee" function on the contract. +* [SPLIT.payeeCount](https://portal.thirdweb.com/references/typescript/v5/split/payeeCount): Calls the "payeeCount" function on the contract. +* [SPLIT.releasable](https://portal.thirdweb.com/references/typescript/v5/split/releasable): Calls the "releasable" function on the contract. +* [SPLIT.releasableByToken](https://portal.thirdweb.com/references/typescript/v5/split/releasableByToken): Calls the "releasable" function on the contract. +* [SPLIT.release](https://portal.thirdweb.com/references/typescript/v5/split/release): Prepares a transaction to call the "release" function on the contract. +* [SPLIT.releaseByToken](https://portal.thirdweb.com/references/typescript/v5/split/releaseByToken): Similar to the `release` extension, however this one requires you to specify a tokenAddress to release +* [SPLIT.released](https://portal.thirdweb.com/references/typescript/v5/split/released): Calls the "released" function on the contract. +* [SPLIT.releasedByToken](https://portal.thirdweb.com/references/typescript/v5/split/releasedByToken): Calls the "released" function on the contract. Similar to the `released` extension, however this one requires you to specify a tokenAddress +* [SPLIT.shares](https://portal.thirdweb.com/references/typescript/v5/split/shares): Calls the "shares" function on the contract. +* [SPLIT.totalReleased](https://portal.thirdweb.com/references/typescript/v5/split/totalReleased): Calls the "totalReleased" function on the contract. +* [SPLIT.totalReleasedByToken](https://portal.thirdweb.com/references/typescript/v5/split/totalReleasedByToken): Calls the "totalReleased" function on the contract. Similar to the `release` extension, however this one requires you to specify a tokenAddress --- ## THIRDWEB -* [add](https://portal.thirdweb.com/references/typescript/v5/thirdweb/add): Prepares a transaction to call the "add" function on the contract. -* [contractType](https://portal.thirdweb.com/references/typescript/v5/thirdweb/contractType): Calls the "contractType" function on the contract. -* [count](https://portal.thirdweb.com/references/typescript/v5/thirdweb/count): Calls the "count" function on the contract. -* [deployProxyByImplementation](https://portal.thirdweb.com/references/typescript/v5/thirdweb/deployProxyByImplementation): Prepares a transaction to call the "deployProxyByImplementation" function on the contract. -* [getAll](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getAll): Calls the "getAll" function on the contract. -* [getAllPublishedContracts](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getAllPublishedContracts): Calls the "getAllPublishedContracts" function on the contract. -* [getMetadataUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getMetadataUri): Calls the "getMetadataUri" function on the contract. -* [getPublishedContract](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublishedContract): Calls the "getPublishedContract" function on the contract. -* [getPublishedContractVersions](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublishedContractVersions): Calls the "getPublishedContractVersions" function on the contract. -* [getPublishedUriFromCompilerUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublishedUriFromCompilerUri): Calls the "getPublishedUriFromCompilerUri" function on the contract. -* [getPublisherProfileUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublisherProfileUri): Calls the "getPublisherProfileUri" function on the contract. -* [isContractTypeSupported](https://portal.thirdweb.com/references/typescript/v5/thirdweb/isContractTypeSupported): Checks if the `contractType` method is supported by the given contract. -* [remove](https://portal.thirdweb.com/references/typescript/v5/thirdweb/remove): Prepares a transaction to call the "remove" function on the contract. -* [setPublisherProfileUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/setPublisherProfileUri): Prepares a transaction to call the "setPublisherProfileUri" function on the contract. -* [unpublishContract](https://portal.thirdweb.com/references/typescript/v5/thirdweb/unpublishContract): Prepares a transaction to call the "unpublishContract" function on the contract. ---- -## thirdweb -* [publishContract](https://portal.thirdweb.com/references/typescript/v5/thirdweb/publishContract): Publish a contract to the contract publisher. +* [THIRDWEB.add](https://portal.thirdweb.com/references/typescript/v5/thirdweb/add): Prepares a transaction to call the "add" function on the contract. +* [THIRDWEB.contractType](https://portal.thirdweb.com/references/typescript/v5/thirdweb/contractType): Calls the "contractType" function on the contract. +* [THIRDWEB.count](https://portal.thirdweb.com/references/typescript/v5/thirdweb/count): Calls the "count" function on the contract. +* [THIRDWEB.deployProxyByImplementation](https://portal.thirdweb.com/references/typescript/v5/thirdweb/deployProxyByImplementation): Prepares a transaction to call the "deployProxyByImplementation" function on the contract. +* [THIRDWEB.getAll](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getAll): Calls the "getAll" function on the contract. +* [THIRDWEB.getAllPublishedContracts](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getAllPublishedContracts): Calls the "getAllPublishedContracts" function on the contract. +* [THIRDWEB.getMetadataUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getMetadataUri): Calls the "getMetadataUri" function on the contract. +* [THIRDWEB.getPublishedContract](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublishedContract): Calls the "getPublishedContract" function on the contract. +* [THIRDWEB.getPublishedContractVersions](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublishedContractVersions): Calls the "getPublishedContractVersions" function on the contract. +* [THIRDWEB.getPublishedUriFromCompilerUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublishedUriFromCompilerUri): Calls the "getPublishedUriFromCompilerUri" function on the contract. +* [THIRDWEB.getPublisherProfileUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/getPublisherProfileUri): Calls the "getPublisherProfileUri" function on the contract. +* [THIRDWEB.isContractTypeSupported](https://portal.thirdweb.com/references/typescript/v5/thirdweb/isContractTypeSupported): Checks if the `contractType` method is supported by the given contract. +* [THIRDWEB.publishContract](https://portal.thirdweb.com/references/typescript/v5/thirdweb/publishContract): Publish a contract to the contract publisher. +* [THIRDWEB.remove](https://portal.thirdweb.com/references/typescript/v5/thirdweb/remove): Prepares a transaction to call the "remove" function on the contract. +* [THIRDWEB.setPublisherProfileUri](https://portal.thirdweb.com/references/typescript/v5/thirdweb/setPublisherProfileUri): Prepares a transaction to call the "setPublisherProfileUri" function on the contract. +* [THIRDWEB.unpublishContract](https://portal.thirdweb.com/references/typescript/v5/thirdweb/unpublishContract): Prepares a transaction to call the "unpublishContract" function on the contract. --- ## UNISWAP -* [createPool](https://portal.thirdweb.com/references/typescript/v5/uniswap/createPool): Prepares a transaction to call the "createPool" function on the contract. -* [enableFeeAmount](https://portal.thirdweb.com/references/typescript/v5/uniswap/enableFeeAmount): Prepares a transaction to call the "enableFeeAmount" function on the contract. -* [exactInput](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactInput): Prepares a transaction to call the "exactInput" function on the contract. -* [exactInputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactInputSingle): Prepares a transaction to call the "exactInputSingle" function on the contract. -* [exactOutput](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactOutput): Prepares a transaction to call the "exactOutput" function on the contract. -* [exactOutputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactOutputSingle): Prepares a transaction to call the "exactOutputSingle" function on the contract. -* [feeAmountEnabledEvent](https://portal.thirdweb.com/references/typescript/v5/uniswap/feeAmountEnabledEvent): Creates an event object for the FeeAmountEnabled event. -* [feeAmountTickSpacing](https://portal.thirdweb.com/references/typescript/v5/uniswap/feeAmountTickSpacing): Calls the "feeAmountTickSpacing" function on the contract. -* [getPool](https://portal.thirdweb.com/references/typescript/v5/uniswap/getPool): Calls the "getPool" function on the contract. -* [getUniswapV3Pool](https://portal.thirdweb.com/references/typescript/v5/uniswap/getUniswapV3Pool): Finds the Uniswap V3 pools for the two tokens. -* [owner](https://portal.thirdweb.com/references/typescript/v5/uniswap/owner): Calls the "owner" function on the contract. -* [ownerChangedEvent](https://portal.thirdweb.com/references/typescript/v5/uniswap/ownerChangedEvent): Creates an event object for the OwnerChanged event. -* [poolCreatedEvent](https://portal.thirdweb.com/references/typescript/v5/uniswap/poolCreatedEvent): Creates an event object for the PoolCreated event. -* [quoteExactInput](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactInput): Prepares a transaction to call the "quoteExactInput" function on the contract. -* [quoteExactInputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactInputSingle): Prepares a transaction to call the "quoteExactInputSingle" function on the contract. -* [quoteExactOutput](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactOutput): Prepares a transaction to call the "quoteExactOutput" function on the contract. -* [quoteExactOutputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactOutputSingle): Prepares a transaction to call the "quoteExactOutputSingle" function on the contract. -* [setOwner](https://portal.thirdweb.com/references/typescript/v5/uniswap/setOwner): Prepares a transaction to call the "setOwner" function on the contract. +* [UNISWAP.createPool](https://portal.thirdweb.com/references/typescript/v5/uniswap/createPool): Prepares a transaction to call the "createPool" function on the contract. +* [UNISWAP.enableFeeAmount](https://portal.thirdweb.com/references/typescript/v5/uniswap/enableFeeAmount): Prepares a transaction to call the "enableFeeAmount" function on the contract. +* [UNISWAP.exactInput](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactInput): Prepares a transaction to call the "exactInput" function on the contract. +* [UNISWAP.exactInputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactInputSingle): Prepares a transaction to call the "exactInputSingle" function on the contract. +* [UNISWAP.exactOutput](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactOutput): Prepares a transaction to call the "exactOutput" function on the contract. +* [UNISWAP.exactOutputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/exactOutputSingle): Prepares a transaction to call the "exactOutputSingle" function on the contract. +* [UNISWAP.feeAmountEnabledEvent](https://portal.thirdweb.com/references/typescript/v5/uniswap/feeAmountEnabledEvent): Creates an event object for the FeeAmountEnabled event. +* [UNISWAP.feeAmountTickSpacing](https://portal.thirdweb.com/references/typescript/v5/uniswap/feeAmountTickSpacing): Calls the "feeAmountTickSpacing" function on the contract. +* [UNISWAP.getPool](https://portal.thirdweb.com/references/typescript/v5/uniswap/getPool): Calls the "getPool" function on the contract. +* [UNISWAP.getUniswapV3Pool](https://portal.thirdweb.com/references/typescript/v5/uniswap/getUniswapV3Pool): Finds the Uniswap V3 pools for the two tokens. +* [UNISWAP.owner](https://portal.thirdweb.com/references/typescript/v5/uniswap/owner): Calls the "owner" function on the contract. +* [UNISWAP.ownerChangedEvent](https://portal.thirdweb.com/references/typescript/v5/uniswap/ownerChangedEvent): Creates an event object for the OwnerChanged event. +* [UNISWAP.poolCreatedEvent](https://portal.thirdweb.com/references/typescript/v5/uniswap/poolCreatedEvent): Creates an event object for the PoolCreated event. +* [UNISWAP.quoteExactInput](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactInput): Prepares a transaction to call the "quoteExactInput" function on the contract. +* [UNISWAP.quoteExactInputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactInputSingle): Prepares a transaction to call the "quoteExactInputSingle" function on the contract. +* [UNISWAP.quoteExactOutput](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactOutput): Prepares a transaction to call the "quoteExactOutput" function on the contract. +* [UNISWAP.quoteExactOutputSingle](https://portal.thirdweb.com/references/typescript/v5/uniswap/quoteExactOutputSingle): Prepares a transaction to call the "quoteExactOutputSingle" function on the contract. +* [UNISWAP.setOwner](https://portal.thirdweb.com/references/typescript/v5/uniswap/setOwner): Prepares a transaction to call the "setOwner" function on the contract. --- ## UNSTOPPABLE-DOMAINS -* [namehash](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/namehash): Calls the "namehash" function on the contract. -* [resolveAddress](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/resolveAddress): Resolve an Unstoppable-Domain domain to an Ethereum address -* [resolveName](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/resolveName): Resolves the primary Untoppable-Domains name for a specified address. -* [reverseNameOf](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/reverseNameOf): Calls the "reverseNameOf" function on the contract. +* [UNSTOPPABLE-DOMAINS.namehash](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/namehash): Calls the "namehash" function on the contract. +* [UNSTOPPABLE-DOMAINS.resolveAddress](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/resolveAddress): Resolve an Unstoppable-Domain domain to an Ethereum address +* [UNSTOPPABLE-DOMAINS.resolveName](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/resolveName): Resolves the primary Untoppable-Domains name for a specified address. +* [UNSTOPPABLE-DOMAINS.reverseNameOf](https://portal.thirdweb.com/references/typescript/v5/unstoppable-domains/reverseNameOf): Calls the "reverseNameOf" function on the contract. --- ## VOTE -* [canExecute](https://portal.thirdweb.com/references/typescript/v5/vote/canExecute): Simulate the `execute` method of the Vote contract, to check if you can execute a proposal -* [castVote](https://portal.thirdweb.com/references/typescript/v5/vote/castVote): Prepares a transaction to call the "castVote" function on the contract. -* [castVoteBySig](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteBySig): Prepares a transaction to call the "castVoteBySig" function on the contract. -* [castVoteWithReason](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteWithReason): Prepares a transaction to call the "castVoteWithReason" function on the contract. -* [castVoteWithReasonAndParams](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteWithReasonAndParams): Prepares a transaction to call the "castVoteWithReasonAndParams" function on the contract. -* [castVoteWithReasonAndParamsBySig](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteWithReasonAndParamsBySig): Prepares a transaction to call the "castVoteWithReasonAndParamsBySig" function on the contract. -* [execute](https://portal.thirdweb.com/references/typescript/v5/vote/execute): Prepares a transaction to call the "execute" function on the contract. -* [executeProposal](https://portal.thirdweb.com/references/typescript/v5/vote/executeProposal): Execute a Proposal -* [getAll](https://portal.thirdweb.com/references/typescript/v5/vote/getAll): Get all proposals from a Vote contract with some extra info attached for each proposal (current state and votes) -* [getAllProposals](https://portal.thirdweb.com/references/typescript/v5/vote/getAllProposals): Calls the "getAllProposals" function on the contract. -* [getProposalVoteCounts](https://portal.thirdweb.com/references/typescript/v5/vote/getProposalVoteCounts): Get the info about Against, For and Abstain votes of a proposal -* [getVotes](https://portal.thirdweb.com/references/typescript/v5/vote/getVotes): Calls the "getVotes" function on the contract. -* [getVotesWithParams](https://portal.thirdweb.com/references/typescript/v5/vote/getVotesWithParams): Calls the "getVotesWithParams" function on the contract. -* [hashProposal](https://portal.thirdweb.com/references/typescript/v5/vote/hashProposal): Calls the "hashProposal" function on the contract. -* [hasVoted](https://portal.thirdweb.com/references/typescript/v5/vote/hasVoted): Calls the "hasVoted" function on the contract. -* [proposalDeadline](https://portal.thirdweb.com/references/typescript/v5/vote/proposalDeadline): Calls the "proposalDeadline" function on the contract. -* [proposalExists](https://portal.thirdweb.com/references/typescript/v5/vote/proposalExists): Check if a proposal exists based on a given proposalId -* [proposalIndex](https://portal.thirdweb.com/references/typescript/v5/vote/proposalIndex): Calls the "proposalIndex" function on the contract. -* [proposals](https://portal.thirdweb.com/references/typescript/v5/vote/proposals): Calls the "proposals" function on the contract. -* [proposalSnapshot](https://portal.thirdweb.com/references/typescript/v5/vote/proposalSnapshot): Calls the "proposalSnapshot" function on the contract. -* [proposalThreshold](https://portal.thirdweb.com/references/typescript/v5/vote/proposalThreshold): Calls the "proposalThreshold" function on the contract. -* [proposalVotes](https://portal.thirdweb.com/references/typescript/v5/vote/proposalVotes): Calls the "proposalVotes" function on the contract. -* [propose](https://portal.thirdweb.com/references/typescript/v5/vote/propose): Prepares a transaction to call the "propose" function on the contract. -* [quorum](https://portal.thirdweb.com/references/typescript/v5/vote/quorum): Calls the "quorum" function on the contract. -* [quorumDenominator](https://portal.thirdweb.com/references/typescript/v5/vote/quorumDenominator): Calls the "quorumDenominator" function on the contract. -* [quorumNumeratorByBlockNumber](https://portal.thirdweb.com/references/typescript/v5/vote/quorumNumeratorByBlockNumber): Calls the "quorumDenominator" function on the contract with an extra param called `blockNumber` . This extension is similar to the `quorumDenominator` extension, except that it takes in a bigint (blockNumber) -* [relay](https://portal.thirdweb.com/references/typescript/v5/vote/relay): Prepares a transaction to call the "relay" function on the contract. -* [setProposalThreshold](https://portal.thirdweb.com/references/typescript/v5/vote/setProposalThreshold): Prepares a transaction to call the "setProposalThreshold" function on the contract. -* [setVotingDelay](https://portal.thirdweb.com/references/typescript/v5/vote/setVotingDelay): Prepares a transaction to call the "setVotingDelay" function on the contract. -* [setVotingPeriod](https://portal.thirdweb.com/references/typescript/v5/vote/setVotingPeriod): Prepares a transaction to call the "setVotingPeriod" function on the contract. -* [state](https://portal.thirdweb.com/references/typescript/v5/vote/state): Calls the "state" function on the contract. -* [token](https://portal.thirdweb.com/references/typescript/v5/vote/token): Calls the "token" function on the contract. -* [updateQuorumNumerator](https://portal.thirdweb.com/references/typescript/v5/vote/updateQuorumNumerator): Prepares a transaction to call the "updateQuorumNumerator" function on the contract. -* [votingDelay](https://portal.thirdweb.com/references/typescript/v5/vote/votingDelay): Calls the "votingDelay" function on the contract. -* [votingPeriod](https://portal.thirdweb.com/references/typescript/v5/vote/votingPeriod): Calls the "votingPeriod" function on the contract. +* [VOTE.canExecute](https://portal.thirdweb.com/references/typescript/v5/vote/canExecute): Simulate the `execute` method of the Vote contract, to check if you can execute a proposal +* [VOTE.castVote](https://portal.thirdweb.com/references/typescript/v5/vote/castVote): Prepares a transaction to call the "castVote" function on the contract. +* [VOTE.castVoteBySig](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteBySig): Prepares a transaction to call the "castVoteBySig" function on the contract. +* [VOTE.castVoteWithReason](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteWithReason): Prepares a transaction to call the "castVoteWithReason" function on the contract. +* [VOTE.castVoteWithReasonAndParams](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteWithReasonAndParams): Prepares a transaction to call the "castVoteWithReasonAndParams" function on the contract. +* [VOTE.castVoteWithReasonAndParamsBySig](https://portal.thirdweb.com/references/typescript/v5/vote/castVoteWithReasonAndParamsBySig): Prepares a transaction to call the "castVoteWithReasonAndParamsBySig" function on the contract. +* [VOTE.execute](https://portal.thirdweb.com/references/typescript/v5/vote/execute): Prepares a transaction to call the "execute" function on the contract. +* [VOTE.executeProposal](https://portal.thirdweb.com/references/typescript/v5/vote/executeProposal): Execute a Proposal +* [VOTE.getAll](https://portal.thirdweb.com/references/typescript/v5/vote/getAll): Get all proposals from a Vote contract with some extra info attached for each proposal (current state and votes) +* [VOTE.getAllProposals](https://portal.thirdweb.com/references/typescript/v5/vote/getAllProposals): Calls the "getAllProposals" function on the contract. +* [VOTE.getProposalVoteCounts](https://portal.thirdweb.com/references/typescript/v5/vote/getProposalVoteCounts): Get the info about Against, For and Abstain votes of a proposal +* [VOTE.getVotes](https://portal.thirdweb.com/references/typescript/v5/vote/getVotes): Calls the "getVotes" function on the contract. +* [VOTE.getVotesWithParams](https://portal.thirdweb.com/references/typescript/v5/vote/getVotesWithParams): Calls the "getVotesWithParams" function on the contract. +* [VOTE.hashProposal](https://portal.thirdweb.com/references/typescript/v5/vote/hashProposal): Calls the "hashProposal" function on the contract. +* [VOTE.hasVoted](https://portal.thirdweb.com/references/typescript/v5/vote/hasVoted): Calls the "hasVoted" function on the contract. +* [VOTE.proposalDeadline](https://portal.thirdweb.com/references/typescript/v5/vote/proposalDeadline): Calls the "proposalDeadline" function on the contract. +* [VOTE.proposalExists](https://portal.thirdweb.com/references/typescript/v5/vote/proposalExists): Check if a proposal exists based on a given proposalId +* [VOTE.proposalIndex](https://portal.thirdweb.com/references/typescript/v5/vote/proposalIndex): Calls the "proposalIndex" function on the contract. +* [VOTE.proposals](https://portal.thirdweb.com/references/typescript/v5/vote/proposals): Calls the "proposals" function on the contract. +* [VOTE.proposalSnapshot](https://portal.thirdweb.com/references/typescript/v5/vote/proposalSnapshot): Calls the "proposalSnapshot" function on the contract. +* [VOTE.proposalThreshold](https://portal.thirdweb.com/references/typescript/v5/vote/proposalThreshold): Calls the "proposalThreshold" function on the contract. +* [VOTE.proposalVotes](https://portal.thirdweb.com/references/typescript/v5/vote/proposalVotes): Calls the "proposalVotes" function on the contract. +* [VOTE.propose](https://portal.thirdweb.com/references/typescript/v5/vote/propose): Prepares a transaction to call the "propose" function on the contract. +* [VOTE.quorum](https://portal.thirdweb.com/references/typescript/v5/vote/quorum): Calls the "quorum" function on the contract. +* [VOTE.quorumDenominator](https://portal.thirdweb.com/references/typescript/v5/vote/quorumDenominator): Calls the "quorumDenominator" function on the contract. +* [VOTE.quorumNumeratorByBlockNumber](https://portal.thirdweb.com/references/typescript/v5/vote/quorumNumeratorByBlockNumber): Calls the "quorumDenominator" function on the contract with an extra param called `blockNumber`. This extension is similar to the `quorumDenominator` extension, except that it takes in a bigint (blockNumber) +* [VOTE.relay](https://portal.thirdweb.com/references/typescript/v5/vote/relay): Prepares a transaction to call the "relay" function on the contract. +* [VOTE.setProposalThreshold](https://portal.thirdweb.com/references/typescript/v5/vote/setProposalThreshold): Prepares a transaction to call the "setProposalThreshold" function on the contract. +* [VOTE.setVotingDelay](https://portal.thirdweb.com/references/typescript/v5/vote/setVotingDelay): Prepares a transaction to call the "setVotingDelay" function on the contract. +* [VOTE.setVotingPeriod](https://portal.thirdweb.com/references/typescript/v5/vote/setVotingPeriod): Prepares a transaction to call the "setVotingPeriod" function on the contract. +* [VOTE.state](https://portal.thirdweb.com/references/typescript/v5/vote/state): Calls the "state" function on the contract. +* [VOTE.token](https://portal.thirdweb.com/references/typescript/v5/vote/token): Calls the "token" function on the contract. +* [VOTE.updateQuorumNumerator](https://portal.thirdweb.com/references/typescript/v5/vote/updateQuorumNumerator): Prepares a transaction to call the "updateQuorumNumerator" function on the contract. +* [VOTE.votingDelay](https://portal.thirdweb.com/references/typescript/v5/vote/votingDelay): Calls the "votingDelay" function on the contract. +* [VOTE.votingPeriod](https://portal.thirdweb.com/references/typescript/v5/vote/votingPeriod): Calls the "votingPeriod" function on the contract. --- ## MODULES -* [cancelOwnershipHandover](https://portal.thirdweb.com/references/typescript/v5/modules/cancelOwnershipHandover): Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. -* [completeOwnershipHandover](https://portal.thirdweb.com/references/typescript/v5/modules/completeOwnershipHandover): Prepares a transaction to call the "completeOwnershipHandover" function on the contract. -* [getInstalledModules](https://portal.thirdweb.com/references/typescript/v5/modules/getInstalledModules): Calls the "getInstalledModules" function on the contract. -* [getModuleConfig](https://portal.thirdweb.com/references/typescript/v5/modules/getModuleConfig): Calls the "getModuleConfig" function on the contract. -* [getSupportedCallbackFunctions](https://portal.thirdweb.com/references/typescript/v5/modules/getSupportedCallbackFunctions): Calls the "getSupportedCallbackFunctions" function on the contract. -* [grantRoles](https://portal.thirdweb.com/references/typescript/v5/modules/grantRoles): Prepares a transaction to call the "grantRoles" function on the contract. -* [hasAllRoles](https://portal.thirdweb.com/references/typescript/v5/modules/hasAllRoles): Calls the "hasAllRoles" function on the contract. -* [hasAnyRole](https://portal.thirdweb.com/references/typescript/v5/modules/hasAnyRole): Calls the "hasAnyRole" function on the contract. -* [installModule](https://portal.thirdweb.com/references/typescript/v5/modules/installModule): Prepares a transaction to call the "installModule" function on the contract. -* [isGetInstalledModulesSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isGetInstalledModulesSupported): Checks if the `getInstalledModules` method is supported by the given contract. -* [isGetModuleConfigSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isGetModuleConfigSupported): Checks if the `getModuleConfig` method is supported by the given contract. -* [isGetSupportedCallbackFunctionsSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isGetSupportedCallbackFunctionsSupported): Checks if the `getSupportedCallbackFunctions` method is supported by the given contract. -* [isInstallModuleSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isInstallModuleSupported): Checks if the `installModule` method is supported by the given contract. -* [isUninstallModuleSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isUninstallModuleSupported): Checks if the `uninstallModule` method is supported by the given contract. -* [owner](https://portal.thirdweb.com/references/typescript/v5/modules/owner): Calls the "owner" function on the contract. -* [ownershipHandoverExpiresAt](https://portal.thirdweb.com/references/typescript/v5/modules/ownershipHandoverExpiresAt): Calls the "ownershipHandoverExpiresAt" function on the contract. -* [renounceOwnership](https://portal.thirdweb.com/references/typescript/v5/modules/renounceOwnership): Prepares a transaction to call the "renounceOwnership" function on the contract. -* [renounceRoles](https://portal.thirdweb.com/references/typescript/v5/modules/renounceRoles): Prepares a transaction to call the "renounceRoles" function on the contract. -* [requestOwnershipHandover](https://portal.thirdweb.com/references/typescript/v5/modules/requestOwnershipHandover): Prepares a transaction to call the "requestOwnershipHandover" function on the contract. -* [revokeRoles](https://portal.thirdweb.com/references/typescript/v5/modules/revokeRoles): Prepares a transaction to call the "revokeRoles" function on the contract. -* [rolesOf](https://portal.thirdweb.com/references/typescript/v5/modules/rolesOf): Calls the "rolesOf" function on the contract. -* [transferOwnership](https://portal.thirdweb.com/references/typescript/v5/modules/transferOwnership): Prepares a transaction to call the "transferOwnership" function on the contract. -* [uninstallModule](https://portal.thirdweb.com/references/typescript/v5/modules/uninstallModule): Prepares a transaction to call the "uninstallModule" function on the contract. -* [encodeMintParams](https://portal.thirdweb.com/references/typescript/v5/modules/encodeMintParams): Encodes the parameters for the "encodeBytesBeforeMintERC20" function. -* [encodeMintParams](https://portal.thirdweb.com/references/typescript/v5/modules/encodeMintParams-2): Encodes the parameters for the "encodeBytesBeforeMintERC20" function. -* [encodeMintParams](https://portal.thirdweb.com/references/typescript/v5/modules/encodeMintParams-3): Encodes the parameters for the "encodeBytesBeforeMintERC721" function. +* [MODULES.cancelOwnershipHandover](https://portal.thirdweb.com/references/typescript/v5/modules/cancelOwnershipHandover): Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. +* [MODULES.completeOwnershipHandover](https://portal.thirdweb.com/references/typescript/v5/modules/completeOwnershipHandover): Prepares a transaction to call the "completeOwnershipHandover" function on the contract. +* [MODULES.getInstalledModules](https://portal.thirdweb.com/references/typescript/v5/modules/getInstalledModules): Calls the "getInstalledModules" function on the contract. +* [MODULES.getModuleConfig](https://portal.thirdweb.com/references/typescript/v5/modules/getModuleConfig): Calls the "getModuleConfig" function on the contract. +* [MODULES.getSupportedCallbackFunctions](https://portal.thirdweb.com/references/typescript/v5/modules/getSupportedCallbackFunctions): Calls the "getSupportedCallbackFunctions" function on the contract. +* [MODULES.grantRoles](https://portal.thirdweb.com/references/typescript/v5/modules/grantRoles): Prepares a transaction to call the "grantRoles" function on the contract. +* [MODULES.hasAllRoles](https://portal.thirdweb.com/references/typescript/v5/modules/hasAllRoles): Calls the "hasAllRoles" function on the contract. +* [MODULES.hasAnyRole](https://portal.thirdweb.com/references/typescript/v5/modules/hasAnyRole): Calls the "hasAnyRole" function on the contract. +* [MODULES.installModule](https://portal.thirdweb.com/references/typescript/v5/modules/installModule): Prepares a transaction to call the "installModule" function on the contract. +* [MODULES.isGetInstalledModulesSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isGetInstalledModulesSupported): Checks if the `getInstalledModules` method is supported by the given contract. +* [MODULES.isGetModuleConfigSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isGetModuleConfigSupported): Checks if the `getModuleConfig` method is supported by the given contract. +* [MODULES.isGetSupportedCallbackFunctionsSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isGetSupportedCallbackFunctionsSupported): Checks if the `getSupportedCallbackFunctions` method is supported by the given contract. +* [MODULES.isInstallModuleSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isInstallModuleSupported): Checks if the `installModule` method is supported by the given contract. +* [MODULES.isUninstallModuleSupported](https://portal.thirdweb.com/references/typescript/v5/modules/isUninstallModuleSupported): Checks if the `uninstallModule` method is supported by the given contract. +* [MODULES.moduleInstalledEvent](https://portal.thirdweb.com/references/typescript/v5/modules/moduleInstalledEvent): Creates an event object for the ModuleInstalled event. +* [MODULES.owner](https://portal.thirdweb.com/references/typescript/v5/modules/owner): Calls the "owner" function on the contract. +* [MODULES.ownershipHandoverExpiresAt](https://portal.thirdweb.com/references/typescript/v5/modules/ownershipHandoverExpiresAt): Calls the "ownershipHandoverExpiresAt" function on the contract. +* [MODULES.renounceOwnership](https://portal.thirdweb.com/references/typescript/v5/modules/renounceOwnership): Prepares a transaction to call the "renounceOwnership" function on the contract. +* [MODULES.renounceRoles](https://portal.thirdweb.com/references/typescript/v5/modules/renounceRoles): Prepares a transaction to call the "renounceRoles" function on the contract. +* [MODULES.requestOwnershipHandover](https://portal.thirdweb.com/references/typescript/v5/modules/requestOwnershipHandover): Prepares a transaction to call the "requestOwnershipHandover" function on the contract. +* [MODULES.revokeRoles](https://portal.thirdweb.com/references/typescript/v5/modules/revokeRoles): Prepares a transaction to call the "revokeRoles" function on the contract. +* [MODULES.rolesOf](https://portal.thirdweb.com/references/typescript/v5/modules/rolesOf): Calls the "rolesOf" function on the contract. +* [MODULES.transferOwnership](https://portal.thirdweb.com/references/typescript/v5/modules/transferOwnership): Prepares a transaction to call the "transferOwnership" function on the contract. +* [MODULES.uninstallModule](https://portal.thirdweb.com/references/typescript/v5/modules/uninstallModule): Prepares a transaction to call the "uninstallModule" function on the contract. +* [MODULES.encodeMintParams](https://portal.thirdweb.com/references/typescript/v5/modules/encodeMintParams): Encodes the parameters for the "encodeBytesBeforeMintERC20" function. +* [MODULES.encodeMintParams](https://portal.thirdweb.com/references/typescript/v5/modules/encodeMintParams-2): Encodes the parameters for the "encodeBytesBeforeMintERC20" function. +* [MODULES.encodeMintParams](https://portal.thirdweb.com/references/typescript/v5/modules/encodeMintParams-3): Encodes the parameters for the "encodeBytesBeforeMintERC721" function. --- ## EIP5792 -* [getCallsStatus](https://portal.thirdweb.com/references/typescript/v5/eip5792/getCallsStatus): Get the status of an [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle. -* [getCapabilities](https://portal.thirdweb.com/references/typescript/v5/eip5792/getCapabilities): Get the capabilities of a wallet based on the [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) specification. -* [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. -* [waitForBundle](https://portal.thirdweb.com/references/typescript/v5/eip5792/waitForBundle): Waits for the [ EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle to be confirmed. +* [EIP5792.getCallsStatus](https://portal.thirdweb.com/references/typescript/v5/eip5792/getCallsStatus): Get the status of an [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle. +* [EIP5792.getCapabilities](https://portal.thirdweb.com/references/typescript/v5/eip5792/getCapabilities): Get the capabilities of a wallet based on the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) specification. +* [EIP5792.sendAndConfirmCalls](https://portal.thirdweb.com/references/typescript/v5/eip5792/sendAndConfirmCalls): Send and confirm calls in a single transaction. +* [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. --- # Modules --- -## Common -* [checkModulesCompatibility](https://portal.thirdweb.com/references/typescript/v5/common/checkModulesCompatibility): Check if the given modules are compatible with the given core contract -* [deployModularContract](https://portal.thirdweb.com/references/typescript/v5/common/deployModularContract): Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well. -* [getDeployedModule](https://portal.thirdweb.com/references/typescript/v5/common/getDeployedModule): Gets a deployed module implementation contract. -* [getOrDeployModule](https://portal.thirdweb.com/references/typescript/v5/common/getOrDeployModule): Gets or deploys a module implementation contract. -* [grantMinterRole](https://portal.thirdweb.com/references/typescript/v5/common/grantMinterRole): Grants the minter role to a user. -* [installPublishedModule](https://portal.thirdweb.com/references/typescript/v5/common/installPublishedModule): Install a published module on a modular contract -* [uninstallModuleByProxy](https://portal.thirdweb.com/references/typescript/v5/common/uninstallModuleByProxy): Uninstall an module by proxy -* [uninstallPublishedModule](https://portal.thirdweb.com/references/typescript/v5/common/uninstallPublishedModule): Uninstall a published module ---- ## BatchMetadataERC1155 -* [batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/encodeInstall): Encodes the install data for the BatchMetadataERC1155 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/install): Installs the BatchMetadataERC1155 module on a core contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/module): Convenience function to add the BatchMetadataERC1155 module as a default module on a core contract. -* [uploadMetadata](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/uploadMetadata): Uploads metadata for a batch of NFTs. +* [BatchMetadataERC1155.batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. +* [BatchMetadataERC1155.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/encodeInstall): Encodes the install data for the BatchMetadataERC1155 module. +* [BatchMetadataERC1155.install](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/install): Installs the BatchMetadataERC1155 module on a core contract. +* [BatchMetadataERC1155.module](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/module): Convenience function to add the BatchMetadataERC1155 module as a default module on a core contract. +* [BatchMetadataERC1155.uploadMetadata](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc1155/uploadMetadata): Uploads metadata for a batch of NFTs. --- ## BatchMetadataERC721 -* [batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/encodeInstall): Encodes the install data for the BatchMetadataERC721 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/install): Installs the BatchMetadataERC721 module on a core contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/module): Convenience function to add the BatchMetadataERC721 module as a default module on a core contract. -* [uploadMetadata](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/uploadMetadata): Uploads metadata for a batch of NFTs. +* [BatchMetadataERC721.batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. +* [BatchMetadataERC721.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/encodeInstall): Encodes the install data for the BatchMetadataERC721 module. +* [BatchMetadataERC721.install](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/install): Installs the BatchMetadataERC721 module on a core contract. +* [BatchMetadataERC721.module](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/module): Convenience function to add the BatchMetadataERC721 module as a default module on a core contract. +* [BatchMetadataERC721.uploadMetadata](https://portal.thirdweb.com/references/typescript/v5/batchmetadataerc721/uploadMetadata): Uploads metadata for a batch of NFTs. --- ## ClaimableERC1155 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/encodeInstall): Encodes the install data for the ClaimableERC1155 module. -* [getClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/getClaimCondition): Calls the "getClaimConditionByTokenId" function on the contract. -* [getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/getSaleConfig): Calls the "getSaleConfig" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/install): Installs the ClaimableERC1155 module on a core contract. -* [mint](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/mint): Mints ERC1155 tokens to a specified address via a ClaimableERC1155 module. -* [module](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/module): Convenience function to add the ClaimableERC1155 module as a default module on a core contract. -* [setClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/setClaimCondition): Sets the claim conditions for a given token ID. -* [setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. +* [ClaimableERC1155.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/encodeInstall): Encodes the install data for the ClaimableERC1155 module. +* [ClaimableERC1155.getClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/getClaimCondition): Calls the "getClaimConditionByTokenId" function on the contract. +* [ClaimableERC1155.getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/getSaleConfig): Calls the "getSaleConfig" function on the contract. +* [ClaimableERC1155.install](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/install): Installs the ClaimableERC1155 module on a core contract. +* [ClaimableERC1155.mint](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/mint): Mints ERC1155 tokens to a specified address via a ClaimableERC1155 module. +* [ClaimableERC1155.module](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/module): Convenience function to add the ClaimableERC1155 module as a default module on a core contract. +* [ClaimableERC1155.setClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/setClaimCondition): Sets the claim conditions for a given token ID. +* [ClaimableERC1155.setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc1155/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. --- ## ClaimableERC20 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/encodeInstall): Encodes the install data for the ClaimableERC20 module. -* [getClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/getClaimCondition): Calls the "getClaimCondition" function on the contract. -* [getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/getSaleConfig): Calls the "getSaleConfig" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/install): Installs the ClaimableERC20 module on a core contract. -* [mint](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/mint): Mints tokens to a specified address via a ClaimableERC20 module. -* [module](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/module): Convenience function to add the ClaimableERC20 module as a default module on a core contract. -* [setClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/setClaimCondition): Sets the claim conditions for a given token ID. -* [setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. +* [ClaimableERC20.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/encodeInstall): Encodes the install data for the ClaimableERC20 module. +* [ClaimableERC20.getClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/getClaimCondition): Calls the "getClaimCondition" function on the contract. +* [ClaimableERC20.getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/getSaleConfig): Calls the "getSaleConfig" function on the contract. +* [ClaimableERC20.install](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/install): Installs the ClaimableERC20 module on a core contract. +* [ClaimableERC20.mint](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/mint): Mints tokens to a specified address via a ClaimableERC20 module. +* [ClaimableERC20.module](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/module): Convenience function to add the ClaimableERC20 module as a default module on a core contract. +* [ClaimableERC20.setClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/setClaimCondition): Sets the claim conditions for a given token ID. +* [ClaimableERC20.setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc20/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. --- ## ClaimableERC721 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/encodeInstall): Encodes the install data for the ClaimableERC721 module. -* [getClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/getClaimCondition): Calls the "getClaimCondition" function on the contract. -* [getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/getSaleConfig): Calls the "getSaleConfig" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/install): Installs the ClaimableERC721 module on a core contract. -* [mint](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/mint): Mints ERC721 tokens to a specified address via a ClaimableERC721 module. -* [module](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/module): Convenience function to add the ClaimableERC721 module as a default module on a core contract. -* [setClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/setClaimCondition): Sets the claim conditions for a given token ID. -* [setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. +* [ClaimableERC721.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/encodeInstall): Encodes the install data for the ClaimableERC721 module. +* [ClaimableERC721.getClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/getClaimCondition): Calls the "getClaimCondition" function on the contract. +* [ClaimableERC721.getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/getSaleConfig): Calls the "getSaleConfig" function on the contract. +* [ClaimableERC721.install](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/install): Installs the ClaimableERC721 module on a core contract. +* [ClaimableERC721.mint](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/mint): Mints ERC721 tokens to a specified address via a ClaimableERC721 module. +* [ClaimableERC721.module](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/module): Convenience function to add the ClaimableERC721 module as a default module on a core contract. +* [ClaimableERC721.setClaimCondition](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/setClaimCondition): Sets the claim conditions for a given token ID. +* [ClaimableERC721.setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/claimableerc721/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. --- ## MintableERC1155 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/encodeInstall): Encodes the install data for the MintableERC1155 module. -* [generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/generateMintSignature): Generates a payload and signature for minting ERC1155 tokens with a signature. -* [getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/getSaleConfig): Calls the "getSaleConfig" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/install): Installs the MintableERC1155 module on a core contract. -* [mintWithRole](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/mintWithRole): Mints ERC1155 tokens to a specified address via a MintableERC1155 module. -* [mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/mintWithSignature): Mints ERC1155 tokens to a specified address with a signature via a MintableERC1155 module. -* [module](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/module): Convenience function to add the MintableERC1155 module as a default module on a core contract. -* [setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. +* [MintableERC1155.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/encodeInstall): Encodes the install data for the MintableERC1155 module. +* [MintableERC1155.generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/generateMintSignature): Generates a payload and signature for minting ERC1155 tokens with a signature. +* [MintableERC1155.getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/getSaleConfig): Calls the "getSaleConfig" function on the contract. +* [MintableERC1155.install](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/install): Installs the MintableERC1155 module on a core contract. +* [MintableERC1155.mintWithRole](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/mintWithRole): Mints ERC1155 tokens to a specified address via a MintableERC1155 module. +* [MintableERC1155.mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/mintWithSignature): Mints ERC1155 tokens to a specified address with a signature via a MintableERC1155 module. +* [MintableERC1155.module](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/module): Convenience function to add the MintableERC1155 module as a default module on a core contract. +* [MintableERC1155.setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc1155/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. --- ## MintableERC20 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/encodeInstall): Encodes the install data for the MintableERC20 module. -* [generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/generateMintSignature): Generates a mint signature for a given mint request to be used with a MintableERC20 module. -* [getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/getSaleConfig): Calls the "getSaleConfig" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/install): Installs the MintableERC20 module on a core contract. -* [mintWithRole](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/mintWithRole): Mints ERC20 tokens to a specified address via a MintableERC20 module. -* [mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/mintWithSignature): Mints ERC20 tokens to a specified address with a signature via a MintableERC20 module. -* [module](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/module): Convenience function to add the MintableERC20 module as a default module on a core contract. -* [setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. +* [MintableERC20.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/encodeInstall): Encodes the install data for the MintableERC20 module. +* [MintableERC20.generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/generateMintSignature): Generates a mint signature for a given mint request to be used with a MintableERC20 module. +* [MintableERC20.getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/getSaleConfig): Calls the "getSaleConfig" function on the contract. +* [MintableERC20.install](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/install): Installs the MintableERC20 module on a core contract. +* [MintableERC20.mintWithRole](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/mintWithRole): Mints ERC20 tokens to a specified address via a MintableERC20 module. +* [MintableERC20.mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/mintWithSignature): Mints ERC20 tokens to a specified address with a signature via a MintableERC20 module. +* [MintableERC20.module](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/module): Convenience function to add the MintableERC20 module as a default module on a core contract. +* [MintableERC20.setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc20/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. --- ## MintableERC721 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/encodeInstall): Encodes the install data for the MintableERC721 module. -* [generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/generateMintSignature): Generates a payload and signature for minting ERC721 tokens via a MintableERC721 module. -* [getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/getSaleConfig): Calls the "getSaleConfig" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/install): Installs the MintableERC721 module on a core contract. -* [mintWithRole](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/mintWithRole): Mints ERC721 tokens to a specified address via a MintableERC721 module. -* [mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/mintWithSignature): Mints ERC721 tokens to a specified address with a signature via a MintableERC721 module. -* [module](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/module): Convenience function to add the MintableERC721 module as a default module on a core contract. -* [setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. +* [MintableERC721.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/encodeInstall): Encodes the install data for the MintableERC721 module. +* [MintableERC721.generateMintSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/generateMintSignature): Generates a payload and signature for minting ERC721 tokens via a MintableERC721 module. +* [MintableERC721.getSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/getSaleConfig): Calls the "getSaleConfig" function on the contract. +* [MintableERC721.install](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/install): Installs the MintableERC721 module on a core contract. +* [MintableERC721.mintWithRole](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/mintWithRole): Mints ERC721 tokens to a specified address via a MintableERC721 module. +* [MintableERC721.mintWithSignature](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/mintWithSignature): Mints ERC721 tokens to a specified address with a signature via a MintableERC721 module. +* [MintableERC721.module](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/module): Convenience function to add the MintableERC721 module as a default module on a core contract. +* [MintableERC721.setSaleConfig](https://portal.thirdweb.com/references/typescript/v5/mintableerc721/setSaleConfig): Prepares a transaction to call the "setSaleConfig" function on the contract. --- ## OpenEditionMetadataERC721 -* [batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/encodeInstall): Encodes the install data for the OpenEditionMetadataERC721 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/install): Installs the OpenEditionMetadataERC721 module on a core contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/module): Convenience function to add the OpenEditionMetadataERC721 module as a default module on a core contract. -* [setSharedMetadata](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/setSharedMetadata): Prepares a transaction to call the "setSharedMetadata" function on the contract. -* [sharedMetadataUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/sharedMetadataUpdatedEvent): Creates an event object for the SharedMetadataUpdated event. +* [OpenEditionMetadataERC721.batchMetadataUpdateEvent](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/batchMetadataUpdateEvent): Creates an event object for the BatchMetadataUpdate event. +* [OpenEditionMetadataERC721.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/encodeInstall): Encodes the install data for the OpenEditionMetadataERC721 module. +* [OpenEditionMetadataERC721.install](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/install): Installs the OpenEditionMetadataERC721 module on a core contract. +* [OpenEditionMetadataERC721.module](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/module): Convenience function to add the OpenEditionMetadataERC721 module as a default module on a core contract. +* [OpenEditionMetadataERC721.setSharedMetadata](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/setSharedMetadata): Prepares a transaction to call the "setSharedMetadata" function on the contract. +* [OpenEditionMetadataERC721.sharedMetadataUpdatedEvent](https://portal.thirdweb.com/references/typescript/v5/openeditionmetadataerc721/sharedMetadataUpdatedEvent): Creates an event object for the SharedMetadataUpdated event. --- ## RoyaltyERC1155 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/encodeInstall): Encodes the install data for the RoyaltyERC1155 module. -* [getDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getDefaultRoyaltyInfo): Calls the "getDefaultRoyaltyInfo" function on the contract. -* [getRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getRoyaltyInfoForToken): Calls the "getRoyaltyInfoForToken" function on the contract. -* [getTransferValidationFunction](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getTransferValidationFunction): Calls the "getTransferValidationFunction" function on the contract. -* [getTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getTransferValidator): Calls the "getTransferValidator" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/install): Installs the RoyaltyERC1155 module on a core contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/module): Convenience function to add the RoyaltyERC1155 module as a default module on a core contract. -* [royaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/royaltyInfo): Calls the "royaltyInfo" function on the contract. -* [setDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/setDefaultRoyaltyInfo): Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. -* [setRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/setRoyaltyInfoForToken): Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. -* [setTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/setTransferValidator): Prepares a transaction to call the "setTransferValidator" function on the contract. +* [RoyaltyERC1155.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/encodeInstall): Encodes the install data for the RoyaltyERC1155 module. +* [RoyaltyERC1155.getDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getDefaultRoyaltyInfo): Calls the "getDefaultRoyaltyInfo" function on the contract. +* [RoyaltyERC1155.getRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getRoyaltyInfoForToken): Calls the "getRoyaltyInfoForToken" function on the contract. +* [RoyaltyERC1155.getTransferValidationFunction](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getTransferValidationFunction): Calls the "getTransferValidationFunction" function on the contract. +* [RoyaltyERC1155.getTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/getTransferValidator): Calls the "getTransferValidator" function on the contract. +* [RoyaltyERC1155.install](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/install): Installs the RoyaltyERC1155 module on a core contract. +* [RoyaltyERC1155.module](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/module): Convenience function to add the RoyaltyERC1155 module as a default module on a core contract. +* [RoyaltyERC1155.royaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/royaltyInfo): Calls the "royaltyInfo" function on the contract. +* [RoyaltyERC1155.setDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/setDefaultRoyaltyInfo): Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. +* [RoyaltyERC1155.setRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/setRoyaltyInfoForToken): Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. +* [RoyaltyERC1155.setTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc1155/setTransferValidator): Prepares a transaction to call the "setTransferValidator" function on the contract. --- ## RoyaltyERC721 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/encodeInstall): Encodes the install data for the RoyaltyERC721 module. -* [getDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getDefaultRoyaltyInfo): Calls the "getDefaultRoyaltyInfo" function on the contract. -* [getRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getRoyaltyInfoForToken): Calls the "getRoyaltyInfoForToken" function on the contract. -* [getTransferValidationFunction](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getTransferValidationFunction): Calls the "getTransferValidationFunction" function on the contract. -* [getTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getTransferValidator): Calls the "getTransferValidator" function on the contract. -* [install](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/install): Installs the RoyaltyERC721 module on a core contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/module): Convenience function to add the RoyaltyERC721 module as a default module on a core contract. -* [royaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/royaltyInfo): Calls the "royaltyInfo" function on the contract. -* [setDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/setDefaultRoyaltyInfo): Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. -* [setRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/setRoyaltyInfoForToken): Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. -* [setTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/setTransferValidator): Prepares a transaction to call the "setTransferValidator" function on the contract. +* [RoyaltyERC721.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/encodeInstall): Encodes the install data for the RoyaltyERC721 module. +* [RoyaltyERC721.getDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getDefaultRoyaltyInfo): Calls the "getDefaultRoyaltyInfo" function on the contract. +* [RoyaltyERC721.getRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getRoyaltyInfoForToken): Calls the "getRoyaltyInfoForToken" function on the contract. +* [RoyaltyERC721.getTransferValidationFunction](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getTransferValidationFunction): Calls the "getTransferValidationFunction" function on the contract. +* [RoyaltyERC721.getTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/getTransferValidator): Calls the "getTransferValidator" function on the contract. +* [RoyaltyERC721.install](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/install): Installs the RoyaltyERC721 module on a core contract. +* [RoyaltyERC721.module](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/module): Convenience function to add the RoyaltyERC721 module as a default module on a core contract. +* [RoyaltyERC721.royaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/royaltyInfo): Calls the "royaltyInfo" function on the contract. +* [RoyaltyERC721.setDefaultRoyaltyInfo](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/setDefaultRoyaltyInfo): Prepares a transaction to call the "setDefaultRoyaltyInfo" function on the contract. +* [RoyaltyERC721.setRoyaltyInfoForToken](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/setRoyaltyInfoForToken): Prepares a transaction to call the "setRoyaltyInfoForToken" function on the contract. +* [RoyaltyERC721.setTransferValidator](https://portal.thirdweb.com/references/typescript/v5/royaltyerc721/setTransferValidator): Prepares a transaction to call the "setTransferValidator" function on the contract. --- ## SequentialTokenIdERC1155 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/sequentialtokeniderc1155/encodeInstall): Encodes the install data for the SequentialTokenIdERC1155 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/sequentialtokeniderc1155/install): Installs the SequentialTokenIdERC1155 module on a core contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/sequentialtokeniderc1155/module): Convenience function to add the SequentialTokenIdERC1155 module as a default module on a core contract. +* [SequentialTokenIdERC1155.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/sequentialtokeniderc1155/encodeInstall): Encodes the install data for the SequentialTokenIdERC1155 module. +* [SequentialTokenIdERC1155.install](https://portal.thirdweb.com/references/typescript/v5/sequentialtokeniderc1155/install): Installs the SequentialTokenIdERC1155 module on a core contract. +* [SequentialTokenIdERC1155.module](https://portal.thirdweb.com/references/typescript/v5/sequentialtokeniderc1155/module): Convenience function to add the SequentialTokenIdERC1155 module as a default module on a core contract. --- ## TransferableERC1155 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/encodeInstall): Encodes the install data for the TransferableERC1155 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/install): Installs the TransferableERC1155 module on a core contract. -* [isTransferEnabled](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/isTransferEnabled): Calls the "isTransferEnabled" function on the contract. -* [isTransferEnabledFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/isTransferEnabledFor): Calls the "isTransferEnabledFor" function on the contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/module): Convenience function to add the TransferableERC1155 module as a default module on a core contract. -* [setTransferable](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/setTransferable): Prepares a transaction to call the "setTransferable" function on the contract. -* [setTransferableFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/setTransferableFor): Prepares a transaction to call the "setTransferableFor" function on the contract. +* [TransferableERC1155.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/encodeInstall): Encodes the install data for the TransferableERC1155 module. +* [TransferableERC1155.install](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/install): Installs the TransferableERC1155 module on a core contract. +* [TransferableERC1155.isTransferEnabled](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/isTransferEnabled): Calls the "isTransferEnabled" function on the contract. +* [TransferableERC1155.isTransferEnabledFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/isTransferEnabledFor): Calls the "isTransferEnabledFor" function on the contract. +* [TransferableERC1155.module](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/module): Convenience function to add the TransferableERC1155 module as a default module on a core contract. +* [TransferableERC1155.setTransferable](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/setTransferable): Prepares a transaction to call the "setTransferable" function on the contract. +* [TransferableERC1155.setTransferableFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc1155/setTransferableFor): Prepares a transaction to call the "setTransferableFor" function on the contract. --- ## TransferableERC20 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/encodeInstall): Encodes the install data for the TransferableERC20 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/install): Installs the TransferableERC20 module on a core contract. -* [isTransferEnabled](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/isTransferEnabled): Calls the "isTransferEnabled" function on the contract. -* [isTransferEnabledFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/isTransferEnabledFor): Calls the "isTransferEnabledFor" function on the contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/module): Convenience function to add the TransferableERC20 module as a default module on a core contract. -* [setTransferable](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/setTransferable): Prepares a transaction to call the "setTransferable" function on the contract. -* [setTransferableFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/setTransferableFor): Prepares a transaction to call the "setTransferableFor" function on the contract. +* [TransferableERC20.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/encodeInstall): Encodes the install data for the TransferableERC20 module. +* [TransferableERC20.install](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/install): Installs the TransferableERC20 module on a core contract. +* [TransferableERC20.isTransferEnabled](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/isTransferEnabled): Calls the "isTransferEnabled" function on the contract. +* [TransferableERC20.isTransferEnabledFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/isTransferEnabledFor): Calls the "isTransferEnabledFor" function on the contract. +* [TransferableERC20.module](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/module): Convenience function to add the TransferableERC20 module as a default module on a core contract. +* [TransferableERC20.setTransferable](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/setTransferable): Prepares a transaction to call the "setTransferable" function on the contract. +* [TransferableERC20.setTransferableFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc20/setTransferableFor): Prepares a transaction to call the "setTransferableFor" function on the contract. --- ## TransferableERC721 -* [encodeInstall](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/encodeInstall): Encodes the install data for the TransferableERC721 module. -* [install](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/install): Installs the TransferableERC721 module on a core contract. -* [isTransferEnabled](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/isTransferEnabled): Calls the "isTransferEnabled" function on the contract. -* [isTransferEnabledFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/isTransferEnabledFor): Calls the "isTransferEnabledFor" function on the contract. -* [module](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/module): Convenience function to add the TransferableERC721 module as a default module on a core contract. -* [setTransferable](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/setTransferable): Prepares a transaction to call the "setTransferable" function on the contract. -* [setTransferableFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/setTransferableFor): Prepares a transaction to call the "setTransferableFor" function on the contract. +* [TransferableERC721.encodeInstall](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/encodeInstall): Encodes the install data for the TransferableERC721 module. +* [TransferableERC721.install](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/install): Installs the TransferableERC721 module on a core contract. +* [TransferableERC721.isTransferEnabled](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/isTransferEnabled): Calls the "isTransferEnabled" function on the contract. +* [TransferableERC721.isTransferEnabledFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/isTransferEnabledFor): Calls the "isTransferEnabledFor" function on the contract. +* [TransferableERC721.module](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/module): Convenience function to add the TransferableERC721 module as a default module on a core contract. +* [TransferableERC721.setTransferable](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/setTransferable): Prepares a transaction to call the "setTransferable" function on the contract. +* [TransferableERC721.setTransferableFor](https://portal.thirdweb.com/references/typescript/v5/transferableerc721/setTransferableFor): Prepares a transaction to call the "setTransferableFor" function on the contract. +--- +# Universal Bridge +--- +## Buy +* [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. +--- +## 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. --- # Client * [createThirdwebClient](https://portal.thirdweb.com/references/typescript/v5/createThirdwebClient): Creates a Thirdweb client using the provided client ID (client-side) or secret key (server-side). @@ -976,7 +990,7 @@ * [AccountBalance](https://portal.thirdweb.com/references/typescript/v5/AccountBalance): This component fetches and shows the balance of the wallet address on a given chain. It inherits all the attributes of a HTML `` component, hence you can style it just like how you would style a normal `` * [AccountName](https://portal.thirdweb.com/references/typescript/v5/AccountName): This component is used to display the name of the account. A "name" in this context is the username, or account of the social profiles that the wallet may have. In case a name is not found or failed to resolve, you can always fallback to displaying the wallet address instead by using the `fallbackComponent` prop. * [WalletIcon](https://portal.thirdweb.com/references/typescript/v5/WalletIcon): This component tries to resolve the icon of a given wallet, then return an image. -* [deploySmartAccount](https://portal.thirdweb.com/references/typescript/v5/deploySmartAccount): Deployes a smart account via a dummy transaction. +* [deploySmartAccount](https://portal.thirdweb.com/references/typescript/v5/deploySmartAccount): Deployes a smart account via a dummy transaction. If the account is already deployed, this will do nothing. * [getUser](https://portal.thirdweb.com/references/typescript/v5/getUser): Gets user based on the provided query parameters. This function is only available on the server (a secret key is required in the client). * [authenticate](https://portal.thirdweb.com/references/typescript/v5/authenticate): Authenticates the user based on the provided authentication arguments. * [authenticateWithRedirect](https://portal.thirdweb.com/references/typescript/v5/authenticateWithRedirect): Authenticates the user based on the provided authentication arguments using a redirect. @@ -985,37 +999,43 @@ * [createWalletConnectClient](https://portal.thirdweb.com/references/typescript/v5/createWalletConnectClient): Creates a new WalletConnect client for interacting with another application. * [createWalletConnectSession](https://portal.thirdweb.com/references/typescript/v5/createWalletConnectSession): Initiates a new WalletConnect session for interacting with another application. * [disconnectWalletConnectSession](https://portal.thirdweb.com/references/typescript/v5/disconnectWalletConnectSession): Disconnects a WalletConnect session. -* [ecosystemWallet](https://portal.thirdweb.com/references/typescript/v5/ecosystemWallet): Creates an [ Ecosystem Wallet](https://portal.thirdweb.com/connect/wallet/overview) based on various authentication methods. Full list of available authentication methods [ here](/connect/wallet/sign-in-methods/configure) . +* [ecosystemWallet](https://portal.thirdweb.com/references/typescript/v5/ecosystemWallet): Creates an [Ecosystem Wallet](https://portal.thirdweb.com/connect/wallet/overview) based on various authentication methods. Full list of available authentication methods [here](/connect/wallet/sign-in-methods/configure). * [getActiveWalletConnectSessions](https://portal.thirdweb.com/references/typescript/v5/getActiveWalletConnectSessions): Retrieves all active WalletConnect sessions. * [getProfiles](https://portal.thirdweb.com/references/typescript/v5/getProfiles): Gets the linked profiles for the connected in-app or ecosystem wallet. * [getUserEmail](https://portal.thirdweb.com/references/typescript/v5/getUserEmail): Retrieves the authenticated user email for the active in-app wallet. * [getUserPhoneNumber](https://portal.thirdweb.com/references/typescript/v5/getUserPhoneNumber): Retrieves the authenticated user phone number for the active embedded wallet. -* [inAppWallet](https://portal.thirdweb.com/references/typescript/v5/inAppWallet): Creates an app scoped wallet for users based on various authentication methods. Full list of available authentication methods [ here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure) . +* [inAppWallet](https://portal.thirdweb.com/references/typescript/v5/inAppWallet): Creates an app scoped wallet for users based on various authentication methods. Full list of available authentication methods [here](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure). * [linkProfile](https://portal.thirdweb.com/references/typescript/v5/linkProfile): Connects a new profile (and new authentication method) to the current user. * [preAuthenticate](https://portal.thirdweb.com/references/typescript/v5/preAuthenticate): Pre-authenticates the user based on the provided authentication strategy. Use this function to send a verification code to the user's email or phone number. * [privateKeyToAccount](https://portal.thirdweb.com/references/typescript/v5/privateKeyToAccount): Get an `Account` object from a private key. * [smartWallet](https://portal.thirdweb.com/references/typescript/v5/smartWallet): Creates a ERC4337 smart wallet based on a admin account. * [unlinkProfile](https://portal.thirdweb.com/references/typescript/v5/unlinkProfile): Disconnects an existing profile (authentication method) from the current user. Once disconnected, that profile can no longer be used to sign into the account. * [walletConnect](https://portal.thirdweb.com/references/typescript/v5/walletConnect): Creates a wallet that allows connecting to any wallet that supports the WalletConnect protocol. -* [engineAccount](https://portal.thirdweb.com/references/typescript/v5/engineAccount): Creates an account that uses your engine backend wallet for sending transactions and signing messages. -* [erc7579](https://portal.thirdweb.com/references/typescript/v5/erc7579): Config for a ERC7579 modular smart wallet. +* [engineAccount](https://portal.thirdweb.com/references/typescript/v5/engineAccount): This for v2 dedicated engine instances, for v3 and engine cloud use Engine.serverWallet() +* [ERC7579.erc7579](https://portal.thirdweb.com/references/typescript/v5/erc7579): Config for a ERC7579 modular smart wallet. +--- +# Wallet Connection +* [AutoConnect](https://portal.thirdweb.com/references/typescript/v5/autoConnect): AutoConnect last connected wallet on page reload or revisit. Note: If you are using `ConnectButton` or `ConnectEmbed` components, You don't need to use this component as it is already included. --- # Wallet Utilities * [generateAccount](https://portal.thirdweb.com/references/typescript/v5/generateAccount): Generates a new account with a random private key. * [getWalletBalance](https://portal.thirdweb.com/references/typescript/v5/getWalletBalance): Retrieves the balance of a token or native currency for a given wallet. -* [injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider): Get Injected Provider for given wallet by passing a wallet ID (rdns) using [ EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) Provider Discovery. +* [injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider): Get Injected Provider for given wallet by passing a wallet ID (rdns) using [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) Provider Discovery. * [getSocialIcon](https://portal.thirdweb.com/references/typescript/v5/getSocialIcon): Gets the icon URI for a given social authentication provider * [hasStoredPasskey](https://portal.thirdweb.com/references/typescript/v5/hasStoredPasskey): Returns whether this device has a stored passkey ready to be used for sign-in * [bundleUserOp](https://portal.thirdweb.com/references/typescript/v5/bundleUserOp): Bundle a user operation. * [createAndSignUserOp](https://portal.thirdweb.com/references/typescript/v5/createAndSignUserOp): Create and sign a user operation. * [createUnsignedUserOp](https://portal.thirdweb.com/references/typescript/v5/createUnsignedUserOp): Creates an unsigned user operation from a prepared transaction. * [estimateUserOpGas](https://portal.thirdweb.com/references/typescript/v5/estimateUserOpGas): Estimate the gas cost of a user operation. +* [estimateUserOpGasCost](https://portal.thirdweb.com/references/typescript/v5/estimateUserOpGasCost): Estimate the gas cost of a user operation. * [getPaymasterAndData](https://portal.thirdweb.com/references/typescript/v5/getPaymasterAndData): Get paymaster and data details for a user operation. * [getUserOpGasFees](https://portal.thirdweb.com/references/typescript/v5/getUserOpGasFees): Get the gas fees of a user operation. +* [getUserOpHash](https://portal.thirdweb.com/references/typescript/v5/getUserOpHash): Get the hash of a user operation. * [getUserOpReceipt](https://portal.thirdweb.com/references/typescript/v5/getUserOpReceipt): Get the receipt of a user operation. * [getUserOpReceiptRaw](https://portal.thirdweb.com/references/typescript/v5/getUserOpReceiptRaw): Get the receipt of a user operation. * [predictAddress](https://portal.thirdweb.com/references/typescript/v5/predictAddress): Use `predictSmartAccountAddress` instead. * [predictSmartAccountAddress](https://portal.thirdweb.com/references/typescript/v5/predictSmartAccountAddress): Predict the address of a smart account. +* [prepareUserOp](https://portal.thirdweb.com/references/typescript/v5/prepareUserOp): Prepare a user operation for signing. * [signUserOp](https://portal.thirdweb.com/references/typescript/v5/signUserOp): Sign a user operation. * [waitForUserOpReceipt](https://portal.thirdweb.com/references/typescript/v5/waitForUserOpReceipt): Wait for the user operation to be mined. --- @@ -1041,7 +1061,7 @@ * [verifyContract](https://portal.thirdweb.com/references/typescript/v5/verifyContract): Verifies a contract by performing the following steps: * [getInitializeTransaction](https://portal.thirdweb.com/references/typescript/v5/getInitializeTransaction): Prepares the initialization transaction for a contract deployment * [getOrDeployInfraForPublishedContract](https://portal.thirdweb.com/references/typescript/v5/getOrDeployInfraForPublishedContract): Gets or deploys the infrastructure contracts needed for a published contract deployment -* [getContractEvents](https://portal.thirdweb.com/references/typescript/v5/getContractEvents): Retrieves events from a contract based on the provided options. +* [getContractEvents](https://portal.thirdweb.com/references/typescript/v5/getContractEvents): Get contract events * [parseEventLogs](https://portal.thirdweb.com/references/typescript/v5/parseEventLogs): Parses logs and returns the corresponding events. * [prepareEvent](https://portal.thirdweb.com/references/typescript/v5/prepareEvent): Prepares an event by parsing the signature, generating the event hash, and encoding the event topics. * [watchContractEvents](https://portal.thirdweb.com/references/typescript/v5/watchContractEvents): Listens for contract events from the blockchain. @@ -1058,7 +1078,7 @@ * [estimateGasCost](https://portal.thirdweb.com/references/typescript/v5/estimateGasCost): Estimate the gas cost of a transaction in ether and wei. * [prepareContractCall](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall): Prepares a contract call by resolving the ABI function, parameters and encoded data. Optionally specify other properties such as value or gas price. * [prepareTransaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction): Prepares a transaction with the given options. -* [readContract](https://portal.thirdweb.com/references/typescript/v5/readContract): Use this for raw read calls from a contract, but you can also use read [ extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) for predefined methods for common standards. +* [readContract](https://portal.thirdweb.com/references/typescript/v5/readContract): Use this for raw read calls from a contract, but you can also use read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) for predefined methods for common standards. * [sendAndConfirmTransaction](https://portal.thirdweb.com/references/typescript/v5/sendAndConfirmTransaction): Sends a transaction using the provided wallet. * [sendBatchTransaction](https://portal.thirdweb.com/references/typescript/v5/sendBatchTransaction): Sends a batch transaction using the provided options. * [sendTransaction](https://portal.thirdweb.com/references/typescript/v5/sendTransaction): Sends a transaction using the provided account. @@ -1070,6 +1090,19 @@ * [waitForReceipt](https://portal.thirdweb.com/references/typescript/v5/waitForReceipt): Waits for the transaction receipt of a given transaction hash on a specific contract. * [getTransactionStore](https://portal.thirdweb.com/references/typescript/v5/getTransactionStore): Retrieve the transaction store for a given address. --- +# Insight +* [getContractEvents](https://portal.thirdweb.com/references/typescript/v5/getContractEvents-2): Get contract events +* [getContractNFTs](https://portal.thirdweb.com/references/typescript/v5/getContractNFTs): Get all NFTs from a contract +* [getNFT](https://portal.thirdweb.com/references/typescript/v5/getNFT): Get NFT metadata by contract address and token id +* [getOwnedNFTs](https://portal.thirdweb.com/references/typescript/v5/getOwnedNFTs): Get NFTs owned by an address +* [getOwnedTokens](https://portal.thirdweb.com/references/typescript/v5/getOwnedTokens): Get ERC20 tokens owned by an address +* [getTransactions](https://portal.thirdweb.com/references/typescript/v5/getTransactions): Get transactions for a wallet +--- +# Engine +* [getTransactionStatus](https://portal.thirdweb.com/references/typescript/v5/getTransactionStatus): Get the execution status of a transaction. +* [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. +--- # Nebula * [chat](https://portal.thirdweb.com/references/typescript/v5/chat): Chat with Nebula. * [execute](https://portal.thirdweb.com/references/typescript/v5/execute): Execute a transaction based on a prompt. @@ -1079,14 +1112,14 @@ --- # Auth * [createAuth](https://portal.thirdweb.com/references/typescript/v5/createAuth): Creates an authentication object with the given options. -* [isErc6492Signature](https://portal.thirdweb.com/references/typescript/v5/isErc6492Signature): The signature to check for ERC6492 compatibility -* [parseErc6492Signature](https://portal.thirdweb.com/references/typescript/v5/parseErc6492Signature): The signature to parse -* [serializeErc6492Signature](https://portal.thirdweb.com/references/typescript/v5/serializeErc6492Signature): The serialized signature +* [isErc6492Signature](https://portal.thirdweb.com/references/typescript/v5/isErc6492Signature): Determines if a signature is compatible with [ERC6492](https://eips.ethereum.org/EIPS/eip-6492) +* [parseErc6492Signature](https://portal.thirdweb.com/references/typescript/v5/parseErc6492Signature): Parses a serialized (Hex) [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492) signature. If the signature is not in ERC-6492 format, the original signature is returned. +* [serializeErc6492Signature](https://portal.thirdweb.com/references/typescript/v5/serializeErc6492Signature): Serializes a signature for use with [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492). The signature must be generated by a signer for an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Account Factory account with counterfactual deployment addresses. * [signLoginPayload](https://portal.thirdweb.com/references/typescript/v5/signLoginPayload): Signs the login payload using the provided account. -* [verifyContractWalletSignature](https://portal.thirdweb.com/references/typescript/v5/verifyContractWalletSignature): A boolean indicating whether the signature is valid. +* [verifyContractWalletSignature](https://portal.thirdweb.com/references/typescript/v5/verifyContractWalletSignature): Verifies a contract wallet signature using [ERC-6942](https://eips.ethereum.org/EIPS/eip-6942) Signature Validation for Predeploy Contracts. This function will validate signatures for both deployed and undeployed smart accounts of all signature types. * [verifyEOASignature](https://portal.thirdweb.com/references/typescript/v5/verifyEOASignature): Verifies the signature of a message using an Ethereum account's EOA (Externally Owned Account). -* [verifySignature](https://portal.thirdweb.com/references/typescript/v5/verifySignature): Verifies the signature based on the provided options. Handles smart contract wallet signatures and EOA signatures. _IMPORTANT: in order to check smart contract signatures, a chain and client must be provided. Or, you can use the `verifyContractWalletSignature` function directly if all signatures will be from smart accounts._ -* [verifyTypedData](https://portal.thirdweb.com/references/typescript/v5/verifyTypedData): A promise that resolves to `true` if the signature is valid, or `false` otherwise. +* [verifySignature](https://portal.thirdweb.com/references/typescript/v5/verifySignature): Verifies the signature based on the provided options. Handles smart contract wallet signatures and EOA signatures._IMPORTANT: in order to check smart contract signatures, a chain and client must be provided. Or, you can use the `verifyContractWalletSignature` function directly if all signatures will be from smart accounts._ +* [verifyTypedData](https://portal.thirdweb.com/references/typescript/v5/verifyTypedData): Verify am [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data signature. This function is interoperable with all wallet types (smart accounts or EOAs). * [decodeJWT](https://portal.thirdweb.com/references/typescript/v5/decodeJWT): Decodes a JSON Web Token (JWT) and returns the decoded payload and signature. * [encodeJWT](https://portal.thirdweb.com/references/typescript/v5/encodeJWT): Builds a JSON Web Token (JWT) using the provided options. * [refreshJWT](https://portal.thirdweb.com/references/typescript/v5/refreshJWT): Refreshes a JSON Web Token (JWT) by encoding a new payload with updated expiration time. @@ -1102,7 +1135,7 @@ * [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): Gets the status of a buy with crypto transaction +* [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. @@ -1116,7 +1149,7 @@ * [TokenSymbol](https://portal.thirdweb.com/references/typescript/v5/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 `` --- # Storage -* [download](https://portal.thirdweb.com/references/typescript/v5/download): Download a file from IPFS: +* [download](https://portal.thirdweb.com/references/typescript/v5/download): Downloads a file from the specified IPFS, Arweave, or HTTP URI. * [resolveArweaveScheme](https://portal.thirdweb.com/references/typescript/v5/resolveArweaveScheme): Resolves the scheme of a given Arweave URI and returns the corresponding URL. * [resolveScheme](https://portal.thirdweb.com/references/typescript/v5/resolveScheme): Resolves the scheme of a given URI and returns the corresponding URL. If the URI starts with "ipfs://", it constructs a URL using the IPFS client ID and the IPFS gateway. If the URI starts with "http", it returns the URI as is. Otherwise, it throws an error indicating an invalid URI scheme. * [unpin](https://portal.thirdweb.com/references/typescript/v5/unpin): Unpins a file from IPFS. For security purposes, this method requires a secret key to be set in the ThirdwebClient instance. @@ -1215,11 +1248,18 @@ * [stringify](https://portal.thirdweb.com/references/typescript/v5/stringify): Stringify a JSON object and convert all bigint values to string --- # Miscellaneous +* [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 * [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 * [isBytes](https://portal.thirdweb.com/references/typescript/v5/isBytes): Reference for isBytes * [isValidENSName](https://portal.thirdweb.com/references/typescript/v5/isValidENSName): Checks if a string is a valid ENS name. It does not check if the ENS name is currently registered or resolves to an address - it only validates the string format. +* [setServiceKey](https://portal.thirdweb.com/references/typescript/v5/setServiceKey): Reference for setServiceKey +* [setThirdwebDomains](https://portal.thirdweb.com/references/typescript/v5/setThirdwebDomains): Reference for setThirdwebDomains * [toEventSelector](https://portal.thirdweb.com/references/typescript/v5/toEventSelector): Returns the hash (of the function/event signature) for a given event or function definition. * [toFunctionSelector](https://portal.thirdweb.com/references/typescript/v5/toFunctionSelector): Reference for toFunctionSelector -* [AutoConnect](https://portal.thirdweb.com/references/typescript/v5/autoConnect): AutoConnect last connected wallet on page reload or revisit. Note: If you are using `ConnectButton` or `ConnectEmbed` components, You don't need to use this component as it is already included. +* [getInstalledWallets](https://portal.thirdweb.com/references/typescript/v5/getInstalledWallets): Get All currently installed wallets. Uses EIP-6963 to discover installed browser extension wallets. +* [randomPrivateKey](https://portal.thirdweb.com/references/typescript/v5/randomPrivateKey): Generates a random ECDSA private key on the secp256k1 curve. +* [create7702MinimalAccount](https://portal.thirdweb.com/references/typescript/v5/create7702MinimalAccount): Reference for create7702MinimalAccount diff --git a/apps/portal/src/app/references/components/TDoc/Summary.tsx b/apps/portal/src/app/references/components/TDoc/Summary.tsx index 7fc3194cb2b..6ce9dd8a816 100644 --- a/apps/portal/src/app/references/components/TDoc/Summary.tsx +++ b/apps/portal/src/app/references/components/TDoc/Summary.tsx @@ -85,7 +85,8 @@ export function TypedocSummary(props: { diff --git a/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts b/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts index f1b86ccfe42..759f98065a3 100644 --- a/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts +++ b/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts @@ -410,12 +410,17 @@ export function getExtensionName( extensionBlockTag: BlockTag, ): string | undefined { try { - const extensionNameString = - extensionBlockTag?.summary?.[0]?.data?.hName || "Common"; - - if (typeof extensionNameString === "string" && extensionNameString) { - return extensionNameString; + const summary = extensionBlockTag.summary?.[0]; + if (summary && "children" in summary) { + const firstChild = summary.children[0]; + if (firstChild && "value" in firstChild) { + const extensionNameString = firstChild.value || "Common"; + if (typeof extensionNameString === "string" && extensionNameString) { + return extensionNameString; + } + } } + return undefined; } catch { return undefined; } diff --git a/apps/portal/src/app/references/components/TDoc/utils/uniqueSlugger.ts b/apps/portal/src/app/references/components/TDoc/utils/uniqueSlugger.ts index 5437ce8645b..dc32aa275bf 100644 --- a/apps/portal/src/app/references/components/TDoc/utils/uniqueSlugger.ts +++ b/apps/portal/src/app/references/components/TDoc/utils/uniqueSlugger.ts @@ -2,7 +2,7 @@ export function uniqueSlugger(options: { base: string; isUnique: (slug: string) => boolean; }) { - const limit = 10; + const limit = 20; const { base, isUnique } = options; // if slug is unique, save it and return diff --git a/apps/portal/src/app/references/typescript/[version]/[[...slug]]/page.tsx b/apps/portal/src/app/references/typescript/[version]/[[...slug]]/page.tsx index be54c0f7cb7..75021bf39d0 100644 --- a/apps/portal/src/app/references/typescript/[version]/[[...slug]]/page.tsx +++ b/apps/portal/src/app/references/typescript/[version]/[[...slug]]/page.tsx @@ -12,6 +12,5 @@ const config = getTDocPage({ }); export default config.default; -// TODO: fix duplicate slugs -// export const generateStaticParams = config.generateStaticParams; +export const generateStaticParams = config.generateStaticParams; export const generateMetadata = config.generateMetadata;