uniport-sdk 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -15
- package/dist/components/index.cjs +128 -56
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +128 -56
- package/dist/components/index.js.map +1 -1
- package/dist/core/index.cjs +140 -22
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +59 -11
- package/dist/core/index.d.ts +59 -11
- package/dist/core/index.js +119 -21
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +150 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +129 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -10,16 +10,22 @@ var TOKEN_ICONS = {
|
|
|
10
10
|
// Stablecoins
|
|
11
11
|
USDC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
|
|
12
12
|
USDT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
|
|
13
|
-
DAI: "https://
|
|
13
|
+
DAI: "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996",
|
|
14
|
+
USDT0: "https://coin-images.coingecko.com/coins/images/53705/large/usdt0.jpg?1737086183",
|
|
15
|
+
USDG: "https://coin-images.coingecko.com/coins/images/51281/large/GDN_USDG_Token_200x200.png?1730484111",
|
|
16
|
+
xDAI: "https://coin-images.coingecko.com/coins/images/11062/large/Identity-Primary-DarkBG.png?1696511004",
|
|
17
|
+
EURe: "https://coin-images.coingecko.com/coins/images/54303/large/eure.jpg?1739167959",
|
|
14
18
|
// Major tokens
|
|
15
19
|
ETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png",
|
|
16
20
|
WETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
|
|
17
21
|
BTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png",
|
|
18
22
|
WBTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",
|
|
23
|
+
cbBTC: "https://coin-images.coingecko.com/coins/images/40143/large/cbbtc.webp?1726136727",
|
|
19
24
|
// L1s & L2s
|
|
20
25
|
SUI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/sui/info/logo.png",
|
|
21
26
|
SOL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png",
|
|
22
27
|
NEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png",
|
|
28
|
+
wNEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png",
|
|
23
29
|
ARB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png",
|
|
24
30
|
OP: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/info/logo.png",
|
|
25
31
|
POL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/polygon/info/logo.png",
|
|
@@ -33,23 +39,30 @@ var TOKEN_ICONS = {
|
|
|
33
39
|
LTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png",
|
|
34
40
|
BCH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png",
|
|
35
41
|
TON: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ton/info/logo.png",
|
|
42
|
+
GRAM: "https://coin-images.coingecko.com/coins/images/17980/large/Gram_Circular_Badge.png?1781524778",
|
|
36
43
|
TRX: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/tron/info/logo.png",
|
|
37
44
|
XLM: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/stellar/info/logo.png",
|
|
38
45
|
APT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png",
|
|
46
|
+
DASH: "https://coin-images.coingecko.com/coins/images/19/large/dash-logo.png?1696501423",
|
|
47
|
+
XPL: "https://coin-images.coingecko.com/coins/images/66489/large/Plasma-symbol-green-1.png?1755142558",
|
|
48
|
+
ADI: "https://coin-images.coingecko.com/coins/images/68846/large/ADI_Token-min.png?1765296433",
|
|
39
49
|
// DeFi & Others
|
|
40
|
-
AAVE: "https://
|
|
50
|
+
AAVE: "https://coin-images.coingecko.com/coins/images/12645/large/aave-token-round.png?1720472354",
|
|
51
|
+
GMX: "https://coin-images.coingecko.com/coins/images/18323/large/arbit.png?1696517814",
|
|
52
|
+
SAFE: "https://coin-images.coingecko.com/coins/images/27032/large/Artboard_1_copy_8circle-1.png?1696526084",
|
|
53
|
+
COW: "https://coin-images.coingecko.com/coins/images/24384/large/CoW-token_logo.png?1719524382",
|
|
41
54
|
UNI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/logo.png",
|
|
42
55
|
LINK: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x514910771AF9Ca656af840dff83E8264EcF986CA/logo.png",
|
|
43
56
|
SHIB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE/logo.png",
|
|
44
57
|
PEPE: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6982508145454Ce325dDbE47a25d4ec3d2311933/logo.png",
|
|
45
58
|
// Ecosystem tokens
|
|
46
59
|
STRK: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png",
|
|
47
|
-
BERA: "https://
|
|
48
|
-
GNO: "https://
|
|
49
|
-
MON: "https://
|
|
60
|
+
BERA: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008",
|
|
61
|
+
GNO: "https://coin-images.coingecko.com/coins/images/662/large/logo_square_simple_300px.png?1696501854",
|
|
62
|
+
MON: "https://coin-images.coingecko.com/coins/images/38927/large/mon.png?1766029057",
|
|
50
63
|
ZEC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png",
|
|
51
64
|
// Meme coins
|
|
52
|
-
|
|
65
|
+
CASHCAT: "https://coin-images.coingecko.com/coins/images/102174280/large/cashcat-logo.jpg?1782922765",
|
|
53
66
|
WIF: "https://s2.coinmarketcap.com/static/img/coins/64x64/28752.png",
|
|
54
67
|
BRETT: "https://s2.coinmarketcap.com/static/img/coins/64x64/29743.png",
|
|
55
68
|
TURBO: "https://s2.coinmarketcap.com/static/img/coins/64x64/24911.png",
|
|
@@ -75,14 +88,20 @@ var CHAIN_ICONS = {
|
|
|
75
88
|
aptos: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png",
|
|
76
89
|
gnosis: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/xdai/info/logo.png",
|
|
77
90
|
starknet: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png",
|
|
78
|
-
bera: "https://
|
|
79
|
-
monad: "https://
|
|
91
|
+
bera: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008",
|
|
92
|
+
monad: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/monad/info/logo.png",
|
|
80
93
|
doge: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/doge/info/logo.png",
|
|
81
94
|
ltc: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png",
|
|
82
95
|
bch: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png",
|
|
83
96
|
xrp: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ripple/info/logo.png",
|
|
84
97
|
zec: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png",
|
|
85
|
-
scroll: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/scroll/info/logo.png"
|
|
98
|
+
scroll: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/scroll/info/logo.png",
|
|
99
|
+
hypercore: "https://coin-images.coingecko.com/asset_platforms/images/243/large/hyperliquid.png?1713924434",
|
|
100
|
+
plasma: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/plasma/info/logo.png",
|
|
101
|
+
hood: "https://coin-images.coingecko.com/asset_platforms/images/102132299/large/robinhood.png?1782921203",
|
|
102
|
+
xlayer: "https://coin-images.coingecko.com/asset_platforms/images/238/large/x_logo.jpeg?1713243242",
|
|
103
|
+
dash: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/dash/info/logo.png",
|
|
104
|
+
adi: "https://coin-images.coingecko.com/asset_platforms/images/102132311/large/adi-chain.png?1788338099"
|
|
86
105
|
};
|
|
87
106
|
var EVM_CHAINS = [
|
|
88
107
|
"eth",
|
|
@@ -95,11 +114,18 @@ var EVM_CHAINS = [
|
|
|
95
114
|
"gnosis",
|
|
96
115
|
"bera",
|
|
97
116
|
"monad",
|
|
98
|
-
"scroll"
|
|
117
|
+
"scroll",
|
|
118
|
+
"plasma",
|
|
119
|
+
"hood",
|
|
120
|
+
"xlayer",
|
|
121
|
+
"adi"
|
|
99
122
|
];
|
|
100
123
|
function isEvmChain(chain) {
|
|
101
124
|
return EVM_CHAINS.includes(chain);
|
|
102
125
|
}
|
|
126
|
+
function usesEvmAddress(chain) {
|
|
127
|
+
return isEvmChain(chain) || chain === "hypercore";
|
|
128
|
+
}
|
|
103
129
|
var CHAINS_REQUIRING_MEMO = ["stellar"];
|
|
104
130
|
function needsMemoDeposit(chain) {
|
|
105
131
|
return CHAINS_REQUIRING_MEMO.includes(chain);
|
|
@@ -130,7 +156,13 @@ var EXPLORER_TX_URLS = {
|
|
|
130
156
|
bch: (h) => `https://blockchair.com/bitcoin-cash/transaction/${h}`,
|
|
131
157
|
xrp: (h) => `https://xrpscan.com/tx/${h}`,
|
|
132
158
|
zec: (h) => `https://blockchair.com/zcash/transaction/${h}`,
|
|
133
|
-
scroll: (h) => `https://scrollscan.com/tx/${h}
|
|
159
|
+
scroll: (h) => `https://scrollscan.com/tx/${h}`,
|
|
160
|
+
hypercore: (h) => `https://app.hyperliquid.xyz/explorer/tx/${h}`,
|
|
161
|
+
plasma: (h) => `https://plasmascan.to/tx/${h}`,
|
|
162
|
+
hood: (h) => `https://robinhoodchain.blockscout.com/tx/${h}`,
|
|
163
|
+
xlayer: (h) => `https://www.oklink.com/x-layer/tx/${h}`,
|
|
164
|
+
dash: (h) => `https://insight.dash.org/insight/tx/${h}`,
|
|
165
|
+
adi: (h) => `https://explorer.adifoundation.ai/tx/${h}`
|
|
134
166
|
};
|
|
135
167
|
function getExplorerTxUrl(chain, hash) {
|
|
136
168
|
return EXPLORER_TX_URLS[chain]?.(hash);
|
|
@@ -140,7 +172,7 @@ function createToken(chain, symbol, assetId, decimals, contractAddress, options)
|
|
|
140
172
|
const canonicalPrefix = TOKEN_NAME_PREFIXES[chain] || chain;
|
|
141
173
|
const legacyName = `${chain}${normalizedSymbol}`;
|
|
142
174
|
const name = options?.name || `${canonicalPrefix}${normalizedSymbol}`;
|
|
143
|
-
const icon = TOKEN_ICONS[symbol] || TOKEN_ICONS.DEFAULT;
|
|
175
|
+
const icon = TOKEN_ICONS[symbol] || TOKEN_ICONS[normalizedSymbol] || TOKEN_ICONS.DEFAULT;
|
|
144
176
|
const chainIcon = CHAIN_ICONS[chain];
|
|
145
177
|
const aliases = new Set(options?.aliases || []);
|
|
146
178
|
if (legacyName !== name) {
|
|
@@ -170,7 +202,9 @@ var TOKEN_NAME_PREFIXES = {
|
|
|
170
202
|
ltc: "litecoin",
|
|
171
203
|
bch: "bitcoinCash",
|
|
172
204
|
bera: "berachain",
|
|
173
|
-
zec: "zcash"
|
|
205
|
+
zec: "zcash",
|
|
206
|
+
hypercore: "hyperliquid",
|
|
207
|
+
hood: "robinhood"
|
|
174
208
|
};
|
|
175
209
|
var suiSUI = createToken("sui", "SUI", "nep141:sui.omft.near", 9);
|
|
176
210
|
var suiUSDC = createToken("sui", "USDC", "nep141:sui-c1b81ecaf27933252d31a963bc5e9458f13c18ce.omft.near", 6, "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC");
|
|
@@ -188,7 +222,10 @@ var ethereumTURBO = createToken("eth", "TURBO", "nep141:eth-0xa35923162c49cf95e6
|
|
|
188
222
|
var ethereumSAFE = createToken("eth", "SAFE", "nep141:eth-0x5afe3855358e112b5647b952709e6165e1c1eeee.omft.near", 18, "0x5afe3855358e112b5647b952709e6165e1c1eeee");
|
|
189
223
|
var arbitrumETH = createToken("arb", "ETH", "nep141:arb.omft.near", 18);
|
|
190
224
|
var arbitrumUSDC = createToken("arb", "USDC", "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near", 6, "0xaf88d065e77c8cc2239327c5edb3a432268e5831");
|
|
191
|
-
var arbitrumUSDT = createToken("arb", "
|
|
225
|
+
var arbitrumUSDT = createToken("arb", "USDT0", "nep141:arb-0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9.omft.near", 6, "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", {
|
|
226
|
+
name: "arbitrumUSDT",
|
|
227
|
+
aliases: ["arbUSDT", "arbitrumUSDT0"]
|
|
228
|
+
});
|
|
192
229
|
var arbitrumARB = createToken("arb", "ARB", "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near", 18, "0x912ce59144191c1204e64559fe8253a0e49e6548");
|
|
193
230
|
var arbitrumGMX = createToken("arb", "GMX", "nep141:arb-0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a.omft.near", 18, "0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a");
|
|
194
231
|
var baseETH = createToken("base", "ETH", "nep141:base.omft.near", 18);
|
|
@@ -204,9 +241,7 @@ var optimismOP = createToken("op", "OP", "nep245:v2_1.omni.hot.tg:10_vLAiSt9KfUG
|
|
|
204
241
|
var solanaSOL = createToken("sol", "SOL", "nep141:sol.omft.near", 9);
|
|
205
242
|
var solanaUSDC = createToken("sol", "USDC", "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", 6, "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
|
|
206
243
|
var solanaUSDT = createToken("sol", "USDT", "nep141:sol-c800a4bd850783ccb82c2b2c7e84175443606352.omft.near", 6, "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB");
|
|
207
|
-
var solanaTRUMP = createToken("sol", "TRUMP", "nep141:sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near", 6, "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN");
|
|
208
244
|
var solanaWIF = createToken("sol", "$WIF", "nep141:sol-b9c68f94ec8fd160137af8cdfe5e61cd68e2afba.omft.near", 6, "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm");
|
|
209
|
-
var solanaMELANIA = createToken("sol", "MELANIA", "nep141:sol-d600e625449a4d9380eaf5e3265e54c90d34e260.omft.near", 6, "FUAfBo2jgks6gB4Z4LfZkqSZgzNucisEHqnNebaRxM1P");
|
|
210
245
|
var bitcoinBTC = createToken("btc", "BTC", "nep141:btc.omft.near", 8);
|
|
211
246
|
var polygonPOL = createToken("pol", "POL", "nep245:v2_1.omni.hot.tg:137_11111111111111111111", 18);
|
|
212
247
|
var polygonUSDC = createToken("pol", "USDC", "nep245:v2_1.omni.hot.tg:137_qiStmoQJDQPTebaPjgx5VBxZv6L", 6, "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359");
|
|
@@ -217,7 +252,10 @@ var avalancheUSDT = createToken("avax", "USDT", "nep245:v2_1.omni.hot.tg:43114_3
|
|
|
217
252
|
var bscBNB = createToken("bsc", "BNB", "nep245:v2_1.omni.hot.tg:56_11111111111111111111", 18);
|
|
218
253
|
var bscUSDC = createToken("bsc", "USDC", "nep245:v2_1.omni.hot.tg:56_2w93GqMcEmQFDru84j3HZZWt557r", 18, "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d");
|
|
219
254
|
var bscUSDT = createToken("bsc", "USDT", "nep245:v2_1.omni.hot.tg:56_2CMMyVTGZkeyNZTSvS5sarzfir6g", 18, "0x55d398326f99059ff775485246999027b3197955");
|
|
220
|
-
var tonTON = createToken("ton", "
|
|
255
|
+
var tonTON = createToken("ton", "GRAM", "nep245:v2_1.omni.hot.tg:1117_", 9, void 0, {
|
|
256
|
+
name: "tonTON",
|
|
257
|
+
aliases: ["tonGRAM"]
|
|
258
|
+
});
|
|
221
259
|
var tonUSDT = createToken("ton", "USDT", "nep245:v2_1.omni.hot.tg:1117_3tsdfyziyc7EJbP2aULWSKU4toBaAcN4FdTgfm5W1mC4ouR", 6, "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs");
|
|
222
260
|
var tronTRX = createToken("tron", "TRX", "nep141:tron.omft.near", 6);
|
|
223
261
|
var tronUSDT = createToken("tron", "USDT", "nep141:tron-d28a265909efecdcee7c5028585214ea0b96f015.omft.near", 6, "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t");
|
|
@@ -238,6 +276,30 @@ var nearNEAR = createToken("near", "wNEAR", "nep141:wrap.near", 24, "wrap.near",
|
|
|
238
276
|
});
|
|
239
277
|
var nearUSDC = createToken("near", "USDC", "nep141:17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1", 6, "17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1");
|
|
240
278
|
var nearUSDT = createToken("near", "USDT", "nep141:usdt.tether-token.near", 6, "usdt.tether-token.near");
|
|
279
|
+
var gnosisUSDC = createToken("gnosis", "USDC", "nep141:gnosis-0x2a22f9c3b484c3629090feed35f17ff8f88f76f0.omft.near", 6, "0x2a22f9c3b484c3629090feed35f17ff8f88f76f0");
|
|
280
|
+
var gnosisUSDT = createToken("gnosis", "USDT", "nep141:gnosis-0x4ecaba5870353805a9f068101a40e0f32ed605c6.omft.near", 6, "0x4ecaba5870353805a9f068101a40e0f32ed605c6");
|
|
281
|
+
var gnosisXDAI = createToken("gnosis", "xDAI", "nep141:gnosis.omft.near", 18, void 0, { name: "gnosisXDAI" });
|
|
282
|
+
var gnosisEURe = createToken("gnosis", "EURe", "nep141:gnosis-0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430.omft.near", 18, "0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430");
|
|
283
|
+
var gnosisGNO = createToken("gnosis", "GNO", "nep141:gnosis-0x9c58bacc331c9aa871afd802db6379a98e80cedb.omft.near", 18, "0x9c58bacc331c9aa871afd802db6379a98e80cedb");
|
|
284
|
+
var gnosisCOW = createToken("gnosis", "COW", "nep141:gnosis-0x177127622c4a00f3d409b75571e12cb3c8973d3c.omft.near", 18, "0x177127622c4a00f3d409b75571e12cb3c8973d3c");
|
|
285
|
+
var gnosisWETH = createToken("gnosis", "WETH", "nep141:gnosis-0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1.omft.near", 18, "0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1");
|
|
286
|
+
var hyperliquidUSDC = createToken("hypercore", "USDC", "1cs_v1:hypercore:hip1:0x6d1e7cde53ba9467b783cb7c530ce054", 8, "0x6d1e7cde53ba9467b783cb7c530ce054");
|
|
287
|
+
var hyperliquidNEAR = createToken("hypercore", "wNEAR", "1cs_v1:hypercore:hip1:0x20b8c9d2f022ffd2aea4f7962b7b1d8b", 8, "0x20b8c9d2f022ffd2aea4f7962b7b1d8b", {
|
|
288
|
+
name: "hyperliquidNEAR",
|
|
289
|
+
aliases: ["hyperliquidwNEAR"]
|
|
290
|
+
});
|
|
291
|
+
var plasmaUSDT0 = createToken("plasma", "USDT0", "nep141:plasma-0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb.omft.near", 6, "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb");
|
|
292
|
+
var plasmaXPL = createToken("plasma", "XPL", "nep141:plasma.omft.near", 18);
|
|
293
|
+
var monadMON = createToken("monad", "MON", "nep245:v2_1.omni.hot.tg:143_11111111111111111111", 18);
|
|
294
|
+
var monadUSDC = createToken("monad", "USDC", "nep245:v2_1.omni.hot.tg:143_2dmLwYWkCQKyTjeUPAsGJuiVLbFx", 6, "0x754704bc059f8c67012fed69bc8a327a5aafb603");
|
|
295
|
+
var monadUSDT0 = createToken("monad", "USDT0", "nep245:v2_1.omni.hot.tg:143_4EJiJxSALvGoTZbnc8K7Ft9533et", 6, "0xe7cd86e13ac4309349f30b3435a9d337750fc82d");
|
|
296
|
+
var robinhoodETH = createToken("hood", "ETH", "nep141:hood.omft.near", 18);
|
|
297
|
+
var robinhoodUSDG = createToken("hood", "USDG", "nep141:hood-0x5fc5360d0400a0fd4f2af552add042d716f1d168.omft.near", 6, "0x5fc5360d0400a0fd4f2af552add042d716f1d168");
|
|
298
|
+
var robinhoodCASHCAT = createToken("hood", "CASHCAT", "nep141:hood-0x020bfc650a365f8bb26819deaabf3e21291018b4.omft.near", 18, "0x020bfc650a365f8bb26819deaabf3e21291018b4");
|
|
299
|
+
var xlayerUSDC = createToken("xlayer", "USDC", "nep245:v2_1.omni.hot.tg:196_2dK9kLNR7Ekq7su8FxNGiUW3djTw", 6, "0x74b7f16337b8972027f6196a17a631ac6de26d22");
|
|
300
|
+
var xlayerUSDT0 = createToken("xlayer", "USDT0", "nep245:v2_1.omni.hot.tg:196_2fezDCvVYRsG8wrK6deJ2VRPiAS1", 6, "0x779ded0c9e1022225f8e0630b35a9b54be713736");
|
|
301
|
+
var dashDASH = createToken("dash", "DASH", "nep141:dash.omft.near", 8);
|
|
302
|
+
var adiADI = createToken("adi", "ADI", "nep245:v2_1.omni.hot.tg:36900_11111111111111111111", 18);
|
|
241
303
|
var CHAINS = {
|
|
242
304
|
stellar: {
|
|
243
305
|
id: "stellar",
|
|
@@ -279,7 +341,7 @@ var CHAINS = {
|
|
|
279
341
|
id: "sol",
|
|
280
342
|
name: "Solana",
|
|
281
343
|
icon: CHAIN_ICONS.sol,
|
|
282
|
-
tokens: [solanaSOL, solanaUSDC, solanaUSDT,
|
|
344
|
+
tokens: [solanaSOL, solanaUSDC, solanaUSDT, solanaWIF]
|
|
283
345
|
},
|
|
284
346
|
btc: {
|
|
285
347
|
id: "btc",
|
|
@@ -381,19 +443,55 @@ var CHAINS = {
|
|
|
381
443
|
id: "gnosis",
|
|
382
444
|
name: "Gnosis",
|
|
383
445
|
icon: CHAIN_ICONS.gnosis,
|
|
384
|
-
tokens: []
|
|
446
|
+
tokens: [gnosisUSDC, gnosisUSDT, gnosisXDAI, gnosisEURe, gnosisGNO, gnosisCOW, gnosisWETH]
|
|
385
447
|
},
|
|
386
448
|
monad: {
|
|
387
449
|
id: "monad",
|
|
388
450
|
name: "Monad",
|
|
389
451
|
icon: CHAIN_ICONS.monad,
|
|
390
|
-
tokens: []
|
|
452
|
+
tokens: [monadMON, monadUSDC, monadUSDT0]
|
|
391
453
|
},
|
|
392
454
|
scroll: {
|
|
393
455
|
id: "scroll",
|
|
394
456
|
name: "Scroll",
|
|
395
457
|
icon: CHAIN_ICONS.scroll,
|
|
396
458
|
tokens: [scrollETH, scrollUSDT]
|
|
459
|
+
},
|
|
460
|
+
hypercore: {
|
|
461
|
+
id: "hypercore",
|
|
462
|
+
name: "Hyperliquid",
|
|
463
|
+
icon: CHAIN_ICONS.hypercore,
|
|
464
|
+
tokens: [hyperliquidUSDC, hyperliquidNEAR]
|
|
465
|
+
},
|
|
466
|
+
plasma: {
|
|
467
|
+
id: "plasma",
|
|
468
|
+
name: "Plasma",
|
|
469
|
+
icon: CHAIN_ICONS.plasma,
|
|
470
|
+
tokens: [plasmaUSDT0, plasmaXPL]
|
|
471
|
+
},
|
|
472
|
+
hood: {
|
|
473
|
+
id: "hood",
|
|
474
|
+
name: "Robinhood Chain",
|
|
475
|
+
icon: CHAIN_ICONS.hood,
|
|
476
|
+
tokens: [robinhoodETH, robinhoodUSDG, robinhoodCASHCAT]
|
|
477
|
+
},
|
|
478
|
+
xlayer: {
|
|
479
|
+
id: "xlayer",
|
|
480
|
+
name: "X Layer",
|
|
481
|
+
icon: CHAIN_ICONS.xlayer,
|
|
482
|
+
tokens: [xlayerUSDC, xlayerUSDT0]
|
|
483
|
+
},
|
|
484
|
+
dash: {
|
|
485
|
+
id: "dash",
|
|
486
|
+
name: "Dash",
|
|
487
|
+
icon: CHAIN_ICONS.dash,
|
|
488
|
+
tokens: [dashDASH]
|
|
489
|
+
},
|
|
490
|
+
adi: {
|
|
491
|
+
id: "adi",
|
|
492
|
+
name: "ADI Chain",
|
|
493
|
+
icon: CHAIN_ICONS.adi,
|
|
494
|
+
tokens: [adiADI]
|
|
397
495
|
}
|
|
398
496
|
};
|
|
399
497
|
var ALL_TOKENS = Object.values(CHAINS).flatMap((chain) => chain.tokens);
|
|
@@ -739,7 +837,7 @@ function useUniportPayment(options) {
|
|
|
739
837
|
cancelled = true;
|
|
740
838
|
};
|
|
741
839
|
}, []);
|
|
742
|
-
const effectiveRefundAddress = swapType === "EXACT_OUTPUT" ? "" : refundAddress.trim() || (selectedChain &&
|
|
840
|
+
const effectiveRefundAddress = swapType === "EXACT_OUTPUT" ? "" : refundAddress.trim() || (selectedChain && usesEvmAddress(selectedChain.id) ? evmDefaultRefundAddress : "");
|
|
743
841
|
const pollingRef = useRef(null);
|
|
744
842
|
const lastStatusRef = useRef(null);
|
|
745
843
|
const previewDebounceRef = useRef(null);
|
|
@@ -807,7 +905,7 @@ function useUniportPayment(options) {
|
|
|
807
905
|
const setRefundAddress = useCallback(
|
|
808
906
|
(newRefundAddress) => {
|
|
809
907
|
setRefundAddressState(newRefundAddress);
|
|
810
|
-
const nextEffective = newRefundAddress.trim() || (selectedChain &&
|
|
908
|
+
const nextEffective = newRefundAddress.trim() || (selectedChain && usesEvmAddress(selectedChain.id) ? evmDefaultRefundAddress : "");
|
|
811
909
|
schedulePreviewQuote(amount, nextEffective, selectedToken);
|
|
812
910
|
},
|
|
813
911
|
[amount, evmDefaultRefundAddress, schedulePreviewQuote, selectedChain, selectedToken]
|
|
@@ -817,7 +915,7 @@ function useUniportPayment(options) {
|
|
|
817
915
|
setSelectedChain(chain);
|
|
818
916
|
setSelectedToken(nextToken);
|
|
819
917
|
setPaymentState("selecting");
|
|
820
|
-
const nextEffective = refundAddress.trim() || (
|
|
918
|
+
const nextEffective = refundAddress.trim() || (usesEvmAddress(chain.id) ? evmDefaultRefundAddress : "");
|
|
821
919
|
schedulePreviewQuote(amount, nextEffective, nextToken);
|
|
822
920
|
}, [amount, evmDefaultRefundAddress, refundAddress, schedulePreviewQuote]);
|
|
823
921
|
const handleTokenSelect = useCallback((token) => {
|
|
@@ -1188,34 +1286,7 @@ function formatPreviewError(error) {
|
|
|
1188
1286
|
return "Could not fetch estimate. Check the details and try again.";
|
|
1189
1287
|
}
|
|
1190
1288
|
function formatChainLabel(chainId) {
|
|
1191
|
-
|
|
1192
|
-
sui: "Sui",
|
|
1193
|
-
eth: "Ethereum",
|
|
1194
|
-
sol: "Solana",
|
|
1195
|
-
arb: "Arbitrum",
|
|
1196
|
-
base: "Base",
|
|
1197
|
-
op: "Optimism",
|
|
1198
|
-
pol: "Polygon",
|
|
1199
|
-
avax: "Avalanche",
|
|
1200
|
-
bsc: "BNB Chain",
|
|
1201
|
-
near: "NEAR",
|
|
1202
|
-
btc: "Bitcoin",
|
|
1203
|
-
ton: "TON",
|
|
1204
|
-
tron: "Tron",
|
|
1205
|
-
stellar: "Stellar",
|
|
1206
|
-
cardano: "Cardano",
|
|
1207
|
-
xrp: "XRP Ledger",
|
|
1208
|
-
doge: "Dogecoin",
|
|
1209
|
-
ltc: "Litecoin",
|
|
1210
|
-
bch: "Bitcoin Cash",
|
|
1211
|
-
aptos: "Aptos",
|
|
1212
|
-
starknet: "Starknet",
|
|
1213
|
-
bera: "Berachain",
|
|
1214
|
-
zec: "Zcash",
|
|
1215
|
-
gnosis: "Gnosis",
|
|
1216
|
-
monad: "Monad"
|
|
1217
|
-
};
|
|
1218
|
-
return labels[chainId] || chainId.toUpperCase();
|
|
1289
|
+
return CHAINS[chainId]?.name ?? chainId.toUpperCase();
|
|
1219
1290
|
}
|
|
1220
1291
|
function UniportModal({
|
|
1221
1292
|
open,
|
|
@@ -1475,7 +1546,7 @@ function UniportModal({
|
|
|
1475
1546
|
"\u2192 ",
|
|
1476
1547
|
payment.destinationToken.symbol,
|
|
1477
1548
|
" on ",
|
|
1478
|
-
payment.destinationToken.chain
|
|
1549
|
+
formatChainLabel(payment.destinationToken.chain)
|
|
1479
1550
|
] })
|
|
1480
1551
|
] })
|
|
1481
1552
|
] }),
|
|
@@ -1522,7 +1593,7 @@ function UniportModal({
|
|
|
1522
1593
|
children: [
|
|
1523
1594
|
"Refund address on ",
|
|
1524
1595
|
ch?.name || "the source chain",
|
|
1525
|
-
ch &&
|
|
1596
|
+
ch && usesEvmAddress(ch.id) && /* @__PURE__ */ jsx("span", { style: { fontWeight: 400, color: t.textMuted }, children: " (optional)" })
|
|
1526
1597
|
]
|
|
1527
1598
|
}
|
|
1528
1599
|
),
|
|
@@ -1532,7 +1603,7 @@ function UniportModal({
|
|
|
1532
1603
|
type: "text",
|
|
1533
1604
|
value: payment.refundAddress,
|
|
1534
1605
|
onChange: (e) => payment.setRefundAddress(e.target.value),
|
|
1535
|
-
placeholder: ch &&
|
|
1606
|
+
placeholder: ch && usesEvmAddress(ch.id) ? `Optional \u2014 defaults to ${UNIPORT_ENS_NAME}` : `Enter a ${ch?.name || "source chain"} refund address`,
|
|
1536
1607
|
spellCheck: false,
|
|
1537
1608
|
autoCapitalize: "off",
|
|
1538
1609
|
autoCorrect: "off",
|
|
@@ -1842,6 +1913,7 @@ function UniportModal({
|
|
|
1842
1913
|
] }) })
|
|
1843
1914
|
] });
|
|
1844
1915
|
};
|
|
1916
|
+
const txUrl = (reported, chain, hash) => reported?.startsWith("https://") ? reported : chain ? getExplorerTxUrl(chain, hash) : void 0;
|
|
1845
1917
|
const renderTxHash = (hash, url) => url ? /* @__PURE__ */ jsxs(
|
|
1846
1918
|
"a",
|
|
1847
1919
|
{
|
|
@@ -1931,14 +2003,14 @@ function UniportModal({
|
|
|
1931
2003
|
"Source TX \xB7 ",
|
|
1932
2004
|
payment.selectedChain?.name
|
|
1933
2005
|
] }),
|
|
1934
|
-
renderTxHash(hash, payment.
|
|
2006
|
+
renderTxHash(hash, txUrl(payment.status?.originTxExplorerUrls?.[i], payment.selectedChain?.id, hash))
|
|
1935
2007
|
] }, `o${i}`)),
|
|
1936
2008
|
payment.status?.destinationTxHashes?.map((hash, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
1937
2009
|
/* @__PURE__ */ jsxs("p", { style: { color: t.textMuted, fontSize: "11px", margin: "0 0 3px", textTransform: "uppercase", letterSpacing: "0.05em" }, children: [
|
|
1938
2010
|
"Destination TX \xB7 ",
|
|
1939
2011
|
CHAINS[payment.destinationToken.chain].name
|
|
1940
2012
|
] }),
|
|
1941
|
-
renderTxHash(hash,
|
|
2013
|
+
renderTxHash(hash, txUrl(payment.status?.destinationTxExplorerUrls?.[i], payment.destinationToken.chain, hash))
|
|
1942
2014
|
] }, `d${i}`)),
|
|
1943
2015
|
!payment.status?.originTxHashes?.length && !payment.status?.destinationTxHashes?.length && /* @__PURE__ */ jsx("p", { style: { color: t.textMuted, fontSize: "13px", margin: 0 }, children: "Loading transaction details\u2026" })
|
|
1944
2016
|
] }),
|