@wormhole-foundation/wormhole-connect 4.2.0-beta.0-development → 5.0.0
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/main.mjs +73 -73
- package/dist/src/telemetry/types.d.ts +2 -1
- package/dist/src/telemetry/types.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +1 -0
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/lib/{aptos-DcdKyekw.js → aptos-BnjZOhUE.js} +1 -1
- package/lib/{aptos-B1Gf2eCD.mjs → aptos-fTiHvXXE.mjs} +2 -2
- package/lib/{basic-DnhL0oWa.mjs → basic-BqusrmRE.mjs} +2 -2
- package/lib/{basic-C6VXQ7m-.js → basic-BrW22Cj9.js} +1 -1
- package/lib/{basic-CFbslwLM.mjs → basic-CK5Bsf0B.mjs} +2 -2
- package/lib/{basic-BS7Z1PMG.js → basic-ChOmeQQk.js} +1 -1
- package/lib/constants-C1w_RyOP.js +1 -0
- package/lib/{constants-CTJ_-E0d.mjs → constants-DcDpDarO.mjs} +5 -5
- package/lib/{core-DT6TBPQP.mjs → core-DQ-6Q1F1.mjs} +5 -5
- package/lib/{core-RRp0K__1.js → core-FA2gBc-s.js} +3 -3
- package/lib/{evm-DlOCiplA.mjs → evm-BJ4Lx-r9.mjs} +3 -3
- package/lib/{evm-BwCfQIyJ.js → evm-BTgO_HRP.js} +2 -2
- package/lib/{evm-BxF9XPn4.mjs → evm-C-vXMfGr.mjs} +3 -3
- package/lib/{evm-C3B8jHD7.js → evm-qxndAh3z.js} +1 -1
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{hypercore-DbqOAqKF.js → hypercore-D7kZiwbe.js} +1 -1
- package/lib/{hypercore-H7pw_pN4.mjs → hypercore-DKqayfki.mjs} +9 -9
- package/lib/{index-mikg85u5.js → index-3Zg1AdoI.js} +1 -1
- package/lib/{index-BuEKhdrW.mjs → index-B1URQBlH.mjs} +1 -1
- package/lib/{index-pn6NZmOS.js → index-B7b8sctd.js} +1 -1
- package/lib/{index-CsLyPoC6.mjs → index-BVciucyT.mjs} +1 -1
- package/lib/{index-BNpkgexR.js → index-BfzaCmg7.js} +1 -1
- package/lib/{index-DVm_f5E1.js → index-C-F8_8dY.js} +1 -1
- package/lib/{index-BmP0jPVN.mjs → index-C6MalNd5.mjs} +9 -9
- package/lib/{index-BbE02hdW.js → index-Cb_8WAm1.js} +8 -8
- package/lib/{index-BnKf2rOm.mjs → index-CgqBQ88K.mjs} +178 -175
- package/lib/{index-BtU67kjy.mjs → index-CowAVUcg.mjs} +1 -1
- package/lib/{index-CGqJokTg.mjs → index-DcFL403C.mjs} +1 -1
- package/lib/{index-DAJZN12d.js → index-Oxm0y6-t.js} +1 -1
- package/lib/{index-t_koRpGi.js → index-XjDX4fWv.js} +1 -1
- package/lib/{index-NAUBlFLG.mjs → index-mNO1mk2F.mjs} +1 -1
- package/lib/{index.es-B3FwsRfN.js → index.es-B9kBDkCQ.js} +3 -3
- package/lib/{index.es-ClIr5Gv-.js → index.es-BZRO-bNH.js} +1 -1
- package/lib/{index.es-CYyuSfPG.mjs → index.es-CF3YY88z.mjs} +3 -3
- package/lib/{index.es-3KAM8l3G.mjs → index.es-CaAL5X4E.mjs} +2 -2
- package/lib/index.js +2 -2
- package/lib/index.mjs +16 -15
- package/lib/lifi.js +1 -1
- package/lib/lifi.mjs +2 -2
- package/lib/mayan.js +1 -1
- package/lib/mayan.mjs +2 -2
- package/lib/{secp256k1-BZFiBDHQ.mjs → secp256k1-1o6o1kFy.mjs} +1 -1
- package/lib/{secp256k1-D3i7kc2M.mjs → secp256k1-BjlnTj1_.mjs} +1 -1
- package/lib/{secp256k1-B2G0zB-5.js → secp256k1-CeYT4ndf.js} +1 -1
- package/lib/{secp256k1-Cteng3v9.mjs → secp256k1-Cw_BiEuN.mjs} +1 -1
- package/lib/{secp256k1-CxjctkO3.js → secp256k1-D5cKS6q_.js} +1 -1
- package/lib/{secp256k1-Bz-QjKBU.js → secp256k1-_QlJc7sK.js} +1 -1
- package/lib/{solana-BE2DAanS.js → solana-DvHFhri3.js} +4 -4
- package/lib/{solana-Df231Yni.mjs → solana-TgPr9kpk.mjs} +8 -8
- package/lib/{solanaEmbed.esm-B9WG-Afi.mjs → solanaEmbed.esm-Bh1-aAL4.mjs} +2 -2
- package/lib/{solanaEmbed.esm-BqcrHrhl.js → solanaEmbed.esm-C8TjRcIV.js} +1 -1
- package/lib/src/telemetry/types.d.ts +2 -1
- package/lib/src/telemetry/types.d.ts.map +1 -1
- package/lib/src/utils/errors.d.ts +1 -0
- package/lib/src/utils/errors.d.ts.map +1 -1
- package/lib/{sui-B9tYcgyb.mjs → sui-CoWRa3vr.mjs} +2 -2
- package/lib/{sui-BVwNcgQT.js → sui-DwFrGd2Y.js} +1 -1
- package/lib/{tokenHelpers-DITWDel1.js → tokenHelpers-CeTyb4rG.js} +1 -1
- package/lib/{tokenHelpers-C53sepsl.mjs → tokenHelpers-VYjmKUxj.mjs} +1 -1
- package/lib/{tokens-CO0YQ3R2.mjs → tokens-D6uJqrsR.mjs} +1 -1
- package/lib/{tokens-CiSHS7oi.js → tokens-mXZqt-qL.js} +1 -1
- package/lib/{w3m-modal-SlcSCSnx.mjs → w3m-modal-BEe8ji9_.mjs} +2 -2
- package/lib/{w3m-modal-5v-rsnN8.mjs → w3m-modal-D3eqrCT1.mjs} +2 -2
- package/lib/{w3m-modal-B0Lu-6W8.js → w3m-modal-Duc13ei7.js} +1 -1
- package/lib/{w3m-modal-B2xHxAWg.js → w3m-modal-f_sUVzPx.js} +1 -1
- package/package.json +1 -1
- package/lib/constants-BCFTvlgh.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const X=require("./platform-DCcL7jHP.js"),ne=require("./unsignedTransaction-qRBv5Cnd.js"),go=require("./index-
|
|
1
|
+
"use strict";const X=require("./platform-DCcL7jHP.js"),ne=require("./unsignedTransaction-qRBv5Cnd.js"),go=require("./index-Cb_8WAm1.js"),tr=require("./hypercore-D7kZiwbe.js");var Ee=go.requireEvents();const wo=ne.getDefaultExportFromCjs(Ee);var rt={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Rc, f as Le, t as xe, a as N, b as yt, C as Tc, d as qc, e as Ui, s as cr, I as Ei, g as $t, k as Ss, A as jc, E as $e, i as kc, h as Dc, y as De, j as jt, r as Ii, O as Ur, o as Be, l as Fc, m as Mr, n as Lr, p as Os, N as Br, P as tn, Q as Uc, q as Mc, u as Lc, v as sn, w as hi, x as Xo, z as lt, B as it, D as mt, F as Qe } from "./index.es-
|
|
1
|
+
import { c as Rc, f as Le, t as xe, a as N, b as yt, C as Tc, d as qc, e as Ui, s as cr, I as Ei, g as $t, k as Ss, A as jc, E as $e, i as kc, h as Dc, y as De, j as jt, r as Ii, O as Ur, o as Be, l as Fc, m as Mr, n as Lr, p as Os, N as Br, P as tn, Q as Uc, q as Mc, u as Lc, v as sn, w as hi, x as Xo, z as lt, B as it, D as mt, F as Qe } from "./index.es-CaAL5X4E.mjs";
|
|
2
2
|
import { ca as B, p as Dt, C as Ie } from "./platform-CSpAb386.mjs";
|
|
3
3
|
function zi(i, { strict: e = !0 } = {}) {
|
|
4
4
|
return !i || typeof i != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(i) : i.startsWith("0x");
|
|
@@ -448,7 +448,7 @@ function Sh(i) {
|
|
|
448
448
|
return $h(`0x${e}`);
|
|
449
449
|
}
|
|
450
450
|
async function Oh({ hash: i, signature: e }) {
|
|
451
|
-
const t = zi(i) ? i : lr(i), { secp256k1: s } = await import("./secp256k1-
|
|
451
|
+
const t = zi(i) ? i : lr(i), { secp256k1: s } = await import("./secp256k1-1o6o1kFy.mjs");
|
|
452
452
|
return `0x${(() => {
|
|
453
453
|
if (typeof e == "object" && "r" in e && "s" in e) {
|
|
454
454
|
const { r: h, s: l, v: u, yParity: p } = e, d = Number(p ?? u), g = pn(d);
|
|
@@ -7404,7 +7404,7 @@ let Eb = class Oc {
|
|
|
7404
7404
|
}
|
|
7405
7405
|
};
|
|
7406
7406
|
const Ib = Eb, Pb = "wc", _b = "ethereum_provider", $b = `${Pb}@2:${_b}:`, Sb = "https://rpc.walletconnect.org/v1/", Ps = ["eth_sendTransaction", "personal_sign"], Ac = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_sendCalls", "wallet_getCapabilities", "wallet_getCallsStatus", "wallet_showCallsStatus"], _s = ["chainChanged", "accountsChanged"], xc = ["chainChanged", "accountsChanged", "message", "disconnect", "connect"], Ob = async () => {
|
|
7407
|
-
const { createAppKit: i } = await import("./core-
|
|
7407
|
+
const { createAppKit: i } = await import("./core-DQ-6Q1F1.mjs").then((e) => e.q);
|
|
7408
7408
|
return i;
|
|
7409
7409
|
};
|
|
7410
7410
|
var Ab = Object.defineProperty, xb = Object.defineProperties, Cb = Object.getOwnPropertyDescriptors, Qo = Object.getOwnPropertySymbols, Nb = Object.prototype.hasOwnProperty, Rb = Object.prototype.propertyIsEnumerable, Fr = (i, e, t) => e in i ? Ab(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Nt = (i, e) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as on, ca as ge, p as we } from "./platform-CSpAb386.mjs";
|
|
2
2
|
import { g as sn, ae as an, c as ye } from "./unsignedTransaction-D2Ja0SuN.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { o as Zt } from "./hypercore-
|
|
3
|
+
import { ab as fo } from "./index-CgqBQ88K.mjs";
|
|
4
|
+
import { o as Zt } from "./hypercore-DKqayfki.mjs";
|
|
5
5
|
var Ie = fo();
|
|
6
6
|
const Kl = /* @__PURE__ */ sn(Ie);
|
|
7
7
|
var rt = {};
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),y=require("react"),B=require("./platform-DCcL7jHP.js"),h0=require("@mui/material/ScopedCssBaseline"),Qe=require("@mui/material/styles"),L=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),y=require("react"),B=require("./platform-DCcL7jHP.js"),h0=require("@mui/material/ScopedCssBaseline"),Qe=require("@mui/material/styles"),L=require("./index-Cb_8WAm1.js"),Se=require("./hypercore-D7kZiwbe.js"),ge=require("@mui/material/Box"),F=require("@mui/material"),Da=require("@mui/icons-material/ArrowBackRounded"),qe=require("./unsignedTransaction-qRBv5Cnd.js"),Aa=require("./constants-C1w_RyOP.js"),me=require("./index-XjDX4fWv.js"),Ut=require("./mint-DW-XgF68.js"),xt=require("@mui/material/CircularProgress"),Ce=require("@mui/material/Stack"),cr=require("@mui/material/Tooltip"),ae=require("@mui/material/Typography"),j0=require("@mui/icons-material/ContentCopy"),y0=require("@mui/icons-material/Done"),N0=require("@mui/icons-material/WarningAmberRounded"),qo=require("@mui/material/Link"),I0=require("./dijkstra-Coh98Vg7.js"),Xo=require("@mui/material/SwipeableDrawer"),an=require("@mui/material/IconButton"),$o=require("@mui/icons-material/CloseRounded"),Ko=require("@mui/material/List"),Gt=require("@mui/material/ListItemButton"),es=require("@mui/material/ListItemIcon"),ts=require("@mui/material/TextField"),ns=require("@mui/material/Button"),wa=require("@mui/material/Popover"),dn=require("@mui/material/Card"),gn=require("@mui/material/CardContent"),L0=require("@mui/material/InputAdornment"),x0=require("@mui/icons-material/ArrowOutward"),C0=require("@mui/icons-material/InfoOutline"),T0=require("@mui/material/Badge"),oi=require("@mui/material/ToggleButton"),Sa=require("@mui/material/ToggleButtonGroup"),p0=require("@mui/icons-material/Close"),is=require("@mui/material/CardActionArea"),Ea=require("@mui/material/CardHeader"),uo=require("@mui/material/Divider"),m0=require("@mui/icons-material/InfoOutlined"),za=require("@mui/material/Collapse"),D0=require("@mui/material/Switch"),A0=require("@mui/material/Modal"),yr=require("@mui/material/Skeleton"),w0=require("@mui/icons-material/ExpandMore"),S0=require("@mui/icons-material/ExpandLess"),E0=require("@mui/icons-material/SwapHoriz"),z0=require("@mui/material/LinearProgress"),Ls=require("./utils-BEljbqMf.js"),xs=require("./tokens-mXZqt-qL.js"),b0=require("./index-DJ2w1fz1.js");function O0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const He=O0(y);var yi={exports:{}},Nr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-with-selector.production.js
|
|
4
4
|
*
|
|
@@ -482,4 +482,4 @@ object-assign
|
|
|
482
482
|
*/var io,ya;function d6(){if(ya)return io;ya=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var u=Object.getOwnPropertyNames(a).map(function(f){return a[f]});if(u.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(f){d[f]=f}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return io=o()?Object.assign:function(s,a){for(var c,u=i(s),d,f=1;f<arguments.length;f++){c=Object(arguments[f]);for(var x in c)t.call(c,x)&&(u[x]=c[x]);if(e){d=e(c);for(var A=0;A<d.length;A++)n.call(c,d[A])&&(u[d[A]]=c[d[A]])}}return u},io}var ro,Na;function Is(){if(Na)return ro;Na=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ro=e,ro}var oo,Ia;function f0(){return Ia||(Ia=1,oo=Function.call.bind(Object.prototype.hasOwnProperty)),oo}var so,La;function g6(){if(La)return so;La=1;var e=function(){};if(B.process$1.env.NODE_ENV!=="production"){var t=Is(),n={},i=f0();e=function(s){var a="Warning: "+s;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(s,a,c,u,d){if(B.process$1.env.NODE_ENV!=="production"){for(var f in s)if(i(s,f)){var x;try{if(typeof s[f]!="function"){var A=Error((u||"React class")+": "+c+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}x=s[f](a,f,u,c,null,t)}catch(m){x=m}if(x&&!(x instanceof Error)&&e((u||"React class")+": type specification of "+c+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof x+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),x instanceof Error&&!(x.message in n)){n[x.message]=!0;var I=d?d():"";e("Failed "+c+" type: "+x.message+(I??""))}}}}return o.resetWarningCache=function(){B.process$1.env.NODE_ENV!=="production"&&(n={})},so=o,so}var ao,xa;function f6(){if(xa)return ao;xa=1;var e=g0(),t=d6(),n=Is(),i=f0(),o=g6(),s=function(){};B.process$1.env.NODE_ENV!=="production"&&(s=function(c){var u="Warning: "+c;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return ao=function(c,u){var d=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function x(b){var w=b&&(d&&b[d]||b[f]);if(typeof w=="function")return w}var A="<<anonymous>>",I={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:D(),arrayOf:g,element:p(),elementType:M(),instanceOf:j,node:S(),objectOf:E,oneOf:N,oneOfType:T,shape:Y,exact:k};function m(b,w){return b===w?b!==0||1/b===1/w:b!==b&&w!==w}function l(b,w){this.message=b,this.data=w&&typeof w=="object"?w:{},this.stack=""}l.prototype=Error.prototype;function h(b){if(B.process$1.env.NODE_ENV!=="production")var w={},O=0;function R(J,ee,$,Z,q,X,re){if(Z=Z||A,X=X||$,re!==n){if(u){var K=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}else if(B.process$1.env.NODE_ENV!=="production"&&typeof console<"u"){var G=Z+":"+$;!w[G]&&O<3&&(s("You are manually calling a React.PropTypes validation function for the `"+X+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),w[G]=!0,O++)}}return ee[$]==null?J?ee[$]===null?new l("The "+q+" `"+X+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new l("The "+q+" `"+X+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:b(ee,$,Z,q,X)}var _=R.bind(null,!1);return _.isRequired=R.bind(null,!0),_}function C(b){function w(O,R,_,J,ee,$){var Z=O[R],q=V(Z);if(q!==b){var X=v(Z);return new l("Invalid "+J+" `"+ee+"` of type "+("`"+X+"` supplied to `"+_+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return h(w)}function D(){return h(a)}function g(b){function w(O,R,_,J,ee){if(typeof b!="function")return new l("Property `"+ee+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var $=O[R];if(!Array.isArray($)){var Z=V($);return new l("Invalid "+J+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+_+"`, expected an array."))}for(var q=0;q<$.length;q++){var X=b($,q,_,J,ee+"["+q+"]",n);if(X instanceof Error)return X}return null}return h(w)}function p(){function b(w,O,R,_,J){var ee=w[O];if(!c(ee)){var $=V(ee);return new l("Invalid "+_+" `"+J+"` of type "+("`"+$+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return h(b)}function M(){function b(w,O,R,_,J){var ee=w[O];if(!e.isValidElementType(ee)){var $=V(ee);return new l("Invalid "+_+" `"+J+"` of type "+("`"+$+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return h(b)}function j(b){function w(O,R,_,J,ee){if(!(O[R]instanceof b)){var $=b.name||A,Z=U(O[R]);return new l("Invalid "+J+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+_+"`, expected ")+("instance of `"+$+"`."))}return null}return h(w)}function N(b){if(!Array.isArray(b))return B.process$1.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),a;function w(O,R,_,J,ee){for(var $=O[R],Z=0;Z<b.length;Z++)if(m($,b[Z]))return null;var q=JSON.stringify(b,function(re,K){var G=v(K);return G==="symbol"?String(K):K});return new l("Invalid "+J+" `"+ee+"` of value `"+String($)+"` "+("supplied to `"+_+"`, expected one of "+q+"."))}return h(w)}function E(b){function w(O,R,_,J,ee){if(typeof b!="function")return new l("Property `"+ee+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var $=O[R],Z=V($);if(Z!=="object")return new l("Invalid "+J+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+_+"`, expected an object."));for(var q in $)if(i($,q)){var X=b($,q,_,J,ee+"."+q,n);if(X instanceof Error)return X}return null}return h(w)}function T(b){if(!Array.isArray(b))return B.process$1.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var w=0;w<b.length;w++){var O=b[w];if(typeof O!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+W(O)+" at index "+w+"."),a}function R(_,J,ee,$,Z){for(var q=[],X=0;X<b.length;X++){var re=b[X],K=re(_,J,ee,$,Z,n);if(K==null)return null;K.data&&i(K.data,"expectedType")&&q.push(K.data.expectedType)}var G=q.length>0?", expected one of type ["+q.join(", ")+"]":"";return new l("Invalid "+$+" `"+Z+"` supplied to "+("`"+ee+"`"+G+"."))}return h(R)}function S(){function b(w,O,R,_,J){return Q(w[O])?null:new l("Invalid "+_+" `"+J+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return h(b)}function z(b,w,O,R,_){return new l((b||"React class")+": "+w+" type `"+O+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function Y(b){function w(O,R,_,J,ee){var $=O[R],Z=V($);if(Z!=="object")return new l("Invalid "+J+" `"+ee+"` of type `"+Z+"` "+("supplied to `"+_+"`, expected `object`."));for(var q in b){var X=b[q];if(typeof X!="function")return z(_,J,ee,q,v(X));var re=X($,q,_,J,ee+"."+q,n);if(re)return re}return null}return h(w)}function k(b){function w(O,R,_,J,ee){var $=O[R],Z=V($);if(Z!=="object")return new l("Invalid "+J+" `"+ee+"` of type `"+Z+"` "+("supplied to `"+_+"`, expected `object`."));var q=t({},O[R],b);for(var X in q){var re=b[X];if(i(b,X)&&typeof re!="function")return z(_,J,ee,X,v(re));if(!re)return new l("Invalid "+J+" `"+ee+"` key `"+X+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(O[R],null," ")+`
|
|
483
483
|
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var K=re($,X,_,J,ee+"."+X,n);if(K)return K}return null}return h(w)}function Q(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(Q);if(b===null||c(b))return!0;var w=x(b);if(w){var O=w.call(b),R;if(w!==b.entries){for(;!(R=O.next()).done;)if(!Q(R.value))return!1}else for(;!(R=O.next()).done;){var _=R.value;if(_&&!Q(_[1]))return!1}}else return!1;return!0;default:return!1}}function P(b,w){return b==="symbol"?!0:w?w["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&w instanceof Symbol:!1}function V(b){var w=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":P(w,b)?"symbol":w}function v(b){if(typeof b>"u"||b===null)return""+b;var w=V(b);if(w==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return w}function W(b){var w=v(b);switch(w){case"array":case"object":return"an "+w;case"boolean":case"date":case"regexp":return"a "+w;default:return w}}function U(b){return!b.constructor||!b.constructor.name?A:b.constructor.name}return I.checkPropTypes=o,I.resetWarningCache=o.resetWarningCache,I.PropTypes=I,I},ao}var co,Ca;function h6(){if(Ca)return co;Ca=1;var e=Is();function t(){}function n(){}return n.resetWarningCache=t,co=function(){function i(a,c,u,d,f,x){if(x!==e){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},co}var Ta;function j6(){if(Ta)return zi.exports;if(Ta=1,B.process$1.env.NODE_ENV!=="production"){var e=g0(),t=!0;zi.exports=f6()(e.isElement,t)}else zi.exports=h6()();return zi.exports}var y6=j6();const gt=qe.getDefaultExportFromCjs(y6);class N6 extends y.Component{static propTypes={children:gt.node.isRequired,element:gt.node,hasMore:gt.bool,initialLoad:gt.bool,isReverse:gt.bool,loader:gt.node,loadMore:gt.func.isRequired,pageStart:gt.number,ref:gt.func,getScrollParent:gt.func,threshold:gt.number,useCapture:gt.bool,useWindow:gt.bool};static defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null};constructor(t){super(t),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const n={get passive(){t=!0}};try{document.addEventListener("test",null,n),document.removeEventListener("test",null,n)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const n=this.props.getScrollParent&&this.props.getScrollParent();return n??(t&&t.parentNode)}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let n=window;this.props.useWindow===!1&&(n=t),n.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),n.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,n=window,i=this.getParentElement(t);let o;if(this.props.useWindow){const s=document.documentElement||document.body.parentNode||document.body,a=n.pageYOffset!==void 0?n.pageYOffset:s.scrollTop;this.props.isReverse?o=a:o=this.calculateOffset(t,a)}else this.props.isReverse?o=i.scrollTop:o=t.scrollHeight-i.scrollTop-i.clientHeight;o<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=i.scrollHeight,this.beforeScrollTop=i.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,n){return t?this.calculateTopPosition(t)+(t.offsetHeight-n-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const t=this.filterProps(this.props),{children:n,element:i,hasMore:o,initialLoad:s,isReverse:a,loader:c,loadMore:u,pageStart:d,ref:f,threshold:x,useCapture:A,useWindow:I,getScrollParent:m,...l}=t;l.ref=C=>{this.scrollComponent=C,f&&f(C)};const h=[n];return o&&(c?a?h.unshift(c):h.push(c):this.defaultLoader&&(a?h.unshift(this.defaultLoader):h.push(this.defaultLoader))),y.createElement(i,l,h)}}const ri=({url:e,text:t})=>{const n=Qe.useTheme(),i=y.useMemo(()=>({addressLink:{display:"inline-flex",alignItems:"center",overflow:"hidden",color:n.palette.text.primary,opacity:.6}}),[n]);return e&&t?r.jsx(qo,{onClick:o=>o.stopPropagation(),sx:i.addressLink,href:e,rel:"noreferrer noopener",target:"_blank",children:t}):null},I6=e=>{const t=Qe.useTheme(),n=y.useMemo(()=>({container:{width:"100%",maxWidth:"448px",[t.breakpoints.down("sm")]:{maxWidth:"412px"}},card:{width:"100%",borderRadius:"8px",border:`1px solid ${t.palette.input.border}`},cardHeader:{paddingBottom:0}}),[t]),{txHash:i,amount:o,amountUsd:s,fromChain:a,fromToken:c,toChain:u,toToken:d,receiveAmount:f,senderTimestamp:x,explorerLink:A}=e.data,I=y.useMemo(()=>r.jsx(ae,{component:"span",padding:"0px 8px",children:"·"}),[]),{getTokenPrice:m,lastTokenPriceUpdate:l}=lt(),h=y.useMemo(()=>{const M=L.config.chains[a];return r.jsxs(Ce,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[r.jsx(di,{chainConfig:M,token:c}),r.jsxs(Ce,{direction:"column",marginLeft:"12px",children:[r.jsxs(ae,{fontSize:16,children:[o," ",c?L.getTokenDisplaySymbolByTokenAddress(c):""]}),r.jsxs(ae,{color:t.palette.text.secondary,fontSize:14,children:[s?r.jsxs(r.Fragment,{children:[L.getUSDFormat(s),I]}):null,M?.displayName]})]})]})},[o,s,a,I,t.palette.text.secondary,c]),C=y.useMemo(()=>{const M=L.config.chains[u],j=d,N=f?L.calculateUSDPrice(m,parseFloat(f),j):0,E=N?r.jsxs(r.Fragment,{children:[N,I]}):null,T=j?L.getTokenDisplaySymbolByTokenAddress(j):"";return r.jsxs(Ce,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[r.jsx(di,{chainConfig:M,token:j}),r.jsxs(Ce,{direction:"column",marginLeft:"12px",children:[r.jsxs(ae,{fontSize:16,children:[f," ",T]}),r.jsxs(ae,{color:t.palette.text.secondary,fontSize:14,children:[E,M?.displayName]})]})]})},[l,u,d,f,m,I,t.palette.text.secondary]),D=y.useMemo(()=>r.jsx(Ce,{height:"24px",borderLeft:"1px solid #8B919D",marginLeft:"16px"}),[]),g=y.useMemo(()=>{if(!x)return"Unknown time";const M=new Date(x),j=Date.now()-M.getTime();return j<1e3*60*60*24?L.millisToRelativeTime(j):`${new Intl.DateTimeFormat("en-US",{dateStyle:"short",timeStyle:"short"}).format(M)}`},[x]),p=y.useMemo(()=>{const M=L.getTransactionExplorerUrl(a,i),j=L.trimTxHash(i,4,4);return M?r.jsx(ri,{url:M,text:j}):j},[a,i]);return r.jsx(ge,{sx:n.container,children:r.jsx(dn,{sx:n.card,children:r.jsxs(is,{disableTouchRipple:!0,onClick:()=>{window.open(A,"_blank")},children:[r.jsx(Ea,{sx:n.cardHeader,title:r.jsxs(ae,{justifyContent:"space-between",color:t.palette.text.secondary,display:"flex",children:[r.jsxs("span",{children:["Transaction ",p]}),r.jsx("span",{children:g})]})}),r.jsxs(gn,{children:[h,D,C]})]})})})},L6=({transactions:e,hasMore:t,setPage:n})=>{const i=F.useTheme(),o=F.useMediaQuery(i.breakpoints.down("sm")),s=y.useMemo(()=>({infiniteScroller:{height:"640px",overflow:"auto",width:"100%",scrollbarWidth:"thin"},spacer:{width:"calc(100% - 8px)",display:"flex",flexDirection:"column",gap:"8px",alignItems:"center",justifyContent:"center"}}),[o]);return r.jsx(F.Box,{sx:s.infiniteScroller,children:r.jsx(N6,{hasMore:t,loadMore:a=>n(a),useWindow:!1,children:r.jsx(F.Box,{sx:s.spacer,children:e?.map((a,c)=>r.jsx(I6,{data:a},c))})})})},x6=y.memo(L6),C6=({transactions:e,isFetching:t,hasMore:n,setPage:i,sendingWallet:o})=>{const s=F.useTheme(),a=F.useMediaQuery(s.breakpoints.down("sm")),c=y.useMemo(()=>({loadingContainer:{display:"flex",flexDirection:"column",gap:"16px",alignItems:"center",justifyContent:"center",width:a?"388px":"456px"}}),[a]);return e?.length?r.jsx(x6,{transactions:e,hasMore:n,setPage:i}):t||e?.length===0?r.jsxs(F.Box,{sx:c.loadingContainer,children:[r.jsx(F.Skeleton,{variant:"rounded",height:24,width:"100%"}),r.jsx(F.Skeleton,{variant:"rounded",height:48,width:"100%"}),r.jsx(F.Skeleton,{variant:"rounded",height:48,width:"100%"})]}):!t&&(!e||e.length===0)?r.jsxs(F.Typography,{color:s.palette.text.secondary,textAlign:"center",children:["No transactions found for the wallet ",L.trimAddress(o.address)]}):null},T6=y.memo(C6),p6=()=>{const e=Xe(),t=F.useTheme(),n=F.useMediaQuery(t.breakpoints.down("sm")),[i,o]=y.useState(0),{transactions:s,isFetching:a,hasMore:c}=u6({page:i}),u=pe(A=>A.wallet.sending),d=y.useMemo(()=>({container:{maxWidth:"456px"},containerMobile:{display:"flex",flexDirection:"column"},txHistoryHeader:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"}}),[]),f=y.useMemo(()=>r.jsxs(F.Box,{sx:d.txHistoryHeader,children:[r.jsx(F.Box,{children:r.jsx(kn,{align:"left",size:18,text:"Transaction history"})}),r.jsx(F.Button,{variant:"text",sx:{color:t.palette.text.primary,padding:0,textTransform:"none",textDecoration:"none","&:hover":{textDecoration:"underline"}},onClick:()=>e(Ot("search")),children:n?"Resume":"Resume Transaction"})]}),[e,n,d.txHistoryHeader,t.palette.text.primary]),x=y.useMemo(()=>n?d.containerMobile:d.container,[n,d.container,d.containerMobile]);return r.jsxs(F.Box,{sx:{...x},children:[r.jsx(Ns,{}),f,r.jsx(T6,{transactions:s,isFetching:a,hasMore:c,setPage:o,sendingWallet:u})]})},m6=y.memo(p6);function D6(e){const t=F.useTheme(),n=Xe(),[i,o]=y.useState(e.showHistory??!1),[s,a]=y.useState(!1),{lastTokenCacheUpdate:c}=lt(),[u,d]=y.useState(!1),f=F.useMediaQuery(t.breakpoints.down("sm")),x=y.useRef(null),A=y.useMemo(()=>({bridgeContent:{margin:"auto",maxWidth:"488px"},doneIcon:{fontSize:"14px",color:t.palette.success.main},copyIcon:{fontSize:"14px"},ctaContainer:{width:"100%"}}),[t.palette.success.main]),{sending:I,receiving:m}=pe(de=>de.wallet),{fromChain:l,toChain:h,route:C,preferredRouteName:D,amount:g,toNativeToken:p,isTransactionInProgress:M,validations:j}=pe(de=>({...de.transferInput,...de.relay})),{sourceToken:N,destToken:E}=vn(),T=l===h,{allSupportedRoutes:S,sortedRoutes:z,sortedRoutesWithQuotes:Y,quotes:k,failedQuotes:Q,isFetching:P}=Bu({amount:g,fromChain:l,toChain:h,preferredRouteName:D,sourceToken:N,destToken:E,toNativeToken:p,sendingWallet:I,receivingWallet:m}),{isFetching:V,supportedDestTokens:v}=ku({sourceChain:l,destChain:h,sourceToken:N}),{error:W,errorInternal:U,info:b,onConfirm:w}=ll({quotes:k});y.useEffect(()=>{if(Y.length===0)n(Ci(""));else{const de=Y.find(ke=>ke.route===D),Te=C??de?.route??Y[0].route,Ee=Y.findIndex(ke=>ke.route===Te)>-1;if(Ee||n(Ci("")),!Te||C&&Ee)return;const Le=Y?.find(ke=>ke.route===Te);Le&&n(Ci(Le.route))}},[D,C,Y,n]);const{isConnecting:O}=D2(l,h);ol();const R=y.useMemo(()=>x2(j),[j]),_=y.useMemo(()=>L.config.routes.allSupportedChains(),[L.config.chains,L.config.routes]),J=y.useMemo(()=>{if(l){const de=L.config.tokens.getAllForChain(l),Te=L.config.chains[l];return Te?po(de,Te):de}else return[]},[l,c]),ee=y.useMemo(()=>Gs(_,h,!0),[h,_]),$=y.useMemo(()=>Gs(_,l),[l,_]),Z=y.useMemo(()=>{if(l&&I?.address)return{chain:l,wallet:I,tokens:J}},[l,I,J]),q=y.useMemo(()=>{if(h&&m?.address){const de=L.config.tokens.getAllForChain(h),Te=L.config.chains[h],Ee=Te?po(de,Te):de;return{chain:h,wallet:m,tokens:Ee}}},[h,m]),X=dl({source:Z,destination:q});y.useEffect(()=>{a(!1)},[h]),fl({route:C,destChain:h,receivingWalletAddress:m?.address,destinationBalances:X.destination.balances,hasUserManuallyChangedGas:s,currentToNativeToken:p,isFetchingBalances:X.isFetching,allowedChains:L.config.ui.autoEnableGasDropOffChains});const re=Wu({balance:N?X.source.balances[N.key]?.balance:null,quotes:k,failedQuotes:Q,tokenSymbol:N?.symbol??"",disabled:!l||!N}),K=y.useCallback(de=>{c4(n,de,I),n(d4()),n(mt(0))},[n,I]),G=y.useCallback(de=>{n(M4(de.tuple)),n(mt(0))},[n]),te=y.useCallback(de=>{u4(n,de,m),n(g4()),n(mt(0))},[n,m]),Me=y.useCallback(de=>{n(r2(de.tuple)),n(mt(0))},[n]),fe=k&&C?k[C]:void 0,je=y.useCallback(()=>{o(de=>(de||L.config.triggerEvent({type:"history.load",details:{wallet:I?.address}}),!de))},[I?.address]),Ie=y.useCallback(de=>{n(Ci(de))},[n]),ze=y.useCallback(()=>{a(!0)},[]),De=y.useMemo(()=>I?.address&&m?.address?null:I?.address&&!m?.address?{disabled:!h,side:"destination",type:Se.TransferWallet.RECEIVING}:{disabled:!l,side:"source",type:Se.TransferWallet.SENDING},[I?.address,m?.address,h,l]),{isCompatible:Be}=gl({sendingWallet:I,receivingWallet:m,sourceChain:l,destChain:h,routes:z}),ve=y.useMemo(()=>W?r.jsxs(ge,{sx:{marginBottom:2},children:[r.jsx(bn,{error:!0,testId:"send-error-message",children:W}),U&&U.message&&L.config.ui.getHelpUrl?r.jsxs(ae,{fontSize:14,sx:{marginTop:1},children:["Having trouble?"," ",r.jsxs("a",{href:"#",onClick:()=>{L.copyTextToClipboard(U.message),d(!0),setTimeout(()=>d(!1),3e3)},children:["Copy the error logs"," ",u?r.jsx(y0,{sx:A.doneIcon}):r.jsx(j0,{sx:A.copyIcon})]})," and ",r.jsx("a",{href:L.config.ui.getHelpUrl,target:"_blank",rel:"noreferrer",children:"ask for help"}),"."]}):null]}):null,[A.copyIcon,A.doneIcon,u,W,U]),Ue=y.useMemo(()=>b?r.jsx(bn,{children:b}):null,[b]),Ze=g&&B.whole(g)>0,ie=I.address&&m.address,se=!l||!N||!h||!E||!ie||!Be||!C||!R||P||!Ze||M||!!re.error,ne=y.useMemo(()=>r.jsx(Tt,{disabled:se,"data-testid":"confirm-transaction-button","aria-label":"Confirm transaction",variant:"primary",onClick:()=>w(),children:M?r.jsxs(ae,{display:"flex",alignItems:"center",gap:1,textTransform:"none",children:[r.jsx(xt,{color:"inherit",size:16,thickness:4}),f?"Preparing":"Preparing transaction"]}):!M&&P?r.jsxs(ae,{display:"flex",alignItems:"center",gap:1,textTransform:"none",children:[r.jsx(xt,{color:"inherit",size:16,thickness:4}),f?"Refreshing":"Refreshing quote"]}):r.jsx(ae,{textTransform:"none",children:f?"Confirm":"Confirm transaction"})}),[se,M,f,P,w]),oe=Ze&&N&&E,ce=!l||!N?"Please select a source asset":!h||!E?"Please select a destination asset":Ze?P?"Loading quotes...":C?"":"Please select a quote":"Please enter an amount",le=r.jsxs(r.Fragment,{children:[r.jsx(e6,{showHistory:i,onToggleHistory:je,isTransactionInProgress:M,isWalletConnected:!!I?.address}),i?r.jsx(m6,{}):r.jsxs(r.Fragment,{children:[r.jsxs(Ce,{sx:{gap:"4px",position:"relative"},children:[r.jsx(ge,{ref:x,children:r.jsx(aa,{chain:l,chainList:ee,token:N,tokenList:J,setChain:K,setToken:G,wallet:I,isSameChainSwap:T,isSource:!0,isTransactionInProgress:M,dataTestId:"source-asset-picker",isConnectingWallet:O,balances:X.source.balances,isFetchingBalances:X.isFetching,anchorEl:x.current,amountValidation:re})}),!L.config.ui.hideSwapInputs&&r.jsx(Wd,{}),r.jsx(aa,{chain:h,chainList:$,token:E,sourceToken:N,tokenList:v,isFetchingQuotes:P,isFetchingTokens:v.length===0&&V,setChain:te,setToken:Me,wallet:m,isSameChainSwap:T,isSource:!1,isTransactionInProgress:M,dataTestId:"dest-asset-picker",isConnectingWallet:O,balances:X.destination.balances,isFetchingBalances:X.isFetching,quote:fe?.success?fe:void 0,anchorEl:x.current})]}),r.jsx(ge,{component:"span",sx:A.ctaContainer,children:ie?r.jsx(cr,{title:ce,children:r.jsx("span",{children:ne})}):De?r.jsx(e5,{...De}):null}),ve,Ue,r.jsx(n6,{validation:re})]})]});return r.jsxs(ge,{sx:{...A.bridgeContent},children:[r.jsx(gr,{children:le}),!i&&r.jsx(ge,{sx:{marginTop:"12px",width:"100%"},children:oe&&r.jsx(Qd,{routes:z,selectedRoute:C,onRouteChange:Ie,quotes:k,isLoading:P,onManualGasChange:ze})}),L.config.ui.showFooter&&r.jsxs(r.Fragment,{children:[r.jsx(A2,{color:t.palette.text.primary}),r.jsx(ls,{})]})]})}const pa=y.memo(D6),A6=()=>{const e=F.useTheme(),t=y.useContext(hn),n=y.useMemo(()=>({container:{width:"100%",maxWidth:"456px",backgroundColor:e.palette.input.background,borderRadius:"8px"},card:{width:"100%",backgroundColor:e.palette.input.background}}),[e]),{sendTx:i,sender:o,amount:s,recipient:a,toChain:c,fromChain:u,token:d,receivedToken:f,receiveAmount:x,receiveNativeAmount:A,eta:I}=pe(k=>k.redeem.txData),{route:m}=pe(k=>k.redeem),l=L.config.tokens.get(d),h=L.config.tokens.get(f),{getTokenPrice:C,isFetchingTokenPrices:D,lastTokenPriceUpdate:g}=lt(),p=y.useMemo(()=>r.jsx(ae,{component:"span",padding:"0px 8px",children:"·"}),[]),M=y.useMemo(()=>{if(!l||!u)return r.jsx(r.Fragment,{});const k=L.config.tokens.get(d),Q=L.config.chains[u],P=L.calculateUSDPrice(C,s,k),V=o?L.trimAddress(o):"",v=o?L.getWalletExplorerUrl(u,o):"",W=B.display(B.truncate(s,6));return r.jsxs(Ce,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[r.jsx(di,{chainConfig:Q,token:k}),r.jsxs(Ce,{direction:"column",marginLeft:"12px",children:[r.jsxs(ae,{fontSize:16,children:[W," ",L.getTokenDisplaySymbolByTokenAddress(l)]}),r.jsx(ae,{color:e.palette.text.secondary,fontSize:14,children:D?r.jsx(xt,{size:14}):r.jsxs(r.Fragment,{children:[P,P?p:null,Q.displayName,v?r.jsxs(r.Fragment,{children:[p,r.jsx(ri,{url:v,text:V})]}):null]})})]})]})},[l,u,d,C,s,o,e.palette.text.secondary,D,p]),j=y.useMemo(()=>{if(!h||!c)return r.jsx(r.Fragment,{});const k=L.config.chains[c],Q=L.calculateUSDPrice(C,x,h),P=a?L.trimAddress(a):"",V=a?L.getWalletExplorerUrl(c,a):"",v=x?B.display(B.truncate(x,6)):"-";return r.jsxs(Ce,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[r.jsx(di,{chainConfig:k,token:h}),r.jsxs(Ce,{direction:"column",marginLeft:"12px",children:[r.jsxs(ae,{fontSize:16,children:[v," ",L.getTokenDisplaySymbolByTokenAddress(h)]}),r.jsx(ae,{color:e.palette.text.secondary,fontSize:14,children:D?r.jsx(xt,{size:14}):r.jsxs(r.Fragment,{children:[Q,Q?p:null,k.displayName,V?r.jsxs(r.Fragment,{children:[p,r.jsx(ri,{url:V,text:P})]}):null]})})]})]})},[h,C,x,a,p,e.palette.text.secondary,c,D,g]),N=y.useMemo(()=>r.jsx(Ce,{height:"28px",borderLeft:"1px solid #8B919D",marginLeft:"16px"}),[]),E=y.useMemo(()=>{if(!f||!A||B.units(A)===0n)return r.jsx(r.Fragment,{});const k=L.config.chains[c];if(!k)return r.jsx(r.Fragment,{});const Q=L.calculateUSDPrice(C,A,L.config.tokens.getGasToken(k.sdkName));return r.jsxs(Ce,{direction:"row",justifyContent:"space-between",children:[r.jsx(ae,{color:e.palette.text.secondary,fontSize:14,children:"Additional gas"}),D?r.jsx(xt,{size:14}):r.jsx(ae,{fontSize:14,children:Q})]})},[A,e.palette.text.secondary,c,D,g]),T=y.useMemo(()=>{const k=t.route??m;if(!k)return null;const Q=Q4(k,i,u,c);if(!Q||Q.length===0)return null;const P=Q.filter(({url:V})=>URL.canParse(V));return P.length===0?null:r.jsx(Ce,{direction:"column",gap:"8px",padding:"12px 16px",children:P.map(({name:V,url:v},W)=>r.jsx(Ce,{direction:"row",justifyContent:"space-between",children:r.jsx(ae,{color:e.palette.text.secondary,fontSize:14,children:r.jsx(ri,{url:v,text:`View on ${V}`})})},W))})},[u,t.route,m,i,e.palette.text.primary,c]),S=y.useMemo(()=>{let k=r.jsx(xt,{size:14});return I?(k=L.millisToHumanString(I),r.jsxs(Ce,{direction:"row",justifyContent:"space-between",children:[r.jsx(ae,{color:e.palette.text.secondary,fontSize:14,children:`Time to ${L.chainDisplayName(c)}`}),r.jsx(ae,{fontSize:14,children:k})]})):null},[I,e.palette.text.secondary,c]),z=i?L.trimAddress(i):"",Y=i?L.getTransactionExplorerUrl(u,i):"";return r.jsx(F.Box,{sx:n.container,children:r.jsxs(dn,{sx:n.card,children:[r.jsxs(gn,{children:[r.jsxs(Ce,{direction:"row",spacing:1,marginBottom:"12px",children:[r.jsx(ae,{color:e.palette.text.secondary,children:"Transaction"}),r.jsx(ae,{color:e.palette.text.secondary,children:Y?r.jsx(ri,{url:Y,text:z}):z})]}),M,N,j,r.jsxs(Ce,{direction:"column",gap:"8px",justifyContent:"space-between",marginTop:"16px",children:[E,S]})]}),r.jsx(uo,{flexItem:!0,sx:{margin:"0 16px",opacity:"50%"}}),T]})})},w6=F.createSvgIcon(r.jsx("svg",{width:"107",height:"107",viewBox:"0 0 107 107",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M53.5 36.625V57.7188M104.125 53.5C104.125 60.1482 102.816 66.7312 100.271 72.8733C97.7273 79.0155 93.9982 84.5963 89.2973 89.2973C84.5963 93.9982 79.0155 97.7273 72.8733 100.271C66.7312 102.816 60.1482 104.125 53.5 104.125C46.8518 104.125 40.2688 102.816 34.1267 100.271C27.9845 97.7273 22.4037 93.9982 17.7027 89.2973C13.0018 84.5963 9.27274 79.0155 6.7286 72.8733C4.18445 66.7312 2.875 60.1482 2.875 53.5C2.875 40.0734 8.20869 27.1967 17.7027 17.7027C27.1967 8.20869 40.0734 2.875 53.5 2.875C66.9266 2.875 79.8032 8.20869 89.2973 17.7027C98.7913 27.1967 104.125 40.0734 104.125 53.5ZM53.5 74.5938H53.545V74.6388H53.5V74.5938Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),"Alert"),S6=F.createSvgIcon(r.jsxs("svg",{width:"106",height:"106",viewBox:"0 0 106 106",stroke:"none",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.5829 105C81.6236 105 105.166 81.4949 105.166 52.5C105.166 23.5051 81.6236 0 52.5829 0C23.5422 0 0 23.5051 0 52.5C0 81.4949 23.5422 105 52.5829 105ZM52.582 101.597C79.7404 101.597 101.757 79.6157 101.757 52.5001C101.757 25.3844 79.7404 3.40283 52.582 3.40283C25.4235 3.40283 3.40723 25.3844 3.40723 52.5001C3.40723 79.6157 25.4235 101.597 52.582 101.597Z",fill:"currentColor"}),r.jsx("path",{d:"M65.7583 39.2417L39.2418 65.7582",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{d:"M39.2417 39.2417L65.7582 65.7582",stroke:"currentColor",strokeWidth:"4"})]}),"Alert"),ma=F.createSvgIcon(r.jsxs("svg",{width:"107",height:"106",viewBox:"0 0 107 106",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M53.2,105.5c29,0,52.6-23.5,52.6-52.5S82.2.5,53.2.5.6,24,.6,53s23.5,52.5,52.6,52.5ZM53.2,102.1c27.2,0,49.2-22,49.2-49.1S80.4,3.9,53.2,3.9,4,25.9,4,53s22,49.1,49.2,49.1Z"}),r.jsx("rect",{fill:"currentColor",x:"51",y:"28.8",width:"5",height:"42.6"}),r.jsx("rect",{fill:"currentColor",x:"48",y:"63.9",width:"25.5",height:"5",transform:"translate(-29.2 62.4) rotate(-45)"}),r.jsx("rect",{fill:"currentColor",x:"43.8",y:"53.7",width:"5",height:"25.5",transform:"translate(-33.4 52.2) rotate(-45)"})]}),"Alert");function E6(){const e=Xe(),t=Qe.useTheme(),[n,i]=y.useState(""),[o,s]=y.useState(null),[a,c]=y.useState(!1),[u,d]=y.useState(!1),[f,x]=y.useState(!1),[A,I]=y.useState(!1),m=y.useContext(hn),{walletProvider:l,connectWallet:h}=qt(),{sourceToken:C,destToken:D}=Zu(),g=y.useMemo(()=>({spacer:{display:"flex",flexDirection:"column",gap:"16px",alignItems:"center",justifyContent:"center",width:"100%"},container:{margin:"auto",maxWidth:"650px"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},claimButton:{backgroundColor:t.palette.warning.light,color:t.palette.warning.contrastText??t.palette.background.default,"&:hover":{backgroundColor:t.palette.warning.main}},circularProgressCircleIndeterminite:{stroke:"url(#circularGradient)",strokeDasharray:"100px, 200px",strokeLinecap:"round"},circularProgressCircleDeterminite:{strokeLinecap:"round",transitionDuration:"1s",transitionProperty:"all",transitionTimingFunction:"linear"},circularProgressRoot:{animationDuration:"1s"},errorBox:{maxWidth:"456px"},txStatusIcon:{width:"105px",height:"105px"},delayText:{maxWidth:"456px"}}),[t]),{route:p,timestamp:M,isResumeTx:j,txData:N}=pe(ne=>ne.redeem);D2(N?.fromChain,N?.toChain);const[E,T]=y.useState(void 0),{receipt:S}=m,z=S&&B.isAttested(S),Y=S&&B.isRefunded(S),k=S&&B.isFailed(S)||!!E,Q=S&&B.isFailed(S)&&S.error instanceof B.RelayFailedError,P=S&&B.isDestinationQueued(S),{recipient:V,toChain:v,fromChain:W,token:U,receivedToken:b,amount:w,eta:O=0,sendTx:R}=N,_=I2(),J=y.useMemo(()=>{if(O&&M)return new Date(M+O)},[O,M]),{seconds:ee,minutes:$,isRunning:Z,restart:q}=l0.useTimer({expiryTimestamp:new Date,autoStart:!1,onExpire:()=>x(!0)});y.useEffect(()=>{!M||!O||Z||q(new Date(M+O),!0)},[O,Z,q,M]);const X=y.useMemo(()=>L.tokenIdFromTuple(b),[b]),re=M0({receipt:S,route:p,eta:J,receivedTokenId:X}),K=S&&B.isCompleted(S)||re.isCompleted;y.useEffect(()=>{re.receipt&&m.setReceipt(re.receipt)},[m,re.receipt]);const G=!!(p&&L.config.routes.get(p)?.AUTOMATIC_DEPOSIT),te=gs(p,C,D,W,v,w,_);y.useEffect(()=>{const{receipt:ne}=m;if(ne)if(K)u||(d(!0),L.config.triggerEvent({type:"transfer.success",details:te}),G||L.config.triggerEvent({type:"transfer.redeem.success",details:te}),c(!1),i(""),s(null),N?.sendTx&&Co(N?.sendTx));else if(Y)L.config.triggerEvent({type:"transfer.refunded",details:te}),N?.sendTx&&Co(N.sendTx);else if(B.isFailed(ne)){const[oe,ce]=L.interpretTransferError(ne.error,te);i(oe),ne.error instanceof B.RelayFailedError&&ne.error.relayExplorer&&s(ne.error.relayExplorer),L.config.triggerEvent({type:"transfer.error",details:te,error:ce}),console.error(`Transfer failed with error ${ce}: ${ne.error}`),c(!1)}else if(E){const[oe,ce]=L.interpretTransferError(E,te);i(oe),L.config.triggerEvent({type:"transfer.redeem.error",details:te,error:ce}),console.error(`Error while manually redeeming: ${ce.type} - ${E}`),c(!1)}else z&&!G&&N?.sendTx?qu(N?.sendTx,"isReadyToClaim",!0):(i(""),s(null))},[S?.state,K,Y,z,E,u]);const Me=pe(ne=>ne.wallet.receiving),fe=(()=>{const ne=M+O,oe=Date.now();return ne>oe?ne-oe:0})(),je=y.useMemo(()=>{let ne="Transaction in progress";return K?ne="Transaction completed":Y?ne="Transaction was refunded":Q?ne="Transfer error":k?ne="Transaction failed":P?ne="Transaction delayed":z&&!G&&(ne=`Ready to claim on ${v}`),ne},[K,Y,Q,k,P,z,G,v]),Ie=y.useMemo(()=>{if(f)return r.jsx(Ce,{children:r.jsx(ae,{color:t.palette.text.secondary,fontSize:14,children:"Wrapping up..."})});const ne=Z?fs($,ee):null;let oe=r.jsx(xt,{size:14});return O&&(oe=`ETA ${sl(O)}`),r.jsxs(Ce,{alignItems:"center",justifyContent:"center",children:[r.jsx(ae,{color:t.palette.text.secondary,fontSize:14,children:oe}),r.jsx(ae,{fontSize:28,children:ne})]})},[O,f,Z,$,ee,t.palette.text.secondary]),ze=O?(O-fe)/O*100:0,De=y.useMemo(()=>r.jsxs(r.Fragment,{children:[r.jsx("svg",{width:0,height:0,children:r.jsx("defs",{children:r.jsxs("linearGradient",{id:"circularGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[r.jsx("stop",{offset:"0%",stopColor:t.palette.primary.main,stopOpacity:"1"}),r.jsx("stop",{offset:"100%",stopColor:t.palette.background.default,stopOpacity:"0.1"})]})})}),r.jsxs(ge,{sx:{position:"relative"},children:[r.jsx(xt,{variant:"determinate",sx:ne=>({color:ne.palette.primary.main,opacity:.2,position:"absolute"}),size:140,thickness:2,value:100}),r.jsx(xt,{variant:f?"indeterminate":"determinate",sx:{"&.MuiCircularProgress-root":g.circularProgressRoot,"& .MuiCircularProgress-circle":f?g.circularProgressCircleIndeterminite:g.circularProgressCircleDeterminite},disableShrink:f,size:140,thickness:2,value:ze})]}),r.jsx(ge,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:Ie})]}),[g.circularProgressCircleDeterminite,g.circularProgressCircleIndeterminite,g.circularProgressRoot,Ie,f,ze,t.palette.background.default,t.palette.primary.main]),Be=y.useMemo(()=>K?r.jsx(d0,{sx:{...g.txStatusIcon,color:t.palette.primary.light}}):Y||P?r.jsx(w6,{sx:{...g.txStatusIcon,color:t.palette.warning.main}}):Q?r.jsx(ma,{sx:{...g.txStatusIcon,color:t.palette.warning.light}}):k?r.jsx(S6,{sx:{...g.txStatusIcon,color:t.palette.error.light}}):!G&&z?r.jsx(ma,{sx:{...g.txStatusIcon,color:t.palette.warning.light}}):De,[K,Y,P,Q,p,k,G,z,g.txStatusIcon,t.palette.primary.light,t.palette.warning.main,t.palette.warning.light,t.palette.error.light,De]);y.useEffect(()=>{let ne;if(m.receipt&&B.isDestinationQueued(m.receipt)){c(!0);const ce=m.receipt.queueReleaseTime.getTime()-Date.now();ne=setTimeout(()=>{c(!1)},ce)}return()=>{ne&&clearTimeout(ne)}},[m.receipt]);const ve=y.useMemo(()=>{if(!V)return!1;if(j&&me.isSvmChain(v)&&Me.address&&Me.type==="Solana"&&Me.address!==V&&p&&["ManualTokenBridge","ManualCCTP","CCTPv2FastExecutorRoute","CCTPv2StandardExecutorRoute"].includes(p)){const{address:le}=L.tokenIdFromTuple(b);return Ut.getAssociatedTokenAddressSync(new qe.PublicKey(B.isNative(le)?Ut.NATIVE_MINT:le.toString()),new qe.PublicKey(Me.address)).equals(new qe.PublicKey(V))?(i(""),!0):(i("Not connected to the receiving wallet"),!1)}const ne=Me.address.toLowerCase(),oe=Me.currentAddress.toLowerCase(),ce=V.toLowerCase();return ne===oe&&ne===ce},[Me,V,v,j,p,b]),Ue=y.useCallback(async()=>{if(c(!0),i(""),s(null),T(void 0),!p)throw new Error("Unknown route, can not claim");if(!m.receipt)throw new Error("No receipt found, can not claim");const ne={route:p,fromToken:Mn(L.config.tokens.mustGet(U)),toToken:Mn(L.config.tokens.mustGet(b)),fromChain:W,toChain:v};if(L.config.triggerEvent({type:"transfer.redeem.initiate",details:ne}),!ve)throw i("Not connected to the receiving wallet"),new Error("Not connected to the receiving wallet");if(!L.config.chains[v])throw i("Your claim has failed, please try again"),new Error("invalid destination chain");const ce=m.route;try{if(!B.isManual(ce)&&!B.isFinalizable(ce))throw new Error("Route is not manual or finalizable");const le=await ui.fromChain(v,Me.address,Se.TransferWallet.RECEIVING,l),de=P&&B.isFinalizable(ce)?ce.finalize(le,m.receipt):!P&&B.isManual(ce)?ce.complete(le,m.receipt):void 0;de&&(L.config.triggerEvent({type:"transfer.redeem.start",details:te}),await de)}catch(le){T(le),c(!1)}},[te,W,ve,P,b,Me.address,m.receipt,m.route,p,v,U,l]),Ze=y.useCallback(async()=>{I(!0),await h(v,Se.TransferWallet.RECEIVING)},[h,v]),ie=y.useMemo(()=>a?r.jsx(Tt,{disabled:!0,variant:"primary",children:r.jsxs(ae,{display:"flex",alignItems:"center",gap:1,textTransform:"none",children:[r.jsx(xt,{size:16,sx:{color:t.palette.primary.contrastText}}),"Transfer in progress"]})}):Q&&o?r.jsx(Tt,{variant:"primary",onClick:()=>{window.open(o.url,"_blank","noopener,noreferrer")},children:r.jsxs(ae,{textTransform:"none",children:["Recover on ",o.name]})}):Q&&p==="CCTPExecutorRoute"&&R?r.jsx(Tt,{variant:"primary",onClick:()=>{e(No()),e(Ot("search")),e(u2({txHash:R,chain:W}))},children:r.jsx(ae,{textTransform:"none",children:"Claim tokens to complete transfer"})}):P||!G&&z||Q?ve?r.jsx(Tt,{styleOverrides:[g.claimButton],variant:n?"error":"primary",onClick:Ue,children:r.jsx(ae,{textTransform:"none",children:"Claim tokens to complete transfer"})}):r.jsx(Tt,{variant:"primary",onClick:Ze,children:r.jsx(ae,{textTransform:"none",children:"Connect receiving wallet"})}):r.jsxs(r.Fragment,{children:[r.jsx(Tt,{variant:"primary",onClick:()=>{e(Ot("bridge"))},children:r.jsx(ae,{textTransform:"none",children:"Start a new transaction"})}),!K&&r.jsx(ae,{fontSize:"12px",sx:{margin:"auto",opacity:.6},children:"Your current transaction will continue to process in the background."})]}),[a,P,G,z,Q,p,R,g.claimButton,K,t.palette.primary.contrastText,ve,n,Ue,Ze,e,W]),se=y.useMemo(()=>{if(!m.receipt||!B.isDestinationQueued(m.receipt))return null;const{to:ne,queueReleaseTime:oe}=m.receipt,ce=L.config.tokens.get(b),le=ce?L.getTokenDisplaySymbolByTokenAddress(ce):"",de=oe.toLocaleString();return r.jsx(ae,{color:t.palette.text.secondary,fontSize:14,sx:g.delayText,children:`Your transfer to ${ne} is delayed due to rate limits configured by ${le}. After
|
|
484
484
|
the delay ends on ${de}, you will need to tap "Claim" to
|
|
485
|
-
complete your transfer.`})},[g.delayText,b,m.receipt,t.palette.text.secondary]);return r.jsxs(ge,{sx:{...g.container,...g.spacer},"data-testid":"redeem-view",children:[r.jsxs(gr,{children:[r.jsx(Ns,{}),r.jsxs(ge,{display:"flex",alignItems:"center",children:[r.jsx(Ms,{route:"bridge"}),r.jsx(kn,{align:"left",text:je,size:24,weight:600,"data-testid":"redeem-view-status-header"})]}),r.jsx(ge,{sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:"140px"},children:Be}),r.jsx(A6,{}),ie,se,n&&r.jsx(bn,{error:!0,sx:g.errorBox,children:n})]}),L.config.ui.showFooter&&r.jsx(A2,{color:t.palette.text.primary}),r.jsx(js,{open:A,walletType:Se.TransferWallet.RECEIVING,setIsOpen:I,isAddressInputVisible:!1})]})}const z6=y.memo(E6),b6=()=>r.jsxs("svg",{width:"0",height:"0",viewBox:"0 0 0 0",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"icons_tokens_sol_linearGradient_0",x1:"4.168",y1:"85.832",x2:"91.832",y2:"-1.832",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#9945FF"}),r.jsx("stop",{offset:".2",stopColor:"#7962E7"}),r.jsx("stop",{offset:"1",stopColor:"#00D18C"})]}),r.jsx("clipPath",{id:"icons_tokens_sol_clipPath_0",children:r.jsx("path",{fill:"#fff",d:"M0 0h96v84H0z"})})]}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_chains_apt_clipPath_0",children:r.jsx("rect",{width:"36",height:"36",fill:"white"})})}),r.jsxs("defs",{children:[r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_0",cx:"0",cy:"0",r:"1",gradientTransform:"translate(653.009 167.889) scale(202.547 206.035)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_1",cx:"0",cy:"0",r:"1",gradientTransform:"translate(540.32 255.753) scale(495.56 504.093)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_0",x1:"331.959",x2:"415.726",y1:"687.445",y2:"179.399",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#81FFFF"}),r.jsx("stop",{offset:".62",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_1",x1:"551.129",x2:"338.385",y1:"258.408",y2:"450.302",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_2",x1:"131.705",x2:"613.118",y1:"553.353",y2:"553.353",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0002E9"}),r.jsx("stop",{offset:".995",stopColor:"#FF00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_3",x1:"635.906",x2:"369.659",y1:"452.584",y2:"699.942",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_4",x1:"131.705",x2:"389.259",y1:"553.352",y2:"553.352",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#7D00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_5",x1:"132.029",x2:"612.795",y1:"453.743",y2:"453.743",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#BE00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_6",x1:"604.91",x2:"569.494",y1:"191.453",y2:"248.03",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_7",x1:"343.013",x2:"362.187",y1:"613.233",y2:"613.233",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_8",x1:"409.132",x2:"428.305",y1:"606.695",y2:"606.695",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_9",x1:"379.785",x2:"394.18",y1:"639.688",y2:"639.688",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_10",x1:"438.053",x2:"452.447",y1:"632.755",y2:"632.755",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_11",x1:"281.083",x2:"312.395",y1:"600.365",y2:"600.365",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_12",x1:"467.049",x2:"498.361",y1:"548.259",y2:"548.259",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsx("clipPath",{id:"icons_chains_osmo_clipPath_0",children:r.jsx("rect",{width:"800",height:"800",fill:"#fff"})})]}),r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"linearGradient_icons_chains_sol_0",x1:"21.9203",y1:"4.40983",x2:"9.65997",y2:"27.9398",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#00FFA3"}),r.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),r.jsxs("linearGradient",{id:"linearGradient_icons_chains_sol_1",x1:"21.9203",y1:"4.40982",x2:"9.65999",y2:"27.9398",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#00FFA3"}),r.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),r.jsxs("linearGradient",{id:"linearGradient_icons_chains_sol_2",x1:"21.9203",y1:"4.40983",x2:"9.66001",y2:"27.9398",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#00FFA3"}),r.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]})]}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_chains_sui_clipPath_0",children:r.jsx("rect",{width:"18",height:"24",fill:"white",transform:"translate(9 6)"})})}),r.jsxs("defs",{children:[r.jsxs("radialGradient",{id:"icons_chains_uni_radialGradient_0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(18.4297 18) rotate(90) scale(18 17.93)",children:[r.jsx("stop",{stopColor:"#FC74FE"}),r.jsx("stop",{offset:"1",stopColor:"#F50DB4"})]}),r.jsx("clipPath",{id:"icons_chains_uni_clipPath_0",children:r.jsx("rect",{width:"36",height:"36",fill:"white",transform:"translate(0.429688)"})})]}),r.jsx("defs",{children:r.jsxs("linearGradient",{id:"icons_chains_xlayer_linearGradient_0",x1:"34",y1:"35.4996",x2:"1.5",y2:"3.49957",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#040404"}),r.jsx("stop",{offset:"1",stopColor:"#282828"})]})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_busd_clipPath_0",children:r.jsx("rect",{width:"199.401",height:"200",fill:"white"})})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_dai_clipPath_0",children:r.jsx("rect",{width:"200",height:"200",fill:"white"})})}),r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"icons_tokens_inj_linearGradient_0",x1:"100",y1:"300",x2:"500",y2:"300",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0082FA"}),r.jsx("stop",{offset:"1",stopColor:"#00F2FE"})]}),r.jsxs("linearGradient",{id:"icons_tokens_inj_linearGradient_1",x1:"100",y1:"300",x2:"500",y2:"300",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0082FA"}),r.jsx("stop",{offset:"1",stopColor:"#00F2FE"})]})]}),r.jsxs("defs",{children:[r.jsxs("filter",{id:"icons_tokens_ntt_filter_0",x:"36.0726",y:"19.3241",width:"12.6301",height:"12.6306",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.18048",result:"effect1_foregroundBlur_4160_67832"})]}),r.jsxs("linearGradient",{id:"icons_tokens_ntt_linearGradient_0",x1:"76.3139",y1:"25.3915",x2:"10.1678",y2:"25.3915",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1, 0, 0, 1, 307.155052, 224.001474)",children:[r.jsx("stop",{stopColor:"white",stopOpacity:"0"}),r.jsx("stop",{offset:"0.5142",stopColor:"white"}),r.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_tokens_ntt_linearGradient_1",x1:"42.748",y1:"1.55322",x2:"42.748",y2:"50.4438",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1, 0, 0, 1, 307.155052, 224.001474)",children:[r.jsx("stop",{stopColor:"white"}),r.jsx("stop",{offset:"0.4519",stopColor:"white",stopOpacity:"0"}),r.jsx("stop",{offset:"0.5397",stopColor:"white",stopOpacity:"0"}),r.jsx("stop",{offset:"1",stopColor:"white"})]})]}),r.jsxs("defs",{children:[r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_0",cx:"0",cy:"0",r:"1",gradientTransform:"translate(653.009 167.889) scale(202.547 206.035)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_1",cx:"0",cy:"0",r:"1",gradientTransform:"translate(540.32 255.753) scale(495.56 504.093)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_0",x1:"331.959",x2:"415.726",y1:"687.445",y2:"179.399",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#81FFFF"}),r.jsx("stop",{offset:".62",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_1",x1:"551.129",x2:"338.385",y1:"258.408",y2:"450.302",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_2",x1:"131.705",x2:"613.118",y1:"553.353",y2:"553.353",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0002E9"}),r.jsx("stop",{offset:".995",stopColor:"#FF00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_3",x1:"635.906",x2:"369.659",y1:"452.584",y2:"699.942",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_4",x1:"131.705",x2:"389.259",y1:"553.352",y2:"553.352",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#7D00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_5",x1:"132.029",x2:"612.795",y1:"453.743",y2:"453.743",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#BE00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_6",x1:"604.91",x2:"569.494",y1:"191.453",y2:"248.03",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_7",x1:"343.013",x2:"362.187",y1:"613.233",y2:"613.233",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_8",x1:"409.132",x2:"428.305",y1:"606.695",y2:"606.695",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_9",x1:"379.785",x2:"394.18",y1:"639.688",y2:"639.688",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_10",x1:"438.053",x2:"452.447",y1:"632.755",y2:"632.755",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_11",x1:"281.083",x2:"312.395",y1:"600.365",y2:"600.365",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_12",x1:"467.049",x2:"498.361",y1:"548.259",y2:"548.259",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsx("clipPath",{id:"icons_chains_osmo_clipPath_0",children:r.jsx("rect",{width:"800",height:"800",fill:"#fff"})})]}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_usdt_clipPath_0",children:r.jsx("rect",{width:"229.912",height:"200",fill:"white"})})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_wbtc_clipPath_0",children:r.jsx("rect",{width:"200",height:"200.022",fill:"white"})})})]}),O6=()=>{const e=Qe.useTheme(),t=y.useContext(hn),n=pe(a=>a.router.route),i=Xe(),o=L.usePrevious(n),{hasExternalSearch:s}=bu();return y.useEffect(()=>{const a="redeem",c="bridge";o===a&&n!==a&&(i(No()),i(t4()),t.clear()),n===c&&o!==c&&o!=="history"&&i(o2())},[n,o,i,t]),y.useEffect(()=>{s&&(i(No()),i(Ot("search")))},[s,i]),r.jsxs(F.Box,{sx:{textAlign:"left",margin:"40px auto",maxWidth:"900px",width:"100%",display:"flex",justifyContent:"center",fontFamily:e.typography.fontFamily,[e.breakpoints.down("sm")]:{margin:"16px auto"}},children:[r.jsx(b6,{}),n==="bridge"&&r.jsx(pa,{showHistory:!1}),n==="redeem"&&r.jsx(z6,{}),n==="history"&&r.jsx(pa,{showHistory:!0}),n==="search"&&r.jsx(zu,{}),n==="terms"&&r.jsx(A4,{})]})};function k6(e){const t=Xe(),n=y.useRef(!1),i=y.useRef(!0),o=pe(a=>a.router.route),s=y.useCallback(a=>{L.isEmptyObject(a)||L.setConfig(a),n.current=!0,L.config.triggerEvent({type:"config",config:a})},[]);return n.current||(e.config&&s(e.config),o!=="bridge"&&t(Ot("bridge"))),y.useEffect(()=>{i.current?(i.current=!1,L.config.triggerEvent({type:"load",config:e.config})):e.config&&(s(e.config),t(o2()))},[e.config,s,t]),r.jsx(O6,{})}const v6={mode:"light",primary:{main:"#A89EFF"},secondary:{main:"#cccccc"},divider:"#a0a2a9",background:{default:"transparent"},text:{primary:"#3F3F46",secondary:"#71717B",tertiary:"#9F9FA9",accent:"#9891DA"},error:{main:"#f44336"},info:{main:"#A4C8F3"},success:{main:"#4caf50"},warning:{main:"#ff9800"},button:{primary:"#A89EFF",primaryText:"#F9F9FB",disabled:"#F3F4F6",disabledText:"#99A1AF",action:"#A89EFF",actionText:"#F9F9FB",hover:"#A89EFF"},options:{hover:"#f9f9fb",select:"#F0F0F5"},card:{background:"#F0F0F5",elevation:"10px 10px 30px 15px #CCD2E7",secondary:"#F0F0F5"},popover:{background:"#FFFFFF",elevation:"10px 10px 30px 15px #CCD2E7",secondary:"#F0F0F5"},input:{background:"#F9F9FB",border:"#E8E6F0",fillTreatment:!0},icon:{primary:"#101828",secondary:"#99A1AF"},toggle:{background:"#E5E7EB",text:"#71717B",active:"#A89EFF",activeText:"#FFFFFF"},formContainer:{background:"#FBFAF9",border:"#E4E4E7"},font:'"Inter", sans-serif',logo:"#000000"},U6={mode:"dark",primary:{main:"#AFA7F6"},secondary:{main:"#667085"},divider:"#ffffff"+ut[20],background:{default:"transparent"},text:{primary:"#ffffff",secondary:"#71717B",tertiary:"#52525C",accent:"#ffffff"},info:{main:"#304C70"},error:{main:"#F04438"},success:{main:"#12B76A"},warning:{main:"#F79009"},button:{primary:"#AFA7F6",primaryText:"#12111A",disabled:"#3F3F46",disabledText:"#71717B",action:"#AFA7F6",actionText:"#12111A",hover:"#9891DA"},options:{hover:"#ffffff"+ut[7],select:"#ffffff"+ut[10]},card:{background:"#1b2033",secondary:"#ffffff"+ut[5],elevation:"none"},popover:{background:"#1b2033",secondary:"#ffffff"+ut[5],elevation:"none"},input:{background:"#18181B",border:"#3F3F46",fillTreatment:!0},icon:{primary:"#F9FAFB",secondary:"#6A7282"},toggle:{background:"#18181B",text:"#9F9FA9",active:"#3C3A50",activeText:"#F4F4F5"},formContainer:{background:"#0E0D12",border:"#333333"},font:'"Inter", sans-serif',logo:"#ffffff"},Y6=e=>{const n=e.mode==="light"?v6:U6,i=Object.assign({},n);if(e){if(e.background&&(i.background={default:e.background}),e.input&&(i.input={...i.input,background:e.input,border:e.secondary||i.secondary.main}),e.inputFillTreatment!==void 0&&(i.input.fillTreatment=e.inputFillTreatment),e.primary){i.primary={main:e.primary};const o=Pe(e.primary||i.primary.main);let s,a,c,u,d,f;o.isDark()?(s=o.lightness(95).hex(),a=o.alpha(.5).hexa(),c=o.lightness(95).alpha(.9).hexa(),u=o.darken(.15).hex(),d=o.lightness(80).hex(),f=o.darken(.05).hex()):(s=o.lightness(5).hex(),a=o.alpha(.5).hexa(),c=o.lightness(5).alpha(.9).hexa(),u=o.lighten(.05).hex(),d=o.lightness(0).hex(),f=o.lighten(.05).hex()),i.button={primary:o.hex(),primaryText:s,disabled:a,disabledText:c,action:u,actionText:d,hover:f}}e.secondary&&(i.secondary={main:e.secondary}),e.text&&(i.text.primary=e.text),e.textSecondary&&(i.text.secondary=e.textSecondary),e.error&&(i.error={main:e.error}),e.success&&(i.success={main:e.success}),e.formBackground&&(i.formContainer={...i.formContainer,background:e.formBackground||i.formContainer.background}),e.formBorder&&(i.formContainer={...i.formContainer,border:e.formBorder||i.formContainer.border})}return Qe.createTheme({components:{MuiPaper:{styleOverrides:{root:{boxShadow:"none"}}},MuiCollapse:{styleOverrides:{root:{width:"100%"}}}},breakpoints:{values:{xs:300,sm:500,md:650,lg:900,xl:1200}},typography:{fontFamily:e.font??'"Inter", sans-serif'},palette:{...i}})};class _6 extends y.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error(t,n)}render(){return this.state.hasError?r.jsx(F.Card,{children:r.jsx(F.Typography,{variant:"h5",style:{textAlign:"center",marginTop:24,marginBottom:24},children:"An unexpected error has occurred. Please refresh the page."})}):this.props.children}}function R6({children:e,provider:t}){const[n,i]=y.useState(!1),o=Xe(),s=y.useCallback((f,x,A)=>{const I=f.getAddress();if(!I)throw new Error("Wallet is not connected");const m={address:I,type:B.chainToPlatform(x),icon:f.getIcon(),name:f.getName()};A===Se.TransferWallet.SENDING?o($c(m)):o(Kc(m));const l=C=>{(C.length===0||C.length&&I&&C[0]!==I)&&f.disconnect()},h=()=>{o(ci(A)),f.off("disconnect",h),f.off("accountsChanged",l)};f.on("disconnect",h),f.on("accountsChanged",l),L.config.triggerEvent({type:"wallet.connect",details:{side:A,chain:x,wallet:f.getName().toLowerCase(),address:f.getAddress()}})},[o]);y.useEffect(()=>(t.on("walletConnected",s),()=>{t.off("walletConnected",s)}),[t,s]);const a=y.useCallback(async(f,x,A)=>{i(!0);try{const I=await t.connectWallet(f,x,A);return I&&s(I,f,x),I}catch{return null}finally{i(!1)}},[s,t]),c=y.useCallback(()=>{t.swapWallets(),o(n4())},[o,t]),u=y.useCallback(async(f,x)=>{try{const A=t.getWallet(f,x);A&&A.disconnect()}catch(A){console.error("Error disconnecting wallet:",A)}o(ci(x))},[o,t]),d=y.useMemo(()=>({connectWallet:a,swapWallets:c,disconnectWallet:u,walletProvider:t,isConnecting:n}),[a,c,u,t,n]);return r.jsx(N2.Provider,{value:d,children:e})}function Q6({config:e,theme:t,walletProvider:n}){He.useEffect(()=>{globalThis.dispatchReduxAction||(window.dispatchReduxAction=s=>{Ws.dispatch(s)})},[]);const i=He.useMemo(()=>Y6(t??{mode:"dark"}),[t]),o=He.useMemo(()=>n??R3,[n]);return r.jsx(X0,{store:Ws,children:r.jsx(Qe.ThemeProvider,{theme:i,children:r.jsx(h0,{enableColorScheme:!0,children:r.jsx(_6,{children:r.jsx(R6,{provider:o,children:r.jsx(Eu,{children:r.jsx(_4,{children:r.jsx(k6,{config:e})})})})})})})})}const{AutomaticTokenBridgeRoute:B6,TokenBridgeRoute:P6,AutomaticCCTPRoute:W6,CCTPRoute:Z6,TBTCRoute:F6}=b0.routes;exports.DEFAULT_ROUTES=L.DEFAULT_ROUTES;exports.ERR_AMOUNT_TOO_LARGE=L.ERR_AMOUNT_TOO_LARGE;exports.ERR_AMOUNT_TOO_SMALL=L.ERR_AMOUNT_TOO_SMALL;exports.ERR_DESTINATION_CONTRACT_PAUSED=L.ERR_DESTINATION_CONTRACT_PAUSED;exports.ERR_INSUFFICIENT_ALLOWANCE=L.ERR_INSUFFICIENT_ALLOWANCE;exports.ERR_INSUFFICIENT_FUNDS=L.ERR_INSUFFICIENT_FUNDS;exports.ERR_INSUFFICIENT_GAS=L.ERR_INSUFFICIENT_GAS;exports.ERR_NOT_ENOUGH_CAPACITY=L.ERR_NOT_ENOUGH_CAPACITY;exports.ERR_RELAY_FAILED=L.ERR_RELAY_FAILED;exports.ERR_SOURCE_CONTRACT_PAUSED=L.ERR_SOURCE_CONTRACT_PAUSED;exports.ERR_TIMEOUT=L.ERR_TIMEOUT;exports.ERR_UNKNOWN=L.ERR_UNKNOWN;exports.ERR_UNSUPPORTED_ABI_VERSION=L.ERR_UNSUPPORTED_ABI_VERSION;exports.ERR_USER_REJECTED=L.ERR_USER_REJECTED;exports.MAINNET=L.MAINNET;exports.TESTNET=L.TESTNET;exports.Token=L.Token;exports.UserActions=L.UserActions;exports.buildConfig=L.buildConfig;exports.config=L.types;exports.TransferWallet=Se.TransferWallet;exports.AutomaticCCTPRoute=W6;exports.AutomaticTokenBridgeRoute=B6;exports.CCTPRoute=Z6;exports.TBTCRoute=F6;exports.TokenBridgeRoute=P6;exports.default=Q6;exports.getTokenDetails=Mn;exports.getTransferDetails=gs;
|
|
485
|
+
complete your transfer.`})},[g.delayText,b,m.receipt,t.palette.text.secondary]);return r.jsxs(ge,{sx:{...g.container,...g.spacer},"data-testid":"redeem-view",children:[r.jsxs(gr,{children:[r.jsx(Ns,{}),r.jsxs(ge,{display:"flex",alignItems:"center",children:[r.jsx(Ms,{route:"bridge"}),r.jsx(kn,{align:"left",text:je,size:24,weight:600,"data-testid":"redeem-view-status-header"})]}),r.jsx(ge,{sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:"140px"},children:Be}),r.jsx(A6,{}),ie,se,n&&r.jsx(bn,{error:!0,sx:g.errorBox,children:n})]}),L.config.ui.showFooter&&r.jsx(A2,{color:t.palette.text.primary}),r.jsx(js,{open:A,walletType:Se.TransferWallet.RECEIVING,setIsOpen:I,isAddressInputVisible:!1})]})}const z6=y.memo(E6),b6=()=>r.jsxs("svg",{width:"0",height:"0",viewBox:"0 0 0 0",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"icons_tokens_sol_linearGradient_0",x1:"4.168",y1:"85.832",x2:"91.832",y2:"-1.832",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#9945FF"}),r.jsx("stop",{offset:".2",stopColor:"#7962E7"}),r.jsx("stop",{offset:"1",stopColor:"#00D18C"})]}),r.jsx("clipPath",{id:"icons_tokens_sol_clipPath_0",children:r.jsx("path",{fill:"#fff",d:"M0 0h96v84H0z"})})]}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_chains_apt_clipPath_0",children:r.jsx("rect",{width:"36",height:"36",fill:"white"})})}),r.jsxs("defs",{children:[r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_0",cx:"0",cy:"0",r:"1",gradientTransform:"translate(653.009 167.889) scale(202.547 206.035)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_1",cx:"0",cy:"0",r:"1",gradientTransform:"translate(540.32 255.753) scale(495.56 504.093)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_0",x1:"331.959",x2:"415.726",y1:"687.445",y2:"179.399",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#81FFFF"}),r.jsx("stop",{offset:".62",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_1",x1:"551.129",x2:"338.385",y1:"258.408",y2:"450.302",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_2",x1:"131.705",x2:"613.118",y1:"553.353",y2:"553.353",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0002E9"}),r.jsx("stop",{offset:".995",stopColor:"#FF00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_3",x1:"635.906",x2:"369.659",y1:"452.584",y2:"699.942",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_4",x1:"131.705",x2:"389.259",y1:"553.352",y2:"553.352",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#7D00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_5",x1:"132.029",x2:"612.795",y1:"453.743",y2:"453.743",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#BE00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_6",x1:"604.91",x2:"569.494",y1:"191.453",y2:"248.03",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_7",x1:"343.013",x2:"362.187",y1:"613.233",y2:"613.233",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_8",x1:"409.132",x2:"428.305",y1:"606.695",y2:"606.695",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_9",x1:"379.785",x2:"394.18",y1:"639.688",y2:"639.688",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_10",x1:"438.053",x2:"452.447",y1:"632.755",y2:"632.755",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_11",x1:"281.083",x2:"312.395",y1:"600.365",y2:"600.365",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_12",x1:"467.049",x2:"498.361",y1:"548.259",y2:"548.259",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsx("clipPath",{id:"icons_chains_osmo_clipPath_0",children:r.jsx("rect",{width:"800",height:"800",fill:"#fff"})})]}),r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"linearGradient_icons_chains_sol_0",x1:"21.9203",y1:"4.40983",x2:"9.65997",y2:"27.9398",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#00FFA3"}),r.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),r.jsxs("linearGradient",{id:"linearGradient_icons_chains_sol_1",x1:"21.9203",y1:"4.40982",x2:"9.65999",y2:"27.9398",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#00FFA3"}),r.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),r.jsxs("linearGradient",{id:"linearGradient_icons_chains_sol_2",x1:"21.9203",y1:"4.40983",x2:"9.66001",y2:"27.9398",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#00FFA3"}),r.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]})]}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_chains_sui_clipPath_0",children:r.jsx("rect",{width:"18",height:"24",fill:"white",transform:"translate(9 6)"})})}),r.jsxs("defs",{children:[r.jsxs("radialGradient",{id:"icons_chains_uni_radialGradient_0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(18.4297 18) rotate(90) scale(18 17.93)",children:[r.jsx("stop",{stopColor:"#FC74FE"}),r.jsx("stop",{offset:"1",stopColor:"#F50DB4"})]}),r.jsx("clipPath",{id:"icons_chains_uni_clipPath_0",children:r.jsx("rect",{width:"36",height:"36",fill:"white",transform:"translate(0.429688)"})})]}),r.jsx("defs",{children:r.jsxs("linearGradient",{id:"icons_chains_xlayer_linearGradient_0",x1:"34",y1:"35.4996",x2:"1.5",y2:"3.49957",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#040404"}),r.jsx("stop",{offset:"1",stopColor:"#282828"})]})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_busd_clipPath_0",children:r.jsx("rect",{width:"199.401",height:"200",fill:"white"})})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_dai_clipPath_0",children:r.jsx("rect",{width:"200",height:"200",fill:"white"})})}),r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:"icons_tokens_inj_linearGradient_0",x1:"100",y1:"300",x2:"500",y2:"300",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0082FA"}),r.jsx("stop",{offset:"1",stopColor:"#00F2FE"})]}),r.jsxs("linearGradient",{id:"icons_tokens_inj_linearGradient_1",x1:"100",y1:"300",x2:"500",y2:"300",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0082FA"}),r.jsx("stop",{offset:"1",stopColor:"#00F2FE"})]})]}),r.jsxs("defs",{children:[r.jsxs("filter",{id:"icons_tokens_ntt_filter_0",x:"36.0726",y:"19.3241",width:"12.6301",height:"12.6306",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.18048",result:"effect1_foregroundBlur_4160_67832"})]}),r.jsxs("linearGradient",{id:"icons_tokens_ntt_linearGradient_0",x1:"76.3139",y1:"25.3915",x2:"10.1678",y2:"25.3915",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1, 0, 0, 1, 307.155052, 224.001474)",children:[r.jsx("stop",{stopColor:"white",stopOpacity:"0"}),r.jsx("stop",{offset:"0.5142",stopColor:"white"}),r.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_tokens_ntt_linearGradient_1",x1:"42.748",y1:"1.55322",x2:"42.748",y2:"50.4438",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1, 0, 0, 1, 307.155052, 224.001474)",children:[r.jsx("stop",{stopColor:"white"}),r.jsx("stop",{offset:"0.4519",stopColor:"white",stopOpacity:"0"}),r.jsx("stop",{offset:"0.5397",stopColor:"white",stopOpacity:"0"}),r.jsx("stop",{offset:"1",stopColor:"white"})]})]}),r.jsxs("defs",{children:[r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_0",cx:"0",cy:"0",r:"1",gradientTransform:"translate(653.009 167.889) scale(202.547 206.035)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("radialGradient",{id:"icons_chains_osmo_radialGradient_1",cx:"0",cy:"0",r:"1",gradientTransform:"translate(540.32 255.753) scale(495.56 504.093)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#FFEAFF",stopOpacity:".6"}),r.jsx("stop",{offset:".681",stopColor:"#A087C9"}),r.jsx("stop",{offset:"1",stopColor:"#10002F"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_0",x1:"331.959",x2:"415.726",y1:"687.445",y2:"179.399",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#81FFFF"}),r.jsx("stop",{offset:".62",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_1",x1:"551.129",x2:"338.385",y1:"258.408",y2:"450.302",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_2",x1:"131.705",x2:"613.118",y1:"553.353",y2:"553.353",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#0002E9"}),r.jsx("stop",{offset:".995",stopColor:"#FF00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_3",x1:"635.906",x2:"369.659",y1:"452.584",y2:"699.942",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_4",x1:"131.705",x2:"389.259",y1:"553.352",y2:"553.352",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#7D00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_5",x1:"132.029",x2:"612.795",y1:"453.743",y2:"453.743",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#000292"}),r.jsx("stop",{offset:".995",stopColor:"#BE00C7"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_6",x1:"604.91",x2:"569.494",y1:"191.453",y2:"248.03",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_7",x1:"343.013",x2:"362.187",y1:"613.233",y2:"613.233",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_8",x1:"409.132",x2:"428.305",y1:"606.695",y2:"606.695",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_9",x1:"379.785",x2:"394.18",y1:"639.688",y2:"639.688",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_10",x1:"438.053",x2:"452.447",y1:"632.755",y2:"632.755",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_11",x1:"281.083",x2:"312.395",y1:"600.365",y2:"600.365",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:"icons_chains_osmo_linearGradient_12",x1:"467.049",x2:"498.361",y1:"548.259",y2:"548.259",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:".289",stopColor:"#fff"}),r.jsx("stop",{offset:".78",stopColor:"#fff",stopOpacity:"0"})]}),r.jsx("clipPath",{id:"icons_chains_osmo_clipPath_0",children:r.jsx("rect",{width:"800",height:"800",fill:"#fff"})})]}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_usdt_clipPath_0",children:r.jsx("rect",{width:"229.912",height:"200",fill:"white"})})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"icons_tokens_wbtc_clipPath_0",children:r.jsx("rect",{width:"200",height:"200.022",fill:"white"})})})]}),O6=()=>{const e=Qe.useTheme(),t=y.useContext(hn),n=pe(a=>a.router.route),i=Xe(),o=L.usePrevious(n),{hasExternalSearch:s}=bu();return y.useEffect(()=>{const a="redeem",c="bridge";o===a&&n!==a&&(i(No()),i(t4()),t.clear()),n===c&&o!==c&&o!=="history"&&i(o2())},[n,o,i,t]),y.useEffect(()=>{s&&(i(No()),i(Ot("search")))},[s,i]),r.jsxs(F.Box,{sx:{textAlign:"left",margin:"40px auto",maxWidth:"900px",width:"100%",display:"flex",justifyContent:"center",fontFamily:e.typography.fontFamily,[e.breakpoints.down("sm")]:{margin:"16px auto"}},children:[r.jsx(b6,{}),n==="bridge"&&r.jsx(pa,{showHistory:!1}),n==="redeem"&&r.jsx(z6,{}),n==="history"&&r.jsx(pa,{showHistory:!0}),n==="search"&&r.jsx(zu,{}),n==="terms"&&r.jsx(A4,{})]})};function k6(e){const t=Xe(),n=y.useRef(!1),i=y.useRef(!0),o=pe(a=>a.router.route),s=y.useCallback(a=>{L.isEmptyObject(a)||L.setConfig(a),n.current=!0,L.config.triggerEvent({type:"config",config:a})},[]);return n.current||(e.config&&s(e.config),o!=="bridge"&&t(Ot("bridge"))),y.useEffect(()=>{i.current?(i.current=!1,L.config.triggerEvent({type:"load",config:e.config})):e.config&&(s(e.config),t(o2()))},[e.config,s,t]),r.jsx(O6,{})}const v6={mode:"light",primary:{main:"#A89EFF"},secondary:{main:"#cccccc"},divider:"#a0a2a9",background:{default:"transparent"},text:{primary:"#3F3F46",secondary:"#71717B",tertiary:"#9F9FA9",accent:"#9891DA"},error:{main:"#f44336"},info:{main:"#A4C8F3"},success:{main:"#4caf50"},warning:{main:"#ff9800"},button:{primary:"#A89EFF",primaryText:"#F9F9FB",disabled:"#F3F4F6",disabledText:"#99A1AF",action:"#A89EFF",actionText:"#F9F9FB",hover:"#A89EFF"},options:{hover:"#f9f9fb",select:"#F0F0F5"},card:{background:"#F0F0F5",elevation:"10px 10px 30px 15px #CCD2E7",secondary:"#F0F0F5"},popover:{background:"#FFFFFF",elevation:"10px 10px 30px 15px #CCD2E7",secondary:"#F0F0F5"},input:{background:"#F9F9FB",border:"#E8E6F0",fillTreatment:!0},icon:{primary:"#101828",secondary:"#99A1AF"},toggle:{background:"#E5E7EB",text:"#71717B",active:"#A89EFF",activeText:"#FFFFFF"},formContainer:{background:"#FBFAF9",border:"#E4E4E7"},font:'"Inter", sans-serif',logo:"#000000"},U6={mode:"dark",primary:{main:"#AFA7F6"},secondary:{main:"#667085"},divider:"#ffffff"+ut[20],background:{default:"transparent"},text:{primary:"#ffffff",secondary:"#71717B",tertiary:"#52525C",accent:"#ffffff"},info:{main:"#304C70"},error:{main:"#F04438"},success:{main:"#12B76A"},warning:{main:"#F79009"},button:{primary:"#AFA7F6",primaryText:"#12111A",disabled:"#3F3F46",disabledText:"#71717B",action:"#AFA7F6",actionText:"#12111A",hover:"#9891DA"},options:{hover:"#ffffff"+ut[7],select:"#ffffff"+ut[10]},card:{background:"#1b2033",secondary:"#ffffff"+ut[5],elevation:"none"},popover:{background:"#1b2033",secondary:"#ffffff"+ut[5],elevation:"none"},input:{background:"#18181B",border:"#3F3F46",fillTreatment:!0},icon:{primary:"#F9FAFB",secondary:"#6A7282"},toggle:{background:"#18181B",text:"#9F9FA9",active:"#3C3A50",activeText:"#F4F4F5"},formContainer:{background:"#0E0D12",border:"#333333"},font:'"Inter", sans-serif',logo:"#ffffff"},Y6=e=>{const n=e.mode==="light"?v6:U6,i=Object.assign({},n);if(e){if(e.background&&(i.background={default:e.background}),e.input&&(i.input={...i.input,background:e.input,border:e.secondary||i.secondary.main}),e.inputFillTreatment!==void 0&&(i.input.fillTreatment=e.inputFillTreatment),e.primary){i.primary={main:e.primary};const o=Pe(e.primary||i.primary.main);let s,a,c,u,d,f;o.isDark()?(s=o.lightness(95).hex(),a=o.alpha(.5).hexa(),c=o.lightness(95).alpha(.9).hexa(),u=o.darken(.15).hex(),d=o.lightness(80).hex(),f=o.darken(.05).hex()):(s=o.lightness(5).hex(),a=o.alpha(.5).hexa(),c=o.lightness(5).alpha(.9).hexa(),u=o.lighten(.05).hex(),d=o.lightness(0).hex(),f=o.lighten(.05).hex()),i.button={primary:o.hex(),primaryText:s,disabled:a,disabledText:c,action:u,actionText:d,hover:f}}e.secondary&&(i.secondary={main:e.secondary}),e.text&&(i.text.primary=e.text),e.textSecondary&&(i.text.secondary=e.textSecondary),e.error&&(i.error={main:e.error}),e.success&&(i.success={main:e.success}),e.formBackground&&(i.formContainer={...i.formContainer,background:e.formBackground||i.formContainer.background}),e.formBorder&&(i.formContainer={...i.formContainer,border:e.formBorder||i.formContainer.border})}return Qe.createTheme({components:{MuiPaper:{styleOverrides:{root:{boxShadow:"none"}}},MuiCollapse:{styleOverrides:{root:{width:"100%"}}}},breakpoints:{values:{xs:300,sm:500,md:650,lg:900,xl:1200}},typography:{fontFamily:e.font??'"Inter", sans-serif'},palette:{...i}})};class _6 extends y.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error(t,n)}render(){return this.state.hasError?r.jsx(F.Card,{children:r.jsx(F.Typography,{variant:"h5",style:{textAlign:"center",marginTop:24,marginBottom:24},children:"An unexpected error has occurred. Please refresh the page."})}):this.props.children}}function R6({children:e,provider:t}){const[n,i]=y.useState(!1),o=Xe(),s=y.useCallback((f,x,A)=>{const I=f.getAddress();if(!I)throw new Error("Wallet is not connected");const m={address:I,type:B.chainToPlatform(x),icon:f.getIcon(),name:f.getName()};A===Se.TransferWallet.SENDING?o($c(m)):o(Kc(m));const l=C=>{(C.length===0||C.length&&I&&C[0]!==I)&&f.disconnect()},h=()=>{o(ci(A)),f.off("disconnect",h),f.off("accountsChanged",l)};f.on("disconnect",h),f.on("accountsChanged",l),L.config.triggerEvent({type:"wallet.connect",details:{side:A,chain:x,wallet:f.getName().toLowerCase(),address:f.getAddress()}})},[o]);y.useEffect(()=>(t.on("walletConnected",s),()=>{t.off("walletConnected",s)}),[t,s]);const a=y.useCallback(async(f,x,A)=>{i(!0);try{const I=await t.connectWallet(f,x,A);return I&&s(I,f,x),I}catch{return null}finally{i(!1)}},[s,t]),c=y.useCallback(()=>{t.swapWallets(),o(n4())},[o,t]),u=y.useCallback(async(f,x)=>{try{const A=t.getWallet(f,x);A&&A.disconnect()}catch(A){console.error("Error disconnecting wallet:",A)}o(ci(x))},[o,t]),d=y.useMemo(()=>({connectWallet:a,swapWallets:c,disconnectWallet:u,walletProvider:t,isConnecting:n}),[a,c,u,t,n]);return r.jsx(N2.Provider,{value:d,children:e})}function Q6({config:e,theme:t,walletProvider:n}){He.useEffect(()=>{globalThis.dispatchReduxAction||(window.dispatchReduxAction=s=>{Ws.dispatch(s)})},[]);const i=He.useMemo(()=>Y6(t??{mode:"dark"}),[t]),o=He.useMemo(()=>n??R3,[n]);return r.jsx(X0,{store:Ws,children:r.jsx(Qe.ThemeProvider,{theme:i,children:r.jsx(h0,{enableColorScheme:!0,children:r.jsx(_6,{children:r.jsx(R6,{provider:o,children:r.jsx(Eu,{children:r.jsx(_4,{children:r.jsx(k6,{config:e})})})})})})})})}const{AutomaticTokenBridgeRoute:B6,TokenBridgeRoute:P6,AutomaticCCTPRoute:W6,CCTPRoute:Z6,TBTCRoute:F6}=b0.routes;exports.DEFAULT_ROUTES=L.DEFAULT_ROUTES;exports.ERR_AMOUNT_TOO_LARGE=L.ERR_AMOUNT_TOO_LARGE;exports.ERR_AMOUNT_TOO_SMALL=L.ERR_AMOUNT_TOO_SMALL;exports.ERR_DESTINATION_CONTRACT_PAUSED=L.ERR_DESTINATION_CONTRACT_PAUSED;exports.ERR_INSUFFICIENT_ALLOWANCE=L.ERR_INSUFFICIENT_ALLOWANCE;exports.ERR_INSUFFICIENT_FUNDS=L.ERR_INSUFFICIENT_FUNDS;exports.ERR_INSUFFICIENT_GAS=L.ERR_INSUFFICIENT_GAS;exports.ERR_NOT_ENOUGH_CAPACITY=L.ERR_NOT_ENOUGH_CAPACITY;exports.ERR_RELAY_FAILED=L.ERR_RELAY_FAILED;exports.ERR_SLIPPAGE_EXCEEDED=L.ERR_SLIPPAGE_EXCEEDED;exports.ERR_SOURCE_CONTRACT_PAUSED=L.ERR_SOURCE_CONTRACT_PAUSED;exports.ERR_TIMEOUT=L.ERR_TIMEOUT;exports.ERR_UNKNOWN=L.ERR_UNKNOWN;exports.ERR_UNSUPPORTED_ABI_VERSION=L.ERR_UNSUPPORTED_ABI_VERSION;exports.ERR_USER_REJECTED=L.ERR_USER_REJECTED;exports.MAINNET=L.MAINNET;exports.TESTNET=L.TESTNET;exports.Token=L.Token;exports.UserActions=L.UserActions;exports.buildConfig=L.buildConfig;exports.config=L.types;exports.TransferWallet=Se.TransferWallet;exports.AutomaticCCTPRoute=W6;exports.AutomaticTokenBridgeRoute=B6;exports.CCTPRoute=Z6;exports.TBTCRoute=F6;exports.TokenBridgeRoute=P6;exports.default=Q6;exports.getTokenDetails=Mn;exports.getTransferDetails=gs;
|
package/lib/index.mjs
CHANGED
|
@@ -4,15 +4,15 @@ import xe, { useMemo as K, useCallback as de, useRef as et, useEffect as Le, use
|
|
|
4
4
|
import { p as oe, c as P2, a as Gs, u as jt, f as Lt, W as en, b as ni, T as Kc, n as e4, i as Hr, d as Vt, g as B2, t as ii, e as es, h as x1, j as Fe, k as t4, w as Kn, s as n4, l as i4, m as Z2, o as zn, q as ts, r as pn, v as r4, x as o4, y as ro, R as D1, z as oo, A as m1, B as A1 } from "./platform-CSpAb386.mjs";
|
|
5
5
|
import s4 from "@mui/material/ScopedCssBaseline";
|
|
6
6
|
import { useTheme as Xe, createTheme as a4, ThemeProvider as c4 } from "@mui/material/styles";
|
|
7
|
-
import { c as Q, i as Vs, g as fn, a as W2, T as l4, b as u4, d as ns, e as w1, f as M4, t as dr, h as d4, j as un, m as g4, s as Js, k as H2, l as is, E as f4, n as rs, o as F2, p as G2, q as h4, r as os, u as V2, v as J2, w as Ce, x as y4, y as vt, z as Yr, A as N4, B as q2, U as _r, C as ss, D as $t, F as qs, G as I4, H as L4, I as S1, J as j4, K as X2, L as C4, M as gr, N as E1, O as T4, P as p4 } from "./index-
|
|
8
|
-
import { W as L7, a3 as j7, a4 as C7, $ as T7, Y as p7, a2 as x7, a1 as D7, Z as m7, a7 as A7,
|
|
9
|
-
import { W as x4, T as qe, w as $2, i as D4, s as m4, g as K2 } from "./hypercore-
|
|
7
|
+
import { c as Q, i as Vs, g as fn, a as W2, T as l4, b as u4, d as ns, e as w1, f as M4, t as dr, h as d4, j as un, m as g4, s as Js, k as H2, l as is, E as f4, n as rs, o as F2, p as G2, q as h4, r as os, u as V2, v as J2, w as Ce, x as y4, y as vt, z as Yr, A as N4, B as q2, U as _r, C as ss, D as $t, F as qs, G as I4, H as L4, I as S1, J as j4, K as X2, L as C4, M as gr, N as E1, O as T4, P as p4 } from "./index-CgqBQ88K.mjs";
|
|
8
|
+
import { W as L7, a3 as j7, a4 as C7, $ as T7, Y as p7, a2 as x7, a1 as D7, Z as m7, a7 as A7, a8 as w7, _ as S7, a5 as E7, a6 as z7, a0 as b7, Q as O7, R as v7, V as k7, S as U7, X as Y7 } from "./index-CgqBQ88K.mjs";
|
|
9
|
+
import { W as x4, T as qe, w as $2, i as D4, s as m4, g as K2 } from "./hypercore-DKqayfki.mjs";
|
|
10
10
|
import ye from "@mui/material/Box";
|
|
11
11
|
import { useTheme as Ee, Box as he, IconButton as A4, createSvgIcon as Mt, Button as e0, Collapse as w4, Typography as nt, Select as S4, MenuItem as z1, CircularProgress as E4, DialogTitle as z4, Dialog as b4, useMediaQuery as Rt, ListItemButton as t0, ListItemIcon as ki, Tooltip as Fr, Stack as mn, Skeleton as Ft, Card as n0, CardContent as O4, TextField as v4 } from "@mui/material";
|
|
12
12
|
import i0 from "@mui/icons-material/ArrowBackRounded";
|
|
13
13
|
import { C as Gr, P as An, g as Xs, i as k4, c as Ji } from "./unsignedTransaction-D2Ja0SuN.mjs";
|
|
14
|
-
import { W as r0 } from "./constants-
|
|
15
|
-
import { i as Vr, S as wn, a as Sn, b as $s, c as Ks, d as o0, e as s0, f as a0, g as b1 } from "./index-
|
|
14
|
+
import { W as r0 } from "./constants-DcDpDarO.mjs";
|
|
15
|
+
import { i as Vr, S as wn, a as Sn, b as $s, c as Ks, d as o0, e as s0, f as a0, g as b1 } from "./index-BVciucyT.mjs";
|
|
16
16
|
import { g as Yi, T as U4, a as Y4, b as _4, N as R4 } from "./mint-BPrKG-Zc.mjs";
|
|
17
17
|
import Ot from "@mui/material/CircularProgress";
|
|
18
18
|
import we from "@mui/material/Stack";
|
|
@@ -54,7 +54,7 @@ import K4 from "@mui/icons-material/ExpandLess";
|
|
|
54
54
|
import el from "@mui/icons-material/SwapHoriz";
|
|
55
55
|
import tl from "@mui/material/LinearProgress";
|
|
56
56
|
import { l as O1 } from "./utils-mBHX3Jpu.mjs";
|
|
57
|
-
import { findToken as v1 } from "./tokens-
|
|
57
|
+
import { findToken as v1 } from "./tokens-D6uJqrsR.mjs";
|
|
58
58
|
import { r as nl } from "./index-DwEx1Hn-.mjs";
|
|
59
59
|
var qi = { exports: {} }, ao = {};
|
|
60
60
|
/**
|
|
@@ -24666,20 +24666,21 @@ export {
|
|
|
24666
24666
|
D7 as ERR_INSUFFICIENT_GAS,
|
|
24667
24667
|
m7 as ERR_NOT_ENOUGH_CAPACITY,
|
|
24668
24668
|
A7 as ERR_RELAY_FAILED,
|
|
24669
|
-
w7 as
|
|
24670
|
-
S7 as
|
|
24671
|
-
E7 as
|
|
24672
|
-
z7 as
|
|
24669
|
+
w7 as ERR_SLIPPAGE_EXCEEDED,
|
|
24670
|
+
S7 as ERR_SOURCE_CONTRACT_PAUSED,
|
|
24671
|
+
E7 as ERR_TIMEOUT,
|
|
24672
|
+
z7 as ERR_UNKNOWN,
|
|
24673
|
+
b7 as ERR_UNSUPPORTED_ABI_VERSION,
|
|
24673
24674
|
f4 as ERR_USER_REJECTED,
|
|
24674
|
-
|
|
24675
|
+
O7 as MAINNET,
|
|
24675
24676
|
y7 as TBTCRoute,
|
|
24676
|
-
|
|
24677
|
-
|
|
24677
|
+
v7 as TESTNET,
|
|
24678
|
+
k7 as Token,
|
|
24678
24679
|
g7 as TokenBridgeRoute,
|
|
24679
24680
|
qe as TransferWallet,
|
|
24680
24681
|
_r as UserActions,
|
|
24681
|
-
|
|
24682
|
-
|
|
24682
|
+
U7 as buildConfig,
|
|
24683
|
+
Y7 as config,
|
|
24683
24684
|
M7 as default,
|
|
24684
24685
|
si as getTokenDetails,
|
|
24685
24686
|
J0 as getTransferDetails
|
package/lib/lifi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils-BEljbqMf.js"),T=require("./tokenHelpers-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils-BEljbqMf.js"),T=require("./tokenHelpers-CeTyb4rG.js"),S=require("./index-Cb_8WAm1.js"),s=require("./platform-DCcL7jHP.js"),C=i=>{if(!i.estimate.fromAmountUSD)throw new e.SDKError(new e.ValidationError("Missing 'fromAmountUSD' in step estimate."));if(!i.estimate.toAmountUSD)throw new e.SDKError(new e.ValidationError("Missing 'toAmountUSD' in step estimate."));return{id:i.id,fromChainId:i.action.fromToken.chainId,fromToken:i.action.fromToken,fromAmount:i.action.fromAmount,fromAmountUSD:i.estimate.fromAmountUSD,fromAddress:i.action.fromAddress,toChainId:i.action.toToken.chainId,toToken:i.action.toToken,toAmount:i.estimate.toAmount,toAmountMin:i.estimate.toAmountMin,toAmountUSD:i.estimate.toAmountUSD,toAddress:i.action.toAddress||i.action.fromAddress,gasCostUSD:i.estimate.gasCosts?.[0]?.amountUSD||"0",steps:[i],insurance:{state:"NOT_INSURABLE",feeAmountUsd:"0"}}};class h extends s.AutomaticRoute{static meta={name:"LiFi",provider:"LI.FI"};static NATIVE_GAS_DROPOFF_SUPPORTED=!1;static IS_AUTOMATIC=!0;config;getDefaultOptions(){return{slippage:e.DEFAULT_SLIPPAGE_PERCENT,maxPriceImpact:e.DEFAULT_MAX_PRICE_IMPACT_PERCENT,allowDestinationCall:!1}}static supportedNetworks(){return["Mainnet"]}static supportedChains(t){return e.supportedChains(t)}static isProtocolSupported(t){return e.supportedChains(t.network).includes(t.chain)}static async supportedDestinationTokens(t,n,a){return T.getAllTokenIdsForChain(a.chain)}async validate(t,n){if(t.fromChain.chain===t.toChain.chain)return{valid:!1,params:n,error:new Error("Same chain swaps are disabled")};const d=n.options?.slippage??e.DEFAULT_SLIPPAGE_PERCENT;if(d<0||d>1)return{valid:!1,params:n,error:new Error("Invalid slippage value")};const r=n.options?.maxPriceImpact??e.DEFAULT_MAX_PRICE_IMPACT_PERCENT;if(r<0||r>1)return{valid:!1,params:n,error:new Error("Invalid maxPriceImpact value")};const f=n.options?.bridges??e.DEFAULT_BRIDGES,l=n.options?.exchanges??e.DEFAULT_EXCHANGES;return{valid:!0,params:{...n,normalizedParams:{slippage:d,maxPriceImpact:r,bridges:f,exchanges:l}}}}fetchQuote(t,n){const{fromChain:a,toChain:d}=t,{normalizedParams:o}=n,r=e.toLifiChainId(a.chain),g=e.toLifiChainId(d.chain),f=t.sender?s.canonicalAddress(t.sender):e.generateThrowawayAddress(a.chain),l=t.recipient?s.canonicalAddress(t.recipient):e.generateThrowawayAddress(d.chain),{integrator:m,feePercent:u}=this.getFeeConfig(t),c={fromChain:r,toChain:g,fromToken:e.toLifiTokenAddress(t.source.id),toToken:e.toLifiTokenAddress(t.destination.id),fromAmount:s.units(t.parseAmount(n.amount)).toString(),fromAddress:f,toAddress:l,slippage:n.normalizedParams.slippage,maxPriceImpact:n.normalizedParams.maxPriceImpact,integrator:m,referrer:n.options.referrer,fee:u};return o.bridges?.allow&&(c.allowBridges=o.bridges.allow),o.bridges?.deny&&(c.denyBridges=o.bridges.deny),o.bridges?.prefer&&(c.preferBridges=o.bridges.prefer),o.exchanges?.allow&&(c.allowExchanges=o.exchanges.allow),o.exchanges?.deny&&(c.denyExchanges=o.exchanges.deny),o.exchanges?.prefer&&(c.preferExchanges=o.exchanges.prefer),e.getQuote(c)}getFeeConfig(t){return this.config?.getFeeConfig?this.config.getFeeConfig(t):{integrator:e.DEFAULT_INTEGRATOR,feePercent:0}}async quote(t,n){try{const a=await this.fetchQuote(t,n);return{success:!0,params:n,sourceToken:{token:t.source.id,amount:s.fromBaseUnits(BigInt(a.estimate?.fromAmount.toString()),t.source.decimals)},destinationToken:{token:t.destination.id,amount:s.fromBaseUnits(BigInt(a.estimate?.toAmount.toString()),t.destination.decimals)},eta:(a.estimate?.executionDuration||e.DEFAULT_ETA_SECONDS)*e.MILLISECONDS_PER_SECOND,details:a}}catch(a){return{success:!1,error:a}}}async initiate(t,n,a,d){const o=n.address(),r=s.canonicalAddress(d),g=await t.fromChain.getRpc(),f=[],l={...a.details,fromAddress:o,toAddress:r},m=C(l),u={request:t,signer:n,rpc:g,txs:f};if(t.fromChain.chain==="Solana")await e.executeSolanaSteps(m,u);else if(t.fromChain.chain==="Sui")await e.executeSuiSteps(m,u);else{const A=await e.getNativeChainId(t.fromChain);await e.executeEvmSteps(m,u,a,A,e.toLifiTokenAddress)}const c={from:t.fromChain.chain,to:t.toChain.chain,state:s.TransferState.SourceInitiated,originTxs:f,tool:a.details.tool};return Object.assign(c,{tool:a.details?.tool})}async*track(t,n=e.DEFAULT_TIMEOUT){if(s.isCompleted(t)||s.isRedeemed(t)||s.isRefunded(t))return t;let a=n;for(;a>0;){const d=Date.now();if(s.isSourceInitiated(t)||s.isSourceFinalized(t)||s.isAttested(t)){const o=await e.getTransactionStatus(this.wh.network,t.originTxs[t.originTxs.length-1],e.toLifiChainId(t.from).toString(),e.toLifiChainId(t.to).toString(),t.tool);if(!o)throw new Error("Failed to fetch transfer status");if(o.status==="DONE"){const r={...t,originTxs:[{chain:t.from,txid:o.sending.txHash}],attestation:{},state:s.TransferState.DestinationFinalized};return yield r,r}else if(o.status==="FAILED"){const r={...t,originTxs:[{chain:t.from,txid:o.sending.txHash}],refundTxs:[],state:s.TransferState.Refunded,attestation:{}};return yield r,r}}await S.sleep(e.POLLING_INTERVAL_MS),a-=Date.now()-d}return t}transferUrl(t){return`https://scan.li.fi/tx/${t}`}}function I(i){return e.config.set({integrator:e.DEFAULT_INTEGRATOR,apiUrl:i.apiUrl??e.DEFAULT_API_URL}),class extends h{config=i}}exports.LiFiRoute=h;exports.createLiFiRouteWithConfig=I;
|
package/lib/lifi.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S, V as p, D as I, a as T, s as C, b as P, c as U, t as g, g as x, d as h, e as _, f as w, h as F, M as L, i as R, j as k, k as v, m as N, n as y, o as M, P as O, p as b, q as B } from "./utils-mBHX3Jpu.mjs";
|
|
2
|
-
import { g as Q } from "./tokenHelpers-
|
|
3
|
-
import { n as z } from "./index-
|
|
2
|
+
import { g as Q } from "./tokenHelpers-VYjmKUxj.mjs";
|
|
3
|
+
import { n as z } from "./index-CgqBQ88K.mjs";
|
|
4
4
|
import { M as G, N as u, u as V, f as E, e as A, q as H, Y as j, x as X, _ as K, $ as W, v as Y } from "./platform-CSpAb386.mjs";
|
|
5
5
|
const $ = (e) => {
|
|
6
6
|
if (!e.estimate.fromAmountUSD)
|