@skip-go/widget 3.13.0 → 3.14.1
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.
|
@@ -3,10 +3,10 @@ import o, { useContext, useState, useMemo, useEffect, useRef, useDebugValue, cre
|
|
|
3
3
|
import { Scope } from "react-shadow-scope";
|
|
4
4
|
import { atom as atom$1, useAtomValue, useAtom, useSetAtom, createStore, Provider } from "jotai";
|
|
5
5
|
import NiceModal, { useModal } from "@ebay/nice-modal-react";
|
|
6
|
-
import { assets, chains, bridges, venues, ChainType, getSigningStargateClient, route,
|
|
6
|
+
import { assets, chains, bridges, venues, ChainType, getSigningStargateClient, route, balances, executeMultipleRoutes, executeRoute, BridgeType, FeeType, GAS_STATION_CHAIN_IDS, subscribeToRouteStatus, setClientOptions } from "@skip-go/client";
|
|
7
7
|
import { atomWithQuery, atomWithMutation } from "jotai-tanstack-query";
|
|
8
8
|
import pluralize from "pluralize";
|
|
9
|
-
import { track,
|
|
9
|
+
import { track, init, add, setUserId } from "@amplitude/analytics-browser";
|
|
10
10
|
import { atomEffect } from "jotai-effect";
|
|
11
11
|
import { WalletType, isWalletConnect, useActiveWalletType, useDisconnect, getWallet, checkWallet, connect, useAccount as useAccount$1, getChainInfo as getChainInfo$1, GrazProvider } from "graz";
|
|
12
12
|
import { createPenumbraClient } from "@penumbra-zone/client";
|
|
@@ -1765,8 +1765,8 @@ const flexProps = lt`
|
|
|
1765
1765
|
${({ flexDirection }) => flexDirection && `flex-direction: ${flexDirection}`};
|
|
1766
1766
|
`;
|
|
1767
1767
|
const Row = dt.div`
|
|
1768
|
-
${({ width }) => width && `width: ${width}px`};
|
|
1769
|
-
${({ height }) => height && `height: ${height}px`};
|
|
1768
|
+
${({ width }) => width !== void 0 && `width: ${typeof width === "number" ? `${width}px` : width}`};
|
|
1769
|
+
${({ height }) => height !== void 0 && `height: ${typeof height === "number" ? `${height}px` : height}`};
|
|
1770
1770
|
flex-direction: row;
|
|
1771
1771
|
${flexProps};
|
|
1772
1772
|
`;
|
|
@@ -1774,10 +1774,24 @@ const Column = dt(Row)`
|
|
|
1774
1774
|
flex-direction: column;
|
|
1775
1775
|
`;
|
|
1776
1776
|
const Spacer = dt.div`
|
|
1777
|
-
|
|
1778
|
-
${({ height }) => height && `height: ${height}px`};
|
|
1777
|
+
position: relative;
|
|
1779
1778
|
flex-shrink: 0;
|
|
1780
1779
|
flex-grow: 0;
|
|
1780
|
+
${({ width }) => width !== void 0 && `width: ${typeof width === "number" ? `${width}px` : width}`};
|
|
1781
|
+
${({ height }) => height !== void 0 && `height: ${typeof height === "number" ? `${height}px` : height}`};
|
|
1782
|
+
|
|
1783
|
+
${({ showLine, lineColor = "#ccc", lineThickness = 1 }) => showLine && `
|
|
1784
|
+
&::after {
|
|
1785
|
+
content: '';
|
|
1786
|
+
position: absolute;
|
|
1787
|
+
top: 50%;
|
|
1788
|
+
left: 0;
|
|
1789
|
+
width: 100%;
|
|
1790
|
+
height: ${lineThickness}px;
|
|
1791
|
+
background-color: ${lineColor};
|
|
1792
|
+
transform: translateY(-50%);
|
|
1793
|
+
}
|
|
1794
|
+
`}
|
|
1781
1795
|
`;
|
|
1782
1796
|
const withBoundProps = (WrappedComponent, boundProps) => {
|
|
1783
1797
|
return (props) => {
|
|
@@ -2193,7 +2207,7 @@ const Text = dt(SmallText)`
|
|
|
2193
2207
|
${({ useWindowsTextHack }) => useWindowsTextHack && isWindows() ? "margin-bottom: -4px" : ""};
|
|
2194
2208
|
${textProps}
|
|
2195
2209
|
`;
|
|
2196
|
-
|
|
2210
|
+
dt(Text).attrs({ as: "button" })`
|
|
2197
2211
|
${removeButtonStyles}
|
|
2198
2212
|
cursor: pointer;
|
|
2199
2213
|
`;
|
|
@@ -4143,11 +4157,7 @@ function shouldReduceFontSize(value) {
|
|
|
4143
4157
|
return valueWithoutCommas.length >= 14;
|
|
4144
4158
|
}
|
|
4145
4159
|
const formatDisplayAmount = (input, options = {}) => {
|
|
4146
|
-
const {
|
|
4147
|
-
showLessThanSign = true,
|
|
4148
|
-
decimals = DEFAULT_DECIMAL_PLACES,
|
|
4149
|
-
abbreviate = true
|
|
4150
|
-
} = options;
|
|
4160
|
+
const { showLessThanSign = true, decimals = DEFAULT_DECIMAL_PLACES, abbreviate = true } = options;
|
|
4151
4161
|
if (input === void 0) {
|
|
4152
4162
|
return "";
|
|
4153
4163
|
}
|
|
@@ -5950,6 +5960,47 @@ const _mainnetChains = [
|
|
|
5950
5960
|
coinType: 118
|
|
5951
5961
|
}
|
|
5952
5962
|
},
|
|
5963
|
+
{
|
|
5964
|
+
chainId: "axone-1",
|
|
5965
|
+
currencies: [
|
|
5966
|
+
{
|
|
5967
|
+
coinDenom: "axone",
|
|
5968
|
+
coinMinimalDenom: "uaxone",
|
|
5969
|
+
coinDecimals: 6
|
|
5970
|
+
}
|
|
5971
|
+
],
|
|
5972
|
+
rest: "https://api.axone.cumulo.com.es",
|
|
5973
|
+
rpc: "https://rpc.axone.cumulo.com.es",
|
|
5974
|
+
bech32Config: {
|
|
5975
|
+
bech32PrefixAccAddr: "axone",
|
|
5976
|
+
bech32PrefixAccPub: "axonepub",
|
|
5977
|
+
bech32PrefixValAddr: "axonevaloper",
|
|
5978
|
+
bech32PrefixValPub: "axonevaloperpub",
|
|
5979
|
+
bech32PrefixConsAddr: "axonevalcons",
|
|
5980
|
+
bech32PrefixConsPub: "axonevalconspub"
|
|
5981
|
+
},
|
|
5982
|
+
chainName: "axone",
|
|
5983
|
+
feeCurrencies: [
|
|
5984
|
+
{
|
|
5985
|
+
coinDenom: "axone",
|
|
5986
|
+
coinMinimalDenom: "uaxone",
|
|
5987
|
+
coinDecimals: 6,
|
|
5988
|
+
gasPriceStep: {
|
|
5989
|
+
low: 1e-3,
|
|
5990
|
+
average: 5e-3,
|
|
5991
|
+
high: 0.01
|
|
5992
|
+
}
|
|
5993
|
+
}
|
|
5994
|
+
],
|
|
5995
|
+
stakeCurrency: {
|
|
5996
|
+
coinDenom: "axone",
|
|
5997
|
+
coinMinimalDenom: "uaxone",
|
|
5998
|
+
coinDecimals: 6
|
|
5999
|
+
},
|
|
6000
|
+
bip44: {
|
|
6001
|
+
coinType: 118
|
|
6002
|
+
}
|
|
6003
|
+
},
|
|
5953
6004
|
{
|
|
5954
6005
|
chainId: "bbn-1",
|
|
5955
6006
|
currencies: [
|
|
@@ -6300,11 +6351,6 @@ const _mainnetChains = [
|
|
|
6300
6351
|
coinDenom: "badge",
|
|
6301
6352
|
coinMinimalDenom: "ubadge",
|
|
6302
6353
|
coinDecimals: 9
|
|
6303
|
-
},
|
|
6304
|
-
{
|
|
6305
|
-
coinDenom: "stake",
|
|
6306
|
-
coinMinimalDenom: "ustake",
|
|
6307
|
-
coinDecimals: 9
|
|
6308
6354
|
}
|
|
6309
6355
|
],
|
|
6310
6356
|
rest: "http://134.122.12.165:1317",
|
|
@@ -8712,6 +8758,16 @@ const _mainnetChains = [
|
|
|
8712
8758
|
average: 0.025,
|
|
8713
8759
|
high: 0.03
|
|
8714
8760
|
}
|
|
8761
|
+
},
|
|
8762
|
+
{
|
|
8763
|
+
coinDenom: "xrp",
|
|
8764
|
+
coinMinimalDenom: "ibc/8464A63954C0350A26C8588E20719F3A0AC8705E4CA0F7450B60C3F16B2D3421",
|
|
8765
|
+
coinDecimals: 18,
|
|
8766
|
+
gasPriceStep: {
|
|
8767
|
+
low: 11395e6,
|
|
8768
|
+
average: 21395e6,
|
|
8769
|
+
high: 31395e6
|
|
8770
|
+
}
|
|
8715
8771
|
}
|
|
8716
8772
|
],
|
|
8717
8773
|
stakeCurrency: {
|
|
@@ -10238,6 +10294,11 @@ const _mainnetChains = [
|
|
|
10238
10294
|
coinDenom: "Hydro Wrapped hINJ",
|
|
10239
10295
|
coinMinimalDenom: "factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj18luqttqyckgpddndh8hvaq25d5nfwjc78m56lc",
|
|
10240
10296
|
coinDecimals: 18
|
|
10297
|
+
},
|
|
10298
|
+
{
|
|
10299
|
+
coinDenom: "wbtc",
|
|
10300
|
+
coinMinimalDenom: "ibc/0E293A7622DC9A6439DB60E6D234B5AF446962E27CA3AB44D0590603DFF6968E",
|
|
10301
|
+
coinDecimals: 8
|
|
10241
10302
|
}
|
|
10242
10303
|
],
|
|
10243
10304
|
rest: "https://6d0ff611-9009-4bd1-a7a7-acec7c70d454.injective-1.mesa-rest.newmetric.xyz",
|
|
@@ -11261,6 +11322,26 @@ const _mainnetChains = [
|
|
|
11261
11322
|
average: 0.025,
|
|
11262
11323
|
high: 0.03
|
|
11263
11324
|
}
|
|
11325
|
+
},
|
|
11326
|
+
{
|
|
11327
|
+
coinDenom: "kUSD",
|
|
11328
|
+
coinMinimalDenom: "ukusd",
|
|
11329
|
+
coinDecimals: 6,
|
|
11330
|
+
gasPriceStep: {
|
|
11331
|
+
low: 0.01,
|
|
11332
|
+
average: 0.025,
|
|
11333
|
+
high: 0.03
|
|
11334
|
+
}
|
|
11335
|
+
},
|
|
11336
|
+
{
|
|
11337
|
+
coinDenom: "USDC",
|
|
11338
|
+
coinMinimalDenom: "ibc/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F",
|
|
11339
|
+
coinDecimals: 6,
|
|
11340
|
+
gasPriceStep: {
|
|
11341
|
+
low: 0.01,
|
|
11342
|
+
average: 0.025,
|
|
11343
|
+
high: 0.03
|
|
11344
|
+
}
|
|
11264
11345
|
}
|
|
11265
11346
|
],
|
|
11266
11347
|
stakeCurrency: {
|
|
@@ -12920,12 +13001,12 @@ const _mainnetChains = [
|
|
|
12920
13001
|
currencies: [
|
|
12921
13002
|
{
|
|
12922
13003
|
coinDenom: "mtgbp",
|
|
12923
|
-
coinMinimalDenom: "
|
|
12924
|
-
coinDecimals:
|
|
13004
|
+
coinMinimalDenom: "umtgbp",
|
|
13005
|
+
coinDecimals: 6
|
|
12925
13006
|
}
|
|
12926
13007
|
],
|
|
12927
13008
|
rest: "https://lcd.mtgbp.com",
|
|
12928
|
-
rpc: "https://
|
|
13009
|
+
rpc: "https://rpc.mtgbp.com",
|
|
12929
13010
|
bech32Config: {
|
|
12930
13011
|
bech32PrefixAccAddr: "mtgbp",
|
|
12931
13012
|
bech32PrefixAccPub: "mtgbppub",
|
|
@@ -12938,22 +13019,22 @@ const _mainnetChains = [
|
|
|
12938
13019
|
feeCurrencies: [
|
|
12939
13020
|
{
|
|
12940
13021
|
coinDenom: "mtgbp",
|
|
12941
|
-
coinMinimalDenom: "
|
|
12942
|
-
coinDecimals:
|
|
13022
|
+
coinMinimalDenom: "umtgbp",
|
|
13023
|
+
coinDecimals: 6,
|
|
12943
13024
|
gasPriceStep: {
|
|
12944
|
-
low:
|
|
12945
|
-
average:
|
|
12946
|
-
high:
|
|
13025
|
+
low: 0.025,
|
|
13026
|
+
average: 0.03,
|
|
13027
|
+
high: 0.035
|
|
12947
13028
|
}
|
|
12948
13029
|
}
|
|
12949
13030
|
],
|
|
12950
13031
|
stakeCurrency: {
|
|
12951
13032
|
coinDenom: "mtgbp",
|
|
12952
|
-
coinMinimalDenom: "
|
|
12953
|
-
coinDecimals:
|
|
13033
|
+
coinMinimalDenom: "umtgbp",
|
|
13034
|
+
coinDecimals: 6
|
|
12954
13035
|
},
|
|
12955
13036
|
bip44: {
|
|
12956
|
-
coinType:
|
|
13037
|
+
coinType: 118
|
|
12957
13038
|
}
|
|
12958
13039
|
},
|
|
12959
13040
|
{
|
|
@@ -13326,6 +13407,11 @@ const _mainnetChains = [
|
|
|
13326
13407
|
coinDenom: "ltc",
|
|
13327
13408
|
coinMinimalDenom: "ibc/C4C791209A16419A4BB3C3177E5E8AE4477C9D7457842E7F531F91C513FA79A0",
|
|
13328
13409
|
coinDecimals: 8
|
|
13410
|
+
},
|
|
13411
|
+
{
|
|
13412
|
+
coinDenom: "TAB",
|
|
13413
|
+
coinMinimalDenom: "factory/neutron1r5qx58l3xx2y8gzjtkqjndjgx69mktmapl45vns0pa73z0zpn7fqgltnll/TAB",
|
|
13414
|
+
coinDecimals: 6
|
|
13329
13415
|
}
|
|
13330
13416
|
],
|
|
13331
13417
|
rest: "https://rest-lb.neutron.org",
|
|
@@ -17085,6 +17171,21 @@ const _mainnetChains = [
|
|
|
17085
17171
|
coinDenom: "XRP",
|
|
17086
17172
|
coinMinimalDenom: "ibc/46EB46DB30D3BBC6F404A9232C09785F36D40DA05C662A8E295712ECBAFF1609",
|
|
17087
17173
|
coinDecimals: 18
|
|
17174
|
+
},
|
|
17175
|
+
{
|
|
17176
|
+
coinDenom: "titan",
|
|
17177
|
+
coinMinimalDenom: "ibc/87B7A56E83C08DBFD567F0DE6463EC54181B8B819B3CAD7A584C47D59A2A05CF",
|
|
17178
|
+
coinDecimals: 6
|
|
17179
|
+
},
|
|
17180
|
+
{
|
|
17181
|
+
coinDenom: "ebaby",
|
|
17182
|
+
coinMinimalDenom: "factory/osmo12r3yc76u9lxe33yemstatnw8602culdjzrtr8lmnpycmd3z7d4jsxx60kc/FwNhFaW3zLxoLUgXCdWjqBzcvGNPaB7B2XZqm2xgrB93",
|
|
17183
|
+
coinDecimals: 6
|
|
17184
|
+
},
|
|
17185
|
+
{
|
|
17186
|
+
coinDenom: "FOST",
|
|
17187
|
+
coinMinimalDenom: "factory/osmo1q77cw0mmlluxu0wr29fcdd0tdnh78gzhkvhe4n6ulal9qvrtu43qtd0nh8/fost",
|
|
17188
|
+
coinDecimals: 6
|
|
17088
17189
|
}
|
|
17089
17190
|
],
|
|
17090
17191
|
rest: "https://lcd.osmosis.zone/",
|
|
@@ -19364,6 +19465,16 @@ const _mainnetChains = [
|
|
|
19364
19465
|
coinMinimalDenom: "lp:33:upryzm",
|
|
19365
19466
|
coinDecimals: 6
|
|
19366
19467
|
},
|
|
19468
|
+
{
|
|
19469
|
+
coinDenom: "lp:34:pryzmypt-pryzm",
|
|
19470
|
+
coinMinimalDenom: "lp:34:upryzmypt-upryzm",
|
|
19471
|
+
coinDecimals: 6
|
|
19472
|
+
},
|
|
19473
|
+
{
|
|
19474
|
+
coinDenom: "lp:35:pryzm-usdc",
|
|
19475
|
+
coinMinimalDenom: "lp:35:upryzm-uusdc",
|
|
19476
|
+
coinDecimals: 6
|
|
19477
|
+
},
|
|
19367
19478
|
{
|
|
19368
19479
|
coinDenom: "lp:36:susds",
|
|
19369
19480
|
coinMinimalDenom: "lp:36:asusds",
|
|
@@ -19422,6 +19533,26 @@ const _mainnetChains = [
|
|
|
19422
19533
|
},
|
|
19423
19534
|
chainName: "pryzm",
|
|
19424
19535
|
feeCurrencies: [
|
|
19536
|
+
{
|
|
19537
|
+
coinDenom: "auuu",
|
|
19538
|
+
coinMinimalDenom: "factory/pryzm1jnhcsa5ddjsjq2t97v6a82z542rduxvtw6wd9h/uauuu",
|
|
19539
|
+
coinDecimals: 6,
|
|
19540
|
+
gasPriceStep: {
|
|
19541
|
+
low: 0.1,
|
|
19542
|
+
average: 0.15,
|
|
19543
|
+
high: 0.2
|
|
19544
|
+
}
|
|
19545
|
+
},
|
|
19546
|
+
{
|
|
19547
|
+
coinDenom: "pryzm",
|
|
19548
|
+
coinMinimalDenom: "upryzm",
|
|
19549
|
+
coinDecimals: 6,
|
|
19550
|
+
gasPriceStep: {
|
|
19551
|
+
low: 0.02,
|
|
19552
|
+
average: 0.03,
|
|
19553
|
+
high: 0.04
|
|
19554
|
+
}
|
|
19555
|
+
},
|
|
19425
19556
|
{
|
|
19426
19557
|
coinDenom: "atom",
|
|
19427
19558
|
coinMinimalDenom: "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2",
|
|
@@ -19482,16 +19613,6 @@ const _mainnetChains = [
|
|
|
19482
19613
|
high: 0.04
|
|
19483
19614
|
}
|
|
19484
19615
|
},
|
|
19485
|
-
{
|
|
19486
|
-
coinDenom: "auuu",
|
|
19487
|
-
coinMinimalDenom: "factory/pryzm1jnhcsa5ddjsjq2t97v6a82z542rduxvtw6wd9h/uauuu",
|
|
19488
|
-
coinDecimals: 6,
|
|
19489
|
-
gasPriceStep: {
|
|
19490
|
-
low: 0.01,
|
|
19491
|
-
average: 0.015,
|
|
19492
|
-
high: 0.02
|
|
19493
|
-
}
|
|
19494
|
-
},
|
|
19495
19616
|
{
|
|
19496
19617
|
coinDenom: "dydx",
|
|
19497
19618
|
coinMinimalDenom: "ibc/F8CA5236869F819BC006EEF088E67889A26E4140339757878F0F4E229CDDA858",
|
|
@@ -19629,12 +19750,12 @@ const _mainnetChains = [
|
|
|
19629
19750
|
currencies: [
|
|
19630
19751
|
{
|
|
19631
19752
|
coinDenom: "qfs",
|
|
19632
|
-
coinMinimalDenom: "
|
|
19633
|
-
coinDecimals:
|
|
19753
|
+
coinMinimalDenom: "uqfs",
|
|
19754
|
+
coinDecimals: 6
|
|
19634
19755
|
}
|
|
19635
19756
|
],
|
|
19636
19757
|
rest: "https://lcd.qfsone.com",
|
|
19637
|
-
rpc: "https://
|
|
19758
|
+
rpc: "https://rpc.qfsone.com",
|
|
19638
19759
|
bech32Config: {
|
|
19639
19760
|
bech32PrefixAccAddr: "qfs",
|
|
19640
19761
|
bech32PrefixAccPub: "qfspub",
|
|
@@ -19647,22 +19768,22 @@ const _mainnetChains = [
|
|
|
19647
19768
|
feeCurrencies: [
|
|
19648
19769
|
{
|
|
19649
19770
|
coinDenom: "qfs",
|
|
19650
|
-
coinMinimalDenom: "
|
|
19651
|
-
coinDecimals:
|
|
19771
|
+
coinMinimalDenom: "uqfs",
|
|
19772
|
+
coinDecimals: 6,
|
|
19652
19773
|
gasPriceStep: {
|
|
19653
|
-
low:
|
|
19654
|
-
average:
|
|
19655
|
-
high:
|
|
19774
|
+
low: 0.025,
|
|
19775
|
+
average: 0.03,
|
|
19776
|
+
high: 0.035
|
|
19656
19777
|
}
|
|
19657
19778
|
}
|
|
19658
19779
|
],
|
|
19659
19780
|
stakeCurrency: {
|
|
19660
19781
|
coinDenom: "qfs",
|
|
19661
|
-
coinMinimalDenom: "
|
|
19662
|
-
coinDecimals:
|
|
19782
|
+
coinMinimalDenom: "uqfs",
|
|
19783
|
+
coinDecimals: 6
|
|
19663
19784
|
},
|
|
19664
19785
|
bip44: {
|
|
19665
|
-
coinType:
|
|
19786
|
+
coinType: 118
|
|
19666
19787
|
}
|
|
19667
19788
|
},
|
|
19668
19789
|
{
|
|
@@ -21628,44 +21749,44 @@ const _mainnetChains = [
|
|
|
21628
21749
|
}
|
|
21629
21750
|
},
|
|
21630
21751
|
{
|
|
21631
|
-
chainId: "taketitan-
|
|
21752
|
+
chainId: "taketitan-1",
|
|
21632
21753
|
currencies: [
|
|
21633
21754
|
{
|
|
21634
|
-
coinDenom: "
|
|
21635
|
-
coinMinimalDenom: "
|
|
21636
|
-
coinDecimals:
|
|
21755
|
+
coinDenom: "titan",
|
|
21756
|
+
coinMinimalDenom: "utitan",
|
|
21757
|
+
coinDecimals: 6
|
|
21637
21758
|
}
|
|
21638
21759
|
],
|
|
21639
|
-
rest: "https://
|
|
21640
|
-
rpc: "https://
|
|
21760
|
+
rest: "https://lcd.taketitan.com",
|
|
21761
|
+
rpc: "https://rpc.taketitan.com",
|
|
21641
21762
|
bech32Config: {
|
|
21642
|
-
bech32PrefixAccAddr: "
|
|
21643
|
-
bech32PrefixAccPub: "
|
|
21644
|
-
bech32PrefixValAddr: "
|
|
21645
|
-
bech32PrefixValPub: "
|
|
21646
|
-
bech32PrefixConsAddr: "
|
|
21647
|
-
bech32PrefixConsPub: "
|
|
21763
|
+
bech32PrefixAccAddr: "titan",
|
|
21764
|
+
bech32PrefixAccPub: "titanpub",
|
|
21765
|
+
bech32PrefixValAddr: "titanvaloper",
|
|
21766
|
+
bech32PrefixValPub: "titanvaloperpub",
|
|
21767
|
+
bech32PrefixConsAddr: "titanvalcons",
|
|
21768
|
+
bech32PrefixConsPub: "titanvalconspub"
|
|
21648
21769
|
},
|
|
21649
21770
|
chainName: "taketitan",
|
|
21650
21771
|
feeCurrencies: [
|
|
21651
21772
|
{
|
|
21652
|
-
coinDenom: "
|
|
21653
|
-
coinMinimalDenom: "
|
|
21654
|
-
coinDecimals:
|
|
21773
|
+
coinDenom: "titan",
|
|
21774
|
+
coinMinimalDenom: "utitan",
|
|
21775
|
+
coinDecimals: 6,
|
|
21655
21776
|
gasPriceStep: {
|
|
21656
|
-
low:
|
|
21657
|
-
average:
|
|
21658
|
-
high:
|
|
21777
|
+
low: 0.025,
|
|
21778
|
+
average: 0.03,
|
|
21779
|
+
high: 0.035
|
|
21659
21780
|
}
|
|
21660
21781
|
}
|
|
21661
21782
|
],
|
|
21662
21783
|
stakeCurrency: {
|
|
21663
|
-
coinDenom: "
|
|
21664
|
-
coinMinimalDenom: "
|
|
21665
|
-
coinDecimals:
|
|
21784
|
+
coinDenom: "titan",
|
|
21785
|
+
coinMinimalDenom: "utitan",
|
|
21786
|
+
coinDecimals: 6
|
|
21666
21787
|
},
|
|
21667
21788
|
bip44: {
|
|
21668
|
-
coinType:
|
|
21789
|
+
coinType: 118
|
|
21669
21790
|
}
|
|
21670
21791
|
},
|
|
21671
21792
|
{
|
|
@@ -25796,7 +25917,7 @@ const _testnetChains = [
|
|
|
25796
25917
|
coinDecimals: 6,
|
|
25797
25918
|
gasPriceStep: {
|
|
25798
25919
|
low: 0.01,
|
|
25799
|
-
average: 0.
|
|
25920
|
+
average: 0.02,
|
|
25800
25921
|
high: 0.03
|
|
25801
25922
|
}
|
|
25802
25923
|
}
|
|
@@ -31465,6 +31586,12 @@ const _explorers = [
|
|
|
31465
31586
|
url: "https://explorer.whenmoonwhenlambo.money/arkeo",
|
|
31466
31587
|
txPage: "https://explorer.whenmoonwhenlambo.money/arkeo/tx/${txHash}",
|
|
31467
31588
|
accountPage: "https://explorer.whenmoonwhenlambo.money/arkeo/account/${accountAddress}"
|
|
31589
|
+
},
|
|
31590
|
+
{
|
|
31591
|
+
kind: "NodeStake",
|
|
31592
|
+
url: "https://explorer.nodestake.org/arkeo",
|
|
31593
|
+
txPage: "https://explorer.nodestake.org/arkeo/tx/${txHash}",
|
|
31594
|
+
accountPage: "https://explorer.nodestake.org/arkeo/account/${accountAddress}"
|
|
31468
31595
|
}
|
|
31469
31596
|
]
|
|
31470
31597
|
},
|
|
@@ -31732,6 +31859,23 @@ const _explorers = [
|
|
|
31732
31859
|
}
|
|
31733
31860
|
]
|
|
31734
31861
|
},
|
|
31862
|
+
{
|
|
31863
|
+
chainId: "axone-1",
|
|
31864
|
+
explorers: [
|
|
31865
|
+
{
|
|
31866
|
+
kind: "valopers",
|
|
31867
|
+
url: "https://axone.valopers.com/",
|
|
31868
|
+
txPage: "https://axone.valopers.com/transactions/${txHash}",
|
|
31869
|
+
accountPage: "https://axone.valopers.com/account/${accountAddress}"
|
|
31870
|
+
},
|
|
31871
|
+
{
|
|
31872
|
+
kind: "NodeStake",
|
|
31873
|
+
url: "https://explorer.nodestake.org/axone",
|
|
31874
|
+
txPage: "https://explorer.nodestake.org/axone/tx/${txHash}",
|
|
31875
|
+
accountPage: "https://explorer.nodestake.org/axone/account/${accountAddress}"
|
|
31876
|
+
}
|
|
31877
|
+
]
|
|
31878
|
+
},
|
|
31735
31879
|
{
|
|
31736
31880
|
chainId: "bbn-1",
|
|
31737
31881
|
explorers: [
|
|
@@ -32552,9 +32696,8 @@ const _explorers = [
|
|
|
32552
32696
|
chainId: "cifer-2",
|
|
32553
32697
|
explorers: [
|
|
32554
32698
|
{
|
|
32555
|
-
|
|
32556
|
-
|
|
32557
|
-
txPage: "https://explorer.cifer.ai/transactions/${txHash}"
|
|
32699
|
+
url: "https://www.cifscan.com/",
|
|
32700
|
+
txPage: "https://www.cifscan.com/tx/${txHash}"
|
|
32558
32701
|
}
|
|
32559
32702
|
]
|
|
32560
32703
|
},
|
|
@@ -35349,7 +35492,7 @@ const _explorers = [
|
|
|
35349
35492
|
explorers: [
|
|
35350
35493
|
{
|
|
35351
35494
|
kind: "ping.pub",
|
|
35352
|
-
url: "https://blockexplorer.mtgbp.com
|
|
35495
|
+
url: "https://blockexplorer.mtgbp.com",
|
|
35353
35496
|
txPage: "https://blockexplorer.mtgbp.com/mtgbp/tx/${txHash}",
|
|
35354
35497
|
accountPage: "https://blockexplorer.mtgbp.com/mtgbp/accounts/${accountAddress}"
|
|
35355
35498
|
}
|
|
@@ -36248,6 +36391,12 @@ const _explorers = [
|
|
|
36248
36391
|
url: "https://shannon.pokt.network",
|
|
36249
36392
|
txPage: "https://shannon.pokt.network/tx/${txHash}",
|
|
36250
36393
|
accountPage: "https://shannon.pokt.network/poktroll/account/${accountAddress}"
|
|
36394
|
+
},
|
|
36395
|
+
{
|
|
36396
|
+
kind: "🗺 Ping Pub fork Explorer by Blockval",
|
|
36397
|
+
url: "https://explorer.blockval.io/pocket",
|
|
36398
|
+
txPage: "https://explorer.blockval.io/pocket/tx/${txHash}",
|
|
36399
|
+
accountPage: "https://explorer.blockval.io/pocket/account/${accountAddress}"
|
|
36251
36400
|
}
|
|
36252
36401
|
]
|
|
36253
36402
|
},
|
|
@@ -36417,7 +36566,7 @@ const _explorers = [
|
|
|
36417
36566
|
explorers: [
|
|
36418
36567
|
{
|
|
36419
36568
|
kind: "ping.pub",
|
|
36420
|
-
url: "https://blockexplorer.qfsone.com
|
|
36569
|
+
url: "https://blockexplorer.qfsone.com",
|
|
36421
36570
|
txPage: "https://blockexplorer.qfsone.com/qfs/tx/${txHash}",
|
|
36422
36571
|
accountPage: "https://blockexplorer.qfsone.com/qfs/accounts/${accountAddress}"
|
|
36423
36572
|
}
|
|
@@ -37767,13 +37916,13 @@ const _explorers = [
|
|
|
37767
37916
|
]
|
|
37768
37917
|
},
|
|
37769
37918
|
{
|
|
37770
|
-
chainId: "taketitan-
|
|
37919
|
+
chainId: "taketitan-1",
|
|
37771
37920
|
explorers: [
|
|
37772
37921
|
{
|
|
37773
37922
|
kind: "ping.pub",
|
|
37774
|
-
url: "https://
|
|
37775
|
-
txPage: "https://
|
|
37776
|
-
accountPage: "https://
|
|
37923
|
+
url: "https://blockexplorer.taketitan.com",
|
|
37924
|
+
txPage: "https://blockexplorer.taketitan.com/taketitan/tx/${txHash}",
|
|
37925
|
+
accountPage: "https://blockexplorer.taketitan.com/taketitan/accounts/${accountAddress}"
|
|
37777
37926
|
}
|
|
37778
37927
|
]
|
|
37779
37928
|
},
|
|
@@ -41327,6 +41476,7 @@ const setRouteToDefaultRouteAtom = atom$1(null, (get, set, assets2) => {
|
|
|
41327
41476
|
var HISTORY_VERSION = /* @__PURE__ */ ((HISTORY_VERSION2) => {
|
|
41328
41477
|
HISTORY_VERSION2[HISTORY_VERSION2["camelCase"] = 0] = "camelCase";
|
|
41329
41478
|
HISTORY_VERSION2[HISTORY_VERSION2["routeDetails"] = 1] = "routeDetails";
|
|
41479
|
+
HISTORY_VERSION2[HISTORY_VERSION2["userAddresses"] = 2] = "userAddresses";
|
|
41330
41480
|
return HISTORY_VERSION2;
|
|
41331
41481
|
})(HISTORY_VERSION || {});
|
|
41332
41482
|
const transactionHistoryVersionAtom = atomWithStorage(
|
|
@@ -41339,9 +41489,16 @@ const transactionHistoryAtom = atomWithStorage(
|
|
|
41339
41489
|
);
|
|
41340
41490
|
const sortedHistoryItemsAtom = atom$1((get) => {
|
|
41341
41491
|
const history = get(transactionHistoryAtom);
|
|
41342
|
-
|
|
41343
|
-
(historyItem) => historyItem.txsSigned > 0 && historyItem.transactionDetails.some((tx) => tx.txHash)
|
|
41344
|
-
).
|
|
41492
|
+
const sortedAndFiltered = history.filter(
|
|
41493
|
+
(historyItem) => historyItem.txsSigned > 0 && historyItem.mainRouteId === void 0 && historyItem.transactionDetails.some((tx) => tx.txHash)
|
|
41494
|
+
).map((historyItem) => {
|
|
41495
|
+
const relatedRoutes = [...historyItem.relatedRoutes ?? []];
|
|
41496
|
+
return {
|
|
41497
|
+
...historyItem,
|
|
41498
|
+
relatedRoutes
|
|
41499
|
+
};
|
|
41500
|
+
}).sort((a, b) => b.timestamp - a.timestamp);
|
|
41501
|
+
return sortedAndFiltered;
|
|
41345
41502
|
});
|
|
41346
41503
|
const setTransactionHistoryAtom = atom$1(
|
|
41347
41504
|
null,
|
|
@@ -41354,7 +41511,9 @@ const setTransactionHistoryAtom = atom$1(
|
|
|
41354
41511
|
newHistory[index] = { ...oldItem, ...historyItem };
|
|
41355
41512
|
} else {
|
|
41356
41513
|
if (historyItem.id) {
|
|
41357
|
-
|
|
41514
|
+
if (historyItem.mainRouteId === void 0) {
|
|
41515
|
+
set(setCurrentTransactionIdAtom, historyItem.id);
|
|
41516
|
+
}
|
|
41358
41517
|
newHistory.push(historyItem);
|
|
41359
41518
|
}
|
|
41360
41519
|
}
|
|
@@ -41367,7 +41526,7 @@ const currentTransactionAtom = atom$1((get) => {
|
|
|
41367
41526
|
return history.find((historyItem) => historyItem.id === currentTransactionId);
|
|
41368
41527
|
});
|
|
41369
41528
|
const lastTransactionInTimeAtom = atom$1((get) => {
|
|
41370
|
-
const history = get(
|
|
41529
|
+
const history = get(sortedHistoryItemsAtom);
|
|
41371
41530
|
if (history.length === 0) return;
|
|
41372
41531
|
const sorted = [...history].sort((a, b) => b.timestamp - a.timestamp);
|
|
41373
41532
|
return sorted.at(0);
|
|
@@ -45415,7 +45574,7 @@ function walletConnect(parameters) {
|
|
|
45415
45574
|
const optionalChains = config2.chains.map((x2) => x2.id);
|
|
45416
45575
|
if (!optionalChains.length)
|
|
45417
45576
|
return;
|
|
45418
|
-
const { EthereumProvider } = await import("./index.es-
|
|
45577
|
+
const { EthereumProvider } = await import("./index.es-MjDHEa3g.js");
|
|
45419
45578
|
return await EthereumProvider.init({
|
|
45420
45579
|
...parameters,
|
|
45421
45580
|
disableProviderPing: true,
|
|
@@ -45751,7 +45910,291 @@ const createSkipExplorerLink = (transactionDetails) => {
|
|
|
45751
45910
|
const initialTxChainId = (_b = transactionDetails == null ? void 0 : transactionDetails[0]) == null ? void 0 : _b.chainId;
|
|
45752
45911
|
return `https://explorer.skip.build/?tx_hash=${txHashCommaSeperatedList}&chain_id=${initialTxChainId}${isTestnet ? "&is_testnet=true" : ""}`;
|
|
45753
45912
|
};
|
|
45913
|
+
const skipAllBalancesRequestAtom = atom$1(void 0);
|
|
45914
|
+
const skipAllBalancesAtom = atomWithQuery((get) => {
|
|
45915
|
+
const params = get(skipAllBalancesRequestAtom);
|
|
45916
|
+
const isInvertingSwap = get(isInvertingSwapAtom);
|
|
45917
|
+
const enabled = params && !isInvertingSwap;
|
|
45918
|
+
return {
|
|
45919
|
+
queryKey: ["skipBalances", params],
|
|
45920
|
+
queryFn: async () => {
|
|
45921
|
+
if (!params) {
|
|
45922
|
+
return { chains: {} };
|
|
45923
|
+
}
|
|
45924
|
+
if (Object.keys((params == null ? void 0 : params.chains) ?? {}).length === 0) {
|
|
45925
|
+
return { chains: {} };
|
|
45926
|
+
}
|
|
45927
|
+
const res = await balances({ ...params, abortDuplicateRequests: true });
|
|
45928
|
+
if (res === void 0) {
|
|
45929
|
+
return { chains: {} };
|
|
45930
|
+
}
|
|
45931
|
+
if (res.chains === void 0) {
|
|
45932
|
+
return { chains: {} };
|
|
45933
|
+
}
|
|
45934
|
+
return res;
|
|
45935
|
+
},
|
|
45936
|
+
enabled,
|
|
45937
|
+
refetchInterval: 1e3 * 60,
|
|
45938
|
+
retry: 1,
|
|
45939
|
+
gcTime: 0,
|
|
45940
|
+
placeholderData: (prevData) => prevData
|
|
45941
|
+
};
|
|
45942
|
+
});
|
|
45943
|
+
const GAS_ON_RECEIVE_AMOUNT_USD = {
|
|
45944
|
+
[ChainType.Cosmos]: 0.1,
|
|
45945
|
+
evm_l2: 2
|
|
45946
|
+
};
|
|
45947
|
+
const gasOnReceiveAtom = atom$1(void 0);
|
|
45948
|
+
const gasOnReceiveAmountAtom = atom$1(void 0);
|
|
45949
|
+
const gasOnReceiveRouteRequestAtom = atom$1((get) => {
|
|
45950
|
+
var _a, _b, _c, _d, _e2, _f;
|
|
45951
|
+
const balances2 = get(skipAllBalancesAtom);
|
|
45952
|
+
const chains2 = get(skipChainsAtom);
|
|
45953
|
+
const sourceAsset = get(sourceAssetAtom);
|
|
45954
|
+
const destinationAsset = get(destinationAssetAtom);
|
|
45955
|
+
const _amount = get(gasOnReceiveAmountAtom);
|
|
45956
|
+
if (!sourceAsset || !destinationAsset) return;
|
|
45957
|
+
const destinationChain = (_a = chains2.data) == null ? void 0 : _a.find((c) => c.chainId === (destinationAsset == null ? void 0 : destinationAsset.chainId));
|
|
45958
|
+
const amountUsd = (() => {
|
|
45959
|
+
if (_amount !== void 0) {
|
|
45960
|
+
const parsedAmount = Number(_amount);
|
|
45961
|
+
if (!isNaN(parsedAmount)) return parsedAmount;
|
|
45962
|
+
}
|
|
45963
|
+
if ((destinationChain == null ? void 0 : destinationChain.chainType) === ChainType.Evm) {
|
|
45964
|
+
return GAS_ON_RECEIVE_AMOUNT_USD.evm_l2;
|
|
45965
|
+
}
|
|
45966
|
+
return GAS_ON_RECEIVE_AMOUNT_USD[ChainType.Cosmos];
|
|
45967
|
+
})();
|
|
45968
|
+
const destinationFeeAssets = (() => {
|
|
45969
|
+
var _a2;
|
|
45970
|
+
if ((destinationChain == null ? void 0 : destinationChain.chainType) === ChainType.Evm) {
|
|
45971
|
+
const assets2 = get(skipAssetsAtom);
|
|
45972
|
+
const evmFeeAsset = (_a2 = assets2.data) == null ? void 0 : _a2.find(
|
|
45973
|
+
(asset) => asset.chain_key === (destinationChain == null ? void 0 : destinationChain.chainId) && asset.denom.includes("-native")
|
|
45974
|
+
);
|
|
45975
|
+
if (evmFeeAsset) {
|
|
45976
|
+
return [{ amountOut: void 0, denom: evmFeeAsset.denom }];
|
|
45977
|
+
}
|
|
45978
|
+
}
|
|
45979
|
+
return destinationChain == null ? void 0 : destinationChain.feeAssets.map((asset) => {
|
|
45980
|
+
var _a3, _b2, _c2;
|
|
45981
|
+
const gasPrice = ((_a3 = asset.gasPrice) == null ? void 0 : _a3.average) ?? ((_b2 = asset.gasPrice) == null ? void 0 : _b2.high) ?? ((_c2 = asset.gasPrice) == null ? void 0 : _c2.low);
|
|
45982
|
+
return {
|
|
45983
|
+
amountOut: gasPrice && convertHumanReadableAmountToCryptoAmount(
|
|
45984
|
+
BigNumber(gasPrice).multipliedBy(3).toNumber(),
|
|
45985
|
+
destinationAsset == null ? void 0 : destinationAsset.decimals
|
|
45986
|
+
),
|
|
45987
|
+
denom: asset.denom
|
|
45988
|
+
};
|
|
45989
|
+
});
|
|
45990
|
+
})();
|
|
45991
|
+
if (!(sourceAsset == null ? void 0 : sourceAsset.chainId) || !sourceAsset.denom || !destinationFeeAssets) return;
|
|
45992
|
+
const sourceAssetUsdPrice = (_f = (_e2 = (_d = (_c = (_b = balances2 == null ? void 0 : balances2.data) == null ? void 0 : _b.chains) == null ? void 0 : _c[sourceAsset == null ? void 0 : sourceAsset.chainId]) == null ? void 0 : _d.denoms) == null ? void 0 : _e2[sourceAsset == null ? void 0 : sourceAsset.denom]) == null ? void 0 : _f.price;
|
|
45993
|
+
if (!sourceAssetUsdPrice) return;
|
|
45994
|
+
const amount = BigNumber(sourceAssetUsdPrice).multipliedBy(amountUsd).toString();
|
|
45995
|
+
return {
|
|
45996
|
+
amountIn: convertHumanReadableAmountToCryptoAmount(amount, destinationAsset == null ? void 0 : destinationAsset.decimals),
|
|
45997
|
+
sourceAssetChainId: sourceAsset.chainId,
|
|
45998
|
+
sourceAssetDenom: sourceAsset.denom,
|
|
45999
|
+
destAssetChainId: destinationAsset == null ? void 0 : destinationAsset.chainId,
|
|
46000
|
+
destAssetDenoms: destinationFeeAssets
|
|
46001
|
+
};
|
|
46002
|
+
});
|
|
46003
|
+
const isSomeDestinationFeeBalanceAvailableAtom = atomWithQuery((get) => {
|
|
46004
|
+
const chainAddresses = get(chainAddressesAtom);
|
|
46005
|
+
const chainAddressesArray = Object.values(chainAddresses);
|
|
46006
|
+
const destination = chainAddressesArray == null ? void 0 : chainAddressesArray[chainAddressesArray.length - 1];
|
|
46007
|
+
const destinationAddress = destination == null ? void 0 : destination.address;
|
|
46008
|
+
const gasOnReceiveRouteParams = get(gasOnReceiveRouteRequestAtom);
|
|
46009
|
+
const queryEnabled = !!destinationAddress && !!gasOnReceiveRouteParams;
|
|
46010
|
+
return {
|
|
46011
|
+
enabled: queryEnabled,
|
|
46012
|
+
retry: false,
|
|
46013
|
+
refetchOnReconnect: false,
|
|
46014
|
+
refetchOnWindowFocus: false,
|
|
46015
|
+
refetchInterval: false,
|
|
46016
|
+
queryKey: ["destinationBalances", { destination, gasOnReceiveRouteParams }],
|
|
46017
|
+
queryFn: async () => {
|
|
46018
|
+
if (!gasOnReceiveRouteParams) return false;
|
|
46019
|
+
const balanceResponse = await balances({
|
|
46020
|
+
chains: {
|
|
46021
|
+
[destination.chainId]: {
|
|
46022
|
+
address: destinationAddress
|
|
46023
|
+
}
|
|
46024
|
+
}
|
|
46025
|
+
});
|
|
46026
|
+
const isSomeBalanceAvailable = gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.destAssetDenoms.some(
|
|
46027
|
+
({ denom, amountOut }) => {
|
|
46028
|
+
var _a, _b, _c, _d;
|
|
46029
|
+
const balanceAmount = (_d = (_c = (_b = (_a = balanceResponse == null ? void 0 : balanceResponse.chains) == null ? void 0 : _a[destination.chainId]) == null ? void 0 : _b.denoms) == null ? void 0 : _c[denom]) == null ? void 0 : _d.amount;
|
|
46030
|
+
const isMoreThanAmountOut = !!balanceAmount && !!amountOut && BigNumber(balanceAmount).isGreaterThanOrEqualTo(amountOut);
|
|
46031
|
+
return amountOut ? isMoreThanAmountOut : balanceAmount && balanceAmount !== "0";
|
|
46032
|
+
}
|
|
46033
|
+
);
|
|
46034
|
+
if (!isSomeBalanceAvailable) {
|
|
46035
|
+
track("gas on receive: no destination balance");
|
|
46036
|
+
}
|
|
46037
|
+
return isSomeBalanceAvailable;
|
|
46038
|
+
}
|
|
46039
|
+
};
|
|
46040
|
+
});
|
|
46041
|
+
const gasOnReceiveAtomEffect = atomEffect((get, set) => {
|
|
46042
|
+
var _a;
|
|
46043
|
+
const gorRoute = get(gasOnReceiveRouteAtom);
|
|
46044
|
+
const isSomeDestinationFeeBalanceAvailable = get(isSomeDestinationFeeBalanceAvailableAtom);
|
|
46045
|
+
const currentTransactionItem = get(currentTransactionAtom);
|
|
46046
|
+
if (gorRoute.isLoading || isSomeDestinationFeeBalanceAvailable.isLoading) return;
|
|
46047
|
+
if (currentTransactionItem) return;
|
|
46048
|
+
if (!((_a = gorRoute.data) == null ? void 0 : _a.gasOnReceiveAsset)) return;
|
|
46049
|
+
if (isSomeDestinationFeeBalanceAvailable.data) {
|
|
46050
|
+
set(gasOnReceiveAtom, (prev2) => prev2 ?? false);
|
|
46051
|
+
} else {
|
|
46052
|
+
set(gasOnReceiveAtom, (prev2) => prev2 ?? true);
|
|
46053
|
+
}
|
|
46054
|
+
});
|
|
46055
|
+
const gasOnReceiveRouteAtom = atomWithQuery((get) => {
|
|
46056
|
+
const { data: chains2 } = get(skipChainsAtom);
|
|
46057
|
+
const { data: originalRoute } = get(skipRouteAtom);
|
|
46058
|
+
const params = get(skipRouteRequestAtom);
|
|
46059
|
+
const currentPage = get(currentPageAtom);
|
|
46060
|
+
const destinationAsset = get(destinationAssetAtom);
|
|
46061
|
+
const routeConfig = get(routeConfigAtom);
|
|
46062
|
+
const swapSettings = get(swapSettingsAtom);
|
|
46063
|
+
const gasOnReceiveRouteParams = get(gasOnReceiveRouteRequestAtom);
|
|
46064
|
+
const currentTransactionItem = get(currentTransactionAtom);
|
|
46065
|
+
const destinationAssetIsAFeeAsset = gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.destAssetDenoms.map((i) => i.denom).includes((destinationAsset == null ? void 0 : destinationAsset.denom) ?? "");
|
|
46066
|
+
const chainAddresses = get(chainAddressesAtom);
|
|
46067
|
+
const chainAddressesArray = Object.values(chainAddresses);
|
|
46068
|
+
const destination = chainAddressesArray == null ? void 0 : chainAddressesArray[chainAddressesArray.length - 1];
|
|
46069
|
+
const destinationAddress = destination == null ? void 0 : destination.address;
|
|
46070
|
+
const enabledDestinationChainType = [ChainType.Cosmos, ChainType.Evm];
|
|
46071
|
+
const disabledChainIds = ["1", "solana"];
|
|
46072
|
+
const chain = chains2 == null ? void 0 : chains2.find((i) => i.chainId === (destination == null ? void 0 : destination.chainId));
|
|
46073
|
+
const isRouteEnabled = (() => {
|
|
46074
|
+
if (!chain) return false;
|
|
46075
|
+
if (!enabledDestinationChainType.includes(chain.chainType)) return false;
|
|
46076
|
+
if (disabledChainIds.includes(chain.chainId)) return false;
|
|
46077
|
+
return true;
|
|
46078
|
+
})();
|
|
46079
|
+
const queryEnabled = originalRoute && currentPage === Routes.SwapExecutionPage && !destinationAssetIsAFeeAsset && !!destinationAddress && isRouteEnabled && !currentTransactionItem;
|
|
46080
|
+
return {
|
|
46081
|
+
enabled: queryEnabled,
|
|
46082
|
+
queryKey: [
|
|
46083
|
+
"gasOnReceiveRoute",
|
|
46084
|
+
{
|
|
46085
|
+
originalRoute: {
|
|
46086
|
+
usdAmountOut: originalRoute == null ? void 0 : originalRoute.usdAmountOut
|
|
46087
|
+
},
|
|
46088
|
+
params,
|
|
46089
|
+
destinationAddress,
|
|
46090
|
+
sourceAssetChainId: gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.sourceAssetChainId,
|
|
46091
|
+
sourceAssetDenom: gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.sourceAssetDenom,
|
|
46092
|
+
destAssetChainId: gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.destAssetChainId,
|
|
46093
|
+
destAssetDenoms: gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.destAssetDenoms
|
|
46094
|
+
}
|
|
46095
|
+
],
|
|
46096
|
+
retry: false,
|
|
46097
|
+
refetchInterval: false,
|
|
46098
|
+
queryFn: async () => {
|
|
46099
|
+
if (!params) throw new Error("No route request provided");
|
|
46100
|
+
let feeRoute;
|
|
46101
|
+
if (destinationAssetIsAFeeAsset || !(gasOnReceiveRouteParams == null ? void 0 : gasOnReceiveRouteParams.destAssetDenoms) || gasOnReceiveRouteParams.destAssetDenoms.length === 0) {
|
|
46102
|
+
return null;
|
|
46103
|
+
}
|
|
46104
|
+
const {
|
|
46105
|
+
destAssetDenoms,
|
|
46106
|
+
amountIn: amountInFallback,
|
|
46107
|
+
...restParams
|
|
46108
|
+
} = gasOnReceiveRouteParams;
|
|
46109
|
+
const splitDenoms = chunkArray(destAssetDenoms);
|
|
46110
|
+
for (const chunk of splitDenoms) {
|
|
46111
|
+
const feeAssetRoutes = chunk.map(async ({ amountOut, denom }) => {
|
|
46112
|
+
try {
|
|
46113
|
+
const res = await route({
|
|
46114
|
+
destAssetDenom: denom,
|
|
46115
|
+
amountIn: amountOut ? void 0 : amountInFallback,
|
|
46116
|
+
amountOut: amountOut ?? void 0,
|
|
46117
|
+
...restParams,
|
|
46118
|
+
smartRelay: true,
|
|
46119
|
+
...routeConfig,
|
|
46120
|
+
goFast: swapSettings.routePreference === RoutePreference.FASTEST,
|
|
46121
|
+
allowMultiTx: false,
|
|
46122
|
+
abortDuplicateRequests: true
|
|
46123
|
+
});
|
|
46124
|
+
return res;
|
|
46125
|
+
} catch (_e2) {
|
|
46126
|
+
return null;
|
|
46127
|
+
}
|
|
46128
|
+
});
|
|
46129
|
+
const result = await Promise.all(feeAssetRoutes);
|
|
46130
|
+
const _feeRoute = result.find((result2) => result2 == null ? void 0 : result2.usdAmountOut);
|
|
46131
|
+
if (_feeRoute == null ? void 0 : _feeRoute.usdAmountOut) {
|
|
46132
|
+
feeRoute = _feeRoute;
|
|
46133
|
+
break;
|
|
46134
|
+
}
|
|
46135
|
+
}
|
|
46136
|
+
if (!(feeRoute == null ? void 0 : feeRoute.amountOut) || !originalRoute) return null;
|
|
46137
|
+
params.amountIn = BigNumber(originalRoute.amountIn ?? 0).minus(BigNumber((feeRoute == null ? void 0 : feeRoute.amountIn) ?? 0)).toString();
|
|
46138
|
+
params.amountOut = void 0;
|
|
46139
|
+
const mainRoute = await route({
|
|
46140
|
+
...params,
|
|
46141
|
+
smartRelay: true,
|
|
46142
|
+
...routeConfig,
|
|
46143
|
+
goFast: swapSettings.routePreference === RoutePreference.FASTEST,
|
|
46144
|
+
abortDuplicateRequests: true
|
|
46145
|
+
});
|
|
46146
|
+
if (!mainRoute) return null;
|
|
46147
|
+
return {
|
|
46148
|
+
mainRoute,
|
|
46149
|
+
feeRoute,
|
|
46150
|
+
gasOnReceiveAsset: {
|
|
46151
|
+
amountOut: feeRoute.amountOut,
|
|
46152
|
+
amountUsd: feeRoute.usdAmountOut,
|
|
46153
|
+
denom: feeRoute.destAssetDenom,
|
|
46154
|
+
chainId: feeRoute.destAssetChainId
|
|
46155
|
+
}
|
|
46156
|
+
};
|
|
46157
|
+
}
|
|
46158
|
+
};
|
|
46159
|
+
});
|
|
46160
|
+
const chunkArray = (arr, size2 = 3) => {
|
|
46161
|
+
const result = [];
|
|
46162
|
+
for (let i = 0; i < arr.length; i += size2) {
|
|
46163
|
+
result.push(arr.slice(i, i + size2));
|
|
46164
|
+
}
|
|
46165
|
+
return result;
|
|
46166
|
+
};
|
|
45754
46167
|
const chainAddressesAtom = atom$1({});
|
|
46168
|
+
const feeRouteChainAddressesAtom = atom$1({});
|
|
46169
|
+
const feeRouteAddressesAtomEffect = atomEffect((get, set) => {
|
|
46170
|
+
var _a;
|
|
46171
|
+
const isEnabled = get(gasOnReceiveAtom);
|
|
46172
|
+
const gasRoute = get(gasOnReceiveRouteAtom);
|
|
46173
|
+
const _chainAddresses = get(chainAddressesAtom);
|
|
46174
|
+
const chainAddresses = Object.values(_chainAddresses);
|
|
46175
|
+
const { data: chains2 } = get(skipChainsAtom);
|
|
46176
|
+
if (isEnabled && ((_a = gasRoute.data) == null ? void 0 : _a.feeRoute)) {
|
|
46177
|
+
gasRoute.data.feeRoute.requiredChainAddresses.forEach((chainId, i) => {
|
|
46178
|
+
const chain = chains2 == null ? void 0 : chains2.find((c) => c.chainId === chainId);
|
|
46179
|
+
const findAddress = chainAddresses.find((address) => address.chainId === chainId);
|
|
46180
|
+
if (findAddress) {
|
|
46181
|
+
set(feeRouteChainAddressesAtom, (prev2) => ({
|
|
46182
|
+
...prev2,
|
|
46183
|
+
[i]: findAddress
|
|
46184
|
+
}));
|
|
46185
|
+
} else {
|
|
46186
|
+
set(feeRouteChainAddressesAtom, (prev2) => ({
|
|
46187
|
+
...prev2,
|
|
46188
|
+
[i]: {
|
|
46189
|
+
chainId,
|
|
46190
|
+
address: void 0,
|
|
46191
|
+
chainType: chain == null ? void 0 : chain.chainType
|
|
46192
|
+
}
|
|
46193
|
+
}));
|
|
46194
|
+
}
|
|
46195
|
+
});
|
|
46196
|
+
}
|
|
46197
|
+
});
|
|
45755
46198
|
const swapExecutionStateAtom = atomWithStorageNoCrossTabSync(
|
|
45756
46199
|
LOCAL_STORAGE_KEYS.swapExecutionState,
|
|
45757
46200
|
{
|
|
@@ -45767,6 +46210,31 @@ const setCurrentTransactionIdAtom = atom$1(null, (_get, set, transactionId) => {
|
|
|
45767
46210
|
currentTransactionId: transactionId
|
|
45768
46211
|
}));
|
|
45769
46212
|
});
|
|
46213
|
+
const gasRouteEffect = atomEffect((get, set) => {
|
|
46214
|
+
const { data: originalRoute } = get(skipRouteAtom);
|
|
46215
|
+
const { data: gorRoute } = get(gasOnReceiveRouteAtom);
|
|
46216
|
+
const isGorEnabled = get(gasOnReceiveAtom);
|
|
46217
|
+
const currentTransaction = get(currentTransactionAtom);
|
|
46218
|
+
if (currentTransaction) return;
|
|
46219
|
+
set(swapExecutionStateAtom, (prev2) => {
|
|
46220
|
+
var _a;
|
|
46221
|
+
return {
|
|
46222
|
+
...prev2,
|
|
46223
|
+
mainRoute: gorRoute == null ? void 0 : gorRoute.mainRoute,
|
|
46224
|
+
feeRoute: gorRoute == null ? void 0 : gorRoute.feeRoute,
|
|
46225
|
+
isFeeRouteEnabled: isGorEnabled,
|
|
46226
|
+
...isGorEnabled && (gorRoute == null ? void 0 : gorRoute.mainRoute) ? {
|
|
46227
|
+
route: gorRoute.mainRoute,
|
|
46228
|
+
clientOperations: getClientOperations(gorRoute.mainRoute.operations)
|
|
46229
|
+
} : {
|
|
46230
|
+
route: originalRoute ?? prev2.originalRoute,
|
|
46231
|
+
clientOperations: getClientOperations(
|
|
46232
|
+
(originalRoute == null ? void 0 : originalRoute.operations) ?? ((_a = prev2.originalRoute) == null ? void 0 : _a.operations)
|
|
46233
|
+
)
|
|
46234
|
+
}
|
|
46235
|
+
};
|
|
46236
|
+
});
|
|
46237
|
+
});
|
|
45770
46238
|
const setSwapExecutionStateAtom = atom$1(null, (get, set) => {
|
|
45771
46239
|
var _a;
|
|
45772
46240
|
const { data: route2 } = get(skipRouteAtom);
|
|
@@ -45789,16 +46257,26 @@ const setSwapExecutionStateAtom = atom$1(null, (get, set) => {
|
|
|
45789
46257
|
address: ""
|
|
45790
46258
|
};
|
|
45791
46259
|
});
|
|
46260
|
+
set(gasOnReceiveAtom, void 0);
|
|
45792
46261
|
set(chainAddressesAtom, initialChainAddresses);
|
|
45793
46262
|
set(swapExecutionStateAtom, {
|
|
45794
46263
|
userAddresses: [],
|
|
45795
|
-
transactionDetailsArray: [],
|
|
45796
46264
|
route: route2,
|
|
46265
|
+
originalRoute: route2,
|
|
46266
|
+
feeRoute: void 0,
|
|
46267
|
+
mainRoute: void 0,
|
|
45797
46268
|
clientOperations: getClientOperations(route2.operations),
|
|
45798
46269
|
currentTransactionId: void 0
|
|
45799
46270
|
});
|
|
45800
46271
|
set(submitSwapExecutionCallbacksAtom, {
|
|
45801
46272
|
onRouteStatusUpdated: async (routeStatus) => {
|
|
46273
|
+
var _a2;
|
|
46274
|
+
const failedFeeRoute = (_a2 = routeStatus == null ? void 0 : routeStatus.relatedRoutes) == null ? void 0 : _a2.find(
|
|
46275
|
+
(relatedRoute) => relatedRoute.status === "failed"
|
|
46276
|
+
);
|
|
46277
|
+
if (failedFeeRoute) {
|
|
46278
|
+
track("gas on receive: fee route failed", { feeRoute: failedFeeRoute });
|
|
46279
|
+
}
|
|
45802
46280
|
set(setTransactionHistoryAtom, routeStatus);
|
|
45803
46281
|
},
|
|
45804
46282
|
onTransactionUpdated: (txInfo) => {
|
|
@@ -45911,7 +46389,7 @@ atom$1(
|
|
|
45911
46389
|
}));
|
|
45912
46390
|
}
|
|
45913
46391
|
);
|
|
45914
|
-
const
|
|
46392
|
+
const userAddressesEffectAtom = atomEffect((get, set) => {
|
|
45915
46393
|
const chainAddresses = get(chainAddressesAtom);
|
|
45916
46394
|
const addressesMatch = Object.values(chainAddresses).every(
|
|
45917
46395
|
(chainAddress) => !!chainAddress.address
|
|
@@ -45928,18 +46406,37 @@ const chainAddressEffectAtom = atomEffect((get, set) => {
|
|
|
45928
46406
|
userAddresses
|
|
45929
46407
|
}));
|
|
45930
46408
|
});
|
|
46409
|
+
const feeRouteUserAddressesEffectAtom = atomEffect((get, set) => {
|
|
46410
|
+
const chainAddresses = get(feeRouteChainAddressesAtom);
|
|
46411
|
+
const addressesMatch = Object.values(chainAddresses).every(
|
|
46412
|
+
(chainAddress) => !!chainAddress.address
|
|
46413
|
+
);
|
|
46414
|
+
if (!addressesMatch) return;
|
|
46415
|
+
const userAddresses = Object.values(chainAddresses).map((chainAddress) => {
|
|
46416
|
+
return {
|
|
46417
|
+
chainId: chainAddress.chainId,
|
|
46418
|
+
address: chainAddress.address
|
|
46419
|
+
};
|
|
46420
|
+
});
|
|
46421
|
+
set(swapExecutionStateAtom, (prev2) => ({
|
|
46422
|
+
...prev2,
|
|
46423
|
+
feeRouteUserAddresses: userAddresses
|
|
46424
|
+
}));
|
|
46425
|
+
});
|
|
45931
46426
|
const submitSwapExecutionCallbacksAtom = atom$1();
|
|
45932
46427
|
const simulateTxAtom = atom$1();
|
|
45933
46428
|
const batchSignTxsAtom = atom$1(true);
|
|
45934
46429
|
const skipSubmitSwapExecutionAtom = atomWithMutation((get) => {
|
|
45935
46430
|
var _a;
|
|
45936
|
-
const { route: route2,
|
|
46431
|
+
const { userAddresses, route: route2, mainRoute, feeRoute, isFeeRouteEnabled, feeRouteUserAddresses } = get(swapExecutionStateAtom);
|
|
46432
|
+
const gorRoute = get(gasOnReceiveRouteAtom);
|
|
45937
46433
|
const submitSwapExecutionCallbacks = get(submitSwapExecutionCallbacksAtom);
|
|
45938
46434
|
const simulateTx = get(simulateTxAtom);
|
|
45939
46435
|
const batchSignTxs = get(batchSignTxsAtom);
|
|
45940
46436
|
const swapSettings = get(swapSettingsAtom);
|
|
45941
46437
|
const getSigners = get(getConnectedSignersAtom);
|
|
45942
46438
|
const wallets = get(walletsAtom);
|
|
46439
|
+
const isDestinationFeeBalanceAvailable = get(isSomeDestinationFeeBalanceAvailableAtom);
|
|
45943
46440
|
const { timeoutSeconds } = get(routeConfigAtom);
|
|
45944
46441
|
const { data: chains2 } = get(skipChainsAtom);
|
|
45945
46442
|
const sourceAsset = get(sourceAssetAtom);
|
|
@@ -45958,17 +46455,12 @@ const skipSubmitSwapExecutionAtom = atomWithMutation((get) => {
|
|
|
45958
46455
|
return {
|
|
45959
46456
|
gcTime: Infinity,
|
|
45960
46457
|
mutationFn: async ({ getSvmSigner }) => {
|
|
45961
|
-
var _a2;
|
|
45962
|
-
|
|
45963
|
-
|
|
45964
|
-
try {
|
|
45965
|
-
await executeRoute({
|
|
45966
|
-
route: route2,
|
|
45967
|
-
userAddresses,
|
|
46458
|
+
var _a2, _b;
|
|
46459
|
+
const createParams = (sourceChainId) => {
|
|
46460
|
+
return {
|
|
45968
46461
|
timeoutSeconds,
|
|
45969
|
-
slippageTolerancePercent: swapSettings.slippage.toString(),
|
|
45970
46462
|
useUnlimitedApproval: swapSettings.useUnlimitedApproval,
|
|
45971
|
-
simulate: simulateTx !== void 0 ? simulateTx :
|
|
46463
|
+
simulate: simulateTx !== void 0 ? simulateTx : sourceChainId !== "984122",
|
|
45972
46464
|
batchSignTxs: batchSignTxs !== void 0 ? batchSignTxs : true,
|
|
45973
46465
|
...submitSwapExecutionCallbacks,
|
|
45974
46466
|
getCosmosSigner: async (chainId) => {
|
|
@@ -46006,11 +46498,53 @@ const skipSubmitSwapExecutionAtom = atomWithMutation((get) => {
|
|
|
46006
46498
|
}
|
|
46007
46499
|
return adapter;
|
|
46008
46500
|
}
|
|
46009
|
-
}
|
|
46501
|
+
};
|
|
46502
|
+
};
|
|
46503
|
+
try {
|
|
46504
|
+
if (isFeeRouteEnabled && mainRoute && feeRoute) {
|
|
46505
|
+
if (!(feeRouteUserAddresses == null ? void 0 : feeRouteUserAddresses.length)) return;
|
|
46506
|
+
track("execute route", {
|
|
46507
|
+
gasOnReceive: true,
|
|
46508
|
+
isFeeRouteAvailable: true,
|
|
46509
|
+
isDestinationFeeBalanceAvailable: isDestinationFeeBalanceAvailable.data,
|
|
46510
|
+
mainRoute,
|
|
46511
|
+
feeRoute
|
|
46512
|
+
});
|
|
46513
|
+
await executeMultipleRoutes({
|
|
46514
|
+
route: {
|
|
46515
|
+
mainRoute,
|
|
46516
|
+
...isFeeRouteEnabled ? { feeRoute } : {}
|
|
46517
|
+
},
|
|
46518
|
+
userAddresses: {
|
|
46519
|
+
mainRoute: userAddresses,
|
|
46520
|
+
...isFeeRouteEnabled ? { feeRoute: feeRouteUserAddresses } : {}
|
|
46521
|
+
},
|
|
46522
|
+
slippageTolerancePercent: {
|
|
46523
|
+
mainRoute: swapSettings.slippage.toString(),
|
|
46524
|
+
...isFeeRouteEnabled ? { feeRoute: "10" } : {}
|
|
46525
|
+
},
|
|
46526
|
+
...createParams(mainRoute.sourceAssetChainId)
|
|
46527
|
+
});
|
|
46528
|
+
} else {
|
|
46529
|
+
if (!route2) return;
|
|
46530
|
+
if (!userAddresses.length) return;
|
|
46531
|
+
track("execute route", {
|
|
46532
|
+
gasOnReceive: false,
|
|
46533
|
+
isFeeRouteAvailable: !!((_a2 = gorRoute.data) == null ? void 0 : _a2.gasOnReceiveAsset),
|
|
46534
|
+
isDestinationFeeBalanceAvailable: isDestinationFeeBalanceAvailable.data,
|
|
46535
|
+
mainRoute: route2
|
|
46536
|
+
});
|
|
46537
|
+
await executeRoute({
|
|
46538
|
+
route: route2,
|
|
46539
|
+
userAddresses,
|
|
46540
|
+
slippageTolerancePercent: swapSettings.slippage.toString(),
|
|
46541
|
+
...createParams(route2.sourceAssetChainId)
|
|
46542
|
+
});
|
|
46543
|
+
}
|
|
46010
46544
|
} catch (error) {
|
|
46011
46545
|
console.error(error);
|
|
46012
46546
|
const currentTransaction = get(currentTransactionAtom);
|
|
46013
|
-
(
|
|
46547
|
+
(_b = submitSwapExecutionCallbacks == null ? void 0 : submitSwapExecutionCallbacks.onError) == null ? void 0 : _b.call(submitSwapExecutionCallbacks, error, currentTransaction == null ? void 0 : currentTransaction.transactionDetails);
|
|
46014
46548
|
}
|
|
46015
46549
|
return null;
|
|
46016
46550
|
},
|
|
@@ -46537,13 +47071,12 @@ const ModalRowItem = ({
|
|
|
46537
47071
|
rightContent,
|
|
46538
47072
|
onClick,
|
|
46539
47073
|
style,
|
|
46540
|
-
eureka
|
|
46541
|
-
as = "button"
|
|
47074
|
+
eureka
|
|
46542
47075
|
}) => {
|
|
46543
47076
|
return /* @__PURE__ */ jsxs(
|
|
46544
47077
|
StyledModalRowItemContainer,
|
|
46545
47078
|
{
|
|
46546
|
-
as,
|
|
47079
|
+
as: "button",
|
|
46547
47080
|
align: "center",
|
|
46548
47081
|
justify: "space-between",
|
|
46549
47082
|
onClick,
|
|
@@ -46557,29 +47090,16 @@ const ModalRowItem = ({
|
|
|
46557
47090
|
}
|
|
46558
47091
|
);
|
|
46559
47092
|
};
|
|
46560
|
-
const StyledModalRowItemContainer = dt(Row)
|
|
46561
|
-
({ onClick, as }) => ({
|
|
46562
|
-
...as === "div" && !!onClick && {
|
|
46563
|
-
role: "button",
|
|
46564
|
-
tabIndex: 0,
|
|
46565
|
-
onKeyDown: (e) => {
|
|
46566
|
-
if (e.key === "Enter") {
|
|
46567
|
-
e.preventDefault();
|
|
46568
|
-
onClick();
|
|
46569
|
-
}
|
|
46570
|
-
}
|
|
46571
|
-
}
|
|
46572
|
-
})
|
|
46573
|
-
)`
|
|
47093
|
+
const StyledModalRowItemContainer = dt(Row)`
|
|
46574
47094
|
${removeButtonStyles};
|
|
46575
47095
|
position: relative;
|
|
46576
|
-
width: ${({ as }) => as === "div" ? "-webkit-fill-available" : "100%"};
|
|
46577
47096
|
height: 60px;
|
|
46578
47097
|
border-radius: ${({ theme }) => {
|
|
46579
47098
|
var _a;
|
|
46580
47099
|
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.rowItem);
|
|
46581
47100
|
}};
|
|
46582
|
-
|
|
47101
|
+
width: 100%;
|
|
47102
|
+
padding: 12px 15px;
|
|
46583
47103
|
margin-top: 5px;
|
|
46584
47104
|
|
|
46585
47105
|
z-index: 0;
|
|
@@ -46811,29 +47331,6 @@ const useCopyAddress = () => {
|
|
|
46811
47331
|
isShowingCopyAddressFeedback
|
|
46812
47332
|
};
|
|
46813
47333
|
};
|
|
46814
|
-
const skipAllBalancesRequestAtom = atom$1(void 0);
|
|
46815
|
-
const skipAllBalancesAtom = atomWithQuery((get) => {
|
|
46816
|
-
const params = get(skipAllBalancesRequestAtom);
|
|
46817
|
-
const isInvertingSwap = get(isInvertingSwapAtom);
|
|
46818
|
-
const enabled = params && !isInvertingSwap;
|
|
46819
|
-
return {
|
|
46820
|
-
queryKey: ["skipBalances", params],
|
|
46821
|
-
queryFn: async () => {
|
|
46822
|
-
if (!params) {
|
|
46823
|
-
return { chains: {} };
|
|
46824
|
-
}
|
|
46825
|
-
if (Object.keys((params == null ? void 0 : params.chains) ?? {}).length === 0) {
|
|
46826
|
-
return { chains: {} };
|
|
46827
|
-
}
|
|
46828
|
-
return balances({ ...params, abortDuplicateRequests: true });
|
|
46829
|
-
},
|
|
46830
|
-
enabled,
|
|
46831
|
-
refetchInterval: 1e3 * 60,
|
|
46832
|
-
retry: 1,
|
|
46833
|
-
gcTime: 0,
|
|
46834
|
-
placeholderData: (prevData) => prevData
|
|
46835
|
-
};
|
|
46836
|
-
});
|
|
46837
47334
|
const useGetBalance = () => {
|
|
46838
47335
|
const { data: skipBalances } = useAtomValue(skipAllBalancesAtom);
|
|
46839
47336
|
const getBalance = useCallback(
|
|
@@ -47061,10 +47558,17 @@ const SwapExecutionPageRouteDetailedRow = ({
|
|
|
47061
47558
|
const selectedChainAddress = context === "destination" ? lastChainAddress : firstChainAddressFoundForChainId;
|
|
47062
47559
|
return {
|
|
47063
47560
|
address: selectedChainAddress == null ? void 0 : selectedChainAddress.address,
|
|
47064
|
-
image: (selectedChainAddress == null ? void 0 : selectedChainAddress.source) === "wallet" && ((_a2 = selectedChainAddress == null ? void 0 : selectedChainAddress.wallet) == null ? void 0 : _a2.walletInfo.logo) || void 0
|
|
47561
|
+
image: (selectedChainAddress == null ? void 0 : selectedChainAddress.source) === "wallet" && ((_a2 = selectedChainAddress == null ? void 0 : selectedChainAddress.wallet) == null ? void 0 : _a2.walletInfo.logo) || void 0,
|
|
47562
|
+
source: selectedChainAddress == null ? void 0 : selectedChainAddress.source
|
|
47065
47563
|
};
|
|
47066
47564
|
}, [chainAddresses, chainId, context]);
|
|
47067
47565
|
const walletImage = useCroppedImage(chainAddressWallet.image);
|
|
47566
|
+
const renderWalletImage = useMemo(() => {
|
|
47567
|
+
if ((chainAddressWallet == null ? void 0 : chainAddressWallet.source) === "injected" || (chainAddressWallet == null ? void 0 : chainAddressWallet.source) === "input") return;
|
|
47568
|
+
if (!chainAddressWallet.address) return;
|
|
47569
|
+
if (walletImage) return /* @__PURE__ */ jsx("img", { height: "100%", src: walletImage });
|
|
47570
|
+
return /* @__PURE__ */ jsx(SkeletonElement, { height: 18, width: 18 });
|
|
47571
|
+
}, [chainAddressWallet.address, chainAddressWallet == null ? void 0 : chainAddressWallet.source, walletImage]);
|
|
47068
47572
|
const renderAddress = useMemo(() => {
|
|
47069
47573
|
const Container2 = shouldRenderEditDestinationWallet ? ({ children }) => /* @__PURE__ */ jsx(Row, { gap: 5, children }) : o.Fragment;
|
|
47070
47574
|
if (!chainAddressWallet.address) return;
|
|
@@ -47080,15 +47584,7 @@ const SwapExecutionPageRouteDetailedRow = ({
|
|
|
47080
47584
|
};
|
|
47081
47585
|
return /* @__PURE__ */ jsxs(Container2, { children: [
|
|
47082
47586
|
/* @__PURE__ */ jsxs(AddressPillButton, { onClick: () => copyAddress(chainAddressWallet == null ? void 0 : chainAddressWallet.address), children: [
|
|
47083
|
-
|
|
47084
|
-
"img",
|
|
47085
|
-
{
|
|
47086
|
-
src: walletImage,
|
|
47087
|
-
style: {
|
|
47088
|
-
height: "100%"
|
|
47089
|
-
}
|
|
47090
|
-
}
|
|
47091
|
-
) : /* @__PURE__ */ jsx(SkeletonElement, { height: 18, width: 18 }),
|
|
47587
|
+
renderWalletImage,
|
|
47092
47588
|
renderContent()
|
|
47093
47589
|
] }),
|
|
47094
47590
|
shouldRenderEditDestinationWallet && /* @__PURE__ */ jsx(
|
|
@@ -47104,7 +47600,7 @@ const SwapExecutionPageRouteDetailedRow = ({
|
|
|
47104
47600
|
}, [
|
|
47105
47601
|
shouldRenderEditDestinationWallet,
|
|
47106
47602
|
chainAddressWallet.address,
|
|
47107
|
-
|
|
47603
|
+
renderWalletImage,
|
|
47108
47604
|
isMobileScreenSize,
|
|
47109
47605
|
onClickEditDestinationWallet,
|
|
47110
47606
|
theme.primary.text.lowContrast,
|
|
@@ -47148,7 +47644,7 @@ const SwapExecutionPageRouteDetailedRow = ({
|
|
|
47148
47644
|
},
|
|
47149
47645
|
justify: "space-between",
|
|
47150
47646
|
children: /* @__PURE__ */ jsxs(Row, { align: "center", children: [
|
|
47151
|
-
/* @__PURE__ */ jsxs(LeftContent, { children: [
|
|
47647
|
+
/* @__PURE__ */ jsxs(LeftContent, { gap: 5, children: [
|
|
47152
47648
|
/* @__PURE__ */ jsxs(Row, { gap: 5, align: "center", children: [
|
|
47153
47649
|
/* @__PURE__ */ jsx(StyledAssetAmount, { normalTextColor: true, title: assetDetails == null ? void 0 : assetDetails.amount, children: formatDisplayAmount(assetDetails == null ? void 0 : assetDetails.amount) }),
|
|
47154
47650
|
/* @__PURE__ */ jsx(StyledSymbol, { normalTextColor: true, children: assetDetails == null ? void 0 : assetDetails.symbol }),
|
|
@@ -48249,7 +48745,6 @@ const ConnectEcoRow = ({
|
|
|
48249
48745
|
return /* @__PURE__ */ jsx(
|
|
48250
48746
|
ModalRowItem,
|
|
48251
48747
|
{
|
|
48252
|
-
as: "div",
|
|
48253
48748
|
style: { marginTop: ITEM_GAP$1, minHeight: `${ITEM_HEIGHT$2}px` },
|
|
48254
48749
|
onClick: handleConnectClick,
|
|
48255
48750
|
leftContent: account ? /* @__PURE__ */ jsxs(Row, { align: "center", gap: 10, children: [
|
|
@@ -48286,7 +48781,7 @@ const ConnectEcoRow = ({
|
|
|
48286
48781
|
),
|
|
48287
48782
|
/* @__PURE__ */ jsx(ChainIndicator, { chainId: accountchainId })
|
|
48288
48783
|
] })
|
|
48289
|
-
] }) : /* @__PURE__ */ jsxs(
|
|
48784
|
+
] }) : /* @__PURE__ */ jsxs(Text, { children: [
|
|
48290
48785
|
"Connect to",
|
|
48291
48786
|
" ",
|
|
48292
48787
|
chainType === ChainType.Cosmos ? "Cosmos" : chainType === ChainType.Evm ? "Ethereum" : "Solana"
|
|
@@ -48439,7 +48934,7 @@ const RouteArrow = ({ color = "currentColor" }) => /* @__PURE__ */ jsx("svg", {
|
|
|
48439
48934
|
function formatUSD(amount) {
|
|
48440
48935
|
const amountNumber = typeof amount === "string" ? parseFloat(amount) : amount;
|
|
48441
48936
|
const minDisplayable = 1 / Math.pow(10, 2);
|
|
48442
|
-
if (amountNumber
|
|
48937
|
+
if (amountNumber >= 0 && amountNumber < minDisplayable) {
|
|
48443
48938
|
return `< ${usdFormatter.format(minDisplayable)}`;
|
|
48444
48939
|
}
|
|
48445
48940
|
return usdFormatter.format(amountNumber);
|
|
@@ -48528,6 +49023,16 @@ const QuestionMarkIcon = ({
|
|
|
48528
49023
|
)
|
|
48529
49024
|
}
|
|
48530
49025
|
);
|
|
49026
|
+
const QuestionMarkTooltip = ({ content }) => {
|
|
49027
|
+
return /* @__PURE__ */ jsx(Tooltip, { content, children: /* @__PURE__ */ jsx(StyledQuestionMarkIcon, {}) });
|
|
49028
|
+
};
|
|
49029
|
+
const StyledQuestionMarkIcon = dt(QuestionMarkIcon)`
|
|
49030
|
+
color: ${({ theme }) => theme.primary.text.ultraLowContrast};
|
|
49031
|
+
&:hover {
|
|
49032
|
+
color: ${({ theme }) => theme.primary.text.normal};
|
|
49033
|
+
}
|
|
49034
|
+
transition: color 0.2s ease;
|
|
49035
|
+
`;
|
|
48531
49036
|
const SlippageSelector = () => {
|
|
48532
49037
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
48533
49038
|
const [customSlippageInput, setCustomSlippageInput] = useState("");
|
|
@@ -48543,10 +49048,9 @@ const SlippageSelector = () => {
|
|
|
48543
49048
|
"Max Slippage",
|
|
48544
49049
|
/* @__PURE__ */ jsx(Spacer, { width: 5 }),
|
|
48545
49050
|
/* @__PURE__ */ jsx(
|
|
48546
|
-
|
|
49051
|
+
QuestionMarkTooltip,
|
|
48547
49052
|
{
|
|
48548
|
-
content: /* @__PURE__ */ jsx(SmallText, { normalTextColor: true, style: { width: 250 }, children: "If price changes unfavorably during the transaction by more than this amount, the transaction will revert." })
|
|
48549
|
-
children: /* @__PURE__ */ jsx(QuestionMarkIcon, {})
|
|
49053
|
+
content: /* @__PURE__ */ jsx(SmallText, { normalTextColor: true, style: { width: 250 }, children: "If price changes unfavorably during the transaction by more than this amount, the transaction will revert." })
|
|
48550
49054
|
}
|
|
48551
49055
|
)
|
|
48552
49056
|
] }),
|
|
@@ -48699,10 +49203,9 @@ const RoutePreferenceSelector = () => {
|
|
|
48699
49203
|
"Route Preference",
|
|
48700
49204
|
/* @__PURE__ */ jsx(Spacer, { width: 5 }),
|
|
48701
49205
|
/* @__PURE__ */ jsx(
|
|
48702
|
-
|
|
49206
|
+
QuestionMarkTooltip,
|
|
48703
49207
|
{
|
|
48704
|
-
content: /* @__PURE__ */ jsx(SmallText, { normalTextColor: true, style: { width: 250 }, children: "Choose if faster or cheaper routes should be prioritized. Fast routes require a $50 minimum from Ethereum and may not be available if there is insufficient liquidity for an asset." })
|
|
48705
|
-
children: /* @__PURE__ */ jsx(QuestionMarkIcon, {})
|
|
49208
|
+
content: /* @__PURE__ */ jsx(SmallText, { normalTextColor: true, style: { width: 250 }, children: "Choose if faster or cheaper routes should be prioritized. Fast routes require a $50 minimum from Ethereum and may not be available if there is insufficient liquidity for an asset." })
|
|
48706
49209
|
}
|
|
48707
49210
|
)
|
|
48708
49211
|
] }),
|
|
@@ -49428,7 +49931,7 @@ const SwapPageAssetChainInput = ({
|
|
|
49428
49931
|
"%"
|
|
49429
49932
|
] })
|
|
49430
49933
|
] }) : /* @__PURE__ */ jsx(SmallText, { children: usdValue && formatUSD(usdValue) }),
|
|
49431
|
-
usdValue && feeLabel && /* @__PURE__ */ jsx(Row, { align: "center", gap: 4, children: /* @__PURE__ */ jsx(SmallText, {
|
|
49934
|
+
usdValue && feeLabel && /* @__PURE__ */ jsx(Row, { style: { color: feeColor }, align: "center", gap: 4, children: typeof feeLabel === "string" ? /* @__PURE__ */ jsx(SmallText, { children: feeLabel }) : feeLabel })
|
|
49432
49935
|
] }),
|
|
49433
49936
|
(assetDetails == null ? void 0 : assetDetails.chainName) ? /* @__PURE__ */ jsx(
|
|
49434
49937
|
StyledOnChainGhostButton,
|
|
@@ -49872,9 +50375,9 @@ var WalletSource = /* @__PURE__ */ ((WalletSource2) => {
|
|
|
49872
50375
|
const SetAddressModal = createModal((modalProps) => {
|
|
49873
50376
|
var _a, _b, _c;
|
|
49874
50377
|
const isMobileScreenSize = useIsMobileScreenSize();
|
|
49875
|
-
const { chainId, chainAddressIndex } = modalProps;
|
|
49876
|
-
const { route: route2 } = useAtomValue(swapExecutionStateAtom);
|
|
49877
|
-
const requiredChainAddresses = route2 == null ? void 0 : route2.requiredChainAddresses;
|
|
50378
|
+
const { chainId, chainAddressIndex, isFeeRoute } = modalProps;
|
|
50379
|
+
const { route: route2, feeRoute } = useAtomValue(swapExecutionStateAtom);
|
|
50380
|
+
const requiredChainAddresses = isFeeRoute ? feeRoute == null ? void 0 : feeRoute.requiredChainAddresses : route2 == null ? void 0 : route2.requiredChainAddresses;
|
|
49878
50381
|
if (modalProps.chainAddressIndex === void 0) {
|
|
49879
50382
|
throw new Error("chain address index cannot be undefined");
|
|
49880
50383
|
}
|
|
@@ -49886,7 +50389,10 @@ const SetAddressModal = createModal((modalProps) => {
|
|
|
49886
50389
|
const [showManualAddressInput, setShowManualAddressInput] = useState(false);
|
|
49887
50390
|
const [manualWalletAddress, setManualWalletAddress] = useState("");
|
|
49888
50391
|
const _walletList = useWalletList({ chainId, destinationWalletList: true });
|
|
49889
|
-
const [
|
|
50392
|
+
const [_chainAddresses, _setChainAddresses] = useAtom(chainAddressesAtom);
|
|
50393
|
+
const [feeRouteChainAddresses, setFeeRouteChainAddresses] = useAtom(feeRouteChainAddressesAtom);
|
|
50394
|
+
const chainAddresses = isFeeRoute ? feeRouteChainAddresses : _chainAddresses;
|
|
50395
|
+
const setChainAddresses = isFeeRoute ? setFeeRouteChainAddresses : _setChainAddresses;
|
|
49890
50396
|
const showWithdrawalWarning = new Set(Object.values(chainAddresses).map(({ chainId: chainId2 }) => chainId2)).size > 1;
|
|
49891
50397
|
const mobile = isMobile();
|
|
49892
50398
|
const manualWalletEntry = {
|
|
@@ -50556,6 +51062,20 @@ const SwapExecutionPageRouteSimpleRow = ({
|
|
|
50556
51062
|
});
|
|
50557
51063
|
const groupedAssets = useGroupedAssetByRecommendedSymbol();
|
|
50558
51064
|
const groupedAsset = groupedAssets == null ? void 0 : groupedAssets.find((i) => i.id === (assetDetails == null ? void 0 : assetDetails.symbol));
|
|
51065
|
+
const { feeRoute } = useAtomValue(swapExecutionStateAtom);
|
|
51066
|
+
const isGorEnabled = useAtomValue(gasOnReceiveAtom);
|
|
51067
|
+
const { data: assets2 } = useAtomValue(skipAssetsAtom);
|
|
51068
|
+
const gasOnReceiveAsset = useMemo(() => {
|
|
51069
|
+
const gasAsset = {
|
|
51070
|
+
chainId: feeRoute == null ? void 0 : feeRoute.destAssetChainId,
|
|
51071
|
+
denom: feeRoute == null ? void 0 : feeRoute.destAssetDenom
|
|
51072
|
+
};
|
|
51073
|
+
if (!gasAsset) return;
|
|
51074
|
+
const asset = assets2 == null ? void 0 : assets2.find(
|
|
51075
|
+
(a) => a.chainId === (gasAsset == null ? void 0 : gasAsset.chainId) && a.denom === (gasAsset == null ? void 0 : gasAsset.denom)
|
|
51076
|
+
);
|
|
51077
|
+
return asset;
|
|
51078
|
+
}, [assets2, feeRoute == null ? void 0 : feeRoute.destAssetChainId, feeRoute == null ? void 0 : feeRoute.destAssetDenom]);
|
|
50559
51079
|
const chainAddresses = useAtomValue(chainAddressesAtom);
|
|
50560
51080
|
const source = useMemo(() => {
|
|
50561
51081
|
var _a, _b;
|
|
@@ -50581,11 +51101,21 @@ const SwapExecutionPageRouteSimpleRow = ({
|
|
|
50581
51101
|
}, [chainAddresses, context]);
|
|
50582
51102
|
const walletImage = useCroppedImage(source.image);
|
|
50583
51103
|
const renderWalletImage = useMemo(() => {
|
|
50584
|
-
if (source.source === "injected") return;
|
|
51104
|
+
if (source.source === "injected" || source.source === "input") return;
|
|
50585
51105
|
if (!source.address) return;
|
|
50586
51106
|
if (walletImage) return /* @__PURE__ */ jsx("img", { height: 12, width: 12, src: walletImage });
|
|
50587
51107
|
return /* @__PURE__ */ jsx(SkeletonElement, { height: 12, width: 12 });
|
|
50588
51108
|
}, [source.address, source.source, walletImage]);
|
|
51109
|
+
const renderGasRouteAmount = useMemo(() => {
|
|
51110
|
+
var _a;
|
|
51111
|
+
if (!isGorEnabled) return;
|
|
51112
|
+
if (context === "source") return;
|
|
51113
|
+
if (!gasOnReceiveAsset) return;
|
|
51114
|
+
const amountUsd = feeRoute == null ? void 0 : feeRoute.usdAmountOut;
|
|
51115
|
+
if (!amountUsd) return;
|
|
51116
|
+
const assetSymbol = ((_a = gasOnReceiveAsset == null ? void 0 : gasOnReceiveAsset.recommendedSymbol) == null ? void 0 : _a.toUpperCase()) ?? "";
|
|
51117
|
+
return `+ ${formatUSD(amountUsd)} in ${assetSymbol}`;
|
|
51118
|
+
}, [context, feeRoute == null ? void 0 : feeRoute.usdAmountOut, gasOnReceiveAsset, isGorEnabled]);
|
|
50589
51119
|
const renderExplorerLink = useMemo(() => {
|
|
50590
51120
|
if (!explorerLink) return;
|
|
50591
51121
|
if (isMobileScreenSize) {
|
|
@@ -50618,7 +51148,11 @@ const SwapExecutionPageRouteSimpleRow = ({
|
|
|
50618
51148
|
" ",
|
|
50619
51149
|
assetDetails == null ? void 0 : assetDetails.symbol
|
|
50620
51150
|
] }),
|
|
50621
|
-
usdValue && /* @__PURE__ */
|
|
51151
|
+
usdValue && /* @__PURE__ */ jsxs(SmallText, { children: [
|
|
51152
|
+
formatUSD(usdValue),
|
|
51153
|
+
" ",
|
|
51154
|
+
renderGasRouteAmount
|
|
51155
|
+
] }),
|
|
50622
51156
|
/* @__PURE__ */ jsxs(Row, { align: "center", height: 18, gap: 5, children: [
|
|
50623
51157
|
/* @__PURE__ */ jsxs(StyledChainName, { normalTextColor: true, textWrap: "nowrap", children: [
|
|
50624
51158
|
"on ",
|
|
@@ -50698,11 +51232,12 @@ const SwapExecutionPageRouteSimple = ({
|
|
|
50698
51232
|
statusData,
|
|
50699
51233
|
onClickEditDestinationWallet,
|
|
50700
51234
|
swapExecutionState,
|
|
50701
|
-
firstOperationStatus
|
|
51235
|
+
firstOperationStatus,
|
|
51236
|
+
bottomContent
|
|
50702
51237
|
}) => {
|
|
50703
51238
|
var _a, _b;
|
|
50704
51239
|
const theme = nt();
|
|
50705
|
-
const { route: route2 } = useAtomValue(swapExecutionStateAtom);
|
|
51240
|
+
const { route: route2, originalRoute } = useAtomValue(swapExecutionStateAtom);
|
|
50706
51241
|
const firstOperation = operations[0];
|
|
50707
51242
|
const lastOperation = operations[operations.length - 1];
|
|
50708
51243
|
const status = statusData == null ? void 0 : statusData.transferEvents;
|
|
@@ -50718,10 +51253,10 @@ const SwapExecutionPageRouteSimple = ({
|
|
|
50718
51253
|
}
|
|
50719
51254
|
}, [firstOperationStatus, lastOperation.transferIndex, status, swapExecutionState]);
|
|
50720
51255
|
const source = {
|
|
50721
|
-
denom:
|
|
50722
|
-
tokenAmount:
|
|
50723
|
-
chainId:
|
|
50724
|
-
usdValue:
|
|
51256
|
+
denom: originalRoute == null ? void 0 : originalRoute.sourceAssetDenom,
|
|
51257
|
+
tokenAmount: (originalRoute == null ? void 0 : originalRoute.amountIn) ?? "",
|
|
51258
|
+
chainId: originalRoute == null ? void 0 : originalRoute.sourceAssetChainId,
|
|
51259
|
+
usdValue: originalRoute == null ? void 0 : originalRoute.usdAmountIn
|
|
50725
51260
|
};
|
|
50726
51261
|
const destination = {
|
|
50727
51262
|
denom: lastOperation.denomOut,
|
|
@@ -50752,7 +51287,8 @@ const SwapExecutionPageRouteSimple = ({
|
|
|
50752
51287
|
explorerLink: destinationExplorerLink,
|
|
50753
51288
|
context: "destination"
|
|
50754
51289
|
}
|
|
50755
|
-
)
|
|
51290
|
+
),
|
|
51291
|
+
bottomContent
|
|
50756
51292
|
] });
|
|
50757
51293
|
};
|
|
50758
51294
|
const StyledBridgeArrowIcon = dt(BridgeArrowIcon)`
|
|
@@ -50761,11 +51297,6 @@ const StyledBridgeArrowIcon = dt(BridgeArrowIcon)`
|
|
|
50761
51297
|
`;
|
|
50762
51298
|
const StyledSwapExecutionPageRoute$1 = dt(Column)`
|
|
50763
51299
|
padding: 30px;
|
|
50764
|
-
background: ${({ theme }) => theme.primary.background.normal};
|
|
50765
|
-
border-radius: ${({ theme }) => {
|
|
50766
|
-
var _a;
|
|
50767
|
-
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.main);
|
|
50768
|
-
}};
|
|
50769
51300
|
min-height: 225px;
|
|
50770
51301
|
`;
|
|
50771
51302
|
const SwapExecutionBridgeIcon = ({
|
|
@@ -50892,13 +51423,14 @@ const SwapExecutionPageRouteDetailed = ({
|
|
|
50892
51423
|
onClickEditDestinationWallet,
|
|
50893
51424
|
swapExecutionState,
|
|
50894
51425
|
firstOperationStatus,
|
|
50895
|
-
secondOperationStatus
|
|
51426
|
+
secondOperationStatus,
|
|
51427
|
+
bottomContent
|
|
50896
51428
|
}) => {
|
|
50897
51429
|
var _a;
|
|
50898
51430
|
const { data: swapVenues } = useAtomValue(skipSwapVenuesAtom);
|
|
50899
51431
|
const { data: bridges2 } = useAtomValue(skipBridgesAtom);
|
|
51432
|
+
const { originalRoute } = useAtomValue(swapExecutionStateAtom);
|
|
50900
51433
|
const isGasStationTx = useIsGasStationTx();
|
|
50901
|
-
const firstOperation = operations[0];
|
|
50902
51434
|
const status = statusData == null ? void 0 : statusData.transferEvents;
|
|
50903
51435
|
const getBridgeSwapVenue = useCallback(
|
|
50904
51436
|
(operation) => {
|
|
@@ -51004,22 +51536,25 @@ const SwapExecutionPageRouteDetailed = ({
|
|
|
51004
51536
|
status,
|
|
51005
51537
|
statusData
|
|
51006
51538
|
]);
|
|
51007
|
-
return /* @__PURE__ */
|
|
51008
|
-
/* @__PURE__ */
|
|
51009
|
-
|
|
51010
|
-
|
|
51011
|
-
|
|
51012
|
-
|
|
51013
|
-
|
|
51014
|
-
|
|
51015
|
-
|
|
51016
|
-
|
|
51017
|
-
|
|
51018
|
-
|
|
51019
|
-
|
|
51020
|
-
|
|
51021
|
-
|
|
51022
|
-
|
|
51539
|
+
return /* @__PURE__ */ jsxs(StyledSwapExecutionPageRoute, { children: [
|
|
51540
|
+
/* @__PURE__ */ jsxs(Column, { children: [
|
|
51541
|
+
/* @__PURE__ */ jsx(
|
|
51542
|
+
SwapExecutionPageRouteDetailedRow,
|
|
51543
|
+
{
|
|
51544
|
+
tokenAmount: (originalRoute == null ? void 0 : originalRoute.amountIn) ?? "",
|
|
51545
|
+
denom: originalRoute == null ? void 0 : originalRoute.sourceAssetDenom,
|
|
51546
|
+
chainId: originalRoute == null ? void 0 : originalRoute.sourceAssetChainId,
|
|
51547
|
+
explorerLink: (_a = status == null ? void 0 : status[0]) == null ? void 0 : _a.fromExplorerLink,
|
|
51548
|
+
status: firstOperationStatus,
|
|
51549
|
+
context: "source",
|
|
51550
|
+
index: 0
|
|
51551
|
+
}
|
|
51552
|
+
),
|
|
51553
|
+
renderOperations,
|
|
51554
|
+
isGasStationTx && /* @__PURE__ */ jsx(StyledGasStationTxText, { children: "Transactions from EVM to Babylon have gas provided automatically if no gas tokens are found." })
|
|
51555
|
+
] }),
|
|
51556
|
+
bottomContent
|
|
51557
|
+
] });
|
|
51023
51558
|
};
|
|
51024
51559
|
const OperationTypeIconContainer = dt(Column).attrs({
|
|
51025
51560
|
as: Column
|
|
@@ -51031,12 +51566,7 @@ const OperationTypeIconContainer = dt(Column).attrs({
|
|
|
51031
51566
|
`;
|
|
51032
51567
|
const StyledSwapExecutionPageRoute = dt(Column)`
|
|
51033
51568
|
padding: 25px;
|
|
51034
|
-
gap:
|
|
51035
|
-
background: ${({ theme }) => theme.primary.background.normal};
|
|
51036
|
-
border-radius: ${({ theme }) => {
|
|
51037
|
-
var _a;
|
|
51038
|
-
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.main);
|
|
51039
|
-
}};
|
|
51569
|
+
gap: 5px;
|
|
51040
51570
|
min-height: 225px;
|
|
51041
51571
|
`;
|
|
51042
51572
|
const StyledSwapVenueOrBridgeImage = dt.img`
|
|
@@ -51065,6 +51595,50 @@ const StyledGasStationTxText = dt(SmallText)`
|
|
|
51065
51595
|
padding: 12px;
|
|
51066
51596
|
border-radius: 6px;
|
|
51067
51597
|
`;
|
|
51598
|
+
const SwapExecutionPageRouteContainer = ({
|
|
51599
|
+
showDetailed,
|
|
51600
|
+
...routeProps
|
|
51601
|
+
}) => {
|
|
51602
|
+
const simpleRef = useRef(null);
|
|
51603
|
+
const detailedRef = useRef(null);
|
|
51604
|
+
const [containerHeight, setContainerHeight] = useState(0);
|
|
51605
|
+
useEffect(() => {
|
|
51606
|
+
const updateHeight = () => {
|
|
51607
|
+
const activeRef = showDetailed ? detailedRef : simpleRef;
|
|
51608
|
+
if (activeRef.current) {
|
|
51609
|
+
const height = activeRef.current.scrollHeight;
|
|
51610
|
+
setContainerHeight(height);
|
|
51611
|
+
}
|
|
51612
|
+
};
|
|
51613
|
+
updateHeight();
|
|
51614
|
+
const timeoutId = setTimeout(updateHeight, 10);
|
|
51615
|
+
return () => clearTimeout(timeoutId);
|
|
51616
|
+
}, [showDetailed, routeProps.operations, routeProps.statusData, routeProps.bottomContent]);
|
|
51617
|
+
return /* @__PURE__ */ jsxs(StyledContainer$1, { style: { height: containerHeight }, children: [
|
|
51618
|
+
/* @__PURE__ */ jsx(StyledRouteWrapper, { ref: simpleRef, isVisible: !showDetailed, isActive: !showDetailed, children: /* @__PURE__ */ jsx(SwapExecutionPageRouteSimple, { ...routeProps }) }),
|
|
51619
|
+
/* @__PURE__ */ jsx(StyledRouteWrapper, { ref: detailedRef, isVisible: showDetailed, isActive: showDetailed, children: /* @__PURE__ */ jsx(SwapExecutionPageRouteDetailed, { ...routeProps }) })
|
|
51620
|
+
] });
|
|
51621
|
+
};
|
|
51622
|
+
const StyledContainer$1 = dt.div`
|
|
51623
|
+
position: relative;
|
|
51624
|
+
overflow: hidden;
|
|
51625
|
+
transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
51626
|
+
min-height: 225px;
|
|
51627
|
+
background: ${({ theme }) => theme.primary.background.normal};
|
|
51628
|
+
border-radius: ${({ theme }) => {
|
|
51629
|
+
var _a;
|
|
51630
|
+
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.main);
|
|
51631
|
+
}};
|
|
51632
|
+
`;
|
|
51633
|
+
const StyledRouteWrapper = dt.div`
|
|
51634
|
+
position: ${({ isActive: $isActive }) => $isActive ? "relative" : "absolute"};
|
|
51635
|
+
top: 0;
|
|
51636
|
+
left: 0;
|
|
51637
|
+
right: 0;
|
|
51638
|
+
opacity: ${({ isVisible: $isVisible }) => $isVisible ? 1 : 0};
|
|
51639
|
+
transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
51640
|
+
pointer-events: ${({ isVisible: $isVisible }) => $isVisible ? "auto" : "none"};
|
|
51641
|
+
`;
|
|
51068
51642
|
const useAutoSetAddress = () => {
|
|
51069
51643
|
var _a, _b, _c;
|
|
51070
51644
|
const [chainAddresses, setChainAddresses] = useAtom(chainAddressesAtom);
|
|
@@ -51080,7 +51654,7 @@ const useAutoSetAddress = () => {
|
|
|
51080
51654
|
const { createCosmosWallets } = useCreateCosmosWallets();
|
|
51081
51655
|
const { createEvmWallets } = useCreateEvmWallets();
|
|
51082
51656
|
const { createSolanaWallets } = useCreateSolanaWallets();
|
|
51083
|
-
useAtom(
|
|
51657
|
+
useAtom(userAddressesEffectAtom);
|
|
51084
51658
|
const connectedAddress = useAtomValue(connectedAddressesAtom);
|
|
51085
51659
|
const signRequiredChains = useMemo(() => {
|
|
51086
51660
|
if (!(route2 == null ? void 0 : route2.operations)) return;
|
|
@@ -51283,10 +51857,15 @@ const useHandleTransactionTimeout = (swapExecutionState) => {
|
|
|
51283
51857
|
};
|
|
51284
51858
|
function useSwapExecutionState({
|
|
51285
51859
|
chainAddresses,
|
|
51286
|
-
|
|
51287
|
-
|
|
51860
|
+
requiredChainAddresses,
|
|
51861
|
+
isGettingAddressesLoading,
|
|
51862
|
+
isFetchingDestinationBalance,
|
|
51863
|
+
feeRouteChainAddresses,
|
|
51864
|
+
feeRouteRequiredChainAddresses,
|
|
51865
|
+
isGettingFeeRouteAddressesLoading
|
|
51288
51866
|
}) {
|
|
51289
51867
|
const currentTransaction = useAtomValue(currentTransactionAtom);
|
|
51868
|
+
const isFeeRouteEnabled = useAtomValue(gasOnReceiveAtom);
|
|
51290
51869
|
const showSignaturesRemaining = useMemo(() => {
|
|
51291
51870
|
if (!currentTransaction) return false;
|
|
51292
51871
|
if ((currentTransaction == null ? void 0 : currentTransaction.txsRequired) >= 2 && (currentTransaction == null ? void 0 : currentTransaction.txsSigned) !== (currentTransaction == null ? void 0 : currentTransaction.txsRequired)) {
|
|
@@ -51296,9 +51875,11 @@ function useSwapExecutionState({
|
|
|
51296
51875
|
}, [currentTransaction]);
|
|
51297
51876
|
return useMemo(() => {
|
|
51298
51877
|
var _a;
|
|
51299
|
-
if (
|
|
51878
|
+
if (isFetchingDestinationBalance) return SwapExecutionState.pendingGettingDestinationBalance;
|
|
51879
|
+
if (isGettingAddressesLoading) return SwapExecutionState.pendingGettingAddresses;
|
|
51880
|
+
if (isFeeRouteEnabled && isGettingFeeRouteAddressesLoading)
|
|
51881
|
+
return SwapExecutionState.pendingGettingFeeRouteAddresses;
|
|
51300
51882
|
if (!chainAddresses) return SwapExecutionState.destinationAddressUnset;
|
|
51301
|
-
const requiredChainAddresses = route2 == null ? void 0 : route2.requiredChainAddresses;
|
|
51302
51883
|
if (!requiredChainAddresses) return SwapExecutionState.destinationAddressUnset;
|
|
51303
51884
|
const allAddressesSet = requiredChainAddresses.every(
|
|
51304
51885
|
(_chainId, index) => {
|
|
@@ -51306,7 +51887,16 @@ function useSwapExecutionState({
|
|
|
51306
51887
|
return (_a2 = chainAddresses[index]) == null ? void 0 : _a2.address;
|
|
51307
51888
|
}
|
|
51308
51889
|
);
|
|
51890
|
+
const feeRouteAllAddressesSet = feeRouteRequiredChainAddresses == null ? void 0 : feeRouteRequiredChainAddresses.every(
|
|
51891
|
+
(_chainId, index) => {
|
|
51892
|
+
var _a2;
|
|
51893
|
+
return (_a2 = feeRouteChainAddresses == null ? void 0 : feeRouteChainAddresses[index]) == null ? void 0 : _a2.address;
|
|
51894
|
+
}
|
|
51895
|
+
);
|
|
51309
51896
|
const lastChainAddress = (_a = chainAddresses[requiredChainAddresses.length - 1]) == null ? void 0 : _a.address;
|
|
51897
|
+
if ((currentTransaction == null ? void 0 : currentTransaction.status) === "failed") {
|
|
51898
|
+
return SwapExecutionState.pendingError;
|
|
51899
|
+
}
|
|
51310
51900
|
if ((currentTransaction == null ? void 0 : currentTransaction.status) === "completed") {
|
|
51311
51901
|
return SwapExecutionState.confirmed;
|
|
51312
51902
|
}
|
|
@@ -51331,12 +51921,20 @@ function useSwapExecutionState({
|
|
|
51331
51921
|
if (!allAddressesSet) {
|
|
51332
51922
|
return SwapExecutionState.recoveryAddressUnset;
|
|
51333
51923
|
}
|
|
51924
|
+
if (isFeeRouteEnabled && feeRouteRequiredChainAddresses && !feeRouteAllAddressesSet) {
|
|
51925
|
+
return SwapExecutionState.feeRouteRecoveryAddressUnset;
|
|
51926
|
+
}
|
|
51334
51927
|
return SwapExecutionState.ready;
|
|
51335
51928
|
}, [
|
|
51336
|
-
|
|
51929
|
+
isFetchingDestinationBalance,
|
|
51930
|
+
isGettingAddressesLoading,
|
|
51931
|
+
isFeeRouteEnabled,
|
|
51932
|
+
isGettingFeeRouteAddressesLoading,
|
|
51337
51933
|
chainAddresses,
|
|
51338
|
-
|
|
51934
|
+
requiredChainAddresses,
|
|
51935
|
+
feeRouteRequiredChainAddresses,
|
|
51339
51936
|
currentTransaction == null ? void 0 : currentTransaction.status,
|
|
51937
|
+
feeRouteChainAddresses,
|
|
51340
51938
|
showSignaturesRemaining
|
|
51341
51939
|
]);
|
|
51342
51940
|
}
|
|
@@ -51422,18 +52020,29 @@ const useCountdown = ({
|
|
|
51422
52020
|
}, [estimatedRouteDurationSeconds, enabled, timer]);
|
|
51423
52021
|
return countdown;
|
|
51424
52022
|
};
|
|
52023
|
+
function useDebouncedValue(value, delay) {
|
|
52024
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
52025
|
+
useEffect(() => {
|
|
52026
|
+
const timeout = setTimeout(() => setDebouncedValue(value), delay);
|
|
52027
|
+
return () => clearTimeout(timeout);
|
|
52028
|
+
}, [value, delay]);
|
|
52029
|
+
return debouncedValue;
|
|
52030
|
+
}
|
|
51425
52031
|
const SwapExecutionButton = ({
|
|
51426
52032
|
swapExecutionState,
|
|
51427
52033
|
route: route2,
|
|
51428
52034
|
signaturesRemaining,
|
|
51429
52035
|
lastOperation,
|
|
51430
52036
|
connectRequiredChains,
|
|
52037
|
+
connectFeeRouteRequiredChains,
|
|
51431
52038
|
submitExecuteRouteMutation
|
|
51432
52039
|
}) => {
|
|
52040
|
+
var _a, _b, _c;
|
|
51433
52041
|
const countdown = useCountdown({
|
|
51434
52042
|
estimatedRouteDurationSeconds: route2 == null ? void 0 : route2.estimatedRouteDurationSeconds,
|
|
51435
52043
|
enabled: swapExecutionState === SwapExecutionState.pending
|
|
51436
52044
|
});
|
|
52045
|
+
const chainAddresses = useAtomValue(chainAddressesAtom);
|
|
51437
52046
|
const { wallets: solanaWallets2 } = useWallet();
|
|
51438
52047
|
const svmWallet = useAtomValue(svmWalletAtom);
|
|
51439
52048
|
const theme = nt();
|
|
@@ -51453,7 +52062,8 @@ const SwapExecutionButton = ({
|
|
|
51453
52062
|
route2 == null ? void 0 : route2.destAssetChainId,
|
|
51454
52063
|
route2 == null ? void 0 : route2.txsRequired
|
|
51455
52064
|
]);
|
|
51456
|
-
|
|
52065
|
+
const debouncedSwapExecutionState = useDebouncedValue(swapExecutionState, 150);
|
|
52066
|
+
switch (debouncedSwapExecutionState) {
|
|
51457
52067
|
case SwapExecutionState.recoveryAddressUnset:
|
|
51458
52068
|
return /* @__PURE__ */ jsx(
|
|
51459
52069
|
MainButton,
|
|
@@ -51466,6 +52076,18 @@ const SwapExecutionButton = ({
|
|
|
51466
52076
|
}
|
|
51467
52077
|
}
|
|
51468
52078
|
);
|
|
52079
|
+
case SwapExecutionState.feeRouteRecoveryAddressUnset:
|
|
52080
|
+
return /* @__PURE__ */ jsx(
|
|
52081
|
+
MainButton,
|
|
52082
|
+
{
|
|
52083
|
+
label: "Set intermediary address",
|
|
52084
|
+
icon: ICONS.rightArrow,
|
|
52085
|
+
onClick: () => {
|
|
52086
|
+
track("swap execution page: set recovery address button - clicked");
|
|
52087
|
+
connectFeeRouteRequiredChains == null ? void 0 : connectFeeRouteRequiredChains(true);
|
|
52088
|
+
}
|
|
52089
|
+
}
|
|
52090
|
+
);
|
|
51469
52091
|
case SwapExecutionState.destinationAddressUnset:
|
|
51470
52092
|
return /* @__PURE__ */ jsx(
|
|
51471
52093
|
MainButton,
|
|
@@ -51485,7 +52107,8 @@ const SwapExecutionButton = ({
|
|
|
51485
52107
|
}
|
|
51486
52108
|
);
|
|
51487
52109
|
case SwapExecutionState.ready: {
|
|
51488
|
-
|
|
52110
|
+
const destinationWalletSource = ((_a = route2 == null ? void 0 : route2.requiredChainAddresses) == null ? void 0 : _a.length) && ((_c = chainAddresses[((_b = route2 == null ? void 0 : route2.requiredChainAddresses) == null ? void 0 : _b.length) - 1]) == null ? void 0 : _c.source);
|
|
52111
|
+
track("swap execution page: confirm button - clicked", { route: route2, destinationWalletSource });
|
|
51489
52112
|
const onClickConfirmSwap = () => {
|
|
51490
52113
|
if ((route2 == null ? void 0 : route2.txsRequired) && route2.txsRequired > 1) {
|
|
51491
52114
|
track("warning page: additional signing required", { route: route2 });
|
|
@@ -51563,6 +52186,10 @@ const SwapExecutionButton = ({
|
|
|
51563
52186
|
);
|
|
51564
52187
|
case SwapExecutionState.pendingGettingAddresses:
|
|
51565
52188
|
return /* @__PURE__ */ jsx(MainButton, { label: "Getting addresses", loading: true });
|
|
52189
|
+
case SwapExecutionState.pendingGettingDestinationBalance:
|
|
52190
|
+
return /* @__PURE__ */ jsx(MainButton, { label: "Getting destination balance", loading: true });
|
|
52191
|
+
case SwapExecutionState.pendingError:
|
|
52192
|
+
return /* @__PURE__ */ jsx(MainButton, { label: "Awaiting result", loading: true });
|
|
51566
52193
|
default:
|
|
51567
52194
|
return null;
|
|
51568
52195
|
}
|
|
@@ -51676,6 +52303,345 @@ function usePreventPageUnload(shouldWarn) {
|
|
|
51676
52303
|
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
51677
52304
|
}, [shouldWarn]);
|
|
51678
52305
|
}
|
|
52306
|
+
const GasIcon = ({ color = "currentColor" }) => /* @__PURE__ */ jsx("svg", { width: "16", height: "15", viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
52307
|
+
"path",
|
|
52308
|
+
{
|
|
52309
|
+
d: "M1.22261 1.84952C1.24188 1.32934 1.4249 0.895862 1.77169 0.549076C2.11847 0.202289 2.55195 0.0192658 3.07213 0H7.69592C8.2161 0.0192658 8.64958 0.202289 8.99636 0.549076C9.34315 0.895862 9.52617 1.32934 9.54544 1.84952V7.39807H9.77663C10.4895 7.41734 11.0867 7.66779 11.5684 8.14944C12.05 8.63109 12.3005 9.22832 12.3197 9.94116V10.8659C12.3582 11.2898 12.5894 11.521 13.0133 11.5595C13.4371 11.521 13.6683 11.2898 13.7069 10.8659V6.38662C13.3023 6.29029 12.9748 6.07836 12.7243 5.75084C12.4546 5.44259 12.3197 5.06691 12.3197 4.62379V2.77428L11.395 1.84952C11.1445 1.54126 11.1445 1.23301 11.395 0.924759C11.7032 0.674302 12.0115 0.674302 12.3197 0.924759L14.5449 3.14996C14.911 3.51601 15.094 3.95912 15.094 4.4793V10.8659C15.0747 11.4632 14.8724 11.9544 14.4871 12.3398C14.1018 12.7251 13.6105 12.9274 13.0133 12.9466C12.416 12.9274 11.9248 12.7251 11.5395 12.3398C11.1541 11.9544 10.9518 11.4632 10.9326 10.8659V9.94116C10.9326 9.61364 10.817 9.33429 10.5858 9.1031C10.3739 8.89117 10.1042 8.77558 9.77663 8.75631H9.54544V12.9466C9.81516 12.9466 10.0367 13.0333 10.2101 13.2067C10.3835 13.3801 10.4702 13.6017 10.4702 13.8714C10.4702 14.1411 10.3835 14.3627 10.2101 14.5361C10.0367 14.7094 9.81516 14.7961 9.54544 14.7961H1.22261C0.952888 14.7961 0.731333 14.7094 0.55794 14.5361C0.384547 14.3627 0.297852 14.1411 0.297852 13.8714C0.297852 13.6017 0.384547 13.3801 0.55794 13.2067C0.731333 13.0333 0.952888 12.9466 1.22261 12.9466V1.84952ZM3.07213 5.08617C3.09139 5.37516 3.24552 5.52929 3.53451 5.54855H7.23354C7.52253 5.52929 7.67666 5.37516 7.69592 5.08617V2.3119C7.67666 2.02291 7.52253 1.86878 7.23354 1.84952H3.53451C3.24552 1.86878 3.09139 2.02291 3.07213 2.3119V5.08617Z",
|
|
52310
|
+
fill: color
|
|
52311
|
+
}
|
|
52312
|
+
) });
|
|
52313
|
+
const SwitchWrapper = dt.div`
|
|
52314
|
+
width: 42px;
|
|
52315
|
+
height: 24px;
|
|
52316
|
+
border-radius: ${({ theme }) => {
|
|
52317
|
+
var _a;
|
|
52318
|
+
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.selectionButton);
|
|
52319
|
+
}};
|
|
52320
|
+
background-color: ${({ checked, theme }) => checked ? theme.brandColor : theme.secondary.background.transparent};
|
|
52321
|
+
display: flex;
|
|
52322
|
+
align-items: center;
|
|
52323
|
+
padding: 6px;
|
|
52324
|
+
cursor: pointer;
|
|
52325
|
+
transition: background-color 0.2s ease;
|
|
52326
|
+
user-select: none;
|
|
52327
|
+
`;
|
|
52328
|
+
const SwitchThumb = dt.div`
|
|
52329
|
+
width: 16px;
|
|
52330
|
+
height: 16px;
|
|
52331
|
+
border-radius: ${({ theme }) => {
|
|
52332
|
+
var _a;
|
|
52333
|
+
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.selectionButton);
|
|
52334
|
+
}};
|
|
52335
|
+
background-color: ${({ checked, theme }) => checked ? theme.secondary.background.normal : theme.primary.text.ultraLowContrast};
|
|
52336
|
+
transition: transform 0.2s ease;
|
|
52337
|
+
transform: translateX(${({ checked }) => checked ? "16px" : "0"});
|
|
52338
|
+
`;
|
|
52339
|
+
const Switch = ({ checked = false, onChange }) => {
|
|
52340
|
+
const toggle = () => {
|
|
52341
|
+
onChange == null ? void 0 : onChange(!checked);
|
|
52342
|
+
};
|
|
52343
|
+
return /* @__PURE__ */ jsx(SwitchWrapper, { checked, onClick: toggle, children: /* @__PURE__ */ jsx(SwitchThumb, { checked }) });
|
|
52344
|
+
};
|
|
52345
|
+
const SpinnerIcon = (props) => {
|
|
52346
|
+
return /* @__PURE__ */ jsxs("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
52347
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", opacity: ".25", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
52348
|
+
/* @__PURE__ */ jsx(
|
|
52349
|
+
"path",
|
|
52350
|
+
{
|
|
52351
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",
|
|
52352
|
+
fill: "currentColor",
|
|
52353
|
+
opacity: ".75"
|
|
52354
|
+
}
|
|
52355
|
+
)
|
|
52356
|
+
] });
|
|
52357
|
+
};
|
|
52358
|
+
const GasOnReceive = ({ routeDetails, hideContainer } = {}) => {
|
|
52359
|
+
var _a, _b, _c, _d, _e2;
|
|
52360
|
+
const theme = nt();
|
|
52361
|
+
const [gasOnReceive, setGasOnReceive] = useAtom(gasOnReceiveAtom);
|
|
52362
|
+
const { isLoading: fetchingGasRoute } = useAtomValue(gasOnReceiveRouteAtom);
|
|
52363
|
+
const { feeRoute } = useAtomValue(swapExecutionStateAtom);
|
|
52364
|
+
const { data: assets2 } = useAtomValue(skipAssetsAtom);
|
|
52365
|
+
const isSomeDestinationFeeBalanceAvailable = useAtomValue(
|
|
52366
|
+
isSomeDestinationFeeBalanceAvailableAtom
|
|
52367
|
+
);
|
|
52368
|
+
const currentTransaction = useAtomValue(currentTransactionAtom);
|
|
52369
|
+
const isFetchingBalance = isSomeDestinationFeeBalanceAvailable.isLoading;
|
|
52370
|
+
const gasOnReceiveAsset = useMemo(() => {
|
|
52371
|
+
var _a2, _b2;
|
|
52372
|
+
const gasAsset = {
|
|
52373
|
+
chainId: ((_a2 = routeDetails == null ? void 0 : routeDetails.route) == null ? void 0 : _a2.destAssetChainId) ?? (feeRoute == null ? void 0 : feeRoute.destAssetChainId),
|
|
52374
|
+
denom: ((_b2 = routeDetails == null ? void 0 : routeDetails.route) == null ? void 0 : _b2.destAssetDenom) ?? (feeRoute == null ? void 0 : feeRoute.destAssetDenom)
|
|
52375
|
+
};
|
|
52376
|
+
if (!gasAsset) return;
|
|
52377
|
+
const asset = assets2 == null ? void 0 : assets2.find(
|
|
52378
|
+
(a) => a.chainId === (gasAsset == null ? void 0 : gasAsset.chainId) && a.denom === (gasAsset == null ? void 0 : gasAsset.denom)
|
|
52379
|
+
);
|
|
52380
|
+
return asset;
|
|
52381
|
+
}, [
|
|
52382
|
+
assets2,
|
|
52383
|
+
feeRoute == null ? void 0 : feeRoute.destAssetChainId,
|
|
52384
|
+
feeRoute == null ? void 0 : feeRoute.destAssetDenom,
|
|
52385
|
+
(_a = routeDetails == null ? void 0 : routeDetails.route) == null ? void 0 : _a.destAssetChainId,
|
|
52386
|
+
(_b = routeDetails == null ? void 0 : routeDetails.route) == null ? void 0 : _b.destAssetDenom
|
|
52387
|
+
]);
|
|
52388
|
+
const amountUsd = ((_c = routeDetails == null ? void 0 : routeDetails.route) == null ? void 0 : _c.usdAmountOut) ?? (feeRoute == null ? void 0 : feeRoute.usdAmountOut);
|
|
52389
|
+
const amountOut = ((_d = routeDetails == null ? void 0 : routeDetails.route) == null ? void 0 : _d.amountOut) ?? (feeRoute == null ? void 0 : feeRoute.amountOut) ?? "";
|
|
52390
|
+
const assetSymbol = ((_e2 = gasOnReceiveAsset == null ? void 0 : gasOnReceiveAsset.recommendedSymbol) == null ? void 0 : _e2.toUpperCase()) ?? "";
|
|
52391
|
+
const gasOnReceiveText = useMemo(() => {
|
|
52392
|
+
var _a2;
|
|
52393
|
+
const formattedAmountText = amountUsd && Number(amountUsd) > 0 ? `${formatUSD(amountUsd)} in ${assetSymbol}` : `${convertTokenAmountToHumanReadableAmount(amountOut, gasOnReceiveAsset == null ? void 0 : gasOnReceiveAsset.decimals)} ${assetSymbol}`;
|
|
52394
|
+
const transferAssetRelease = routeDetails == null ? void 0 : routeDetails.transferAssetRelease;
|
|
52395
|
+
const transferAssetReleaseDetails = assets2 == null ? void 0 : assets2.find(
|
|
52396
|
+
(a) => a.chainId === (transferAssetRelease == null ? void 0 : transferAssetRelease.chainId) && a.denom === (transferAssetRelease == null ? void 0 : transferAssetRelease.denom)
|
|
52397
|
+
);
|
|
52398
|
+
switch (routeDetails == null ? void 0 : routeDetails.status) {
|
|
52399
|
+
case "pending":
|
|
52400
|
+
return `Receiving ${formattedAmountText}`;
|
|
52401
|
+
case "completed":
|
|
52402
|
+
return `Received ${formattedAmountText} as gas top-up`;
|
|
52403
|
+
case "failed":
|
|
52404
|
+
if (transferAssetReleaseDetails) {
|
|
52405
|
+
return `Gas top-up failed. Assets released as ${(transferAssetRelease == null ? void 0 : transferAssetRelease.amount) ? convertTokenAmountToHumanReadableAmount(transferAssetRelease == null ? void 0 : transferAssetRelease.amount, transferAssetReleaseDetails == null ? void 0 : transferAssetReleaseDetails.decimals) : void 0} ${(_a2 = transferAssetReleaseDetails == null ? void 0 : transferAssetReleaseDetails.recommendedSymbol) == null ? void 0 : _a2.toUpperCase()}`;
|
|
52406
|
+
}
|
|
52407
|
+
return `Failed to receive ${formattedAmountText} as gas top-up`;
|
|
52408
|
+
default:
|
|
52409
|
+
return /* @__PURE__ */ jsxs(Row, { align: "center", gap: 8, children: [
|
|
52410
|
+
"Enable gas top up",
|
|
52411
|
+
/* @__PURE__ */ jsx(
|
|
52412
|
+
QuestionMarkTooltip,
|
|
52413
|
+
{
|
|
52414
|
+
content: /* @__PURE__ */ jsxs(SmallText, { normalTextColor: true, style: { whiteSpace: "nowrap" }, children: [
|
|
52415
|
+
"You'll get ",
|
|
52416
|
+
formattedAmountText
|
|
52417
|
+
] })
|
|
52418
|
+
}
|
|
52419
|
+
)
|
|
52420
|
+
] });
|
|
52421
|
+
}
|
|
52422
|
+
}, [amountOut, amountUsd, assetSymbol, assets2, gasOnReceiveAsset == null ? void 0 : gasOnReceiveAsset.decimals, routeDetails]);
|
|
52423
|
+
const renderIcon = useMemo(() => {
|
|
52424
|
+
if ((routeDetails == null ? void 0 : routeDetails.status) === "pending") {
|
|
52425
|
+
return /* @__PURE__ */ jsx(
|
|
52426
|
+
SmallText,
|
|
52427
|
+
{
|
|
52428
|
+
style: {
|
|
52429
|
+
marginLeft: "8px",
|
|
52430
|
+
marginRight: "8px",
|
|
52431
|
+
position: "relative"
|
|
52432
|
+
},
|
|
52433
|
+
children: /* @__PURE__ */ jsx(
|
|
52434
|
+
SpinnerIcon,
|
|
52435
|
+
{
|
|
52436
|
+
style: {
|
|
52437
|
+
animation: "spin 1s linear infinite",
|
|
52438
|
+
position: "absolute",
|
|
52439
|
+
height: 14,
|
|
52440
|
+
width: 14
|
|
52441
|
+
}
|
|
52442
|
+
}
|
|
52443
|
+
)
|
|
52444
|
+
}
|
|
52445
|
+
);
|
|
52446
|
+
}
|
|
52447
|
+
return /* @__PURE__ */ jsx(
|
|
52448
|
+
GasIcon,
|
|
52449
|
+
{
|
|
52450
|
+
color: (routeDetails == null ? void 0 : routeDetails.status) === "failed" ? theme.warning.text : theme.primary.text.lowContrast
|
|
52451
|
+
}
|
|
52452
|
+
);
|
|
52453
|
+
}, [routeDetails == null ? void 0 : routeDetails.status, theme.primary.text.lowContrast, theme.warning.text]);
|
|
52454
|
+
if (!routeDetails && (!feeRoute || !gasOnReceiveAsset)) {
|
|
52455
|
+
return null;
|
|
52456
|
+
}
|
|
52457
|
+
return /* @__PURE__ */ jsxs(GasOnReceiveContainer, { hideContainer, align: "center", justify: "space-between", children: [
|
|
52458
|
+
/* @__PURE__ */ jsxs(Row, { gap: 8, align: "center", children: [
|
|
52459
|
+
renderIcon,
|
|
52460
|
+
(isFetchingBalance || fetchingGasRoute) && !routeDetails ? /* @__PURE__ */ jsx(SkeletonElement, { height: 20, width: 300 }) : /* @__PURE__ */ jsx(
|
|
52461
|
+
SmallText,
|
|
52462
|
+
{
|
|
52463
|
+
color: (routeDetails == null ? void 0 : routeDetails.status) === "failed" ? theme.warning.text : theme.primary.text.lowContrast,
|
|
52464
|
+
children: gasOnReceiveText
|
|
52465
|
+
}
|
|
52466
|
+
)
|
|
52467
|
+
] }),
|
|
52468
|
+
routeDetails ? null : !isFetchingBalance && !currentTransaction && /* @__PURE__ */ jsx(
|
|
52469
|
+
Switch,
|
|
52470
|
+
{
|
|
52471
|
+
checked: gasOnReceive,
|
|
52472
|
+
onChange: (value) => {
|
|
52473
|
+
track("gas on receive: toggle button - clicked", {
|
|
52474
|
+
gasOnReceive: value
|
|
52475
|
+
});
|
|
52476
|
+
setGasOnReceive(value);
|
|
52477
|
+
}
|
|
52478
|
+
}
|
|
52479
|
+
)
|
|
52480
|
+
] });
|
|
52481
|
+
};
|
|
52482
|
+
const GasOnReceiveContainer = dt(Row)`
|
|
52483
|
+
${({ hideContainer, theme }) => !hideContainer && lt`
|
|
52484
|
+
background-color: ${theme.secondary.background.transparent};
|
|
52485
|
+
padding: 15px 20px;
|
|
52486
|
+
height: 40px;
|
|
52487
|
+
`}
|
|
52488
|
+
border-radius: ${({ theme }) => {
|
|
52489
|
+
var _a;
|
|
52490
|
+
return convertToPxValue((_a = theme.borderRadius) == null ? void 0 : _a.selectionButton);
|
|
52491
|
+
}};
|
|
52492
|
+
`;
|
|
52493
|
+
const useFeeRouteAutoSetAddress = () => {
|
|
52494
|
+
var _a, _b, _c;
|
|
52495
|
+
const [feeRouteChainAddresses, setFeeRouteChainAddresses] = useAtom(feeRouteChainAddressesAtom);
|
|
52496
|
+
const { feeRoute, isFeeRouteEnabled } = useAtomValue(swapExecutionStateAtom);
|
|
52497
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
52498
|
+
const connectedAddress = useAtomValue(connectedAddressesAtom);
|
|
52499
|
+
const sourceWallet = useAtomValue(walletsAtom);
|
|
52500
|
+
const currentTransaction = useAtomValue(currentTransactionAtom);
|
|
52501
|
+
const [walletHasChanged, setWalletHasChanged] = useState(false);
|
|
52502
|
+
const [currentSourceWallets, setCurrentSourceWallets] = useState();
|
|
52503
|
+
const [currentConnectedAddress, setCurrentConnectedAddress] = useState();
|
|
52504
|
+
const { createCosmosWallets } = useCreateCosmosWallets();
|
|
52505
|
+
const { createEvmWallets } = useCreateEvmWallets();
|
|
52506
|
+
const { createSolanaWallets } = useCreateSolanaWallets();
|
|
52507
|
+
useAtom(feeRouteUserAddressesEffectAtom);
|
|
52508
|
+
const connectRequiredChains = useCallback(
|
|
52509
|
+
async (openModal) => {
|
|
52510
|
+
setIsLoading(true);
|
|
52511
|
+
const createWallets = {
|
|
52512
|
+
[ChainType.Cosmos]: createCosmosWallets,
|
|
52513
|
+
[ChainType.Evm]: createEvmWallets,
|
|
52514
|
+
[ChainType.Svm]: createSolanaWallets
|
|
52515
|
+
};
|
|
52516
|
+
try {
|
|
52517
|
+
if (!feeRoute || !isFeeRouteEnabled) return;
|
|
52518
|
+
const requiredChainAddresses = feeRoute.requiredChainAddresses;
|
|
52519
|
+
if (!requiredChainAddresses) return;
|
|
52520
|
+
Object.entries(feeRouteChainAddresses).forEach(async ([_index, chainAddress], index) => {
|
|
52521
|
+
var _a2, _b2;
|
|
52522
|
+
if (!chainAddress.address || chainAddress.address === "") {
|
|
52523
|
+
const injectedAddress = connectedAddress == null ? void 0 : connectedAddress[chainAddress.chainId];
|
|
52524
|
+
if (injectedAddress) {
|
|
52525
|
+
setFeeRouteChainAddresses((prev2) => ({
|
|
52526
|
+
...prev2,
|
|
52527
|
+
[index]: {
|
|
52528
|
+
...chainAddress,
|
|
52529
|
+
address: injectedAddress,
|
|
52530
|
+
source: WalletSource.Injected
|
|
52531
|
+
}
|
|
52532
|
+
}));
|
|
52533
|
+
} else {
|
|
52534
|
+
if (!chainAddress.chainType) return;
|
|
52535
|
+
const wallets = createWallets[chainAddress.chainType](chainAddress.chainId);
|
|
52536
|
+
const walletName = (_a2 = sourceWallet[chainAddress.chainType]) == null ? void 0 : _a2.walletName;
|
|
52537
|
+
const wallet = wallets.find((w2) => w2.walletName === walletName);
|
|
52538
|
+
const response = await ((_b2 = wallet == null ? void 0 : wallet.getAddress) == null ? void 0 : _b2.call(wallet, {}));
|
|
52539
|
+
const getLogo = () => {
|
|
52540
|
+
var _a3;
|
|
52541
|
+
if ((wallet == null ? void 0 : wallet.walletChainType) === "evm" && (wallet == null ? void 0 : wallet.walletName) === "app.keplr") {
|
|
52542
|
+
return getCosmosWalletInfo(WalletType.KEPLR).imgSrc;
|
|
52543
|
+
}
|
|
52544
|
+
return (response == null ? void 0 : response.logo) ?? ((_a3 = wallet == null ? void 0 : wallet.walletInfo) == null ? void 0 : _a3.logo);
|
|
52545
|
+
};
|
|
52546
|
+
if (response == null ? void 0 : response.address) {
|
|
52547
|
+
setFeeRouteChainAddresses((prev2) => ({
|
|
52548
|
+
...prev2,
|
|
52549
|
+
[index]: {
|
|
52550
|
+
...chainAddress,
|
|
52551
|
+
address: response.address,
|
|
52552
|
+
logo: response.logo,
|
|
52553
|
+
source: WalletSource.Wallet,
|
|
52554
|
+
wallet: wallet ? {
|
|
52555
|
+
walletName: wallet == null ? void 0 : wallet.walletName,
|
|
52556
|
+
walletPrettyName: wallet == null ? void 0 : wallet.walletPrettyName,
|
|
52557
|
+
walletChainType: chainAddress.chainType,
|
|
52558
|
+
walletInfo: {
|
|
52559
|
+
logo: getLogo()
|
|
52560
|
+
}
|
|
52561
|
+
} : void 0
|
|
52562
|
+
}
|
|
52563
|
+
}));
|
|
52564
|
+
} else if (openModal) {
|
|
52565
|
+
NiceModal.show(Modals.SetAddressModal, {
|
|
52566
|
+
chainId: chainAddress.chainId,
|
|
52567
|
+
chainAddressIndex: index,
|
|
52568
|
+
isFeeRoute: true
|
|
52569
|
+
});
|
|
52570
|
+
}
|
|
52571
|
+
}
|
|
52572
|
+
}
|
|
52573
|
+
});
|
|
52574
|
+
} catch (error) {
|
|
52575
|
+
console.error("Error connecting required chains:", error);
|
|
52576
|
+
} finally {
|
|
52577
|
+
setIsLoading(false);
|
|
52578
|
+
}
|
|
52579
|
+
},
|
|
52580
|
+
[
|
|
52581
|
+
connectedAddress,
|
|
52582
|
+
createCosmosWallets,
|
|
52583
|
+
createEvmWallets,
|
|
52584
|
+
createSolanaWallets,
|
|
52585
|
+
feeRoute,
|
|
52586
|
+
feeRouteChainAddresses,
|
|
52587
|
+
isFeeRouteEnabled,
|
|
52588
|
+
setFeeRouteChainAddresses,
|
|
52589
|
+
sourceWallet
|
|
52590
|
+
]
|
|
52591
|
+
);
|
|
52592
|
+
useEffect(() => {
|
|
52593
|
+
var _a2, _b2, _c2, _d, _e2, _f;
|
|
52594
|
+
if (currentTransaction && (currentTransaction == null ? void 0 : currentTransaction.status) !== "unconfirmed") {
|
|
52595
|
+
setIsLoading(false);
|
|
52596
|
+
return;
|
|
52597
|
+
}
|
|
52598
|
+
const hasWalletChanged = ((_a2 = sourceWallet.cosmos) == null ? void 0 : _a2.id) !== ((_b2 = currentSourceWallets == null ? void 0 : currentSourceWallets.cosmos) == null ? void 0 : _b2.id) || ((_c2 = sourceWallet.evm) == null ? void 0 : _c2.id) !== ((_d = currentSourceWallets == null ? void 0 : currentSourceWallets.evm) == null ? void 0 : _d.id) || ((_e2 = sourceWallet.svm) == null ? void 0 : _e2.id) !== ((_f = currentSourceWallets == null ? void 0 : currentSourceWallets.svm) == null ? void 0 : _f.id);
|
|
52599
|
+
const hasConnectedAddressChanged = JSON.stringify(connectedAddress) !== JSON.stringify(currentConnectedAddress);
|
|
52600
|
+
if (hasConnectedAddressChanged) {
|
|
52601
|
+
setCurrentConnectedAddress(connectedAddress);
|
|
52602
|
+
setWalletHasChanged(true);
|
|
52603
|
+
}
|
|
52604
|
+
if (hasWalletChanged) {
|
|
52605
|
+
setCurrentSourceWallets(sourceWallet);
|
|
52606
|
+
setWalletHasChanged(true);
|
|
52607
|
+
}
|
|
52608
|
+
}, [
|
|
52609
|
+
connectRequiredChains,
|
|
52610
|
+
connectedAddress,
|
|
52611
|
+
currentConnectedAddress,
|
|
52612
|
+
(_a = currentSourceWallets == null ? void 0 : currentSourceWallets.cosmos) == null ? void 0 : _a.id,
|
|
52613
|
+
(_b = currentSourceWallets == null ? void 0 : currentSourceWallets.evm) == null ? void 0 : _b.id,
|
|
52614
|
+
(_c = currentSourceWallets == null ? void 0 : currentSourceWallets.svm) == null ? void 0 : _c.id,
|
|
52615
|
+
currentTransaction,
|
|
52616
|
+
currentTransaction == null ? void 0 : currentTransaction.status,
|
|
52617
|
+
isLoading,
|
|
52618
|
+
feeRoute == null ? void 0 : feeRoute.requiredChainAddresses,
|
|
52619
|
+
sourceWallet
|
|
52620
|
+
]);
|
|
52621
|
+
useEffect(() => {
|
|
52622
|
+
if (!isFeeRouteEnabled) {
|
|
52623
|
+
setIsLoading(false);
|
|
52624
|
+
return;
|
|
52625
|
+
} else {
|
|
52626
|
+
setWalletHasChanged(true);
|
|
52627
|
+
}
|
|
52628
|
+
}, [isFeeRouteEnabled]);
|
|
52629
|
+
useEffect(() => {
|
|
52630
|
+
if (walletHasChanged && isFeeRouteEnabled) {
|
|
52631
|
+
connectRequiredChains();
|
|
52632
|
+
setWalletHasChanged(false);
|
|
52633
|
+
}
|
|
52634
|
+
}, [
|
|
52635
|
+
connectRequiredChains,
|
|
52636
|
+
isFeeRouteEnabled,
|
|
52637
|
+
feeRoute == null ? void 0 : feeRoute.requiredChainAddresses,
|
|
52638
|
+
walletHasChanged
|
|
52639
|
+
]);
|
|
52640
|
+
return {
|
|
52641
|
+
connectRequiredChains,
|
|
52642
|
+
isLoading
|
|
52643
|
+
};
|
|
52644
|
+
};
|
|
51679
52645
|
var SwapExecutionState = /* @__PURE__ */ ((SwapExecutionState2) => {
|
|
51680
52646
|
SwapExecutionState2[SwapExecutionState2["recoveryAddressUnset"] = 0] = "recoveryAddressUnset";
|
|
51681
52647
|
SwapExecutionState2[SwapExecutionState2["destinationAddressUnset"] = 1] = "destinationAddressUnset";
|
|
@@ -51687,15 +52653,34 @@ var SwapExecutionState = /* @__PURE__ */ ((SwapExecutionState2) => {
|
|
|
51687
52653
|
SwapExecutionState2[SwapExecutionState2["validatingGasBalance"] = 7] = "validatingGasBalance";
|
|
51688
52654
|
SwapExecutionState2[SwapExecutionState2["approving"] = 8] = "approving";
|
|
51689
52655
|
SwapExecutionState2[SwapExecutionState2["pendingGettingAddresses"] = 9] = "pendingGettingAddresses";
|
|
52656
|
+
SwapExecutionState2[SwapExecutionState2["pendingGettingDestinationBalance"] = 10] = "pendingGettingDestinationBalance";
|
|
52657
|
+
SwapExecutionState2[SwapExecutionState2["pendingGettingFeeRouteAddresses"] = 11] = "pendingGettingFeeRouteAddresses";
|
|
52658
|
+
SwapExecutionState2[SwapExecutionState2["feeRouteRecoveryAddressUnset"] = 12] = "feeRouteRecoveryAddressUnset";
|
|
52659
|
+
SwapExecutionState2[SwapExecutionState2["pendingError"] = 13] = "pendingError";
|
|
51690
52660
|
return SwapExecutionState2;
|
|
51691
52661
|
})(SwapExecutionState || {});
|
|
51692
52662
|
const SwapExecutionPage = () => {
|
|
52663
|
+
const theme = nt();
|
|
51693
52664
|
const setCurrentPage = useSetAtom(currentPageAtom);
|
|
51694
|
-
const { route: route2, clientOperations } = useAtomValue(swapExecutionStateAtom);
|
|
52665
|
+
const { route: route2, clientOperations, feeRoute } = useAtomValue(swapExecutionStateAtom);
|
|
51695
52666
|
const currentTransaction = useAtomValue(currentTransactionAtom);
|
|
51696
52667
|
const chainAddresses = useAtomValue(chainAddressesAtom);
|
|
51697
|
-
const
|
|
52668
|
+
const feeRouteChainAddresses = useAtomValue(feeRouteChainAddressesAtom);
|
|
52669
|
+
const { connectRequiredChains, isLoading: isGettingAddressesLoading } = useAutoSetAddress();
|
|
52670
|
+
const {
|
|
52671
|
+
connectRequiredChains: connectFeeRouteRequiredChains,
|
|
52672
|
+
isLoading: isGettingFeeRouteAddressesLoading
|
|
52673
|
+
} = useFeeRouteAutoSetAddress();
|
|
51698
52674
|
const [simpleRoute, setSimpleRoute] = useState(true);
|
|
52675
|
+
const isSomeDestinationFeeBalanceAvailable = useAtomValue(
|
|
52676
|
+
isSomeDestinationFeeBalanceAvailableAtom
|
|
52677
|
+
);
|
|
52678
|
+
const { data: gasRoute, isLoading: isGasRouteLoading } = useAtomValue(gasOnReceiveRouteAtom);
|
|
52679
|
+
const gasRouteEnabled = useAtomValue(gasOnReceiveAtom);
|
|
52680
|
+
const isFetchingDestinationBalance = isSomeDestinationFeeBalanceAvailable.isLoading || isGasRouteLoading;
|
|
52681
|
+
useAtom(gasRouteEffect);
|
|
52682
|
+
useAtom(feeRouteAddressesAtomEffect);
|
|
52683
|
+
useAtom(gasOnReceiveAtomEffect);
|
|
51699
52684
|
const { mutate: submitExecuteRouteMutation, error } = useAtomValue(skipSubmitSwapExecutionAtom);
|
|
51700
52685
|
const signaturesRemaining = useMemo(() => {
|
|
51701
52686
|
if (!currentTransaction) return 0;
|
|
@@ -51707,8 +52692,12 @@ const SwapExecutionPage = () => {
|
|
|
51707
52692
|
const lastOperation = clientOperations[clientOperations.length - 1];
|
|
51708
52693
|
const swapExecutionState = useSwapExecutionState({
|
|
51709
52694
|
chainAddresses,
|
|
51710
|
-
|
|
51711
|
-
|
|
52695
|
+
requiredChainAddresses: route2 == null ? void 0 : route2.requiredChainAddresses,
|
|
52696
|
+
feeRouteChainAddresses,
|
|
52697
|
+
feeRouteRequiredChainAddresses: feeRoute == null ? void 0 : feeRoute.requiredChainAddresses,
|
|
52698
|
+
isGettingAddressesLoading,
|
|
52699
|
+
isGettingFeeRouteAddressesLoading,
|
|
52700
|
+
isFetchingDestinationBalance
|
|
51712
52701
|
});
|
|
51713
52702
|
const isSafeToleave = (route2 == null ? void 0 : route2.txsRequired) === (currentTransaction == null ? void 0 : currentTransaction.transactionDetails.length);
|
|
51714
52703
|
usePreventPageUnload(
|
|
@@ -51755,8 +52744,22 @@ const SwapExecutionPage = () => {
|
|
|
51755
52744
|
});
|
|
51756
52745
|
};
|
|
51757
52746
|
}, [swapExecutionState, lastOperation.signRequired, lastOperation.fromChain, route2]);
|
|
51758
|
-
const SwapExecutionPageRoute = simpleRoute ? SwapExecutionPageRouteSimple : SwapExecutionPageRouteDetailed;
|
|
51759
52747
|
const shouldRenderTrackProgressButton = lastTxHash && lastTxChainId && (route2 == null ? void 0 : route2.txsRequired) === (currentTransaction == null ? void 0 : currentTransaction.transactionDetails.length);
|
|
52748
|
+
const gasOnReceiveComponent = useMemo(() => {
|
|
52749
|
+
var _a;
|
|
52750
|
+
return (gasRoute || feeRoute) && !isGasRouteLoading && !currentTransaction && !isFetchingDestinationBalance || currentTransaction && gasRouteEnabled ? /* @__PURE__ */ jsxs(Column, { children: [
|
|
52751
|
+
/* @__PURE__ */ jsx(Spacer, { height: 30, showLine: true, lineColor: theme.secondary.background.transparent }),
|
|
52752
|
+
/* @__PURE__ */ jsx(GasOnReceive, { routeDetails: (_a = currentTransaction == null ? void 0 : currentTransaction.relatedRoutes) == null ? void 0 : _a[0] })
|
|
52753
|
+
] }) : null;
|
|
52754
|
+
}, [
|
|
52755
|
+
currentTransaction,
|
|
52756
|
+
feeRoute,
|
|
52757
|
+
gasRoute,
|
|
52758
|
+
gasRouteEnabled,
|
|
52759
|
+
isFetchingDestinationBalance,
|
|
52760
|
+
isGasRouteLoading,
|
|
52761
|
+
theme.secondary.background.transparent
|
|
52762
|
+
]);
|
|
51760
52763
|
return /* @__PURE__ */ jsxs(Column, { gap: 5, children: [
|
|
51761
52764
|
/* @__PURE__ */ jsx(
|
|
51762
52765
|
PageHeader,
|
|
@@ -51794,14 +52797,16 @@ const SwapExecutionPage = () => {
|
|
|
51794
52797
|
}
|
|
51795
52798
|
),
|
|
51796
52799
|
/* @__PURE__ */ jsx(
|
|
51797
|
-
|
|
52800
|
+
SwapExecutionPageRouteContainer,
|
|
51798
52801
|
{
|
|
52802
|
+
showDetailed: !simpleRoute,
|
|
51799
52803
|
onClickEditDestinationWallet,
|
|
51800
52804
|
operations: clientOperations,
|
|
51801
52805
|
statusData: currentTransaction,
|
|
51802
52806
|
swapExecutionState,
|
|
51803
52807
|
firstOperationStatus,
|
|
51804
|
-
secondOperationStatus
|
|
52808
|
+
secondOperationStatus,
|
|
52809
|
+
bottomContent: gasOnReceiveComponent
|
|
51805
52810
|
}
|
|
51806
52811
|
),
|
|
51807
52812
|
/* @__PURE__ */ jsx(
|
|
@@ -51812,6 +52817,7 @@ const SwapExecutionPage = () => {
|
|
|
51812
52817
|
signaturesRemaining,
|
|
51813
52818
|
lastOperation,
|
|
51814
52819
|
connectRequiredChains,
|
|
52820
|
+
connectFeeRouteRequiredChains,
|
|
51815
52821
|
submitExecuteRouteMutation
|
|
51816
52822
|
}
|
|
51817
52823
|
),
|
|
@@ -52242,8 +53248,8 @@ const useCleanupDebouncedAtoms = () => {
|
|
|
52242
53248
|
}, [cleanupDebouncedDestinationAssetAmount, cleanupDebouncedSourceAssetAmount]);
|
|
52243
53249
|
};
|
|
52244
53250
|
const useUpdateAmountWhenRouteChanges = () => {
|
|
52245
|
-
const
|
|
52246
|
-
const
|
|
53251
|
+
const route2 = useAtomValue(skipRouteAtom);
|
|
53252
|
+
const direction = useAtomValue(swapDirectionAtom);
|
|
52247
53253
|
const [sourceAsset, setSourceAsset] = useAtom(sourceAssetAtom);
|
|
52248
53254
|
const [destinationAsset, setDestinationAsset] = useAtom(destinationAssetAtom);
|
|
52249
53255
|
const prevRoute = useRef(route2.data);
|
|
@@ -52264,12 +53270,16 @@ const useUpdateAmountWhenRouteChanges = () => {
|
|
|
52264
53270
|
if (direction === "swap-in") {
|
|
52265
53271
|
setDestinationAsset((old) => ({
|
|
52266
53272
|
...old,
|
|
52267
|
-
amount: removeTrailingZeros(
|
|
53273
|
+
amount: removeTrailingZeros(
|
|
53274
|
+
formatDisplayAmount(swapInAmount, { decimals: 5, abbreviate: false })
|
|
53275
|
+
)
|
|
52268
53276
|
}));
|
|
52269
53277
|
} else if (direction === "swap-out") {
|
|
52270
53278
|
setSourceAsset((old) => ({
|
|
52271
53279
|
...old,
|
|
52272
|
-
amount: removeTrailingZeros(
|
|
53280
|
+
amount: removeTrailingZeros(
|
|
53281
|
+
formatDisplayAmount(swapOutAmount, { decimals: 5, abbreviate: false })
|
|
53282
|
+
)
|
|
52273
53283
|
}));
|
|
52274
53284
|
}
|
|
52275
53285
|
}, [route2.data, direction, sourceAsset, destinationAsset, setSourceAsset, setDestinationAsset]);
|
|
@@ -52289,19 +53299,6 @@ const useShowCosmosLedgerWarning = () => {
|
|
|
52289
53299
|
return !!(account == null ? void 0 : account.wallet.isLedger);
|
|
52290
53300
|
}, [sourceAsset == null ? void 0 : sourceAsset.chainId, chainType, getAccount]);
|
|
52291
53301
|
};
|
|
52292
|
-
const SpinnerIcon = (props) => {
|
|
52293
|
-
return /* @__PURE__ */ jsxs("svg", { fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
52294
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", opacity: ".25", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
52295
|
-
/* @__PURE__ */ jsx(
|
|
52296
|
-
"path",
|
|
52297
|
-
{
|
|
52298
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",
|
|
52299
|
-
fill: "currentColor",
|
|
52300
|
-
opacity: ".75"
|
|
52301
|
-
}
|
|
52302
|
-
)
|
|
52303
|
-
] });
|
|
52304
|
-
};
|
|
52305
53302
|
const ConnectedWalletContent = () => {
|
|
52306
53303
|
const sourceAsset = useAtomValue(sourceAssetAtom);
|
|
52307
53304
|
const getAccount = useGetAccount();
|
|
@@ -52384,18 +53381,44 @@ const ConnectedWalletContent = () => {
|
|
|
52384
53381
|
};
|
|
52385
53382
|
const useTxHistory = ({ txHistoryItem }) => {
|
|
52386
53383
|
const setTransactionHistory = useSetAtom(setTransactionHistoryAtom);
|
|
52387
|
-
const
|
|
53384
|
+
const unsubscribersRef = useRef(null);
|
|
53385
|
+
const subscribedIdsRef = useRef(/* @__PURE__ */ new Set());
|
|
52388
53386
|
useEffect(() => {
|
|
52389
|
-
|
|
52390
|
-
|
|
52391
|
-
|
|
52392
|
-
|
|
53387
|
+
var _a;
|
|
53388
|
+
if (!txHistoryItem) return;
|
|
53389
|
+
const unsubscribers = [];
|
|
53390
|
+
const subscribedRouteIds = /* @__PURE__ */ new Set();
|
|
53391
|
+
const subscribe = (route2) => {
|
|
53392
|
+
if (!route2.id || subscribedRouteIds.has(route2.id)) return;
|
|
53393
|
+
subscribedRouteIds.add(route2.id);
|
|
53394
|
+
unsubscribers.push(
|
|
53395
|
+
subscribeToRouteStatus({
|
|
53396
|
+
routeDetails: route2,
|
|
53397
|
+
onRouteStatusUpdated: (routeStatus) => {
|
|
53398
|
+
var _a2;
|
|
53399
|
+
const failedFeeRoute = (_a2 = routeStatus == null ? void 0 : routeStatus.relatedRoutes) == null ? void 0 : _a2.find(
|
|
53400
|
+
(relatedRoute) => relatedRoute.status === "failed"
|
|
53401
|
+
);
|
|
53402
|
+
if (failedFeeRoute) {
|
|
53403
|
+
track("gas on receive: fee route failed", { feeRoute: failedFeeRoute });
|
|
53404
|
+
}
|
|
53405
|
+
setTransactionHistory(routeStatus);
|
|
53406
|
+
}
|
|
53407
|
+
})
|
|
53408
|
+
);
|
|
53409
|
+
};
|
|
53410
|
+
subscribe(txHistoryItem);
|
|
53411
|
+
(_a = txHistoryItem.relatedRoutes) == null ? void 0 : _a.forEach((relatedRoute) => {
|
|
53412
|
+
if (relatedRoute && relatedRoute.id) {
|
|
53413
|
+
subscribe(relatedRoute);
|
|
53414
|
+
}
|
|
52393
53415
|
});
|
|
52394
|
-
|
|
53416
|
+
unsubscribersRef.current = unsubscribers;
|
|
53417
|
+
subscribedIdsRef.current = subscribedRouteIds;
|
|
52395
53418
|
return () => {
|
|
52396
|
-
|
|
53419
|
+
unsubscribers.forEach((unsub) => unsub());
|
|
52397
53420
|
};
|
|
52398
|
-
}, [
|
|
53421
|
+
}, [txHistoryItem, setTransactionHistory]);
|
|
52399
53422
|
return txHistoryItem;
|
|
52400
53423
|
};
|
|
52401
53424
|
const SwapPageHeader = memo(() => {
|
|
@@ -52508,6 +53531,183 @@ const useConnectToMissingCosmosChain = () => {
|
|
|
52508
53531
|
}, [sourceAsset, wallets, extraChainIdsToConnect, addExtraChainIdsToConnectForWalletType]);
|
|
52509
53532
|
return { isAskingToApproveConnection };
|
|
52510
53533
|
};
|
|
53534
|
+
const name = "@skip-go/widget";
|
|
53535
|
+
const description = "Swap widget";
|
|
53536
|
+
const version = "3.14.1";
|
|
53537
|
+
const repository = {
|
|
53538
|
+
url: "https://github.com/skip-mev/skip-go",
|
|
53539
|
+
directory: "packages/widget"
|
|
53540
|
+
};
|
|
53541
|
+
const type = "module";
|
|
53542
|
+
const scripts = {
|
|
53543
|
+
dev: "vite --force --host",
|
|
53544
|
+
"dev:visual-test": "VISUAL_TEST=true yarn dev",
|
|
53545
|
+
"dev:storybook": "storybook dev -p 6006",
|
|
53546
|
+
build: "npm run generate-chains && NODE_OPTIONS=--max-old-space-size=16384 vite build",
|
|
53547
|
+
"watch:build": "vite build --watch",
|
|
53548
|
+
lint: "NODE_OPTIONS=--max-old-space-size=32384 eslint . --fix",
|
|
53549
|
+
preview: "vite preview",
|
|
53550
|
+
"build:web-component": "NODE_OPTIONS=--max-old-space-size=32384 webpack --config webpack.config.js",
|
|
53551
|
+
"publish:web-component": "npm run build:web-component && cd web-component && npm publish && cd ..",
|
|
53552
|
+
prepack: "yarn run pre",
|
|
53553
|
+
postpack: "yarn run post",
|
|
53554
|
+
pre: "npm run build && node scripts/prepublish.cjs",
|
|
53555
|
+
post: "git checkout -- package.json",
|
|
53556
|
+
"generate-chains": "node scripts/generate-chains.cjs",
|
|
53557
|
+
"update-registries": "yarn up @initia/initia-registry chain-registry",
|
|
53558
|
+
test: "yarn playwright test",
|
|
53559
|
+
"update-screenshots": "UPDATE_SCREENSHOTS=true yarn playwright test Keplr.test.tsx",
|
|
53560
|
+
"combine-images": "node scripts/combine-images.mjs"
|
|
53561
|
+
};
|
|
53562
|
+
const exports = {
|
|
53563
|
+
".": {
|
|
53564
|
+
types: "./build/index.d.ts",
|
|
53565
|
+
"import": "./build/index.js"
|
|
53566
|
+
}
|
|
53567
|
+
};
|
|
53568
|
+
const types = "./build/index.d.ts";
|
|
53569
|
+
const files = [
|
|
53570
|
+
"build",
|
|
53571
|
+
"README.md"
|
|
53572
|
+
];
|
|
53573
|
+
const devDependencies = {
|
|
53574
|
+
"@chromatic-com/storybook": "^1.6.1",
|
|
53575
|
+
"@eslint/js": "^9.9.0",
|
|
53576
|
+
"@initia/initia-registry": "^1.0.6",
|
|
53577
|
+
"@keplr-wallet/types": "^0.12.125",
|
|
53578
|
+
"@playwright/test": "^1.51.1",
|
|
53579
|
+
"@storybook/addon-essentials": "^8.2.6",
|
|
53580
|
+
"@storybook/addon-interactions": "^8.2.6",
|
|
53581
|
+
"@storybook/addon-links": "^8.2.6",
|
|
53582
|
+
"@storybook/addon-onboarding": "^8.2.6",
|
|
53583
|
+
"@storybook/blocks": "^8.2.6",
|
|
53584
|
+
"@storybook/react": "^8.2.6",
|
|
53585
|
+
"@storybook/react-vite": "^8.2.6",
|
|
53586
|
+
"@storybook/test": "^8.2.6",
|
|
53587
|
+
"@testing-library/dom": "^10.4.0",
|
|
53588
|
+
"@testing-library/react": "^16.2.0",
|
|
53589
|
+
"@types/eslint__js": "^8.42.3",
|
|
53590
|
+
"@types/pluralize": "^0.0.33",
|
|
53591
|
+
"@types/pngjs": "^6.0.5",
|
|
53592
|
+
"@types/react": "^19.0.10",
|
|
53593
|
+
"@types/react-dom": "^19.0.4",
|
|
53594
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
53595
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
53596
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
53597
|
+
buffer: "^6.0.3",
|
|
53598
|
+
"chain-registry": "^2.0.34",
|
|
53599
|
+
download: "^8.0.0",
|
|
53600
|
+
eslint: "^9.9.0",
|
|
53601
|
+
"eslint-config-prettier": "^9.1.0",
|
|
53602
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
53603
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
53604
|
+
"fs-extra": "^11.3.0",
|
|
53605
|
+
"node-polyfill-webpack-plugin": "^4.0.0",
|
|
53606
|
+
"pino-pretty": "^13.0.0",
|
|
53607
|
+
pixelmatch: "^7.1.0",
|
|
53608
|
+
pngjs: "^7.0.0",
|
|
53609
|
+
"postcss-loader": "^8.1.1",
|
|
53610
|
+
prettier: "^3.4.2",
|
|
53611
|
+
process: "^0.11.10",
|
|
53612
|
+
pureimage: "^0.4.18",
|
|
53613
|
+
"raw-loader": "^4.0.2",
|
|
53614
|
+
react: ">=17.0.0",
|
|
53615
|
+
"react-dom": ">=17.0.0",
|
|
53616
|
+
starknet: "6.11.0",
|
|
53617
|
+
storybook: "^8.2.6",
|
|
53618
|
+
"ts-loader": "^9.5.1",
|
|
53619
|
+
typescript: "^5.5.4",
|
|
53620
|
+
"typescript-eslint": "^8.2.0",
|
|
53621
|
+
"url-loader": "^4.1.1",
|
|
53622
|
+
vite: "^5.3.4",
|
|
53623
|
+
"vite-plugin-dts": "^4.0.0-beta.1",
|
|
53624
|
+
"vite-plugin-node-polyfills": "^0.22.0",
|
|
53625
|
+
webpack: "^5.94.0",
|
|
53626
|
+
"webpack-cli": "^5.1.4"
|
|
53627
|
+
};
|
|
53628
|
+
const peerDependencies = {
|
|
53629
|
+
"@tanstack/react-query": "^5.51.21",
|
|
53630
|
+
react: ">=17.0.0",
|
|
53631
|
+
"react-dom": ">=17.0.0",
|
|
53632
|
+
viem: "^2.21.55",
|
|
53633
|
+
wagmi: "^2.14.1"
|
|
53634
|
+
};
|
|
53635
|
+
const dependencies = {
|
|
53636
|
+
"@amplitude/analytics-browser": "^2.11.12",
|
|
53637
|
+
"@amplitude/plugin-session-replay-browser": "^1.16.5",
|
|
53638
|
+
"@cosmjs/amino": "0.33.1",
|
|
53639
|
+
"@cosmjs/cosmwasm-stargate": "0.33.1",
|
|
53640
|
+
"@cosmjs/encoding": "0.33.1",
|
|
53641
|
+
"@cosmjs/math": "0.33.1",
|
|
53642
|
+
"@cosmjs/proto-signing": "0.33.1",
|
|
53643
|
+
"@cosmjs/stargate": "0.33.1",
|
|
53644
|
+
"@ebay/nice-modal-react": "^1.2.13",
|
|
53645
|
+
"@eslint/compat": "^1.1.1",
|
|
53646
|
+
"@penumbra-zone/bech32m": "^13.0.0",
|
|
53647
|
+
"@penumbra-zone/client": "^24.0.0",
|
|
53648
|
+
"@penumbra-zone/protobuf": "^7.2.0",
|
|
53649
|
+
"@penumbra-zone/transport-dom": "^7.5.0",
|
|
53650
|
+
"@r2wc/react-to-web-component": "^2.0.3",
|
|
53651
|
+
"@skip-go/client": "workspace:^",
|
|
53652
|
+
"@solana/spl-token": "^0.4.8",
|
|
53653
|
+
"@solana/wallet-adapter-ledger": "^0.9.25",
|
|
53654
|
+
"@solana/wallet-adapter-react": "^0.15.39",
|
|
53655
|
+
"@solana/wallet-adapter-wallets": "^0.19.37",
|
|
53656
|
+
"@solana/web3.js": "^1.95.8",
|
|
53657
|
+
"@tanstack/query-core": "^5.51.21",
|
|
53658
|
+
"@walletconnect/modal": "^2.7.0",
|
|
53659
|
+
"@walletconnect/sign-client": "^2.20.3",
|
|
53660
|
+
"@walletconnect/solana-adapter": "^0.0.8",
|
|
53661
|
+
add: "^2.0.6",
|
|
53662
|
+
bech32: "^2.0.0",
|
|
53663
|
+
graz: "0.3.3",
|
|
53664
|
+
jotai: "^2.10.1",
|
|
53665
|
+
"jotai-effect": "^1.0.2",
|
|
53666
|
+
"jotai-tanstack-query": "^0.8.6",
|
|
53667
|
+
"lodash.debounce": "^4.0.8",
|
|
53668
|
+
pluralize: "^8.0.0",
|
|
53669
|
+
"rc-virtual-list": "^3.14.5",
|
|
53670
|
+
"react-error-boundary": "^4.0.13",
|
|
53671
|
+
"react-shadow-scope": "^1.0.5",
|
|
53672
|
+
"styled-components": "^6.1.13",
|
|
53673
|
+
uuid: "^11.1.0",
|
|
53674
|
+
yarn: "^1.22.22",
|
|
53675
|
+
zod: "^3.23.8"
|
|
53676
|
+
};
|
|
53677
|
+
const publishConfig = {
|
|
53678
|
+
access: "public"
|
|
53679
|
+
};
|
|
53680
|
+
const packageJson = {
|
|
53681
|
+
name,
|
|
53682
|
+
description,
|
|
53683
|
+
version,
|
|
53684
|
+
repository,
|
|
53685
|
+
type,
|
|
53686
|
+
scripts,
|
|
53687
|
+
exports,
|
|
53688
|
+
types,
|
|
53689
|
+
files,
|
|
53690
|
+
devDependencies,
|
|
53691
|
+
peerDependencies,
|
|
53692
|
+
dependencies,
|
|
53693
|
+
publishConfig
|
|
53694
|
+
};
|
|
53695
|
+
let isAmplitudeInitialized = false;
|
|
53696
|
+
const initAmplitude = () => {
|
|
53697
|
+
if (isAmplitudeInitialized) return;
|
|
53698
|
+
init("14616a575f32087cf0403ab8f3ea3ce0", {
|
|
53699
|
+
appVersion: version
|
|
53700
|
+
});
|
|
53701
|
+
isAmplitudeInitialized = true;
|
|
53702
|
+
};
|
|
53703
|
+
const startAmplitudeSessionReplay = () => {
|
|
53704
|
+
if (isAmplitudeInitialized) {
|
|
53705
|
+
const plugin = sessionReplayPlugin({
|
|
53706
|
+
sampleRate: 1
|
|
53707
|
+
});
|
|
53708
|
+
add(plugin);
|
|
53709
|
+
}
|
|
53710
|
+
};
|
|
52511
53711
|
const SwapPage = () => {
|
|
52512
53712
|
var _a;
|
|
52513
53713
|
const { SettingsFooter, drawerOpen } = useSettingsDrawer();
|
|
@@ -52538,6 +53738,7 @@ const SwapPage = () => {
|
|
|
52538
53738
|
const getBalance = useGetBalance();
|
|
52539
53739
|
const callbacks = useAtomValue(callbacksAtom);
|
|
52540
53740
|
const setChainAddresses = useSetAtom(chainAddressesAtom);
|
|
53741
|
+
const setFeeRouteChainAddresses = useSetAtom(feeRouteChainAddressesAtom);
|
|
52541
53742
|
useFetchAllBalances();
|
|
52542
53743
|
useCleanupDebouncedAtoms();
|
|
52543
53744
|
useUpdateAmountWhenRouteChanges();
|
|
@@ -52660,9 +53861,12 @@ const SwapPage = () => {
|
|
|
52660
53861
|
var _a2;
|
|
52661
53862
|
const formattedUsdAmount = (_a2 = getTotalFees(fees2)) == null ? void 0 : _a2.formattedUsdAmount;
|
|
52662
53863
|
if (formattedUsdAmount) {
|
|
52663
|
-
return
|
|
53864
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(SmallText, { color: "inherit", children: [
|
|
53865
|
+
formattedUsdAmount,
|
|
53866
|
+
" in fees"
|
|
53867
|
+
] }) });
|
|
52664
53868
|
}
|
|
52665
|
-
return "no fees";
|
|
53869
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(SmallText, { color: "inherit", children: "no fees" }) });
|
|
52666
53870
|
}, [fees2]);
|
|
52667
53871
|
const feeWarning = useMemo(() => {
|
|
52668
53872
|
if (!(route2 == null ? void 0 : route2.usdAmountIn) || !(route2 == null ? void 0 : route2.usdAmountOut)) return false;
|
|
@@ -52728,6 +53932,7 @@ const SwapPage = () => {
|
|
|
52728
53932
|
}
|
|
52729
53933
|
const onClick = () => {
|
|
52730
53934
|
var _a3, _b;
|
|
53935
|
+
startAmplitudeSessionReplay();
|
|
52731
53936
|
track("swap page: continue button - clicked", {
|
|
52732
53937
|
route: route2,
|
|
52733
53938
|
type: isSwapOperation ? "swap" : "send",
|
|
@@ -52738,6 +53943,7 @@ const SwapPage = () => {
|
|
|
52738
53943
|
startTransition(() => {
|
|
52739
53944
|
setError(void 0);
|
|
52740
53945
|
setChainAddresses({});
|
|
53946
|
+
setFeeRouteChainAddresses({});
|
|
52741
53947
|
setSwapExecutionState();
|
|
52742
53948
|
setCurrentPage(Routes.SwapExecutionPage);
|
|
52743
53949
|
});
|
|
@@ -52830,6 +54036,7 @@ const SwapPage = () => {
|
|
|
52830
54036
|
showGoFastWarning,
|
|
52831
54037
|
isGoFast,
|
|
52832
54038
|
setChainAddresses,
|
|
54039
|
+
setFeeRouteChainAddresses,
|
|
52833
54040
|
setCurrentPage,
|
|
52834
54041
|
setSwapExecutionState,
|
|
52835
54042
|
setError
|
|
@@ -52936,7 +54143,10 @@ const TransactionHistoryPageHistoryItemDetails = ({
|
|
|
52936
54143
|
absoluteTimeString,
|
|
52937
54144
|
onClickDelete,
|
|
52938
54145
|
transferAssetRelease,
|
|
52939
|
-
transactionDetails
|
|
54146
|
+
transactionDetails,
|
|
54147
|
+
feeAssetRouteDetails,
|
|
54148
|
+
senderAddress,
|
|
54149
|
+
receiverAddress
|
|
52940
54150
|
}) => {
|
|
52941
54151
|
var _a;
|
|
52942
54152
|
const theme = nt();
|
|
@@ -53006,6 +54216,18 @@ const TransactionHistoryPageHistoryItemDetails = ({
|
|
|
53006
54216
|
}
|
|
53007
54217
|
)
|
|
53008
54218
|
] }),
|
|
54219
|
+
senderAddress && /* @__PURE__ */ jsxs(StyledHistoryItemDetailRow, { align: "center", children: [
|
|
54220
|
+
/* @__PURE__ */ jsx(StyledDetailsLabel, { children: "Sender" }),
|
|
54221
|
+
/* @__PURE__ */ jsx(SmallText, { normalTextColor: true, children: senderAddress })
|
|
54222
|
+
] }),
|
|
54223
|
+
receiverAddress && /* @__PURE__ */ jsxs(StyledHistoryItemDetailRow, { align: "center", children: [
|
|
54224
|
+
/* @__PURE__ */ jsx(StyledDetailsLabel, { children: "Receiver" }),
|
|
54225
|
+
/* @__PURE__ */ jsx(SmallText, { normalTextColor: true, children: receiverAddress })
|
|
54226
|
+
] }),
|
|
54227
|
+
feeAssetRouteDetails && /* @__PURE__ */ jsx(StyledHistoryItemDetailRow, { align: "center", children: /* @__PURE__ */ jsxs(Column, { width: "100%", children: [
|
|
54228
|
+
/* @__PURE__ */ jsx(Spacer, { height: 20, showLine: true, lineColor: theme.secondary.background.transparent }),
|
|
54229
|
+
/* @__PURE__ */ jsx(GasOnReceive, { hideContainer: true, routeDetails: feeAssetRouteDetails })
|
|
54230
|
+
] }) }),
|
|
53009
54231
|
/* @__PURE__ */ jsx(Row, { align: "center", style: { marginTop: 10, padding: "0px 10px" }, children: /* @__PURE__ */ jsxs(Button, { onClick: onClickDelete, gap: 5, align: "center", children: [
|
|
53010
54232
|
/* @__PURE__ */ jsx(SmallText, { color: theme.error.text, children: "Delete" }),
|
|
53011
54233
|
/* @__PURE__ */ jsx(TrashIcon, { color: theme.error.text })
|
|
@@ -53671,6 +54893,7 @@ const TransactionHistoryPageHistoryItem = forwardRef(
|
|
|
53671
54893
|
onClickRow,
|
|
53672
54894
|
onClickDelete
|
|
53673
54895
|
}, ref) => {
|
|
54896
|
+
var _a, _b;
|
|
53674
54897
|
const theme = nt();
|
|
53675
54898
|
const isMobileScreenSize = useIsMobileScreenSize();
|
|
53676
54899
|
const historyItem = useTxHistory({
|
|
@@ -53689,10 +54912,21 @@ const TransactionHistoryPageHistoryItem = forwardRef(
|
|
|
53689
54912
|
timestamp,
|
|
53690
54913
|
transactionDetails
|
|
53691
54914
|
} = txHistoryItem;
|
|
54915
|
+
const totalSourceTokenAmount = useMemo(() => {
|
|
54916
|
+
var _a2;
|
|
54917
|
+
const totalRelatedRouteSourceAmount = ((_a2 = txHistoryItem == null ? void 0 : txHistoryItem.relatedRoutes) == null ? void 0 : _a2.reduce(
|
|
54918
|
+
(acc, routeDetail) => {
|
|
54919
|
+
var _a3;
|
|
54920
|
+
return BigNumber(acc).plus(BigNumber(((_a3 = routeDetail.route) == null ? void 0 : _a3.amountIn) || 0)).toNumber();
|
|
54921
|
+
},
|
|
54922
|
+
0
|
|
54923
|
+
)) ?? 0;
|
|
54924
|
+
return BigNumber(amountIn ?? 0).plus(BigNumber(totalRelatedRouteSourceAmount)).toString();
|
|
54925
|
+
}, [amountIn, txHistoryItem]);
|
|
53692
54926
|
const sourceAssetDetails = useGetAssetDetails({
|
|
53693
54927
|
assetDenom: sourceAssetDenom,
|
|
53694
54928
|
chainId: sourceAssetChainId,
|
|
53695
|
-
tokenAmount:
|
|
54929
|
+
tokenAmount: totalSourceTokenAmount
|
|
53696
54930
|
});
|
|
53697
54931
|
const destinationAssetDetails = useGetAssetDetails({
|
|
53698
54932
|
assetDenom: destAssetDenom,
|
|
@@ -53711,6 +54945,10 @@ const TransactionHistoryPageHistoryItem = forwardRef(
|
|
|
53711
54945
|
assetImage: destinationAssetDetails.assetImage ?? "",
|
|
53712
54946
|
chainName: destinationAssetDetails.chainName
|
|
53713
54947
|
};
|
|
54948
|
+
const feeAssetRouteDetails = useMemo(() => {
|
|
54949
|
+
var _a2, _b2;
|
|
54950
|
+
return ((_a2 = historyItem == null ? void 0 : historyItem.relatedRoutes) == null ? void 0 : _a2[0]) || ((_b2 = txHistoryItem == null ? void 0 : txHistoryItem.relatedRoutes) == null ? void 0 : _b2[0]);
|
|
54951
|
+
}, [historyItem, txHistoryItem]);
|
|
53714
54952
|
const renderStatus = useMemo(() => {
|
|
53715
54953
|
switch (historyItem == null ? void 0 : historyItem.status) {
|
|
53716
54954
|
case "unconfirmed":
|
|
@@ -53755,6 +54993,36 @@ const TransactionHistoryPageHistoryItem = forwardRef(
|
|
|
53755
54993
|
addSuffix: true
|
|
53756
54994
|
}).replace("minutes", "mins").replace("minute", "min").replace("hours", "hrs").replace("hour", "hr").replace("seconds", "secs").replace("second", "sec").replace("months", "mos").replace("month", "mo").replace("years", "yrs").replace("year", "yr");
|
|
53757
54995
|
}, [historyItem == null ? void 0 : historyItem.status, timestamp]);
|
|
54996
|
+
const senderAddress = useMemo(() => {
|
|
54997
|
+
var _a2, _b2;
|
|
54998
|
+
return (_b2 = (_a2 = historyItem == null ? void 0 : historyItem.userAddresses) == null ? void 0 : _a2.find(
|
|
54999
|
+
(address) => {
|
|
55000
|
+
var _a3;
|
|
55001
|
+
return address.chainId === ((_a3 = historyItem == null ? void 0 : historyItem.route) == null ? void 0 : _a3.sourceAssetChainId);
|
|
55002
|
+
}
|
|
55003
|
+
)) == null ? void 0 : _b2.address;
|
|
55004
|
+
}, [(_a = historyItem == null ? void 0 : historyItem.route) == null ? void 0 : _a.sourceAssetChainId, historyItem == null ? void 0 : historyItem.userAddresses]);
|
|
55005
|
+
const receiverAddress = useMemo(() => {
|
|
55006
|
+
var _a2, _b2, _c, _d;
|
|
55007
|
+
if ((historyItem == null ? void 0 : historyItem.transferAssetRelease) !== void 0) {
|
|
55008
|
+
return (_b2 = (_a2 = historyItem == null ? void 0 : historyItem.userAddresses) == null ? void 0 : _a2.find(
|
|
55009
|
+
(address) => {
|
|
55010
|
+
var _a3;
|
|
55011
|
+
return address.chainId === ((_a3 = historyItem == null ? void 0 : historyItem.transferAssetRelease) == null ? void 0 : _a3.chainId);
|
|
55012
|
+
}
|
|
55013
|
+
)) == null ? void 0 : _b2.address;
|
|
55014
|
+
}
|
|
55015
|
+
return (_d = (_c = historyItem == null ? void 0 : historyItem.userAddresses) == null ? void 0 : _c.find(
|
|
55016
|
+
(address) => {
|
|
55017
|
+
var _a3;
|
|
55018
|
+
return address.chainId === ((_a3 = historyItem == null ? void 0 : historyItem.route) == null ? void 0 : _a3.destAssetChainId);
|
|
55019
|
+
}
|
|
55020
|
+
)) == null ? void 0 : _d.address;
|
|
55021
|
+
}, [
|
|
55022
|
+
(_b = historyItem == null ? void 0 : historyItem.route) == null ? void 0 : _b.destAssetChainId,
|
|
55023
|
+
historyItem == null ? void 0 : historyItem.transferAssetRelease,
|
|
55024
|
+
historyItem == null ? void 0 : historyItem.userAddresses
|
|
55025
|
+
]);
|
|
53758
55026
|
if (!txHistoryItem.route) return null;
|
|
53759
55027
|
return /* @__PURE__ */ jsxs(StyledHistoryContainer, { ref, showDetails, children: [
|
|
53760
55028
|
/* @__PURE__ */ jsxs(StyledHistoryItemRow, { align: "center", justify: "space-between", onClick: onClickRow, children: [
|
|
@@ -53780,7 +55048,10 @@ const TransactionHistoryPageHistoryItem = forwardRef(
|
|
|
53780
55048
|
removeTransactionHistoryItem(txHistoryItem.timestamp);
|
|
53781
55049
|
onClickDelete == null ? void 0 : onClickDelete();
|
|
53782
55050
|
},
|
|
53783
|
-
transferAssetRelease: historyItem == null ? void 0 : historyItem.transferAssetRelease
|
|
55051
|
+
transferAssetRelease: historyItem == null ? void 0 : historyItem.transferAssetRelease,
|
|
55052
|
+
feeAssetRouteDetails,
|
|
55053
|
+
senderAddress,
|
|
55054
|
+
receiverAddress
|
|
53784
55055
|
}
|
|
53785
55056
|
)
|
|
53786
55057
|
] });
|
|
@@ -54048,176 +55319,6 @@ const useMobileRouteConfig = () => {
|
|
|
54048
55319
|
}));
|
|
54049
55320
|
}, [isMobile2, setRouteConfig]);
|
|
54050
55321
|
};
|
|
54051
|
-
const name = "@skip-go/widget";
|
|
54052
|
-
const description = "Swap widget";
|
|
54053
|
-
const version = "3.13.0";
|
|
54054
|
-
const repository = {
|
|
54055
|
-
url: "https://github.com/skip-mev/skip-go",
|
|
54056
|
-
directory: "packages/widget"
|
|
54057
|
-
};
|
|
54058
|
-
const type = "module";
|
|
54059
|
-
const scripts = {
|
|
54060
|
-
dev: "vite --force --host",
|
|
54061
|
-
"dev:visual-test": "VISUAL_TEST=true yarn dev",
|
|
54062
|
-
"dev:storybook": "storybook dev -p 6006",
|
|
54063
|
-
build: "npm run generate-chains && NODE_OPTIONS=--max-old-space-size=16384 vite build",
|
|
54064
|
-
"watch:build": "vite build --watch",
|
|
54065
|
-
lint: "NODE_OPTIONS=--max-old-space-size=32384 eslint . --fix",
|
|
54066
|
-
preview: "vite preview",
|
|
54067
|
-
"build:web-component": "NODE_OPTIONS=--max-old-space-size=32384 webpack --config webpack.config.js",
|
|
54068
|
-
"publish:web-component": "npm run build:web-component && cd web-component && npm publish && cd ..",
|
|
54069
|
-
prepack: "yarn run pre",
|
|
54070
|
-
postpack: "yarn run post",
|
|
54071
|
-
pre: "npm run build && node scripts/prepublish.cjs",
|
|
54072
|
-
post: "git checkout -- package.json",
|
|
54073
|
-
"generate-chains": "node scripts/generate-chains.cjs",
|
|
54074
|
-
"update-registries": "yarn up @initia/initia-registry chain-registry",
|
|
54075
|
-
test: "yarn playwright test",
|
|
54076
|
-
"update-screenshots": "UPDATE_SCREENSHOTS=true yarn playwright test Keplr.test.tsx",
|
|
54077
|
-
"combine-images": "node scripts/combine-images.mjs"
|
|
54078
|
-
};
|
|
54079
|
-
const exports = {
|
|
54080
|
-
".": {
|
|
54081
|
-
types: "./build/index.d.ts",
|
|
54082
|
-
"import": "./build/index.js"
|
|
54083
|
-
}
|
|
54084
|
-
};
|
|
54085
|
-
const types = "./build/index.d.ts";
|
|
54086
|
-
const files = [
|
|
54087
|
-
"build",
|
|
54088
|
-
"README.md"
|
|
54089
|
-
];
|
|
54090
|
-
const devDependencies = {
|
|
54091
|
-
"@chromatic-com/storybook": "^1.6.1",
|
|
54092
|
-
"@eslint/js": "^9.9.0",
|
|
54093
|
-
"@initia/initia-registry": "^1.0.6",
|
|
54094
|
-
"@keplr-wallet/types": "^0.12.125",
|
|
54095
|
-
"@playwright/test": "^1.51.1",
|
|
54096
|
-
"@storybook/addon-essentials": "^8.2.6",
|
|
54097
|
-
"@storybook/addon-interactions": "^8.2.6",
|
|
54098
|
-
"@storybook/addon-links": "^8.2.6",
|
|
54099
|
-
"@storybook/addon-onboarding": "^8.2.6",
|
|
54100
|
-
"@storybook/blocks": "^8.2.6",
|
|
54101
|
-
"@storybook/react": "^8.2.6",
|
|
54102
|
-
"@storybook/react-vite": "^8.2.6",
|
|
54103
|
-
"@storybook/test": "^8.2.6",
|
|
54104
|
-
"@testing-library/dom": "^10.4.0",
|
|
54105
|
-
"@testing-library/react": "^16.2.0",
|
|
54106
|
-
"@types/eslint__js": "^8.42.3",
|
|
54107
|
-
"@types/pluralize": "^0.0.33",
|
|
54108
|
-
"@types/pngjs": "^6.0.5",
|
|
54109
|
-
"@types/react": "^19.0.10",
|
|
54110
|
-
"@types/react-dom": "^19.0.4",
|
|
54111
|
-
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
54112
|
-
"@typescript-eslint/parser": "^7.15.0",
|
|
54113
|
-
"@vitejs/plugin-react": "^4.3.1",
|
|
54114
|
-
buffer: "^6.0.3",
|
|
54115
|
-
"chain-registry": "^2.0.18",
|
|
54116
|
-
download: "^8.0.0",
|
|
54117
|
-
eslint: "^9.9.0",
|
|
54118
|
-
"eslint-config-prettier": "^9.1.0",
|
|
54119
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
54120
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
54121
|
-
"fs-extra": "^11.3.0",
|
|
54122
|
-
"node-polyfill-webpack-plugin": "^4.0.0",
|
|
54123
|
-
"pino-pretty": "^13.0.0",
|
|
54124
|
-
pixelmatch: "^7.1.0",
|
|
54125
|
-
pngjs: "^7.0.0",
|
|
54126
|
-
"postcss-loader": "^8.1.1",
|
|
54127
|
-
prettier: "^3.4.2",
|
|
54128
|
-
process: "^0.11.10",
|
|
54129
|
-
pureimage: "^0.4.18",
|
|
54130
|
-
"raw-loader": "^4.0.2",
|
|
54131
|
-
react: ">=17.0.0",
|
|
54132
|
-
"react-dom": ">=17.0.0",
|
|
54133
|
-
starknet: "6.11.0",
|
|
54134
|
-
storybook: "^8.2.6",
|
|
54135
|
-
"ts-loader": "^9.5.1",
|
|
54136
|
-
typescript: "^5.5.4",
|
|
54137
|
-
"typescript-eslint": "^8.2.0",
|
|
54138
|
-
"url-loader": "^4.1.1",
|
|
54139
|
-
vite: "^5.3.4",
|
|
54140
|
-
"vite-plugin-dts": "^4.0.0-beta.1",
|
|
54141
|
-
"vite-plugin-node-polyfills": "^0.22.0",
|
|
54142
|
-
webpack: "^5.94.0",
|
|
54143
|
-
"webpack-cli": "^5.1.4"
|
|
54144
|
-
};
|
|
54145
|
-
const peerDependencies = {
|
|
54146
|
-
"@tanstack/react-query": "^5.51.21",
|
|
54147
|
-
react: ">=17.0.0",
|
|
54148
|
-
"react-dom": ">=17.0.0",
|
|
54149
|
-
viem: "^2.21.55",
|
|
54150
|
-
wagmi: "^2.14.1"
|
|
54151
|
-
};
|
|
54152
|
-
const dependencies = {
|
|
54153
|
-
"@amplitude/analytics-browser": "^2.11.12",
|
|
54154
|
-
"@amplitude/plugin-session-replay-browser": "^1.16.5",
|
|
54155
|
-
"@cosmjs/amino": "0.33.1",
|
|
54156
|
-
"@cosmjs/cosmwasm-stargate": "0.33.1",
|
|
54157
|
-
"@cosmjs/encoding": "0.33.1",
|
|
54158
|
-
"@cosmjs/math": "0.33.1",
|
|
54159
|
-
"@cosmjs/proto-signing": "0.33.1",
|
|
54160
|
-
"@cosmjs/stargate": "0.33.1",
|
|
54161
|
-
"@ebay/nice-modal-react": "^1.2.13",
|
|
54162
|
-
"@eslint/compat": "^1.1.1",
|
|
54163
|
-
"@penumbra-zone/bech32m": "^13.0.0",
|
|
54164
|
-
"@penumbra-zone/client": "^24.0.0",
|
|
54165
|
-
"@penumbra-zone/protobuf": "^7.2.0",
|
|
54166
|
-
"@penumbra-zone/transport-dom": "^7.5.0",
|
|
54167
|
-
"@r2wc/react-to-web-component": "^2.0.3",
|
|
54168
|
-
"@skip-go/client": "workspace:^",
|
|
54169
|
-
"@solana/spl-token": "^0.4.8",
|
|
54170
|
-
"@solana/wallet-adapter-ledger": "^0.9.25",
|
|
54171
|
-
"@solana/wallet-adapter-react": "^0.15.39",
|
|
54172
|
-
"@solana/wallet-adapter-wallets": "^0.19.37",
|
|
54173
|
-
"@solana/web3.js": "^1.95.8",
|
|
54174
|
-
"@tanstack/query-core": "^5.51.21",
|
|
54175
|
-
"@walletconnect/modal": "^2.7.0",
|
|
54176
|
-
"@walletconnect/sign-client": "^2.20.3",
|
|
54177
|
-
"@walletconnect/solana-adapter": "^0.0.8",
|
|
54178
|
-
add: "^2.0.6",
|
|
54179
|
-
bech32: "^2.0.0",
|
|
54180
|
-
graz: "0.3.3",
|
|
54181
|
-
jotai: "^2.10.1",
|
|
54182
|
-
"jotai-effect": "^1.0.2",
|
|
54183
|
-
"jotai-tanstack-query": "^0.8.6",
|
|
54184
|
-
"lodash.debounce": "^4.0.8",
|
|
54185
|
-
pluralize: "^8.0.0",
|
|
54186
|
-
"rc-virtual-list": "^3.14.5",
|
|
54187
|
-
"react-error-boundary": "^4.0.13",
|
|
54188
|
-
"react-shadow-scope": "^1.0.5",
|
|
54189
|
-
"styled-components": "^6.1.13",
|
|
54190
|
-
uuid: "^11.1.0",
|
|
54191
|
-
yarn: "^1.22.22",
|
|
54192
|
-
zod: "^3.23.8"
|
|
54193
|
-
};
|
|
54194
|
-
const publishConfig = {
|
|
54195
|
-
access: "public"
|
|
54196
|
-
};
|
|
54197
|
-
const packageJson = {
|
|
54198
|
-
name,
|
|
54199
|
-
description,
|
|
54200
|
-
version,
|
|
54201
|
-
repository,
|
|
54202
|
-
type,
|
|
54203
|
-
scripts,
|
|
54204
|
-
exports,
|
|
54205
|
-
types,
|
|
54206
|
-
files,
|
|
54207
|
-
devDependencies,
|
|
54208
|
-
peerDependencies,
|
|
54209
|
-
dependencies,
|
|
54210
|
-
publishConfig
|
|
54211
|
-
};
|
|
54212
|
-
const initAmplitude = () => {
|
|
54213
|
-
init("14616a575f32087cf0403ab8f3ea3ce0", {
|
|
54214
|
-
appVersion: version
|
|
54215
|
-
});
|
|
54216
|
-
const plugin = sessionReplayPlugin({
|
|
54217
|
-
sampleRate: 1
|
|
54218
|
-
});
|
|
54219
|
-
add(plugin);
|
|
54220
|
-
};
|
|
54221
55322
|
const useInitWidget = (props) => {
|
|
54222
55323
|
var _a, _b;
|
|
54223
55324
|
if (props.enableAmplitudeAnalytics) {
|
|
@@ -54247,16 +55348,18 @@ const useInitWidget = (props) => {
|
|
|
54247
55348
|
const getSigners = useAtomValue(getConnectedSignersAtom);
|
|
54248
55349
|
const wallets = useAtomValue(walletsAtom);
|
|
54249
55350
|
const mergedSkipClientConfig = useMemo(() => {
|
|
54250
|
-
const { apiUrl, chainIdsToAffiliates, endpointOptions: endpointOptions2 } = props;
|
|
55351
|
+
const { apiUrl, chainIdsToAffiliates, endpointOptions: endpointOptions2, apiKey } = props;
|
|
54251
55352
|
const fromWidgetProps = {
|
|
54252
55353
|
apiUrl,
|
|
54253
55354
|
chainIdsToAffiliates,
|
|
54254
|
-
endpointOptions: endpointOptions2
|
|
55355
|
+
endpointOptions: endpointOptions2,
|
|
55356
|
+
apiKey
|
|
54255
55357
|
};
|
|
54256
55358
|
return {
|
|
54257
55359
|
apiUrl: fromWidgetProps.apiUrl ?? defaultSkipClientConfig.apiUrl,
|
|
54258
55360
|
endpointOptions: fromWidgetProps.endpointOptions ?? defaultSkipClientConfig.endpointOptions,
|
|
54259
|
-
chainIdsToAffiliates: fromWidgetProps.chainIdsToAffiliates ?? {}
|
|
55361
|
+
chainIdsToAffiliates: fromWidgetProps.chainIdsToAffiliates ?? {},
|
|
55362
|
+
apiKey: fromWidgetProps.apiKey
|
|
54260
55363
|
};
|
|
54261
55364
|
}, [props]);
|
|
54262
55365
|
const mergedTheme = useMemo(() => {
|
|
@@ -54488,6 +55591,50 @@ const getTransactionDetailsWithSimpleTransactionDetailsStatus = (transactionDeta
|
|
|
54488
55591
|
};
|
|
54489
55592
|
});
|
|
54490
55593
|
};
|
|
55594
|
+
const updateHistoryFromRouteDetailsToUserAddresses = () => {
|
|
55595
|
+
const { set } = jotaiStore;
|
|
55596
|
+
try {
|
|
55597
|
+
const transactionHistoryVersion = JSON.parse(
|
|
55598
|
+
localStorage.getItem(LOCAL_STORAGE_KEYS.transactionHistoryVersion) ?? "0"
|
|
55599
|
+
);
|
|
55600
|
+
const transactionHistory = JSON.parse(
|
|
55601
|
+
localStorage.getItem(LOCAL_STORAGE_KEYS.transactionHistory) ?? "[]"
|
|
55602
|
+
);
|
|
55603
|
+
if (!transactionHistory) {
|
|
55604
|
+
throw new Error("transactionHistory not found in localStorage");
|
|
55605
|
+
}
|
|
55606
|
+
if (transactionHistoryVersion === HISTORY_VERSION.routeDetails) {
|
|
55607
|
+
const updatedTransactionHistory = transactionHistory.map((txHistoryItem) => {
|
|
55608
|
+
const { senderAddress, receiverAddress, ...rest } = txHistoryItem;
|
|
55609
|
+
return {
|
|
55610
|
+
...rest,
|
|
55611
|
+
userAddresses: [
|
|
55612
|
+
{
|
|
55613
|
+
chainId: txHistoryItem.route.sourceAssetChainId,
|
|
55614
|
+
address: senderAddress
|
|
55615
|
+
},
|
|
55616
|
+
{
|
|
55617
|
+
chainId: txHistoryItem.route.destAssetChainId,
|
|
55618
|
+
address: receiverAddress
|
|
55619
|
+
}
|
|
55620
|
+
]
|
|
55621
|
+
};
|
|
55622
|
+
});
|
|
55623
|
+
localStorage.setItem(
|
|
55624
|
+
LOCAL_STORAGE_KEYS.transactionHistory,
|
|
55625
|
+
JSON.stringify(updatedTransactionHistory)
|
|
55626
|
+
);
|
|
55627
|
+
console.info(
|
|
55628
|
+
`updated from transactionHistoryVersion ${HISTORY_VERSION.routeDetails} to ${HISTORY_VERSION.userAddresses}`
|
|
55629
|
+
);
|
|
55630
|
+
set(transactionHistoryVersionAtom, HISTORY_VERSION.userAddresses);
|
|
55631
|
+
}
|
|
55632
|
+
} catch {
|
|
55633
|
+
console.warn(
|
|
55634
|
+
`Failed to update transactionHistoryVersion from ${HISTORY_VERSION.routeDetails} to ${HISTORY_VERSION.userAddresses}`
|
|
55635
|
+
);
|
|
55636
|
+
}
|
|
55637
|
+
};
|
|
54491
55638
|
const migrateOldLocalStorageValues = () => {
|
|
54492
55639
|
if (typeof window === "undefined") return;
|
|
54493
55640
|
const { set } = jotaiStore;
|
|
@@ -54528,6 +55675,7 @@ const migrateOldLocalStorageValues = () => {
|
|
|
54528
55675
|
}
|
|
54529
55676
|
});
|
|
54530
55677
|
updateHistoryFromCamelCaseToRouteDetails();
|
|
55678
|
+
updateHistoryFromRouteDetailsToUserAddresses();
|
|
54531
55679
|
};
|
|
54532
55680
|
function toCamelCase(obj) {
|
|
54533
55681
|
return convertKeys(obj, (key) => {
|