@openocean.finance/widget 1.0.54 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/Card/InputCard.d.ts +1 -1
- package/dist/esm/components/Search/SearchInput.d.ts +4 -3
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/cross/adapters/MayanAdapter.js +72 -26
- package/dist/esm/cross/adapters/MayanAdapter.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Search/SearchInput.tsx +4 -3
- package/src/config/version.ts +1 -1
- package/src/cross/adapters/MayanAdapter.ts +93 -33
- package/src/pages/SelectChainPage/SelectChainPage.tsx +5 -3
- package/src/pages/SelectEnabledToolsPage.tsx +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const InputCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("./Card.js").CardProps, "color" | "content" | "translate" | "children" | "ref" | "sx" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "
|
|
1
|
+
export declare const InputCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("./Card.js").CardProps, "color" | "content" | "translate" | "children" | "ref" | "sx" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "square" | "type" | "classes" | "variant" | "elevation" | "component" | "theme" | "as" | "raised" | "selectionColor" | "indented"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
2
|
+
/** 与 MUI InputBase inputProps 一致:底层可为 input 或 textarea */
|
|
2
3
|
interface SearchInputProps {
|
|
3
4
|
name?: string;
|
|
4
5
|
value?: string;
|
|
5
6
|
placeholder?: string;
|
|
6
|
-
onChange?:
|
|
7
|
-
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
8
|
+
onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
8
9
|
autoFocus?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const SearchInput: ({ name, placeholder, onChange, onBlur, value, autoFocus, }: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../../src/components/Search/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../../src/components/Search/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAY1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,GACQ,EAAE,EAAE;IACrB,OAAO,CACL,KAAC,SAAS,cACR,KAAC,WAAW,IAAC,SAAS,kBACpB,KAAC,KAAK,IACJ,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,WAAW,EACxB,YAAY,EACV,KAAC,cAAc,IAAC,QAAQ,EAAC,KAAK,YAC5B,KAAC,MAAM,KAAG,GACK,EAEnB,UAAU,EAAE;oBACV,SAAS,EAAE,QAAQ;oBACnB,QAAQ;oBACR,MAAM;oBACN,IAAI;oBACJ,KAAK;oBACL,SAAS,EAAE,GAAG;iBACf,EACD,YAAY,EAAC,KAAK,EAClB,SAAS,EAAE,SAAS,GACpB,GACU,GACJ,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC3D,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAA;IAE1C,OAAO,CACL,KAAC,0BAA0B,IAAC,YAAY,EAAE,YAAY,YACpD,KAAC,WAAW,OAAK,KAAK,EAAE,SAAS,SAAG,GACT,CAC9B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -3,7 +3,7 @@ export declare const SkeletonWalletMenuButtonContainer: import("@emotion/styled"
|
|
|
3
3
|
export declare const SkeletonCardRow: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
4
|
export declare const SkeletonAmountContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
5
|
export declare const SkeletonCard: import("@emotion/styled").StyledComponent<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
6
|
-
export declare const SkeletonInputCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("../Card/Card.js").CardProps, "color" | "content" | "translate" | "children" | "ref" | "sx" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "
|
|
6
|
+
export declare const SkeletonInputCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("../Card/Card.js").CardProps, "color" | "content" | "translate" | "children" | "ref" | "sx" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "square" | "type" | "classes" | "variant" | "elevation" | "component" | "theme" | "as" | "raised" | "selectionColor" | "indented"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
7
7
|
export declare const SkeletonReviewButtonContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
8
8
|
export declare const SkeletonReviewButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "color" | "children" | "sx" | "style" | "className" | "tabIndex" | "size" | "disabled" | "classes" | "variant" | "href" | "action" | "disableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loading" | "loadingIndicator" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingPosition"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
9
9
|
export declare const SkeletonSendToWalletButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "color" | "children" | "sx" | "style" | "className" | "tabIndex" | "size" | "disabled" | "classes" | "variant" | "href" | "action" | "disableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loading" | "loadingIndicator" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingPosition"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@openocean.finance/widget";
|
|
2
|
-
export declare const version = "1.0.
|
|
2
|
+
export declare const version = "1.0.55";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addresses, fetchQuote, getSwapFromEvmTxPayload, } from '@mayanfinance/swap-sdk';
|
|
2
2
|
import { ChainId } from '@openocean.finance/widget-sdk';
|
|
3
|
-
import { formatUnits
|
|
4
|
-
import { CROSS_CHAIN_FEE_RECEIVER, ZERO_ADDRESS, } from '../constants/index.js';
|
|
3
|
+
import { formatUnits } from 'viem';
|
|
4
|
+
import { CROSS_CHAIN_FEE_RECEIVER, CROSS_CHAIN_FEE_RECEIVER_SOLANA, ZERO_ADDRESS, } from '../constants/index.js';
|
|
5
5
|
import { BaseSwapAdapter, } from './BaseSwapAdapter.js';
|
|
6
6
|
const mappingChain = {
|
|
7
7
|
[ChainId.ETH]: 'ethereum',
|
|
@@ -18,6 +18,20 @@ const mappingChain = {
|
|
|
18
18
|
[ChainId.SUI]: 'sui',
|
|
19
19
|
// [ChainId.PLA]: 'plasma',
|
|
20
20
|
};
|
|
21
|
+
function getMayanApiKey() {
|
|
22
|
+
try {
|
|
23
|
+
return typeof process !== 'undefined'
|
|
24
|
+
? process.env?.MAYAN_API_KEY
|
|
25
|
+
: undefined;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function getMayanFetchQuoteOptions() {
|
|
32
|
+
const apiKey = getMayanApiKey();
|
|
33
|
+
return apiKey ? { apiKey } : undefined;
|
|
34
|
+
}
|
|
21
35
|
export class MayanAdapter extends BaseSwapAdapter {
|
|
22
36
|
getName() {
|
|
23
37
|
return 'Mayan';
|
|
@@ -32,45 +46,59 @@ export class MayanAdapter extends BaseSwapAdapter {
|
|
|
32
46
|
return [];
|
|
33
47
|
}
|
|
34
48
|
async getQuote(params) {
|
|
35
|
-
|
|
49
|
+
const fromChainName = mappingChain[params.fromChain];
|
|
50
|
+
const toChainName = mappingChain[params.toChain];
|
|
51
|
+
if (!fromChainName || !toChainName) {
|
|
36
52
|
throw new Error('No quotes found');
|
|
37
53
|
}
|
|
54
|
+
let slippageBps = params.slippage > 0 ? params.slippage / 100 : 'auto';
|
|
55
|
+
if (+slippageBps > 5) {
|
|
56
|
+
slippageBps = 5;
|
|
57
|
+
}
|
|
38
58
|
const quoteParams = {
|
|
39
|
-
|
|
59
|
+
amountIn64: params.amount,
|
|
40
60
|
fromToken: params.fromToken.isNative
|
|
41
61
|
? ZERO_ADDRESS
|
|
42
62
|
: params.fromToken.address,
|
|
43
63
|
toToken: params.toToken.isNative ? ZERO_ADDRESS : params.toToken.address,
|
|
44
|
-
fromChain:
|
|
45
|
-
toChain:
|
|
46
|
-
slippageBps:
|
|
64
|
+
fromChain: fromChainName,
|
|
65
|
+
toChain: toChainName,
|
|
66
|
+
slippageBps: slippageBps,
|
|
47
67
|
referrer: CROSS_CHAIN_FEE_RECEIVER,
|
|
48
68
|
referrerBps: params.feeBps,
|
|
69
|
+
...(params.recipient ? { destinationAddress: params.recipient } : {}),
|
|
49
70
|
};
|
|
50
|
-
const quotes = await fetchQuote(quoteParams);
|
|
71
|
+
const quotes = await fetchQuote(quoteParams, getMayanFetchQuoteOptions());
|
|
51
72
|
if (!quotes?.[0]) {
|
|
52
73
|
throw new Error('No quotes found');
|
|
53
74
|
}
|
|
75
|
+
const topQuote = quotes[0];
|
|
54
76
|
const formattedInputAmount = formatUnits(BigInt(params.amount), params.fromToken.decimals);
|
|
77
|
+
const outputAmount = BigInt(topQuote.expectedAmountOutBaseUnits);
|
|
78
|
+
const formattedOutputAmount = formatUnits(outputAmount, params.toToken.decimals);
|
|
55
79
|
const tokenInUsd = params.tokenInUsd;
|
|
56
80
|
const tokenOutUsd = params.tokenOutUsd;
|
|
57
81
|
const inputUsd = tokenInUsd * +formattedInputAmount;
|
|
58
|
-
const outputUsd = tokenOutUsd *
|
|
82
|
+
const outputUsd = tokenOutUsd * +formattedOutputAmount;
|
|
83
|
+
const usdPriceImpact = !inputUsd || !outputUsd
|
|
84
|
+
? Number.NaN
|
|
85
|
+
: ((inputUsd - outputUsd) * 100) / inputUsd;
|
|
86
|
+
const sdkPriceImpact = topQuote.priceImpact != null ? Number(topQuote.priceImpact) : Number.NaN;
|
|
59
87
|
return {
|
|
60
88
|
quoteParams: params,
|
|
61
|
-
outputAmount
|
|
62
|
-
formattedOutputAmount
|
|
89
|
+
outputAmount,
|
|
90
|
+
formattedOutputAmount,
|
|
63
91
|
inputUsd,
|
|
64
92
|
outputUsd,
|
|
65
|
-
priceImpact:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
93
|
+
priceImpact: Number.isFinite(sdkPriceImpact) ? sdkPriceImpact : usdPriceImpact,
|
|
94
|
+
rate: +formattedInputAmount > 0
|
|
95
|
+
? +formattedOutputAmount / +formattedInputAmount
|
|
96
|
+
: 0,
|
|
69
97
|
gasFeeUsd: 0,
|
|
70
|
-
timeEstimate:
|
|
98
|
+
timeEstimate: topQuote.etaSeconds,
|
|
71
99
|
contractAddress: addresses.MAYAN_FORWARDER_CONTRACT,
|
|
72
|
-
rawQuote:
|
|
73
|
-
protocolFee:
|
|
100
|
+
rawQuote: topQuote,
|
|
101
|
+
protocolFee: topQuote.clientRelayerFeeSuccess || 0,
|
|
74
102
|
platformFeePercent: (params.feeBps * 100) / 10000,
|
|
75
103
|
};
|
|
76
104
|
}
|
|
@@ -97,7 +125,17 @@ export class MayanAdapter extends BaseSwapAdapter {
|
|
|
97
125
|
// })
|
|
98
126
|
}
|
|
99
127
|
else {
|
|
100
|
-
const
|
|
128
|
+
const mayanQuote = quote.rawQuote;
|
|
129
|
+
// Gasless Swift:需 EIP-712 签名 + submitSwiftEvmSwap,不能走普通 sendTransaction(见 SDK swapFromEvm)
|
|
130
|
+
if (mayanQuote.type === 'SWIFT' && mayanQuote.gasless) {
|
|
131
|
+
throw new Error('Mayan gasless Swift 订单需使用 @mayanfinance/swap-sdk 的 swapFromEvm(EIP-712 + 提交订单),当前适配器仅支持链上交易 payload');
|
|
132
|
+
}
|
|
133
|
+
const mayanApiKey = getMayanApiKey();
|
|
134
|
+
// v13+ getSwapFromEvmTxPayload 为异步;referrerAddresses 需按网络类型提供(文档)
|
|
135
|
+
const res = await getSwapFromEvmTxPayload(mayanQuote, account, quote.quoteParams.recipient, {
|
|
136
|
+
evm: CROSS_CHAIN_FEE_RECEIVER,
|
|
137
|
+
solana: CROSS_CHAIN_FEE_RECEIVER_SOLANA,
|
|
138
|
+
}, account, fromChain, null, null, mayanApiKey ? { apiKey: mayanApiKey } : undefined);
|
|
101
139
|
if (res.to && res.value && res.data) {
|
|
102
140
|
const tx = await walletClient.sendTransaction({
|
|
103
141
|
chain: undefined,
|
|
@@ -126,15 +164,23 @@ export class MayanAdapter extends BaseSwapAdapter {
|
|
|
126
164
|
}
|
|
127
165
|
async getTransactionStatus(p) {
|
|
128
166
|
const res = await fetch(`https://explorer-api.mayan.finance/v3/swap/trx/${p.id}`).then((r) => r.json());
|
|
167
|
+
const clientStatus = res.clientStatus ?? res.status;
|
|
168
|
+
const legacy = res.status;
|
|
169
|
+
let status = 'Processing';
|
|
170
|
+
if (clientStatus === 'COMPLETED' ||
|
|
171
|
+
legacy === 'ORDER_SETTLED') {
|
|
172
|
+
status = 'Success';
|
|
173
|
+
}
|
|
174
|
+
else if (clientStatus === 'REFUNDED' ||
|
|
175
|
+
legacy === 'ORDER_REFUNDED') {
|
|
176
|
+
status = 'Refunded';
|
|
177
|
+
}
|
|
178
|
+
else if (legacy === 'ORDER_CANCELED') {
|
|
179
|
+
status = 'Failed';
|
|
180
|
+
}
|
|
129
181
|
return {
|
|
130
182
|
txHash: res.fulfillTxHash || '',
|
|
131
|
-
status
|
|
132
|
-
? 'Success'
|
|
133
|
-
: res.status === 'ORDER_REFUNDED'
|
|
134
|
-
? 'Refunded'
|
|
135
|
-
: res.status === 'ORDER_CANCELED'
|
|
136
|
-
? 'Failed'
|
|
137
|
-
: 'Processing',
|
|
183
|
+
status,
|
|
138
184
|
};
|
|
139
185
|
}
|
|
140
186
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MayanAdapter.js","sourceRoot":"","sources":["../../../../src/cross/adapters/MayanAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MayanAdapter.js","sourceRoot":"","sources":["../../../../src/cross/adapters/MayanAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,UAAU,EACV,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAElC,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAE/B,YAAY,GACb,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EACL,eAAe,GAMhB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,YAAY,GAA8B;IAC9C,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU;IACzB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK;IACpB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS;IACxB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW;IAC1B,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU;IACzB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU;IACzB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM;IACrB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU;IACzB,0BAA0B;IAC1B,CAAC,OAAO,CAA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AM,YAAY,GAAG,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,MAAM,CAAA;QACnD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QAEzB,IAAI,MAAM,GAAyB,YAAY,CAAA;QAC/C,IACE,YAAY,KAAK,WAAW;YAC5B,MAAM,KAAK,eAAe,EAC1B,CAAC;YACD,MAAM,GAAG,SAAS,CAAA;QACpB,CAAC;aAAM,IACL,YAAY,KAAK,UAAU;YAC3B,MAAM,KAAK,gBAAgB,EAC3B,CAAC;YACD,MAAM,GAAG,UAAU,CAAA;QACrB,CAAC;aAAM,IAAI,MAAM,KAAK,gBAAgB,EAAE,CAAC;YACvC,MAAM,GAAG,QAAQ,CAAA;QACnB,CAAC;QAED,OAAO;YACL,MAAM,EAAE,GAAG,CAAC,aAAa,IAAI,EAAE;YAC/B,MAAM;SACP,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectChainPage.js","sourceRoot":"","sources":["../../../../src/pages/SelectChainPage/SelectChainPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,
|
|
1
|
+
{"version":3,"file":"SelectChainPage.js","sourceRoot":"","sources":["../../../../src/pages/SelectChainPage/SelectChainPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,EAA2B,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,MA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M,EACjB,KAAC,YAAY,IAAC,OAAO,EAAE,KAAK,CAAC,IAAI,GAAI,KANlB,KAAK,CAAC,EAAE,CAOZ,CAClB,CAAC,GACS,CACd,CAAC,CAAC,CAAC,CACF,KAAC,cAAc,IACb,OAAO,EAAE,CAAC,CAAC,6BAA6B,CAAC,EACzC,0BAA0B,SAC1B,CACH,IACiB,CACrB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEnabledToolsPage.js","sourceRoot":"","sources":["../../../src/pages/SelectEnabledToolsPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EACL,4BAA4B,EAC5B,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,MAAM,eAAe,CAAA;AAGtB,OAAO,
|
|
1
|
+
{"version":3,"file":"SelectEnabledToolsPage.js","sourceRoot":"","sources":["../../../src/pages/SelectEnabledToolsPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EACL,4BAA4B,EAC5B,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,MAAM,eAAe,CAAA;AAGtB,OAAO,EAA2B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,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Ac,mBAC/B,KAAC,iBAAiB,IAChB,QAAQ,EAAE,0BAA0B,EACpC,WAAW,EAAE,CAAC,CAAC,cAAc,IAAI,EAAE,CAAC,GACpC,EACD,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CACtB,KAAC,UAAU,cACR,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,MAAC,sBAAsB,IAErB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,aAEpC,KAAC,cAAc,cACb,KAAC,MAAM,IAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,YACtC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GACN,GACM,EACjB,KAAC,YAAY,IAAC,OAAO,EAAE,IAAI,CAAC,IAAI,GAAI,EACnC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAC,KAAK,IAAC,KAAK,EAAC,SAAS,GAAG,KAT/C,IAAI,CAAC,IAAI,CAUS,CAC1B,CAAC,GACS,CACd,CAAC,CAAC,CAAC,CACF,KAAC,cAAc,IACb,OAAO,EAAE,CAAC,CAAC,qBAAqB,IAAI,MAAM,CAAC,EAC3C,0BAA0B,SAC1B,CACH,IACiB,CACrB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -6,7 +6,7 @@ interface FullHeightAdjustablePageContainerProps extends PageContainerProps {
|
|
|
6
6
|
enableFullHeight?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const FullHeightAdjustablePageContainer: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "maxWidth" | "children" | "sx" | "style" | "className" | "fixed" | "classes" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & PageContainerProps & FullHeightAdjustablePageContainerProps, {}, {}>;
|
|
9
|
-
export declare const SendToWalletCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("../../components/Card/Card.js").CardProps, "color" | "content" | "translate" | "children" | "ref" | "sx" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "
|
|
9
|
+
export declare const SendToWalletCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "sx" | "style" | "className" | "square" | "classes" | "variant" | "elevation" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("../../components/Card/Card.js").CardProps, "color" | "content" | "translate" | "children" | "ref" | "sx" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "square" | "type" | "classes" | "variant" | "elevation" | "component" | "theme" | "as" | "raised" | "selectionColor" | "indented"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
10
|
export declare const SendToWalletSheetContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
11
|
export declare const SendToWalletButtonRow: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
12
12
|
export declare const SendToWalletIconButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "color" | "children" | "sx" | "style" | "className" | "tabIndex" | "size" | "disabled" | "classes" | "variant" | "href" | "action" | "disableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loading" | "loadingIndicator" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingPosition"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openocean.finance/widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Openocean Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@emotion/react": "^11.14.0",
|
|
48
48
|
"@emotion/styled": "^11.14.0",
|
|
49
49
|
"@lifi/sdk": "^3.6.8",
|
|
50
|
-
"@mayanfinance/swap-sdk": "^
|
|
50
|
+
"@mayanfinance/swap-sdk": "^13.2.0",
|
|
51
51
|
"@mui/icons-material": "6.0.2",
|
|
52
52
|
"@mui/material": "^6.4.8",
|
|
53
53
|
"@mui/system": "^6.4.8",
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Search } from '@mui/icons-material'
|
|
2
2
|
import { FormControl, InputAdornment } from '@mui/material'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChangeEventHandler, FocusEventHandler } from 'react'
|
|
4
4
|
import { InputCard } from '../../components/Card/InputCard.js'
|
|
5
5
|
import { useHeaderHeight } from '../../stores/header/useHeaderStore.js'
|
|
6
6
|
import { Input, StickySearchInputContainer } from './SearchInput.style.js'
|
|
7
7
|
|
|
8
|
+
/** 与 MUI InputBase inputProps 一致:底层可为 input 或 textarea */
|
|
8
9
|
interface SearchInputProps {
|
|
9
10
|
name?: string
|
|
10
11
|
value?: string
|
|
11
12
|
placeholder?: string
|
|
12
|
-
onChange?:
|
|
13
|
-
onBlur?: FocusEventHandler<HTMLInputElement>
|
|
13
|
+
onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>
|
|
14
|
+
onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>
|
|
14
15
|
autoFocus?: boolean
|
|
15
16
|
}
|
|
16
17
|
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@openocean.finance/widget'
|
|
2
|
-
export const version = '1.0.
|
|
2
|
+
export const version = '1.0.55'
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type ChainName,
|
|
3
3
|
type Quote as MayanQuote,
|
|
4
|
+
type QuoteOptions,
|
|
4
5
|
addresses,
|
|
5
6
|
fetchQuote,
|
|
6
7
|
getSwapFromEvmTxPayload,
|
|
7
8
|
} from '@mayanfinance/swap-sdk'
|
|
8
9
|
import { ChainId } from '@openocean.finance/widget-sdk'
|
|
9
|
-
import { formatUnits
|
|
10
|
+
import { formatUnits } from 'viem'
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
CROSS_CHAIN_FEE_RECEIVER,
|
|
14
|
+
CROSS_CHAIN_FEE_RECEIVER_SOLANA,
|
|
13
15
|
type Currency,
|
|
14
16
|
ZERO_ADDRESS,
|
|
15
17
|
} from '../constants/index.js'
|
|
@@ -41,6 +43,21 @@ const mappingChain: Record<string, ChainName> = {
|
|
|
41
43
|
// [ChainId.PLA]: 'plasma',
|
|
42
44
|
}
|
|
43
45
|
|
|
46
|
+
function getMayanApiKey(): string | undefined {
|
|
47
|
+
try {
|
|
48
|
+
return typeof process !== 'undefined'
|
|
49
|
+
? (process as NodeJS.Process).env?.MAYAN_API_KEY
|
|
50
|
+
: undefined
|
|
51
|
+
} catch {
|
|
52
|
+
return undefined
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function getMayanFetchQuoteOptions(): QuoteOptions | undefined {
|
|
57
|
+
const apiKey = getMayanApiKey()
|
|
58
|
+
return apiKey ? { apiKey } : undefined
|
|
59
|
+
}
|
|
60
|
+
|
|
44
61
|
export class MayanAdapter extends BaseSwapAdapter {
|
|
45
62
|
getName(): string {
|
|
46
63
|
return 'Mayan'
|
|
@@ -57,60 +74,78 @@ export class MayanAdapter extends BaseSwapAdapter {
|
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
async getQuote(params: EvmQuoteParams): Promise<NormalizedQuote> {
|
|
60
|
-
|
|
77
|
+
const fromChainName = mappingChain[params.fromChain]
|
|
78
|
+
const toChainName = mappingChain[params.toChain]
|
|
79
|
+
if (!fromChainName || !toChainName) {
|
|
61
80
|
throw new Error('No quotes found')
|
|
62
81
|
}
|
|
82
|
+
|
|
83
|
+
let slippageBps = params.slippage > 0 ? params.slippage / 100 : ('auto' as const)
|
|
84
|
+
if (+slippageBps > 5) {
|
|
85
|
+
slippageBps = 5
|
|
86
|
+
}
|
|
63
87
|
const quoteParams = {
|
|
64
|
-
|
|
88
|
+
amountIn64: params.amount,
|
|
65
89
|
fromToken: params.fromToken.isNative
|
|
66
90
|
? ZERO_ADDRESS
|
|
67
91
|
: params.fromToken.address,
|
|
68
92
|
toToken: params.toToken.isNative ? ZERO_ADDRESS : params.toToken.address,
|
|
69
|
-
fromChain:
|
|
70
|
-
toChain:
|
|
71
|
-
slippageBps:
|
|
93
|
+
fromChain: fromChainName,
|
|
94
|
+
toChain: toChainName,
|
|
95
|
+
slippageBps: slippageBps,
|
|
72
96
|
referrer: CROSS_CHAIN_FEE_RECEIVER,
|
|
73
97
|
referrerBps: params.feeBps,
|
|
98
|
+
...(params.recipient ? { destinationAddress: params.recipient } : {}),
|
|
74
99
|
}
|
|
75
|
-
const quotes = await fetchQuote(quoteParams)
|
|
100
|
+
const quotes = await fetchQuote(quoteParams, getMayanFetchQuoteOptions())
|
|
76
101
|
if (!quotes?.[0]) {
|
|
77
102
|
throw new Error('No quotes found')
|
|
78
103
|
}
|
|
79
104
|
|
|
105
|
+
const topQuote = quotes[0]
|
|
80
106
|
const formattedInputAmount = formatUnits(
|
|
81
107
|
BigInt(params.amount),
|
|
82
108
|
params.fromToken.decimals
|
|
83
109
|
)
|
|
110
|
+
const outputAmount = BigInt(topQuote.expectedAmountOutBaseUnits)
|
|
111
|
+
const formattedOutputAmount = formatUnits(
|
|
112
|
+
outputAmount,
|
|
113
|
+
params.toToken.decimals
|
|
114
|
+
)
|
|
84
115
|
|
|
85
116
|
const tokenInUsd = params.tokenInUsd
|
|
86
117
|
const tokenOutUsd = params.tokenOutUsd
|
|
87
118
|
const inputUsd = tokenInUsd * +formattedInputAmount
|
|
88
|
-
const outputUsd = tokenOutUsd *
|
|
119
|
+
const outputUsd = tokenOutUsd * +formattedOutputAmount
|
|
120
|
+
|
|
121
|
+
const usdPriceImpact =
|
|
122
|
+
!inputUsd || !outputUsd
|
|
123
|
+
? Number.NaN
|
|
124
|
+
: ((inputUsd - outputUsd) * 100) / inputUsd
|
|
125
|
+
const sdkPriceImpact =
|
|
126
|
+
topQuote.priceImpact != null ? Number(topQuote.priceImpact) : Number.NaN
|
|
89
127
|
|
|
90
128
|
return {
|
|
91
129
|
quoteParams: params,
|
|
92
130
|
|
|
93
|
-
outputAmount
|
|
94
|
-
quotes[0].expectedAmountOut.toString(),
|
|
95
|
-
params.toToken.decimals
|
|
96
|
-
),
|
|
131
|
+
outputAmount,
|
|
97
132
|
|
|
98
|
-
formattedOutputAmount
|
|
133
|
+
formattedOutputAmount,
|
|
99
134
|
|
|
100
135
|
inputUsd,
|
|
101
136
|
outputUsd,
|
|
102
|
-
priceImpact:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
137
|
+
priceImpact: Number.isFinite(sdkPriceImpact) ? sdkPriceImpact : usdPriceImpact,
|
|
138
|
+
rate:
|
|
139
|
+
+formattedInputAmount > 0
|
|
140
|
+
? +formattedOutputAmount / +formattedInputAmount
|
|
141
|
+
: 0,
|
|
107
142
|
gasFeeUsd: 0,
|
|
108
143
|
|
|
109
|
-
timeEstimate:
|
|
144
|
+
timeEstimate: topQuote.etaSeconds,
|
|
110
145
|
contractAddress: addresses.MAYAN_FORWARDER_CONTRACT,
|
|
111
|
-
rawQuote:
|
|
146
|
+
rawQuote: topQuote,
|
|
112
147
|
|
|
113
|
-
protocolFee:
|
|
148
|
+
protocolFee: topQuote.clientRelayerFeeSuccess || 0,
|
|
114
149
|
platformFeePercent: (params.feeBps * 100) / 10_000,
|
|
115
150
|
}
|
|
116
151
|
}
|
|
@@ -143,15 +178,29 @@ export class MayanAdapter extends BaseSwapAdapter {
|
|
|
143
178
|
// referrerAddress: CROSS_CHAIN_FEE_RECEIVER,
|
|
144
179
|
// })
|
|
145
180
|
} else {
|
|
146
|
-
const
|
|
147
|
-
|
|
181
|
+
const mayanQuote = quote.rawQuote as MayanQuote
|
|
182
|
+
// Gasless Swift:需 EIP-712 签名 + submitSwiftEvmSwap,不能走普通 sendTransaction(见 SDK swapFromEvm)
|
|
183
|
+
if (mayanQuote.type === 'SWIFT' && mayanQuote.gasless) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
'Mayan gasless Swift 订单需使用 @mayanfinance/swap-sdk 的 swapFromEvm(EIP-712 + 提交订单),当前适配器仅支持链上交易 payload'
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const mayanApiKey = getMayanApiKey()
|
|
190
|
+
// v13+ getSwapFromEvmTxPayload 为异步;referrerAddresses 需按网络类型提供(文档)
|
|
191
|
+
const res = await getSwapFromEvmTxPayload(
|
|
192
|
+
mayanQuote,
|
|
148
193
|
account,
|
|
149
194
|
quote.quoteParams.recipient,
|
|
150
|
-
{
|
|
195
|
+
{
|
|
196
|
+
evm: CROSS_CHAIN_FEE_RECEIVER,
|
|
197
|
+
solana: CROSS_CHAIN_FEE_RECEIVER_SOLANA,
|
|
198
|
+
},
|
|
151
199
|
account,
|
|
152
200
|
fromChain,
|
|
153
201
|
null,
|
|
154
|
-
null
|
|
202
|
+
null,
|
|
203
|
+
mayanApiKey ? { apiKey: mayanApiKey } : undefined
|
|
155
204
|
)
|
|
156
205
|
if (res.to && res.value && res.data) {
|
|
157
206
|
const tx = await walletClient.sendTransaction({
|
|
@@ -186,16 +235,27 @@ export class MayanAdapter extends BaseSwapAdapter {
|
|
|
186
235
|
`https://explorer-api.mayan.finance/v3/swap/trx/${p.id}`
|
|
187
236
|
).then((r) => r.json())
|
|
188
237
|
|
|
238
|
+
const clientStatus = res.clientStatus ?? res.status
|
|
239
|
+
const legacy = res.status
|
|
240
|
+
|
|
241
|
+
let status: SwapStatus['status'] = 'Processing'
|
|
242
|
+
if (
|
|
243
|
+
clientStatus === 'COMPLETED' ||
|
|
244
|
+
legacy === 'ORDER_SETTLED'
|
|
245
|
+
) {
|
|
246
|
+
status = 'Success'
|
|
247
|
+
} else if (
|
|
248
|
+
clientStatus === 'REFUNDED' ||
|
|
249
|
+
legacy === 'ORDER_REFUNDED'
|
|
250
|
+
) {
|
|
251
|
+
status = 'Refunded'
|
|
252
|
+
} else if (legacy === 'ORDER_CANCELED') {
|
|
253
|
+
status = 'Failed'
|
|
254
|
+
}
|
|
255
|
+
|
|
189
256
|
return {
|
|
190
257
|
txHash: res.fulfillTxHash || '',
|
|
191
|
-
status
|
|
192
|
-
res.status === 'ORDER_SETTLED'
|
|
193
|
-
? 'Success'
|
|
194
|
-
: res.status === 'ORDER_REFUNDED'
|
|
195
|
-
? 'Refunded'
|
|
196
|
-
: res.status === 'ORDER_CANCELED'
|
|
197
|
-
? 'Failed'
|
|
198
|
-
: 'Processing',
|
|
258
|
+
status,
|
|
199
259
|
}
|
|
200
260
|
}
|
|
201
261
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Avatar, ListItemAvatar, debounce } from '@mui/material'
|
|
2
2
|
import type { ExtendedChain } from '@openocean.finance/widget-sdk'
|
|
3
|
-
import { type
|
|
3
|
+
import { type ChangeEventHandler, useState } from 'react'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { useChainSelect } from '../../components/ChainSelect/useChainSelect.js'
|
|
6
6
|
import { FullPageContainer } from '../../components/FullPageContainer.js'
|
|
@@ -43,8 +43,10 @@ export const SelectChainPage: React.FC<SelectChainPageProps> = ({
|
|
|
43
43
|
chains ?? []
|
|
44
44
|
)
|
|
45
45
|
|
|
46
|
-
const handleSearchInputChange:
|
|
47
|
-
|
|
46
|
+
const handleSearchInputChange: ChangeEventHandler<
|
|
47
|
+
HTMLInputElement | HTMLTextAreaElement
|
|
48
|
+
> = (e) => {
|
|
49
|
+
const value = e.target.value
|
|
48
50
|
|
|
49
51
|
if (!value) {
|
|
50
52
|
setFilteredChains(chains ?? [])
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@mui/material'
|
|
15
15
|
import type { ToolsResponse } from '@openocean.finance/widget-sdk'
|
|
16
16
|
import type { MouseEventHandler } from 'react'
|
|
17
|
-
import { type
|
|
17
|
+
import { type ChangeEventHandler, useMemo, useState } from 'react'
|
|
18
18
|
import { useTranslation } from 'react-i18next'
|
|
19
19
|
import { shallow } from 'zustand/shallow'
|
|
20
20
|
import { FullPageContainer } from '../components/FullPageContainer.js'
|
|
@@ -119,8 +119,10 @@ export const SelectEnabledToolsPage: React.FC<{
|
|
|
119
119
|
setToolValue(type, key, !enabledTools[key])
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const handleSearchInputChange:
|
|
123
|
-
|
|
122
|
+
const handleSearchInputChange: ChangeEventHandler<
|
|
123
|
+
HTMLInputElement | HTMLTextAreaElement
|
|
124
|
+
> = (e) => {
|
|
125
|
+
const value = e.target.value
|
|
124
126
|
|
|
125
127
|
if (!value) {
|
|
126
128
|
setFilteredTools(tools?.[typeKey] ?? [])
|