@wormhole-foundation/wormhole-connect 0.3.6 → 0.3.7
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/assets/{ccip-3Wt6ReJT.js → ccip-iUgU_z3s.js} +1 -1
- package/dist/assets/{evm-OtsElgWW.js → evm-d1_WW8vw.js} +4 -4
- package/dist/assets/index-7mjDmQU4.js +7 -0
- package/dist/assets/{index-37oU2-By.js → index-ATpmkjCd.js} +1 -1
- package/dist/assets/{index.es-Pqf6uo9-.js → index.es-JpjUIONF.js} +2 -2
- package/dist/development.css +4 -0
- package/dist/main.js +85 -85
- package/dist/src/AppRouter.d.ts +1 -1
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/components/DemoApp/index.d.ts +4 -0
- package/dist/src/components/DemoApp/index.d.ts.map +1 -0
- package/dist/src/config/constants.d.ts +1 -0
- package/dist/src/config/constants.d.ts.map +1 -1
- package/dist/src/config/events.d.ts +3 -0
- package/dist/src/config/events.d.ts.map +1 -0
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +3 -0
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/config/utils.d.ts +2 -2
- package/dist/src/config/utils.d.ts.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/routes/porticoBridge/porticoBridge.d.ts.map +1 -1
- package/dist/src/store/transferInput.d.ts.map +1 -1
- package/dist/src/telemetry/index.d.ts +3 -0
- package/dist/src/telemetry/index.d.ts.map +1 -0
- package/dist/src/telemetry/types.d.ts +63 -0
- package/dist/src/telemetry/types.d.ts.map +1 -0
- package/dist/src/utils/errors.d.ts +4 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/transferValidation.d.ts +1 -1
- package/dist/src/utils/transferValidation.d.ts.map +1 -1
- package/dist/src/utils/wallet/index.d.ts.map +1 -1
- package/dist/src/views/Bridge/Bridge.d.ts.map +1 -1
- package/dist/src/views/Bridge/Send.d.ts.map +1 -1
- package/dist/src/views/Redeem/Redeem.d.ts.map +1 -1
- package/dist/src/views/Redeem/SendTo.d.ts.map +1 -1
- package/lib/{aptos-4ljP1ifq.js → aptos-B0XHg2zE.js} +1 -1
- package/lib/{aptos-MPxUorM6.mjs → aptos-wBf4KJSG.mjs} +1 -1
- package/lib/{ccip-teuN_8EJ.mjs → ccip-0IR4XE41.mjs} +3 -3
- package/lib/{ccip-rUhDw7gM.js → ccip-xgFEVvDB.js} +1 -1
- package/lib/{cosmos-KAbwO0B8.js → cosmos-U7pz6Y-n.js} +1 -1
- package/lib/{cosmos-JI228Nd5.mjs → cosmos-rVlmcHjk.mjs} +3 -3
- package/lib/development.css +4 -0
- package/lib/{evm-uVCzadYm.mjs → evm-F0-1Kwq7.mjs} +6 -6
- package/lib/{evm-6b3eYq12.js → evm-J20QuYUb.js} +7 -7
- package/lib/{index-jYWsYy63.js → index-Pqo73eQu.js} +1 -1
- package/lib/{index-wPBRjnY5.js → index-XCepGQZD.js} +1 -1
- package/lib/{index-P6TAkzP2.mjs → index-dIeotLF3.mjs} +3 -3
- package/lib/{index-3ezZ5RnU.mjs → index-ilApSFg2.mjs} +54 -54
- package/lib/{index-LLW1EXxz.mjs → index-s6w-9srw.mjs} +2 -2
- package/lib/{index-kyinTgx_.mjs → index-ttzmUhL2.mjs} +1 -1
- package/lib/{index-X4Rc8L59.mjs → index-whku9f8M.mjs} +270 -161
- package/lib/{index-JRh9X0_K.js → index-ygyancx9.js} +7 -7
- package/lib/index-ykIIN-Kb.js +1 -0
- package/lib/{index-rfDfW_jX.js → index-zLKWatzk.js} +1 -1
- package/lib/{index.es-A6ydgKe5.mjs → index.es-2kszfIY1.mjs} +2 -2
- package/lib/{index.es-oecoRjYo.js → index.es-LK9WVURQ.js} +1 -1
- package/lib/{index.es--Y6ulFjB.js → index.es-MG6TQ73e.js} +1 -1
- package/lib/{index.es-M3zYx9bs.js → index.es-ScIglNjB.js} +2 -2
- package/lib/{index.es-riQhAD8z.mjs → index.es-cT4Iwxz9.mjs} +1 -1
- package/lib/{index.es-Sw9pVp3m.mjs → index.es-cx01fct9.mjs} +4 -4
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-fUgzuniQ.js → libsodium-wrappers-AZTCGltp.js} +1 -1
- package/lib/{libsodium-wrappers-gW-aZ0Gi.mjs → libsodium-wrappers-VZa1mNEN.mjs} +1 -1
- package/lib/{sei-Ju_f85SE.mjs → sei-GU-rZSam.mjs} +2 -2
- package/lib/{sei-_dpDCnM5.js → sei-mNvhN-yI.js} +1 -1
- package/lib/{solana-Mu4_Hr3F.js → solana-2TXjdtyO.js} +1 -1
- package/lib/{solana-GIQij4c0.mjs → solana-FNrnrGwM.mjs} +3 -3
- package/lib/{solanaEmbed.esm-Y9E3mfRw.mjs → solanaEmbed.esm-n2ad0GI9.mjs} +2 -2
- package/lib/{solanaEmbed.esm-8a9kiH_G.js → solanaEmbed.esm-svdQy5ZN.js} +1 -1
- package/lib/src/AppRouter.d.ts +1 -1
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/components/DemoApp/index.d.ts +4 -0
- package/lib/src/components/DemoApp/index.d.ts.map +1 -0
- package/lib/src/config/constants.d.ts +1 -0
- package/lib/src/config/constants.d.ts.map +1 -1
- package/lib/src/config/events.d.ts +3 -0
- package/lib/src/config/events.d.ts.map +1 -0
- package/lib/src/config/index.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +3 -0
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/config/utils.d.ts +2 -2
- package/lib/src/config/utils.d.ts.map +1 -1
- package/lib/src/main.d.ts.map +1 -1
- package/lib/src/routes/porticoBridge/porticoBridge.d.ts.map +1 -1
- package/lib/src/store/transferInput.d.ts.map +1 -1
- package/lib/src/telemetry/index.d.ts +3 -0
- package/lib/src/telemetry/index.d.ts.map +1 -0
- package/lib/src/telemetry/types.d.ts +63 -0
- package/lib/src/telemetry/types.d.ts.map +1 -0
- package/lib/src/utils/errors.d.ts +4 -0
- package/lib/src/utils/errors.d.ts.map +1 -0
- package/lib/src/utils/transferValidation.d.ts +1 -1
- package/lib/src/utils/transferValidation.d.ts.map +1 -1
- package/lib/src/utils/wallet/index.d.ts.map +1 -1
- package/lib/src/views/Bridge/Bridge.d.ts.map +1 -1
- package/lib/src/views/Bridge/Send.d.ts.map +1 -1
- package/lib/src/views/Redeem/Redeem.d.ts.map +1 -1
- package/lib/src/views/Redeem/SendTo.d.ts.map +1 -1
- package/lib/{sui-Qdb1JnrN.mjs → sui-PVOqnLuU.mjs} +1 -1
- package/lib/{sui-NogNckVD.js → sui-Uvsz2wgg.js} +1 -1
- package/package.json +4 -3
- package/dist/assets/index-XtkoMMyw.js +0 -7
- package/lib/index-J8yUfjz6.js +0 -1
|
@@ -281585,34 +281585,34 @@ const sortTokens = (e, Re) => {
|
|
|
281585
281585
|
console.info(`Accepted custom NTT group config for "${Qe}"`), Re[Qe] = Fe[Qe];
|
|
281586
281586
|
}
|
|
281587
281587
|
return Re;
|
|
281588
|
-
}, validateDefaults = (e) => {
|
|
281588
|
+
}, validateDefaults = (e, Re, Fe) => {
|
|
281589
281589
|
if (!e)
|
|
281590
281590
|
return;
|
|
281591
281591
|
const {
|
|
281592
|
-
fromNetwork:
|
|
281593
|
-
toNetwork:
|
|
281594
|
-
token:
|
|
281595
|
-
requiredNetwork:
|
|
281592
|
+
fromNetwork: Qe,
|
|
281593
|
+
toNetwork: Je,
|
|
281594
|
+
token: qe,
|
|
281595
|
+
requiredNetwork: We
|
|
281596
281596
|
} = e;
|
|
281597
|
-
if (
|
|
281598
|
-
`Invalid chain name "${
|
|
281599
|
-
)),
|
|
281600
|
-
`Invalid chain name "${
|
|
281601
|
-
)),
|
|
281597
|
+
if (Qe && (Re[Qe] || error(
|
|
281598
|
+
`Invalid chain name "${Qe}" specified for bridgeDefaults.fromNetwork`
|
|
281599
|
+
)), Je && (Re[Je] || error(
|
|
281600
|
+
`Invalid chain name "${Je}" specified for bridgeDefaults.toNetwork`
|
|
281601
|
+
)), Je && Qe && Je === Qe && error(
|
|
281602
281602
|
"Source and destination chain cannot be the same, check the bridgeDefaults configuration"
|
|
281603
|
-
),
|
|
281604
|
-
`Invalid network value "${
|
|
281605
|
-
),
|
|
281603
|
+
), Je && Qe && We && (Re[We] || error(
|
|
281604
|
+
`Invalid network value "${We}" specified for bridgeDefaults.requiredNetwork`
|
|
281605
|
+
), Je !== We && Qe !== We && error(
|
|
281606
281606
|
"Source chain or destination chain must equal the required network"
|
|
281607
|
-
)),
|
|
281608
|
-
const
|
|
281609
|
-
!
|
|
281610
|
-
`Invalid token "${
|
|
281607
|
+
)), qe && (Fe[qe] || error(`Invalid token "${qe}" specified for bridgeDefaults.token`)), Qe && qe) {
|
|
281608
|
+
const Ke = Re[Qe], { tokenId: dt, nativeChain: Ze } = Fe[qe];
|
|
281609
|
+
!dt && Ze !== Ke.key && error(
|
|
281610
|
+
`Invalid token "${qe}" specified for bridgeDefaults.token. It does not exist on "${Qe}"`
|
|
281611
281611
|
);
|
|
281612
281612
|
}
|
|
281613
281613
|
return e;
|
|
281614
281614
|
};
|
|
281615
|
-
var define_import_meta_env_default$3 = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
281615
|
+
var define_import_meta_env_default$3 = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.7" };
|
|
281616
281616
|
const {
|
|
281617
281617
|
REACT_APP_ETHEREUM_RPC,
|
|
281618
281618
|
REACT_APP_SOLANA_RPC,
|
|
@@ -281684,7 +281684,7 @@ const {
|
|
|
281684
281684
|
icon: Icon.ETH,
|
|
281685
281685
|
tokenId: {
|
|
281686
281686
|
chain: "ethereum",
|
|
281687
|
-
address: "
|
|
281687
|
+
address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
|
281688
281688
|
},
|
|
281689
281689
|
coinGeckoId: "ethereum",
|
|
281690
281690
|
color: "#62688F",
|
|
@@ -281766,7 +281766,7 @@ const {
|
|
|
281766
281766
|
icon: Icon.USDC,
|
|
281767
281767
|
tokenId: {
|
|
281768
281768
|
chain: "ethereum",
|
|
281769
|
-
address: "
|
|
281769
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
281770
281770
|
},
|
|
281771
281771
|
coinGeckoId: "usd-coin",
|
|
281772
281772
|
color: "#ffffff",
|
|
@@ -281847,7 +281847,7 @@ const {
|
|
|
281847
281847
|
icon: Icon.WBTC,
|
|
281848
281848
|
tokenId: {
|
|
281849
281849
|
chain: "ethereum",
|
|
281850
|
-
address: "
|
|
281850
|
+
address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
|
|
281851
281851
|
},
|
|
281852
281852
|
coinGeckoId: "wrapped-bitcoin",
|
|
281853
281853
|
color: "#ffffff",
|
|
@@ -281928,7 +281928,7 @@ const {
|
|
|
281928
281928
|
icon: Icon.USDT,
|
|
281929
281929
|
tokenId: {
|
|
281930
281930
|
chain: "ethereum",
|
|
281931
|
-
address: "
|
|
281931
|
+
address: "0xdAC17F958D2ee523a2206206994597C13D831ec7"
|
|
281932
281932
|
},
|
|
281933
281933
|
coinGeckoId: "tether",
|
|
281934
281934
|
color: "#ffffff",
|
|
@@ -282005,7 +282005,7 @@ const {
|
|
|
282005
282005
|
icon: Icon.DAI,
|
|
282006
282006
|
tokenId: {
|
|
282007
282007
|
chain: "ethereum",
|
|
282008
|
-
address: "
|
|
282008
|
+
address: "0x6B175474E89094C44Da98b954EedeAC495271d0F"
|
|
282009
282009
|
},
|
|
282010
282010
|
coinGeckoId: "dai",
|
|
282011
282011
|
color: "#FEFEFD",
|
|
@@ -282079,7 +282079,7 @@ const {
|
|
|
282079
282079
|
icon: Icon.BUSD,
|
|
282080
282080
|
tokenId: {
|
|
282081
282081
|
chain: "ethereum",
|
|
282082
|
-
address: "
|
|
282082
|
+
address: "0x4Fabb145d64652a948d72533023f6E7A623C7C53"
|
|
282083
282083
|
},
|
|
282084
282084
|
coinGeckoId: "binance-usd",
|
|
282085
282085
|
color: "#F0B90B",
|
|
@@ -282138,7 +282138,7 @@ const {
|
|
|
282138
282138
|
icon: Icon.POLYGON,
|
|
282139
282139
|
tokenId: {
|
|
282140
282140
|
chain: "polygon",
|
|
282141
|
-
address: "
|
|
282141
|
+
address: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"
|
|
282142
282142
|
},
|
|
282143
282143
|
coinGeckoId: "matic-network",
|
|
282144
282144
|
color: "#8247E5",
|
|
@@ -282229,7 +282229,7 @@ const {
|
|
|
282229
282229
|
icon: Icon.USDC,
|
|
282230
282230
|
tokenId: {
|
|
282231
282231
|
chain: "polygon",
|
|
282232
|
-
address: "
|
|
282232
|
+
address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"
|
|
282233
282233
|
},
|
|
282234
282234
|
coinGeckoId: "usd-coin",
|
|
282235
282235
|
color: "#2774CA",
|
|
@@ -282299,7 +282299,7 @@ const {
|
|
|
282299
282299
|
icon: Icon.BNB,
|
|
282300
282300
|
tokenId: {
|
|
282301
282301
|
chain: "bsc",
|
|
282302
|
-
address: "
|
|
282302
|
+
address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
|
|
282303
282303
|
},
|
|
282304
282304
|
coinGeckoId: "binancecoin",
|
|
282305
282305
|
color: "#F3BA30",
|
|
@@ -282464,7 +282464,7 @@ const {
|
|
|
282464
282464
|
icon: Icon.AVAX,
|
|
282465
282465
|
tokenId: {
|
|
282466
282466
|
chain: "avalanche",
|
|
282467
|
-
address: "
|
|
282467
|
+
address: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"
|
|
282468
282468
|
},
|
|
282469
282469
|
coinGeckoId: "avalanche-2",
|
|
282470
282470
|
color: "#E84141",
|
|
@@ -282628,7 +282628,7 @@ const {
|
|
|
282628
282628
|
icon: Icon.ETH,
|
|
282629
282629
|
tokenId: {
|
|
282630
282630
|
chain: "avalanche",
|
|
282631
|
-
address: "
|
|
282631
|
+
address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"
|
|
282632
282632
|
},
|
|
282633
282633
|
coinGeckoId: "ethereum",
|
|
282634
282634
|
color: "#62688F",
|
|
@@ -282657,7 +282657,7 @@ const {
|
|
|
282657
282657
|
icon: Icon.FANTOM,
|
|
282658
282658
|
tokenId: {
|
|
282659
282659
|
chain: "fantom",
|
|
282660
|
-
address: "
|
|
282660
|
+
address: "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83"
|
|
282661
282661
|
},
|
|
282662
282662
|
coinGeckoId: "fantom",
|
|
282663
282663
|
color: "#12B4EC",
|
|
@@ -282750,7 +282750,7 @@ const {
|
|
|
282750
282750
|
icon: Icon.CELO,
|
|
282751
282751
|
tokenId: {
|
|
282752
282752
|
chain: "celo",
|
|
282753
|
-
address: "
|
|
282753
|
+
address: "0x471EcE3750Da237f93B8E339c536989b8978a438"
|
|
282754
282754
|
},
|
|
282755
282755
|
coinGeckoId: "celo",
|
|
282756
282756
|
color: "#35D07E",
|
|
@@ -283261,7 +283261,7 @@ const {
|
|
|
283261
283261
|
icon: Icon.ETH,
|
|
283262
283262
|
tokenId: {
|
|
283263
283263
|
chain: "arbitrum",
|
|
283264
|
-
address: "
|
|
283264
|
+
address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
|
|
283265
283265
|
},
|
|
283266
283266
|
coinGeckoId: "ethereum",
|
|
283267
283267
|
color: "#5794EC",
|
|
@@ -283481,7 +283481,7 @@ const {
|
|
|
283481
283481
|
icon: Icon.USDC,
|
|
283482
283482
|
tokenId: {
|
|
283483
283483
|
chain: "optimism",
|
|
283484
|
-
address: "
|
|
283484
|
+
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"
|
|
283485
283485
|
},
|
|
283486
283486
|
coinGeckoId: "usd-coin",
|
|
283487
283487
|
color: "#2774CA",
|
|
@@ -284909,7 +284909,7 @@ const {
|
|
|
284909
284909
|
}
|
|
284910
284910
|
}
|
|
284911
284911
|
};
|
|
284912
|
-
var define_import_meta_env_default$2 = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
284912
|
+
var define_import_meta_env_default$2 = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.7" };
|
|
284913
284913
|
const {
|
|
284914
284914
|
REACT_APP_GOERLI_RPC,
|
|
284915
284915
|
REACT_APP_SEPOLIA_RPC,
|
|
@@ -285073,7 +285073,7 @@ const {
|
|
|
285073
285073
|
icon: Icon.USDC,
|
|
285074
285074
|
tokenId: {
|
|
285075
285075
|
chain: "goerli",
|
|
285076
|
-
address: "
|
|
285076
|
+
address: "0x07865c6E87B9F70255377e024ace6630C1Eaa37F"
|
|
285077
285077
|
},
|
|
285078
285078
|
coinGeckoId: "usd-coin",
|
|
285079
285079
|
color: "#2774CA",
|
|
@@ -285375,7 +285375,7 @@ const {
|
|
|
285375
285375
|
icon: Icon.USDC,
|
|
285376
285376
|
tokenId: {
|
|
285377
285377
|
chain: "mumbai",
|
|
285378
|
-
address: "
|
|
285378
|
+
address: "0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97"
|
|
285379
285379
|
},
|
|
285380
285380
|
coinGeckoId: "usd-coin",
|
|
285381
285381
|
color: "#2774CA",
|
|
@@ -286227,7 +286227,7 @@ const {
|
|
|
286227
286227
|
icon: Icon.ETH,
|
|
286228
286228
|
tokenId: {
|
|
286229
286229
|
chain: "arbitrumgoerli",
|
|
286230
|
-
address: "
|
|
286230
|
+
address: "0xEe01c0CD76354C383B8c7B4e65EA88D00B06f36f"
|
|
286231
286231
|
},
|
|
286232
286232
|
coinGeckoId: "ethereum",
|
|
286233
286233
|
color: "#5794EC",
|
|
@@ -286525,7 +286525,7 @@ const {
|
|
|
286525
286525
|
icon: Icon.USDC,
|
|
286526
286526
|
tokenId: {
|
|
286527
286527
|
chain: "basegoerli",
|
|
286528
|
-
address: "
|
|
286528
|
+
address: "0xF175520C52418dfE19C8098071a252da48Cd1C19"
|
|
286529
286529
|
},
|
|
286530
286530
|
coinGeckoId: "usd-coin",
|
|
286531
286531
|
color: "#2774CA",
|
|
@@ -287234,7 +287234,7 @@ const {
|
|
|
287234
287234
|
}
|
|
287235
287235
|
}
|
|
287236
287236
|
};
|
|
287237
|
-
var define_import_meta_env_default$1 = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
287237
|
+
var define_import_meta_env_default$1 = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.7" };
|
|
287238
287238
|
const {
|
|
287239
287239
|
REACT_APP_ETHEREUM_DEVNET_RPC,
|
|
287240
287240
|
REACT_APP_OSMOSIS_DEVNET_RPC,
|
|
@@ -287354,8 +287354,26 @@ const {
|
|
|
287354
287354
|
index: 0,
|
|
287355
287355
|
keys: ["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
|
|
287356
287356
|
}
|
|
287357
|
-
};
|
|
287358
|
-
|
|
287357
|
+
}, WORMSCAN = "https://wormholescan.io/#/", AVAILABLE_MARKETS_URL = "https://portalbridge.com/docs/faqs/liquid-markets/", CONNECT_VERSION = "0.3.7";
|
|
287358
|
+
function wrapEventHandler(e) {
|
|
287359
|
+
return function(Re) {
|
|
287360
|
+
var Qe;
|
|
287361
|
+
const Fe = {
|
|
287362
|
+
meta: {
|
|
287363
|
+
version: CONNECT_VERSION,
|
|
287364
|
+
host: (Qe = window == null ? void 0 : window.location) == null ? void 0 : Qe.host
|
|
287365
|
+
},
|
|
287366
|
+
...Re
|
|
287367
|
+
};
|
|
287368
|
+
if (console.info("Wormhole Connect event:", Fe), e)
|
|
287369
|
+
try {
|
|
287370
|
+
e(Fe);
|
|
287371
|
+
} catch (Je) {
|
|
287372
|
+
console.error("Error handling event:", Je);
|
|
287373
|
+
}
|
|
287374
|
+
};
|
|
287375
|
+
}
|
|
287376
|
+
var define_import_meta_env_default = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.7" };
|
|
287359
287377
|
function buildConfig(e) {
|
|
287360
287378
|
var dt, Ze;
|
|
287361
287379
|
const Re = ((e == null ? void 0 : e.network) || (e == null ? void 0 : e.env) || // TODO remove; deprecated
|
|
@@ -287370,9 +287388,9 @@ function buildConfig(e) {
|
|
|
287370
287388
|
qe.rpcs,
|
|
287371
287389
|
Qe.rpcs,
|
|
287372
287390
|
e == null ? void 0 : e.rpcs
|
|
287373
|
-
);
|
|
287374
|
-
return {
|
|
287375
|
-
wh:
|
|
287391
|
+
), Ke = getWormholeContext(Fe, qe, Je, We);
|
|
287392
|
+
return e != null && e.bridgeDefaults && validateDefaults(e.bridgeDefaults, Qe.chains, Je), {
|
|
287393
|
+
wh: Ke,
|
|
287376
287394
|
sdkConfig: qe,
|
|
287377
287395
|
// TODO remove either env or network from this
|
|
287378
287396
|
// some code uses lowercase, some uppercase... :(
|
|
@@ -287407,6 +287425,8 @@ function buildConfig(e) {
|
|
|
287407
287425
|
devnet: ["http://localhost:7071"]
|
|
287408
287426
|
}[Re],
|
|
287409
287427
|
coinGeckoApiKey: e == null ? void 0 : e.coinGeckoApiKey,
|
|
287428
|
+
// Callbacks
|
|
287429
|
+
triggerEvent: wrapEventHandler(e == null ? void 0 : e.eventHandler),
|
|
287410
287430
|
// White lists
|
|
287411
287431
|
chains: Qe.chains,
|
|
287412
287432
|
chainsArr: Object.values(Qe.chains).filter((ht) => e != null && e.networks ? e.networks.includes(ht.key) : !0),
|
|
@@ -287422,7 +287442,7 @@ function buildConfig(e) {
|
|
|
287422
287442
|
devnet: "",
|
|
287423
287443
|
testnet: "https://wormhole-foundation.github.io/example-token-bridge-ui/#/register"
|
|
287424
287444
|
}[Re],
|
|
287425
|
-
bridgeDefaults:
|
|
287445
|
+
bridgeDefaults: e == null ? void 0 : e.bridgeDefaults,
|
|
287426
287446
|
cctpWarning: ((Ze = e == null ? void 0 : e.cctpWarning) == null ? void 0 : Ze.href) || "",
|
|
287427
287447
|
pageHeader: e == null ? void 0 : e.pageHeader,
|
|
287428
287448
|
pageSubHeader: e == null ? void 0 : e.pageSubHeader,
|
|
@@ -287752,7 +287772,14 @@ const walletConnection = {
|
|
|
287752
287772
|
if (!We)
|
|
287753
287773
|
throw new Error(`Unable to find wallets for chain ${Re}`);
|
|
287754
287774
|
const { chainId: Ke, context: dt } = We;
|
|
287755
|
-
await Je.connect({ chainId: Ke })
|
|
287775
|
+
await Je.connect({ chainId: Ke }), config$1.triggerEvent({
|
|
287776
|
+
type: "wallet.connect",
|
|
287777
|
+
details: {
|
|
287778
|
+
side: e,
|
|
287779
|
+
chain: Re,
|
|
287780
|
+
wallet: Fe.name.toLowerCase()
|
|
287781
|
+
}
|
|
287782
|
+
});
|
|
287756
287783
|
const Ze = Je.getAddress(), ht = {
|
|
287757
287784
|
address: Ze,
|
|
287758
287785
|
type: Fe.type,
|
|
@@ -287796,7 +287823,7 @@ const walletConnection = {
|
|
|
287796
287823
|
if (Fe.getNetworkInfo().chainId !== e) {
|
|
287797
287824
|
if (Qe.context === Context.ETH)
|
|
287798
287825
|
try {
|
|
287799
|
-
const { switchChain: qe } = await import("./evm-
|
|
287826
|
+
const { switchChain: qe } = await import("./evm-F0-1Kwq7.mjs").then((We) => We.f);
|
|
287800
287827
|
await qe(Fe, e);
|
|
287801
287828
|
} catch (qe) {
|
|
287802
287829
|
if (qe instanceof NotSupported)
|
|
@@ -287804,7 +287831,7 @@ const walletConnection = {
|
|
|
287804
287831
|
throw qe;
|
|
287805
287832
|
}
|
|
287806
287833
|
if (Qe.context === Context.COSMOS) {
|
|
287807
|
-
const { switchChain: qe } = await import("./cosmos-
|
|
287834
|
+
const { switchChain: qe } = await import("./cosmos-rVlmcHjk.mjs");
|
|
287808
287835
|
await qe(Fe, e);
|
|
287809
287836
|
}
|
|
287810
287837
|
return Fe.getAddress();
|
|
@@ -287813,7 +287840,7 @@ const walletConnection = {
|
|
|
287813
287840
|
const Re = walletConnection[e];
|
|
287814
287841
|
Re && await Re.disconnect();
|
|
287815
287842
|
}, watchAsset = async (e, Re) => {
|
|
287816
|
-
const Fe = walletConnection[Re], { watchAsset: Qe } = await import("./evm-
|
|
287843
|
+
const Fe = walletConnection[Re], { watchAsset: Qe } = await import("./evm-F0-1Kwq7.mjs").then((Je) => Je.f);
|
|
287817
287844
|
await Qe(e, Fe);
|
|
287818
287845
|
}, signAndSendTransaction = async (e, Re, Fe, Qe = {}) => {
|
|
287819
287846
|
const Je = config$1.chains[e], qe = walletConnection[Fe];
|
|
@@ -287823,23 +287850,23 @@ const walletConnection = {
|
|
|
287823
287850
|
case Context.ETH:
|
|
287824
287851
|
return Re.transactionHash;
|
|
287825
287852
|
case Context.SOLANA: {
|
|
287826
|
-
const { signAndSendTransaction: We } = await import("./solana-
|
|
287853
|
+
const { signAndSendTransaction: We } = await import("./solana-FNrnrGwM.mjs");
|
|
287827
287854
|
return (await We(Re, qe, Qe)).id;
|
|
287828
287855
|
}
|
|
287829
287856
|
case Context.SUI: {
|
|
287830
|
-
const { signAndSendTransaction: We } = await import("./sui-
|
|
287857
|
+
const { signAndSendTransaction: We } = await import("./sui-PVOqnLuU.mjs");
|
|
287831
287858
|
return (await We(Re, qe)).id;
|
|
287832
287859
|
}
|
|
287833
287860
|
case Context.APTOS: {
|
|
287834
|
-
const { signAndSendTransaction: We } = await import("./aptos-
|
|
287861
|
+
const { signAndSendTransaction: We } = await import("./aptos-wBf4KJSG.mjs");
|
|
287835
287862
|
return (await We(Re, qe)).id;
|
|
287836
287863
|
}
|
|
287837
287864
|
case Context.SEI: {
|
|
287838
|
-
const { signAndSendTransaction: We } = await import("./sei-
|
|
287865
|
+
const { signAndSendTransaction: We } = await import("./sei-GU-rZSam.mjs");
|
|
287839
287866
|
return (await We(Re, qe)).id;
|
|
287840
287867
|
}
|
|
287841
287868
|
case Context.COSMOS: {
|
|
287842
|
-
const { signAndSendTransaction: We } = await import("./cosmos-
|
|
287869
|
+
const { signAndSendTransaction: We } = await import("./cosmos-rVlmcHjk.mjs");
|
|
287843
287870
|
return (await We(Re, qe)).id;
|
|
287844
287871
|
}
|
|
287845
287872
|
default:
|
|
@@ -287872,39 +287899,39 @@ const walletConnection = {
|
|
|
287872
287899
|
if (e === void 0)
|
|
287873
287900
|
return [];
|
|
287874
287901
|
if (e.context === Context.ETH) {
|
|
287875
|
-
const { wallets: Re } = await import("./evm-
|
|
287902
|
+
const { wallets: Re } = await import("./evm-F0-1Kwq7.mjs").then((Fe) => Fe.f);
|
|
287876
287903
|
return Object.values(mapWallets(Re, Context.ETH));
|
|
287877
287904
|
} else if (e.context === Context.SOLANA) {
|
|
287878
|
-
const { fetchOptions: Re } = await import("./solana-
|
|
287905
|
+
const { fetchOptions: Re } = await import("./solana-FNrnrGwM.mjs"), Fe = Re();
|
|
287879
287906
|
return Object.values(mapWallets(Fe, Context.SOLANA));
|
|
287880
287907
|
} else if (e.context === Context.SUI) {
|
|
287881
|
-
const Fe = await (await import("./sui-
|
|
287908
|
+
const Fe = await (await import("./sui-PVOqnLuU.mjs")).fetchOptions();
|
|
287882
287909
|
return Object.values(mapWallets(Fe, Context.SUI));
|
|
287883
287910
|
} else if (e.context === Context.APTOS) {
|
|
287884
|
-
const Fe = (await import("./aptos-
|
|
287911
|
+
const Fe = (await import("./aptos-wBf4KJSG.mjs")).fetchOptions();
|
|
287885
287912
|
return Object.values(mapWallets(Fe, Context.APTOS));
|
|
287886
287913
|
} else if (e.context === Context.SEI) {
|
|
287887
|
-
const Fe = await (await import("./sei-
|
|
287914
|
+
const Fe = await (await import("./sei-GU-rZSam.mjs")).fetchOptions();
|
|
287888
287915
|
return Object.values(mapWallets(Fe, Context.SEI));
|
|
287889
287916
|
} else if (e.context === Context.COSMOS)
|
|
287890
287917
|
if (e.id === CHAIN_ID_EVMOS$1) {
|
|
287891
287918
|
const {
|
|
287892
287919
|
wallets: { cosmosEvm: Re }
|
|
287893
|
-
} = await import("./cosmos-
|
|
287920
|
+
} = await import("./cosmos-rVlmcHjk.mjs");
|
|
287894
287921
|
return Object.values(
|
|
287895
287922
|
mapWallets(Re, Context.COSMOS, ["OKX Wallet"])
|
|
287896
287923
|
);
|
|
287897
287924
|
} else if (e.id === CHAIN_ID_INJECTIVE$1) {
|
|
287898
287925
|
const {
|
|
287899
287926
|
wallets: { cosmosEvm: Re }
|
|
287900
|
-
} = await import("./cosmos-
|
|
287927
|
+
} = await import("./cosmos-rVlmcHjk.mjs");
|
|
287901
287928
|
return Object.values(
|
|
287902
287929
|
mapWallets(Re, Context.COSMOS, ["OKX Wallet"])
|
|
287903
287930
|
);
|
|
287904
287931
|
} else {
|
|
287905
287932
|
const {
|
|
287906
287933
|
wallets: { cosmos: Re }
|
|
287907
|
-
} = await import("./cosmos-
|
|
287934
|
+
} = await import("./cosmos-rVlmcHjk.mjs");
|
|
287908
287935
|
return Object.values(mapWallets(Re, Context.COSMOS));
|
|
287909
287936
|
}
|
|
287910
287937
|
return [];
|
|
@@ -299368,7 +299395,9 @@ class PorticoBridge extends BaseRoute {
|
|
|
299368
299395
|
displayData: [],
|
|
299369
299396
|
destTxInfo: { receivedTokenKey: "" }
|
|
299370
299397
|
};
|
|
299371
|
-
const Ke = await config$1.wh.mustGetProvider(Fe.toChain).getTransactionReceipt(
|
|
299398
|
+
const Ke = await config$1.wh.mustGetProvider(Fe.toChain).getTransactionReceipt(
|
|
299399
|
+
utils$P.hexlify(Je, { allowMissingPrefix: !0 })
|
|
299400
|
+
), dt = dist$8.Buffer.from(Fe.payload.slice(2), "hex"), {
|
|
299372
299401
|
finalTokenAddress: Ze,
|
|
299373
299402
|
flagSet: { shouldUnwrapNative: ht }
|
|
299374
299403
|
} = parsePorticoPayload(dt), Wn = Ke.logs.find(
|
|
@@ -314842,7 +314871,7 @@ const performModificationsIfFromChainChanged = (e) => {
|
|
|
314842
314871
|
}) => {
|
|
314843
314872
|
Object.keys(Fe).forEach((Qe) => {
|
|
314844
314873
|
e.validations[Qe] = Fe[Qe];
|
|
314845
|
-
}),
|
|
314874
|
+
}), e.showValidationState = Re;
|
|
314846
314875
|
},
|
|
314847
314876
|
setRoutes: (e, { payload: Re }) => {
|
|
314848
314877
|
e.routeStates = Re, establishRoute(e);
|
|
@@ -316052,10 +316081,10 @@ Fe.relayerFee.data && !Fe.swapAmounts.isFetching && Re.error ? Re.error : "", ge
|
|
|
316052
316081
|
relay: Re,
|
|
316053
316082
|
wallet: Fe,
|
|
316054
316083
|
portico: Qe
|
|
316055
|
-
}, Je) => {
|
|
316056
|
-
var
|
|
316057
|
-
const
|
|
316058
|
-
Je(setValidations({ validations:
|
|
316084
|
+
}, Je, qe) => {
|
|
316085
|
+
var dt;
|
|
316086
|
+
const We = await validateAll(e, Re, Fe, Qe), Ke = !!(Fe.sending.address && Fe.receiving.address && e.fromChain && e.toChain && e.token && e.destToken && e.amount && Number.parseFloat(e.amount) >= 0 && ((dt = e.routeStates) == null ? void 0 : dt.some((Ze) => Ze.supported)) !== void 0);
|
|
316087
|
+
qe() || Je(setValidations({ validations: We, showValidationState: Ke }));
|
|
316059
316088
|
}, VALIDATION_DELAY_MS = 250, useValidate = () => {
|
|
316060
316089
|
const e = useDispatch(), Re = useSelector((Ke) => Ke.transferInput), Fe = useSelector((Ke) => Ke.relay), Qe = useSelector((Ke) => Ke.wallet), Je = useSelector((Ke) => Ke.porticoBridge), qe = useMemo(
|
|
316061
316090
|
() => ({ transferInput: Re, relay: Fe, wallet: Qe, portico: Je }),
|
|
@@ -316065,7 +316094,10 @@ Fe.relayerFee.data && !Fe.swapAmounts.isFetching && Re.error ? Re.error : "", ge
|
|
|
316065
316094
|
VALIDATION_DELAY_MS
|
|
316066
316095
|
);
|
|
316067
316096
|
useEffect(() => {
|
|
316068
|
-
|
|
316097
|
+
let Ke = !1;
|
|
316098
|
+
return validate(We, e, () => Ke), () => {
|
|
316099
|
+
Ke = !0;
|
|
316100
|
+
};
|
|
316069
316101
|
}, [We, e]);
|
|
316070
316102
|
}, millisToMinutesAndSeconds = (e) => {
|
|
316071
316103
|
const Re = Math.floor(e / 6e4), Fe = Math.floor(e % 6e4 / 1e3);
|
|
@@ -334158,6 +334190,19 @@ function AlertBanner(e) {
|
|
|
334158
334190
|
}
|
|
334159
334191
|
) });
|
|
334160
334192
|
}
|
|
334193
|
+
const ERR_INSUFFICIENT_ALLOWANCE = "insufficient_allowance", ERR_SWAP_FAILED = "swap_failed", ERR_NOT_ENOUGH_CAPACITY = "swap_failed", ERR_SOURCE_CONTRACT_PAUSED = "source_contract_paused", ERR_DESTINATION_CONTRACT_PAUSED = "destination_contract_paused", ERR_UNSUPPORTED_ABI_VERSION = "unsupported_abi_version", ERR_INSUFFICIENT_GAS = "insufficient_gas", ERR_USER_REJECTED = "user_rejected", ERR_TIMEOUT = "user_timeout", ERR_UNKNOWN = "unknown";
|
|
334194
|
+
function interpretTransferError(e, Re) {
|
|
334195
|
+
var Je;
|
|
334196
|
+
let Fe = "Error with transfer, please try again", Qe = ERR_UNKNOWN;
|
|
334197
|
+
return e.message && (e.message === INSUFFICIENT_ALLOWANCE ? (Fe = "Error with transfer, please try again", Qe = ERR_INSUFFICIENT_ALLOWANCE) : e.name === "TransactionExpiredTimeoutError" ? (Fe = "Transfer timed out, please try again", Qe = ERR_TIMEOUT) : (e == null ? void 0 : e.message) === NotEnoughCapacityError.MESSAGE ? (Fe = `This transfer would be rate-limited due to high volume on ${(Je = config$1.chains[Re]) == null ? void 0 : Je.displayName}, please try again later`, Qe = ERR_NOT_ENOUGH_CAPACITY) : (e == null ? void 0 : e.message) === ContractIsPausedError.MESSAGE ? (Fe = e.message, Qe = ERR_SOURCE_CONTRACT_PAUSED) : (e == null ? void 0 : e.message) === DestinationContractIsPausedError.MESSAGE ? (Fe = e.message, Qe = ERR_DESTINATION_CONTRACT_PAUSED) : (e == null ? void 0 : e.message) === UnsupportedContractAbiVersion.MESSAGE ? (Fe = "Unsupported contract ABI version", Qe = ERR_UNSUPPORTED_ABI_VERSION) : (e == null ? void 0 : e.message) === InsufficientFundsForGasError.MESSAGE ? (Fe = e.message, Qe = ERR_INSUFFICIENT_GAS) : e.message.includes("rejected the request") ? (Fe = "Transfer rejected in wallet, please try again", Qe = ERR_USER_REJECTED) : e.message === SWAP_ERROR && (Fe = SWAP_ERROR, Qe = ERR_SWAP_FAILED)), [Fe, { type: Qe, original: e }];
|
|
334198
|
+
}
|
|
334199
|
+
function getTokenDetails(e) {
|
|
334200
|
+
const Re = config$1.tokens[e], { symbol: Fe, tokenId: Qe } = Re;
|
|
334201
|
+
return {
|
|
334202
|
+
symbol: Fe,
|
|
334203
|
+
tokenId: Qe ?? "native"
|
|
334204
|
+
};
|
|
334205
|
+
}
|
|
334161
334206
|
const useStyles$E = makeStyles()((e) => ({
|
|
334162
334207
|
body: {
|
|
334163
334208
|
width: "100%"
|
|
@@ -334196,50 +334241,73 @@ function Send(e) {
|
|
|
334196
334241
|
Wn
|
|
334197
334242
|
);
|
|
334198
334243
|
async function Qn() {
|
|
334199
|
-
|
|
334200
|
-
|
|
334201
|
-
Fe
|
|
334202
|
-
|
|
334203
|
-
|
|
334204
|
-
|
|
334205
|
-
|
|
334206
|
-
|
|
334207
|
-
|
|
334208
|
-
|
|
334209
|
-
|
|
334210
|
-
|
|
334211
|
-
|
|
334212
|
-
|
|
334213
|
-
|
|
334214
|
-
|
|
334215
|
-
|
|
334216
|
-
|
|
334217
|
-
|
|
334218
|
-
|
|
334219
|
-
|
|
334220
|
-
|
|
334221
|
-
|
|
334222
|
-
|
|
334223
|
-
|
|
334224
|
-
|
|
334225
|
-
|
|
334226
|
-
|
|
334227
|
-
|
|
334228
|
-
|
|
334229
|
-
|
|
334230
|
-
|
|
334231
|
-
|
|
334232
|
-
|
|
334233
|
-
|
|
334234
|
-
|
|
334235
|
-
|
|
334236
|
-
|
|
334237
|
-
|
|
334238
|
-
|
|
334239
|
-
|
|
334240
|
-
|
|
334241
|
-
|
|
334242
|
-
|
|
334244
|
+
if (fr(""), await validate(
|
|
334245
|
+
{ transferInput: Qe, relay: Yn, wallet: Jn, portico: or },
|
|
334246
|
+
Fe,
|
|
334247
|
+
() => !1
|
|
334248
|
+
), !isTransferValid(qe) || !Wn)
|
|
334249
|
+
return;
|
|
334250
|
+
Fe(setIsTransactionInProgress(!0));
|
|
334251
|
+
const _r = {
|
|
334252
|
+
route: Wn,
|
|
334253
|
+
fromToken: getTokenDetails(dt),
|
|
334254
|
+
toToken: getTokenDetails(Ze),
|
|
334255
|
+
fromChain: We,
|
|
334256
|
+
toChain: Ke
|
|
334257
|
+
}, Gn = config$1.tokens[dt].tokenId ?? "native";
|
|
334258
|
+
try {
|
|
334259
|
+
const rr = config$1.chains[We];
|
|
334260
|
+
if ((rr == null ? void 0 : rr.context) === Context.ETH) {
|
|
334261
|
+
const Er = rr.chainId;
|
|
334262
|
+
if (typeof Er != "number")
|
|
334263
|
+
throw new Error("invalid evm chain ID");
|
|
334264
|
+
await switchChain(Er, TransferWallet.SENDING), registerWalletSigner(We, TransferWallet.SENDING);
|
|
334265
|
+
}
|
|
334266
|
+
(rr == null ? void 0 : rr.context) === Context.COSMOS && await switchChain(rr.chainId, TransferWallet.SENDING);
|
|
334267
|
+
const yr = isPorticoRoute(Wn) ? or : { toNativeToken: cr };
|
|
334268
|
+
config$1.triggerEvent({
|
|
334269
|
+
type: "transfer.initiate",
|
|
334270
|
+
details: _r
|
|
334271
|
+
});
|
|
334272
|
+
const Ar = await RouteOperator.send(
|
|
334273
|
+
Wn,
|
|
334274
|
+
Gn || "native",
|
|
334275
|
+
`${ht}`,
|
|
334276
|
+
We,
|
|
334277
|
+
Xn.address,
|
|
334278
|
+
Ke,
|
|
334279
|
+
Zn.address,
|
|
334280
|
+
Ze,
|
|
334281
|
+
yr
|
|
334282
|
+
);
|
|
334283
|
+
config$1.triggerEvent({
|
|
334284
|
+
type: "transfer.start",
|
|
334285
|
+
details: _r
|
|
334286
|
+
});
|
|
334287
|
+
let Cr;
|
|
334288
|
+
for (; Cr === void 0; ) {
|
|
334289
|
+
try {
|
|
334290
|
+
Cr = await RouteOperator.getMessage(
|
|
334291
|
+
Wn,
|
|
334292
|
+
Ar,
|
|
334293
|
+
We,
|
|
334294
|
+
!0
|
|
334295
|
+
// don't need to get the signed attestation
|
|
334296
|
+
);
|
|
334297
|
+
} catch (Er) {
|
|
334298
|
+
console.error(Er);
|
|
334299
|
+
}
|
|
334300
|
+
Cr === void 0 && await sleep(3e3);
|
|
334301
|
+
}
|
|
334302
|
+
Fe(setIsTransactionInProgress(!1)), Fe(setSendTx(Ar)), Fe(setTxDetails(Cr)), Fe(setRoute$1(Wn)), Fe(setRoute("redeem")), fr("");
|
|
334303
|
+
} catch (rr) {
|
|
334304
|
+
console.error("Wormhole Connect: error completing transfer", rr), Fe(setIsTransactionInProgress(!1));
|
|
334305
|
+
const [yr, Ar] = interpretTransferError(rr, We);
|
|
334306
|
+
fr(yr), config$1.triggerEvent({
|
|
334307
|
+
type: "transfer.error",
|
|
334308
|
+
error: Ar,
|
|
334309
|
+
details: _r
|
|
334310
|
+
});
|
|
334243
334311
|
}
|
|
334244
334312
|
}
|
|
334245
334313
|
const $n = useCallback(async () => {
|
|
@@ -335546,7 +335614,7 @@ var default_1$3 = OpenInNew.default = void 0, _createSvgIcon$3 = _interopRequire
|
|
|
335546
335614
|
d: "M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"
|
|
335547
335615
|
}), "OpenInNew");
|
|
335548
335616
|
default_1$3 = OpenInNew.default = _default$3;
|
|
335549
|
-
const
|
|
335617
|
+
const useStyles$r = makeStyles()(
|
|
335550
335618
|
(e, { blendColor: Re }) => ({
|
|
335551
335619
|
anchor: {
|
|
335552
335620
|
position: "relative",
|
|
@@ -337434,49 +337502,52 @@ function Bridge() {
|
|
|
337434
337502
|
qn = !1;
|
|
337435
337503
|
};
|
|
337436
337504
|
}, [Ze, qe, dt, Fe]), useEffect(() => {
|
|
337437
|
-
|
|
337438
|
-
|
|
337439
|
-
|
|
337505
|
+
let qn = !1;
|
|
337506
|
+
return (async () => {
|
|
337507
|
+
var nr, pr;
|
|
337508
|
+
let sr = await RouteOperator.allSupportedDestTokens(
|
|
337440
337509
|
config$1.tokens[Ke],
|
|
337441
337510
|
qe,
|
|
337442
337511
|
We
|
|
337443
337512
|
);
|
|
337444
337513
|
if (Ke) {
|
|
337445
|
-
const
|
|
337446
|
-
|
|
337514
|
+
const ar = sr.filter((gr) => gr.nativeChain === We);
|
|
337515
|
+
ar.length > 0 && (sr = ar);
|
|
337447
337516
|
}
|
|
337448
|
-
Fe(setSupportedDestTokens(
|
|
337449
|
-
const
|
|
337517
|
+
Fe(setSupportedDestTokens(sr));
|
|
337518
|
+
const Qn = await RouteOperator.allSupportedDestTokens(
|
|
337450
337519
|
void 0,
|
|
337451
337520
|
qe,
|
|
337452
337521
|
We
|
|
337453
337522
|
);
|
|
337454
|
-
Fe(setAllSupportedDestTokens(
|
|
337455
|
-
const
|
|
337456
|
-
if (We &&
|
|
337457
|
-
const
|
|
337458
|
-
(
|
|
337459
|
-
var
|
|
337460
|
-
return
|
|
337523
|
+
Fe(setAllSupportedDestTokens(Qn)), We && sr.length === 1 && (qn || Fe(setDestToken(sr[0].key)));
|
|
337524
|
+
const $n = sr.map((ar) => ar.symbol);
|
|
337525
|
+
if (We && $n.every((ar) => ar === $n[0]) && ["USDC", "tBTC"].includes($n[0])) {
|
|
337526
|
+
const ar = (nr = sr.find(
|
|
337527
|
+
(gr) => {
|
|
337528
|
+
var _r;
|
|
337529
|
+
return gr.symbol === $n[0] && gr.nativeChain === ((_r = gr.tokenId) == null ? void 0 : _r.chain) && gr.nativeChain === We;
|
|
337461
337530
|
}
|
|
337462
|
-
)) == null ? void 0 :
|
|
337463
|
-
|
|
337531
|
+
)) == null ? void 0 : nr.key;
|
|
337532
|
+
!qn && ar && Fe(setDestToken(ar));
|
|
337464
337533
|
}
|
|
337465
337534
|
if (Ke && dt === "" && We && (!Ze || isPorticoRoute(Ze))) {
|
|
337466
|
-
const
|
|
337535
|
+
const ar = (pr = config$1.tokens[Ke]) == null ? void 0 : pr.symbol;
|
|
337467
337536
|
if ([
|
|
337468
337537
|
...ETHBridge.SUPPORTED_TOKENS,
|
|
337469
337538
|
...wstETHBridge.SUPPORTED_TOKENS
|
|
337470
|
-
].includes(
|
|
337471
|
-
let
|
|
337472
|
-
if (!
|
|
337473
|
-
const
|
|
337474
|
-
|
|
337539
|
+
].includes(ar)) {
|
|
337540
|
+
let _r = getNativeVersionOfToken(ar, We);
|
|
337541
|
+
if (!_r) {
|
|
337542
|
+
const vr = getWrappedToken(config$1.tokens[Ke]);
|
|
337543
|
+
_r = getNativeVersionOfToken(vr.symbol, We);
|
|
337475
337544
|
}
|
|
337476
|
-
|
|
337545
|
+
!qn && _r && isSupportedToken(_r, sr) && Fe(setDestToken(_r));
|
|
337477
337546
|
}
|
|
337478
337547
|
}
|
|
337479
|
-
})()
|
|
337548
|
+
})(), () => {
|
|
337549
|
+
qn = !0;
|
|
337550
|
+
};
|
|
337480
337551
|
}, [Ze, Ke, qe, We, Fe]), useEffect(() => {
|
|
337481
337552
|
(async () => {
|
|
337482
337553
|
if (Ze)
|
|
@@ -338468,42 +338539,69 @@ ${vr}`);
|
|
|
338468
338539
|
}, [Qe, qe]), qn = async () => {
|
|
338469
338540
|
if (Zn(!0), Wn(""), !Qe)
|
|
338470
338541
|
throw new Error("Unknown route, cannot claim");
|
|
338471
|
-
|
|
338542
|
+
const ar = {
|
|
338543
|
+
route: Qe,
|
|
338544
|
+
fromToken: getTokenDetails(qe.tokenKey),
|
|
338545
|
+
toToken: getTokenDetails(qe.receivedTokenKey),
|
|
338546
|
+
fromChain: qe.fromChain,
|
|
338547
|
+
toChain: qe.toChain
|
|
338548
|
+
};
|
|
338549
|
+
if (config$1.triggerEvent({
|
|
338550
|
+
type: "transfer.redeem.initiate",
|
|
338551
|
+
details: ar
|
|
338552
|
+
}), !We || !Yn)
|
|
338472
338553
|
throw Wn("Connect to receiving wallet"), new Error("Connect to receiving wallet");
|
|
338473
|
-
const
|
|
338474
|
-
if (!
|
|
338554
|
+
const gr = config$1.chains[qe.toChain];
|
|
338555
|
+
if (!gr)
|
|
338475
338556
|
throw Wn("Your claim has failed, please try again"), new Error("invalid destination chain");
|
|
338476
|
-
let
|
|
338557
|
+
let _r;
|
|
338477
338558
|
try {
|
|
338478
|
-
if (
|
|
338559
|
+
if (gr.context === Context.ETH && typeof gr.chainId == "number" && (await switchChain(gr.chainId, TransferWallet.RECEIVING), registerWalletSigner(qe.toChain, TransferWallet.RECEIVING)), !Je)
|
|
338479
338560
|
throw new Error("failed to get vaa, cannot redeem");
|
|
338480
|
-
|
|
338561
|
+
_r = await RouteOperator.redeem(
|
|
338481
338562
|
Qe,
|
|
338482
338563
|
qe.toChain,
|
|
338483
338564
|
Je,
|
|
338484
338565
|
We.address
|
|
338485
|
-
),
|
|
338486
|
-
|
|
338487
|
-
|
|
338488
|
-
|
|
338489
|
-
|
|
338490
|
-
const
|
|
338491
|
-
|
|
338566
|
+
), config$1.triggerEvent({
|
|
338567
|
+
type: "transfer.redeem.start",
|
|
338568
|
+
details: ar
|
|
338569
|
+
}), Zn(!1), Wn("");
|
|
338570
|
+
} catch (vr) {
|
|
338571
|
+
const [Gn, rr] = interpretTransferError(
|
|
338572
|
+
vr,
|
|
338573
|
+
qe.toChain
|
|
338574
|
+
);
|
|
338575
|
+
Wn(Gn), config$1.triggerEvent({
|
|
338576
|
+
type: "transfer.redeem.error",
|
|
338577
|
+
details: ar,
|
|
338578
|
+
error: rr
|
|
338579
|
+
}), Zn(!1), console.error(vr);
|
|
338580
|
+
}
|
|
338581
|
+
if (_r !== void 0) {
|
|
338582
|
+
const vr = RouteOperator.getRoute(Qe);
|
|
338583
|
+
if (isNttRoute(vr.TYPE) && Je && isSignedNttMessage(Je))
|
|
338492
338584
|
try {
|
|
338493
|
-
const
|
|
338585
|
+
const Gn = vr, rr = await Gn.getInboundQueuedTransfer(
|
|
338494
338586
|
qe.toChain,
|
|
338495
338587
|
Je.recipientNttManager,
|
|
338496
338588
|
Je.messageDigest
|
|
338497
338589
|
);
|
|
338498
|
-
|
|
338590
|
+
rr ? e(setInboundQueuedTransfer(rr)) : await Gn.isTransferCompleted(
|
|
338499
338591
|
qe.toChain,
|
|
338500
338592
|
Je
|
|
338501
|
-
) && (e(setRedeemTx(
|
|
338502
|
-
|
|
338503
|
-
|
|
338593
|
+
) && (e(setRedeemTx(_r)), e(setTransferComplete(!0)), config$1.triggerEvent({
|
|
338594
|
+
type: "transfer.redeem.success",
|
|
338595
|
+
details: ar
|
|
338596
|
+
}));
|
|
338597
|
+
} catch (Gn) {
|
|
338598
|
+
console.error(Gn);
|
|
338504
338599
|
}
|
|
338505
338600
|
else
|
|
338506
|
-
e(setRedeemTx(
|
|
338601
|
+
e(setRedeemTx(_r)), e(setTransferComplete(!0)), config$1.triggerEvent({
|
|
338602
|
+
type: "transfer.redeem.success",
|
|
338603
|
+
details: ar
|
|
338604
|
+
});
|
|
338507
338605
|
}
|
|
338508
338606
|
}, fr = qe.recipient === "" && qe.toChain === "solana" && qe.payloadID === PayloadType.Manual, sr = dr ? !Fe && !Dt : Xn && !Fe, Qn = Fe || dr ? "" : ht ? "Error please retry . . ." : "Claim below", $n = !Fe && (Qe === Route.Relay || isPorticoRoute(Qe));
|
|
338509
338607
|
let nr = "";
|
|
@@ -339173,7 +339271,16 @@ function Redeem({
|
|
|
339173
339271
|
}
|
|
339174
339272
|
if (Ze)
|
|
339175
339273
|
return;
|
|
339176
|
-
Wn ? Qe()
|
|
339274
|
+
Wn ? (Qe(), config$1.triggerEvent({
|
|
339275
|
+
type: "transfer.success",
|
|
339276
|
+
details: {
|
|
339277
|
+
route: Ke,
|
|
339278
|
+
fromToken: getTokenDetails(Je.tokenKey),
|
|
339279
|
+
toToken: getTokenDetails(Je.receivedTokenKey),
|
|
339280
|
+
fromChain: Je.fromChain,
|
|
339281
|
+
toChain: Je.toChain
|
|
339282
|
+
}
|
|
339283
|
+
})) : await sleep(ht < 10 ? 3e3 : 3e4), ht++;
|
|
339177
339284
|
}
|
|
339178
339285
|
})(), () => {
|
|
339179
339286
|
Ze = !0;
|
|
@@ -339421,17 +339528,19 @@ const useStyles = makeStyles()((e) => ({
|
|
|
339421
339528
|
}
|
|
339422
339529
|
}
|
|
339423
339530
|
}));
|
|
339424
|
-
function AppRouter(
|
|
339531
|
+
function AppRouter(e) {
|
|
339425
339532
|
const { classes: Re } = useStyles(), Fe = useDispatch();
|
|
339426
339533
|
React__default.useEffect(() => {
|
|
339427
|
-
e && (setConfig(e), Fe(clearTransfer()))
|
|
339534
|
+
e.config && (setConfig(e.config), Fe(clearTransfer())), config$1.triggerEvent({
|
|
339535
|
+
type: "load"
|
|
339536
|
+
});
|
|
339428
339537
|
}, []);
|
|
339429
339538
|
const Qe = useSelector(
|
|
339430
339539
|
(Ke) => Ke.router.showWalletModal
|
|
339431
339540
|
), Je = useSelector((Ke) => Ke.router.route), qe = usePrevious(Je), { hasExternalSearch: We } = useExternalSearch();
|
|
339432
339541
|
return useEffect(() => {
|
|
339433
339542
|
const Ke = "redeem", dt = "bridge";
|
|
339434
|
-
qe === Ke && Je !== Ke && (Fe(clearRedeem()), Fe(clearWallets()), Fe(clearNtt()), config$1.wh.registerProviders()),
|
|
339543
|
+
qe === Ke && Je !== Ke && (Fe(clearRedeem()), Fe(clearWallets()), Fe(clearNtt()), config$1.wh.registerProviders()), Je === dt && qe !== dt && (Fe(clearTransfer()), Fe(clearPorticoBridge()));
|
|
339435
339544
|
}, [Je, qe, Fe]), useEffect(() => {
|
|
339436
339545
|
We && (Fe(clearRedeem()), Fe(setRoute("search")));
|
|
339437
339546
|
}, [We, Fe]), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Re.appContent, children: [
|