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/README.md
CHANGED
|
@@ -63,8 +63,8 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
63
63
|
|
|
64
64
|
| Chain | Token Name | Symbol |
|
|
65
65
|
|-------|------------|--------|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
66
|
+
| Stellar | `stellarXLM` | XLM |
|
|
67
|
+
| Stellar | `stellarUSDC` | USDC |
|
|
68
68
|
| Ethereum | `ethereumETH` | ETH |
|
|
69
69
|
| Ethereum | `ethereumUSDC` | USDC |
|
|
70
70
|
| Ethereum | `ethereumUSDT` | USDT |
|
|
@@ -77,28 +77,26 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
77
77
|
| Ethereum | `ethereumPEPE` | PEPE |
|
|
78
78
|
| Ethereum | `ethereumTURBO` | TURBO |
|
|
79
79
|
| Ethereum | `ethereumSAFE` | SAFE |
|
|
80
|
-
| Solana | `solanaSOL` | SOL |
|
|
81
|
-
| Solana | `solanaUSDC` | USDC |
|
|
82
|
-
| Solana | `solanaUSDT` | USDT |
|
|
83
|
-
| Solana | `solanaTRUMP` | TRUMP |
|
|
84
|
-
| Solana | `solanaWIF` | $WIF |
|
|
85
|
-
| Solana | `solanaMELANIA` | MELANIA |
|
|
86
|
-
| Bitcoin | `bitcoinBTC` | BTC |
|
|
87
80
|
| Arbitrum | `arbitrumETH` | ETH |
|
|
88
81
|
| Arbitrum | `arbitrumUSDC` | USDC |
|
|
89
|
-
| Arbitrum | `arbitrumUSDT` |
|
|
82
|
+
| Arbitrum | `arbitrumUSDT` | USDT0 |
|
|
90
83
|
| Arbitrum | `arbitrumARB` | ARB |
|
|
91
84
|
| Arbitrum | `arbitrumGMX` | GMX |
|
|
92
85
|
| Base | `baseETH` | ETH |
|
|
93
86
|
| Base | `baseUSDC` | USDC |
|
|
94
87
|
| Base | `baseCbBTC` | cbBTC |
|
|
95
88
|
| Base | `baseBRETT` | BRETT |
|
|
96
|
-
|
|
|
97
|
-
|
|
|
89
|
+
| Sui | `suiSUI` | SUI |
|
|
90
|
+
| Sui | `suiUSDC` | USDC |
|
|
98
91
|
| Optimism | `optimismETH` | ETH |
|
|
99
92
|
| Optimism | `optimismUSDC` | USDC |
|
|
100
93
|
| Optimism | `optimismUSDT` | USDT |
|
|
101
94
|
| Optimism | `optimismOP` | OP |
|
|
95
|
+
| Solana | `solanaSOL` | SOL |
|
|
96
|
+
| Solana | `solanaUSDC` | USDC |
|
|
97
|
+
| Solana | `solanaUSDT` | USDT |
|
|
98
|
+
| Solana | `solanaWIF` | $WIF |
|
|
99
|
+
| Bitcoin | `bitcoinBTC` | BTC |
|
|
102
100
|
| Polygon | `polygonPOL` | POL |
|
|
103
101
|
| Polygon | `polygonUSDC` | USDC |
|
|
104
102
|
| Polygon | `polygonUSDT` | USDT |
|
|
@@ -108,7 +106,7 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
108
106
|
| BNB Chain | `bscBNB` | BNB |
|
|
109
107
|
| BNB Chain | `bscUSDC` | USDC |
|
|
110
108
|
| BNB Chain | `bscUSDT` | USDT |
|
|
111
|
-
| TON | `tonTON` |
|
|
109
|
+
| TON | `tonTON` | GRAM |
|
|
112
110
|
| TON | `tonUSDT` | USDT |
|
|
113
111
|
| Tron | `tronTRX` | TRX |
|
|
114
112
|
| Tron | `tronUSDT` | USDT |
|
|
@@ -124,8 +122,29 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
124
122
|
| Starknet | `starknetSTRK` | STRK |
|
|
125
123
|
| Berachain | `berachainBERA` | BERA |
|
|
126
124
|
| Zcash | `zcashZEC` | ZEC |
|
|
127
|
-
|
|
|
128
|
-
|
|
|
125
|
+
| Gnosis | `gnosisUSDC` | USDC |
|
|
126
|
+
| Gnosis | `gnosisUSDT` | USDT |
|
|
127
|
+
| Gnosis | `gnosisXDAI` | xDAI |
|
|
128
|
+
| Gnosis | `gnosisEURe` | EURe |
|
|
129
|
+
| Gnosis | `gnosisGNO` | GNO |
|
|
130
|
+
| Gnosis | `gnosisCOW` | COW |
|
|
131
|
+
| Gnosis | `gnosisWETH` | WETH |
|
|
132
|
+
| Monad | `monadMON` | MON |
|
|
133
|
+
| Monad | `monadUSDC` | USDC |
|
|
134
|
+
| Monad | `monadUSDT0` | USDT0 |
|
|
135
|
+
| Scroll | `scrollETH` | ETH |
|
|
136
|
+
| Scroll | `scrollUSDT` | USDT |
|
|
137
|
+
| Hyperliquid | `hyperliquidUSDC` | USDC |
|
|
138
|
+
| Hyperliquid | `hyperliquidNEAR` | wNEAR |
|
|
139
|
+
| Plasma | `plasmaUSDT0` | USDT0 |
|
|
140
|
+
| Plasma | `plasmaXPL` | XPL |
|
|
141
|
+
| Robinhood Chain | `robinhoodETH` | ETH |
|
|
142
|
+
| Robinhood Chain | `robinhoodUSDG` | USDG |
|
|
143
|
+
| Robinhood Chain | `robinhoodCASHCAT` | CASHCAT |
|
|
144
|
+
| X Layer | `xlayerUSDC` | USDC |
|
|
145
|
+
| X Layer | `xlayerUSDT0` | USDT0 |
|
|
146
|
+
| Dash | `dashDASH` | DASH |
|
|
147
|
+
| ADI Chain | `adiADI` | ADI |
|
|
129
148
|
|
|
130
149
|
## Display amounts
|
|
131
150
|
|
|
@@ -167,6 +186,7 @@ The package exports:
|
|
|
167
186
|
- `getExecutionStatus`
|
|
168
187
|
- `getExplorerTxUrl` — block-explorer transaction URL for a given chain
|
|
169
188
|
- `isEvmChain` — whether a `ChainId` is EVM-compatible
|
|
189
|
+
- `usesEvmAddress` — whether a `ChainId` uses 0x EVM accounts (every EVM chain, plus HyperCore)
|
|
170
190
|
- `resolveEnsName` — resolve any `.eth` name via the ENSIdeas API
|
|
171
191
|
- `formatDisplayAmount` — rounds a human-readable amount to 6 significant digits for UI display only (never use the result for on-chain amounts)
|
|
172
192
|
- `needsMemoDeposit` — whether a `ChainId` requires a memo alongside its deposit address
|
|
@@ -16,16 +16,22 @@ var TOKEN_ICONS = {
|
|
|
16
16
|
// Stablecoins
|
|
17
17
|
USDC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
|
|
18
18
|
USDT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
|
|
19
|
-
DAI: "https://
|
|
19
|
+
DAI: "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996",
|
|
20
|
+
USDT0: "https://coin-images.coingecko.com/coins/images/53705/large/usdt0.jpg?1737086183",
|
|
21
|
+
USDG: "https://coin-images.coingecko.com/coins/images/51281/large/GDN_USDG_Token_200x200.png?1730484111",
|
|
22
|
+
xDAI: "https://coin-images.coingecko.com/coins/images/11062/large/Identity-Primary-DarkBG.png?1696511004",
|
|
23
|
+
EURe: "https://coin-images.coingecko.com/coins/images/54303/large/eure.jpg?1739167959",
|
|
20
24
|
// Major tokens
|
|
21
25
|
ETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png",
|
|
22
26
|
WETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
|
|
23
27
|
BTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png",
|
|
24
28
|
WBTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",
|
|
29
|
+
cbBTC: "https://coin-images.coingecko.com/coins/images/40143/large/cbbtc.webp?1726136727",
|
|
25
30
|
// L1s & L2s
|
|
26
31
|
SUI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/sui/info/logo.png",
|
|
27
32
|
SOL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png",
|
|
28
33
|
NEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png",
|
|
34
|
+
wNEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png",
|
|
29
35
|
ARB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png",
|
|
30
36
|
OP: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/info/logo.png",
|
|
31
37
|
POL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/polygon/info/logo.png",
|
|
@@ -39,23 +45,30 @@ var TOKEN_ICONS = {
|
|
|
39
45
|
LTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png",
|
|
40
46
|
BCH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png",
|
|
41
47
|
TON: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ton/info/logo.png",
|
|
48
|
+
GRAM: "https://coin-images.coingecko.com/coins/images/17980/large/Gram_Circular_Badge.png?1781524778",
|
|
42
49
|
TRX: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/tron/info/logo.png",
|
|
43
50
|
XLM: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/stellar/info/logo.png",
|
|
44
51
|
APT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png",
|
|
52
|
+
DASH: "https://coin-images.coingecko.com/coins/images/19/large/dash-logo.png?1696501423",
|
|
53
|
+
XPL: "https://coin-images.coingecko.com/coins/images/66489/large/Plasma-symbol-green-1.png?1755142558",
|
|
54
|
+
ADI: "https://coin-images.coingecko.com/coins/images/68846/large/ADI_Token-min.png?1765296433",
|
|
45
55
|
// DeFi & Others
|
|
46
|
-
AAVE: "https://
|
|
56
|
+
AAVE: "https://coin-images.coingecko.com/coins/images/12645/large/aave-token-round.png?1720472354",
|
|
57
|
+
GMX: "https://coin-images.coingecko.com/coins/images/18323/large/arbit.png?1696517814",
|
|
58
|
+
SAFE: "https://coin-images.coingecko.com/coins/images/27032/large/Artboard_1_copy_8circle-1.png?1696526084",
|
|
59
|
+
COW: "https://coin-images.coingecko.com/coins/images/24384/large/CoW-token_logo.png?1719524382",
|
|
47
60
|
UNI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/logo.png",
|
|
48
61
|
LINK: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x514910771AF9Ca656af840dff83E8264EcF986CA/logo.png",
|
|
49
62
|
SHIB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE/logo.png",
|
|
50
63
|
PEPE: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6982508145454Ce325dDbE47a25d4ec3d2311933/logo.png",
|
|
51
64
|
// Ecosystem tokens
|
|
52
65
|
STRK: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png",
|
|
53
|
-
BERA: "https://
|
|
54
|
-
GNO: "https://
|
|
55
|
-
MON: "https://
|
|
66
|
+
BERA: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008",
|
|
67
|
+
GNO: "https://coin-images.coingecko.com/coins/images/662/large/logo_square_simple_300px.png?1696501854",
|
|
68
|
+
MON: "https://coin-images.coingecko.com/coins/images/38927/large/mon.png?1766029057",
|
|
56
69
|
ZEC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png",
|
|
57
70
|
// Meme coins
|
|
58
|
-
|
|
71
|
+
CASHCAT: "https://coin-images.coingecko.com/coins/images/102174280/large/cashcat-logo.jpg?1782922765",
|
|
59
72
|
WIF: "https://s2.coinmarketcap.com/static/img/coins/64x64/28752.png",
|
|
60
73
|
BRETT: "https://s2.coinmarketcap.com/static/img/coins/64x64/29743.png",
|
|
61
74
|
TURBO: "https://s2.coinmarketcap.com/static/img/coins/64x64/24911.png",
|
|
@@ -81,14 +94,20 @@ var CHAIN_ICONS = {
|
|
|
81
94
|
aptos: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png",
|
|
82
95
|
gnosis: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/xdai/info/logo.png",
|
|
83
96
|
starknet: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png",
|
|
84
|
-
bera: "https://
|
|
85
|
-
monad: "https://
|
|
97
|
+
bera: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008",
|
|
98
|
+
monad: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/monad/info/logo.png",
|
|
86
99
|
doge: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/doge/info/logo.png",
|
|
87
100
|
ltc: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png",
|
|
88
101
|
bch: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png",
|
|
89
102
|
xrp: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ripple/info/logo.png",
|
|
90
103
|
zec: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png",
|
|
91
|
-
scroll: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/scroll/info/logo.png"
|
|
104
|
+
scroll: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/scroll/info/logo.png",
|
|
105
|
+
hypercore: "https://coin-images.coingecko.com/asset_platforms/images/243/large/hyperliquid.png?1713924434",
|
|
106
|
+
plasma: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/plasma/info/logo.png",
|
|
107
|
+
hood: "https://coin-images.coingecko.com/asset_platforms/images/102132299/large/robinhood.png?1782921203",
|
|
108
|
+
xlayer: "https://coin-images.coingecko.com/asset_platforms/images/238/large/x_logo.jpeg?1713243242",
|
|
109
|
+
dash: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/dash/info/logo.png",
|
|
110
|
+
adi: "https://coin-images.coingecko.com/asset_platforms/images/102132311/large/adi-chain.png?1788338099"
|
|
92
111
|
};
|
|
93
112
|
var EVM_CHAINS = [
|
|
94
113
|
"eth",
|
|
@@ -101,11 +120,18 @@ var EVM_CHAINS = [
|
|
|
101
120
|
"gnosis",
|
|
102
121
|
"bera",
|
|
103
122
|
"monad",
|
|
104
|
-
"scroll"
|
|
123
|
+
"scroll",
|
|
124
|
+
"plasma",
|
|
125
|
+
"hood",
|
|
126
|
+
"xlayer",
|
|
127
|
+
"adi"
|
|
105
128
|
];
|
|
106
129
|
function isEvmChain(chain) {
|
|
107
130
|
return EVM_CHAINS.includes(chain);
|
|
108
131
|
}
|
|
132
|
+
function usesEvmAddress(chain) {
|
|
133
|
+
return isEvmChain(chain) || chain === "hypercore";
|
|
134
|
+
}
|
|
109
135
|
var CHAINS_REQUIRING_MEMO = ["stellar"];
|
|
110
136
|
function needsMemoDeposit(chain) {
|
|
111
137
|
return CHAINS_REQUIRING_MEMO.includes(chain);
|
|
@@ -136,7 +162,13 @@ var EXPLORER_TX_URLS = {
|
|
|
136
162
|
bch: (h) => `https://blockchair.com/bitcoin-cash/transaction/${h}`,
|
|
137
163
|
xrp: (h) => `https://xrpscan.com/tx/${h}`,
|
|
138
164
|
zec: (h) => `https://blockchair.com/zcash/transaction/${h}`,
|
|
139
|
-
scroll: (h) => `https://scrollscan.com/tx/${h}
|
|
165
|
+
scroll: (h) => `https://scrollscan.com/tx/${h}`,
|
|
166
|
+
hypercore: (h) => `https://app.hyperliquid.xyz/explorer/tx/${h}`,
|
|
167
|
+
plasma: (h) => `https://plasmascan.to/tx/${h}`,
|
|
168
|
+
hood: (h) => `https://robinhoodchain.blockscout.com/tx/${h}`,
|
|
169
|
+
xlayer: (h) => `https://www.oklink.com/x-layer/tx/${h}`,
|
|
170
|
+
dash: (h) => `https://insight.dash.org/insight/tx/${h}`,
|
|
171
|
+
adi: (h) => `https://explorer.adifoundation.ai/tx/${h}`
|
|
140
172
|
};
|
|
141
173
|
function getExplorerTxUrl(chain, hash) {
|
|
142
174
|
return EXPLORER_TX_URLS[chain]?.(hash);
|
|
@@ -146,7 +178,7 @@ function createToken(chain, symbol, assetId, decimals, contractAddress, options)
|
|
|
146
178
|
const canonicalPrefix = TOKEN_NAME_PREFIXES[chain] || chain;
|
|
147
179
|
const legacyName = `${chain}${normalizedSymbol}`;
|
|
148
180
|
const name = options?.name || `${canonicalPrefix}${normalizedSymbol}`;
|
|
149
|
-
const icon = TOKEN_ICONS[symbol] || TOKEN_ICONS.DEFAULT;
|
|
181
|
+
const icon = TOKEN_ICONS[symbol] || TOKEN_ICONS[normalizedSymbol] || TOKEN_ICONS.DEFAULT;
|
|
150
182
|
const chainIcon = CHAIN_ICONS[chain];
|
|
151
183
|
const aliases = new Set(options?.aliases || []);
|
|
152
184
|
if (legacyName !== name) {
|
|
@@ -176,7 +208,9 @@ var TOKEN_NAME_PREFIXES = {
|
|
|
176
208
|
ltc: "litecoin",
|
|
177
209
|
bch: "bitcoinCash",
|
|
178
210
|
bera: "berachain",
|
|
179
|
-
zec: "zcash"
|
|
211
|
+
zec: "zcash",
|
|
212
|
+
hypercore: "hyperliquid",
|
|
213
|
+
hood: "robinhood"
|
|
180
214
|
};
|
|
181
215
|
var suiSUI = createToken("sui", "SUI", "nep141:sui.omft.near", 9);
|
|
182
216
|
var suiUSDC = createToken("sui", "USDC", "nep141:sui-c1b81ecaf27933252d31a963bc5e9458f13c18ce.omft.near", 6, "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC");
|
|
@@ -194,7 +228,10 @@ var ethereumTURBO = createToken("eth", "TURBO", "nep141:eth-0xa35923162c49cf95e6
|
|
|
194
228
|
var ethereumSAFE = createToken("eth", "SAFE", "nep141:eth-0x5afe3855358e112b5647b952709e6165e1c1eeee.omft.near", 18, "0x5afe3855358e112b5647b952709e6165e1c1eeee");
|
|
195
229
|
var arbitrumETH = createToken("arb", "ETH", "nep141:arb.omft.near", 18);
|
|
196
230
|
var arbitrumUSDC = createToken("arb", "USDC", "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near", 6, "0xaf88d065e77c8cc2239327c5edb3a432268e5831");
|
|
197
|
-
var arbitrumUSDT = createToken("arb", "
|
|
231
|
+
var arbitrumUSDT = createToken("arb", "USDT0", "nep141:arb-0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9.omft.near", 6, "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", {
|
|
232
|
+
name: "arbitrumUSDT",
|
|
233
|
+
aliases: ["arbUSDT", "arbitrumUSDT0"]
|
|
234
|
+
});
|
|
198
235
|
var arbitrumARB = createToken("arb", "ARB", "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near", 18, "0x912ce59144191c1204e64559fe8253a0e49e6548");
|
|
199
236
|
var arbitrumGMX = createToken("arb", "GMX", "nep141:arb-0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a.omft.near", 18, "0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a");
|
|
200
237
|
var baseETH = createToken("base", "ETH", "nep141:base.omft.near", 18);
|
|
@@ -210,9 +247,7 @@ var optimismOP = createToken("op", "OP", "nep245:v2_1.omni.hot.tg:10_vLAiSt9KfUG
|
|
|
210
247
|
var solanaSOL = createToken("sol", "SOL", "nep141:sol.omft.near", 9);
|
|
211
248
|
var solanaUSDC = createToken("sol", "USDC", "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near", 6, "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
|
|
212
249
|
var solanaUSDT = createToken("sol", "USDT", "nep141:sol-c800a4bd850783ccb82c2b2c7e84175443606352.omft.near", 6, "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB");
|
|
213
|
-
var solanaTRUMP = createToken("sol", "TRUMP", "nep141:sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near", 6, "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN");
|
|
214
250
|
var solanaWIF = createToken("sol", "$WIF", "nep141:sol-b9c68f94ec8fd160137af8cdfe5e61cd68e2afba.omft.near", 6, "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm");
|
|
215
|
-
var solanaMELANIA = createToken("sol", "MELANIA", "nep141:sol-d600e625449a4d9380eaf5e3265e54c90d34e260.omft.near", 6, "FUAfBo2jgks6gB4Z4LfZkqSZgzNucisEHqnNebaRxM1P");
|
|
216
251
|
var bitcoinBTC = createToken("btc", "BTC", "nep141:btc.omft.near", 8);
|
|
217
252
|
var polygonPOL = createToken("pol", "POL", "nep245:v2_1.omni.hot.tg:137_11111111111111111111", 18);
|
|
218
253
|
var polygonUSDC = createToken("pol", "USDC", "nep245:v2_1.omni.hot.tg:137_qiStmoQJDQPTebaPjgx5VBxZv6L", 6, "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359");
|
|
@@ -223,7 +258,10 @@ var avalancheUSDT = createToken("avax", "USDT", "nep245:v2_1.omni.hot.tg:43114_3
|
|
|
223
258
|
var bscBNB = createToken("bsc", "BNB", "nep245:v2_1.omni.hot.tg:56_11111111111111111111", 18);
|
|
224
259
|
var bscUSDC = createToken("bsc", "USDC", "nep245:v2_1.omni.hot.tg:56_2w93GqMcEmQFDru84j3HZZWt557r", 18, "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d");
|
|
225
260
|
var bscUSDT = createToken("bsc", "USDT", "nep245:v2_1.omni.hot.tg:56_2CMMyVTGZkeyNZTSvS5sarzfir6g", 18, "0x55d398326f99059ff775485246999027b3197955");
|
|
226
|
-
var tonTON = createToken("ton", "
|
|
261
|
+
var tonTON = createToken("ton", "GRAM", "nep245:v2_1.omni.hot.tg:1117_", 9, void 0, {
|
|
262
|
+
name: "tonTON",
|
|
263
|
+
aliases: ["tonGRAM"]
|
|
264
|
+
});
|
|
227
265
|
var tonUSDT = createToken("ton", "USDT", "nep245:v2_1.omni.hot.tg:1117_3tsdfyziyc7EJbP2aULWSKU4toBaAcN4FdTgfm5W1mC4ouR", 6, "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs");
|
|
228
266
|
var tronTRX = createToken("tron", "TRX", "nep141:tron.omft.near", 6);
|
|
229
267
|
var tronUSDT = createToken("tron", "USDT", "nep141:tron-d28a265909efecdcee7c5028585214ea0b96f015.omft.near", 6, "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t");
|
|
@@ -244,6 +282,30 @@ var nearNEAR = createToken("near", "wNEAR", "nep141:wrap.near", 24, "wrap.near",
|
|
|
244
282
|
});
|
|
245
283
|
var nearUSDC = createToken("near", "USDC", "nep141:17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1", 6, "17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1");
|
|
246
284
|
var nearUSDT = createToken("near", "USDT", "nep141:usdt.tether-token.near", 6, "usdt.tether-token.near");
|
|
285
|
+
var gnosisUSDC = createToken("gnosis", "USDC", "nep141:gnosis-0x2a22f9c3b484c3629090feed35f17ff8f88f76f0.omft.near", 6, "0x2a22f9c3b484c3629090feed35f17ff8f88f76f0");
|
|
286
|
+
var gnosisUSDT = createToken("gnosis", "USDT", "nep141:gnosis-0x4ecaba5870353805a9f068101a40e0f32ed605c6.omft.near", 6, "0x4ecaba5870353805a9f068101a40e0f32ed605c6");
|
|
287
|
+
var gnosisXDAI = createToken("gnosis", "xDAI", "nep141:gnosis.omft.near", 18, void 0, { name: "gnosisXDAI" });
|
|
288
|
+
var gnosisEURe = createToken("gnosis", "EURe", "nep141:gnosis-0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430.omft.near", 18, "0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430");
|
|
289
|
+
var gnosisGNO = createToken("gnosis", "GNO", "nep141:gnosis-0x9c58bacc331c9aa871afd802db6379a98e80cedb.omft.near", 18, "0x9c58bacc331c9aa871afd802db6379a98e80cedb");
|
|
290
|
+
var gnosisCOW = createToken("gnosis", "COW", "nep141:gnosis-0x177127622c4a00f3d409b75571e12cb3c8973d3c.omft.near", 18, "0x177127622c4a00f3d409b75571e12cb3c8973d3c");
|
|
291
|
+
var gnosisWETH = createToken("gnosis", "WETH", "nep141:gnosis-0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1.omft.near", 18, "0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1");
|
|
292
|
+
var hyperliquidUSDC = createToken("hypercore", "USDC", "1cs_v1:hypercore:hip1:0x6d1e7cde53ba9467b783cb7c530ce054", 8, "0x6d1e7cde53ba9467b783cb7c530ce054");
|
|
293
|
+
var hyperliquidNEAR = createToken("hypercore", "wNEAR", "1cs_v1:hypercore:hip1:0x20b8c9d2f022ffd2aea4f7962b7b1d8b", 8, "0x20b8c9d2f022ffd2aea4f7962b7b1d8b", {
|
|
294
|
+
name: "hyperliquidNEAR",
|
|
295
|
+
aliases: ["hyperliquidwNEAR"]
|
|
296
|
+
});
|
|
297
|
+
var plasmaUSDT0 = createToken("plasma", "USDT0", "nep141:plasma-0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb.omft.near", 6, "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb");
|
|
298
|
+
var plasmaXPL = createToken("plasma", "XPL", "nep141:plasma.omft.near", 18);
|
|
299
|
+
var monadMON = createToken("monad", "MON", "nep245:v2_1.omni.hot.tg:143_11111111111111111111", 18);
|
|
300
|
+
var monadUSDC = createToken("monad", "USDC", "nep245:v2_1.omni.hot.tg:143_2dmLwYWkCQKyTjeUPAsGJuiVLbFx", 6, "0x754704bc059f8c67012fed69bc8a327a5aafb603");
|
|
301
|
+
var monadUSDT0 = createToken("monad", "USDT0", "nep245:v2_1.omni.hot.tg:143_4EJiJxSALvGoTZbnc8K7Ft9533et", 6, "0xe7cd86e13ac4309349f30b3435a9d337750fc82d");
|
|
302
|
+
var robinhoodETH = createToken("hood", "ETH", "nep141:hood.omft.near", 18);
|
|
303
|
+
var robinhoodUSDG = createToken("hood", "USDG", "nep141:hood-0x5fc5360d0400a0fd4f2af552add042d716f1d168.omft.near", 6, "0x5fc5360d0400a0fd4f2af552add042d716f1d168");
|
|
304
|
+
var robinhoodCASHCAT = createToken("hood", "CASHCAT", "nep141:hood-0x020bfc650a365f8bb26819deaabf3e21291018b4.omft.near", 18, "0x020bfc650a365f8bb26819deaabf3e21291018b4");
|
|
305
|
+
var xlayerUSDC = createToken("xlayer", "USDC", "nep245:v2_1.omni.hot.tg:196_2dK9kLNR7Ekq7su8FxNGiUW3djTw", 6, "0x74b7f16337b8972027f6196a17a631ac6de26d22");
|
|
306
|
+
var xlayerUSDT0 = createToken("xlayer", "USDT0", "nep245:v2_1.omni.hot.tg:196_2fezDCvVYRsG8wrK6deJ2VRPiAS1", 6, "0x779ded0c9e1022225f8e0630b35a9b54be713736");
|
|
307
|
+
var dashDASH = createToken("dash", "DASH", "nep141:dash.omft.near", 8);
|
|
308
|
+
var adiADI = createToken("adi", "ADI", "nep245:v2_1.omni.hot.tg:36900_11111111111111111111", 18);
|
|
247
309
|
var CHAINS = {
|
|
248
310
|
stellar: {
|
|
249
311
|
id: "stellar",
|
|
@@ -285,7 +347,7 @@ var CHAINS = {
|
|
|
285
347
|
id: "sol",
|
|
286
348
|
name: "Solana",
|
|
287
349
|
icon: CHAIN_ICONS.sol,
|
|
288
|
-
tokens: [solanaSOL, solanaUSDC, solanaUSDT,
|
|
350
|
+
tokens: [solanaSOL, solanaUSDC, solanaUSDT, solanaWIF]
|
|
289
351
|
},
|
|
290
352
|
btc: {
|
|
291
353
|
id: "btc",
|
|
@@ -387,19 +449,55 @@ var CHAINS = {
|
|
|
387
449
|
id: "gnosis",
|
|
388
450
|
name: "Gnosis",
|
|
389
451
|
icon: CHAIN_ICONS.gnosis,
|
|
390
|
-
tokens: []
|
|
452
|
+
tokens: [gnosisUSDC, gnosisUSDT, gnosisXDAI, gnosisEURe, gnosisGNO, gnosisCOW, gnosisWETH]
|
|
391
453
|
},
|
|
392
454
|
monad: {
|
|
393
455
|
id: "monad",
|
|
394
456
|
name: "Monad",
|
|
395
457
|
icon: CHAIN_ICONS.monad,
|
|
396
|
-
tokens: []
|
|
458
|
+
tokens: [monadMON, monadUSDC, monadUSDT0]
|
|
397
459
|
},
|
|
398
460
|
scroll: {
|
|
399
461
|
id: "scroll",
|
|
400
462
|
name: "Scroll",
|
|
401
463
|
icon: CHAIN_ICONS.scroll,
|
|
402
464
|
tokens: [scrollETH, scrollUSDT]
|
|
465
|
+
},
|
|
466
|
+
hypercore: {
|
|
467
|
+
id: "hypercore",
|
|
468
|
+
name: "Hyperliquid",
|
|
469
|
+
icon: CHAIN_ICONS.hypercore,
|
|
470
|
+
tokens: [hyperliquidUSDC, hyperliquidNEAR]
|
|
471
|
+
},
|
|
472
|
+
plasma: {
|
|
473
|
+
id: "plasma",
|
|
474
|
+
name: "Plasma",
|
|
475
|
+
icon: CHAIN_ICONS.plasma,
|
|
476
|
+
tokens: [plasmaUSDT0, plasmaXPL]
|
|
477
|
+
},
|
|
478
|
+
hood: {
|
|
479
|
+
id: "hood",
|
|
480
|
+
name: "Robinhood Chain",
|
|
481
|
+
icon: CHAIN_ICONS.hood,
|
|
482
|
+
tokens: [robinhoodETH, robinhoodUSDG, robinhoodCASHCAT]
|
|
483
|
+
},
|
|
484
|
+
xlayer: {
|
|
485
|
+
id: "xlayer",
|
|
486
|
+
name: "X Layer",
|
|
487
|
+
icon: CHAIN_ICONS.xlayer,
|
|
488
|
+
tokens: [xlayerUSDC, xlayerUSDT0]
|
|
489
|
+
},
|
|
490
|
+
dash: {
|
|
491
|
+
id: "dash",
|
|
492
|
+
name: "Dash",
|
|
493
|
+
icon: CHAIN_ICONS.dash,
|
|
494
|
+
tokens: [dashDASH]
|
|
495
|
+
},
|
|
496
|
+
adi: {
|
|
497
|
+
id: "adi",
|
|
498
|
+
name: "ADI Chain",
|
|
499
|
+
icon: CHAIN_ICONS.adi,
|
|
500
|
+
tokens: [adiADI]
|
|
403
501
|
}
|
|
404
502
|
};
|
|
405
503
|
var ALL_TOKENS = Object.values(CHAINS).flatMap((chain) => chain.tokens);
|
|
@@ -745,7 +843,7 @@ function useUniportPayment(options) {
|
|
|
745
843
|
cancelled = true;
|
|
746
844
|
};
|
|
747
845
|
}, []);
|
|
748
|
-
const effectiveRefundAddress = swapType === "EXACT_OUTPUT" ? "" : refundAddress.trim() || (selectedChain &&
|
|
846
|
+
const effectiveRefundAddress = swapType === "EXACT_OUTPUT" ? "" : refundAddress.trim() || (selectedChain && usesEvmAddress(selectedChain.id) ? evmDefaultRefundAddress : "");
|
|
749
847
|
const pollingRef = react.useRef(null);
|
|
750
848
|
const lastStatusRef = react.useRef(null);
|
|
751
849
|
const previewDebounceRef = react.useRef(null);
|
|
@@ -813,7 +911,7 @@ function useUniportPayment(options) {
|
|
|
813
911
|
const setRefundAddress = react.useCallback(
|
|
814
912
|
(newRefundAddress) => {
|
|
815
913
|
setRefundAddressState(newRefundAddress);
|
|
816
|
-
const nextEffective = newRefundAddress.trim() || (selectedChain &&
|
|
914
|
+
const nextEffective = newRefundAddress.trim() || (selectedChain && usesEvmAddress(selectedChain.id) ? evmDefaultRefundAddress : "");
|
|
817
915
|
schedulePreviewQuote(amount, nextEffective, selectedToken);
|
|
818
916
|
},
|
|
819
917
|
[amount, evmDefaultRefundAddress, schedulePreviewQuote, selectedChain, selectedToken]
|
|
@@ -823,7 +921,7 @@ function useUniportPayment(options) {
|
|
|
823
921
|
setSelectedChain(chain);
|
|
824
922
|
setSelectedToken(nextToken);
|
|
825
923
|
setPaymentState("selecting");
|
|
826
|
-
const nextEffective = refundAddress.trim() || (
|
|
924
|
+
const nextEffective = refundAddress.trim() || (usesEvmAddress(chain.id) ? evmDefaultRefundAddress : "");
|
|
827
925
|
schedulePreviewQuote(amount, nextEffective, nextToken);
|
|
828
926
|
}, [amount, evmDefaultRefundAddress, refundAddress, schedulePreviewQuote]);
|
|
829
927
|
const handleTokenSelect = react.useCallback((token) => {
|
|
@@ -1194,34 +1292,7 @@ function formatPreviewError(error) {
|
|
|
1194
1292
|
return "Could not fetch estimate. Check the details and try again.";
|
|
1195
1293
|
}
|
|
1196
1294
|
function formatChainLabel(chainId) {
|
|
1197
|
-
|
|
1198
|
-
sui: "Sui",
|
|
1199
|
-
eth: "Ethereum",
|
|
1200
|
-
sol: "Solana",
|
|
1201
|
-
arb: "Arbitrum",
|
|
1202
|
-
base: "Base",
|
|
1203
|
-
op: "Optimism",
|
|
1204
|
-
pol: "Polygon",
|
|
1205
|
-
avax: "Avalanche",
|
|
1206
|
-
bsc: "BNB Chain",
|
|
1207
|
-
near: "NEAR",
|
|
1208
|
-
btc: "Bitcoin",
|
|
1209
|
-
ton: "TON",
|
|
1210
|
-
tron: "Tron",
|
|
1211
|
-
stellar: "Stellar",
|
|
1212
|
-
cardano: "Cardano",
|
|
1213
|
-
xrp: "XRP Ledger",
|
|
1214
|
-
doge: "Dogecoin",
|
|
1215
|
-
ltc: "Litecoin",
|
|
1216
|
-
bch: "Bitcoin Cash",
|
|
1217
|
-
aptos: "Aptos",
|
|
1218
|
-
starknet: "Starknet",
|
|
1219
|
-
bera: "Berachain",
|
|
1220
|
-
zec: "Zcash",
|
|
1221
|
-
gnosis: "Gnosis",
|
|
1222
|
-
monad: "Monad"
|
|
1223
|
-
};
|
|
1224
|
-
return labels[chainId] || chainId.toUpperCase();
|
|
1295
|
+
return CHAINS[chainId]?.name ?? chainId.toUpperCase();
|
|
1225
1296
|
}
|
|
1226
1297
|
function UniportModal({
|
|
1227
1298
|
open,
|
|
@@ -1481,7 +1552,7 @@ function UniportModal({
|
|
|
1481
1552
|
"\u2192 ",
|
|
1482
1553
|
payment.destinationToken.symbol,
|
|
1483
1554
|
" on ",
|
|
1484
|
-
payment.destinationToken.chain
|
|
1555
|
+
formatChainLabel(payment.destinationToken.chain)
|
|
1485
1556
|
] })
|
|
1486
1557
|
] })
|
|
1487
1558
|
] }),
|
|
@@ -1528,7 +1599,7 @@ function UniportModal({
|
|
|
1528
1599
|
children: [
|
|
1529
1600
|
"Refund address on ",
|
|
1530
1601
|
ch?.name || "the source chain",
|
|
1531
|
-
ch &&
|
|
1602
|
+
ch && usesEvmAddress(ch.id) && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 400, color: t.textMuted }, children: " (optional)" })
|
|
1532
1603
|
]
|
|
1533
1604
|
}
|
|
1534
1605
|
),
|
|
@@ -1538,7 +1609,7 @@ function UniportModal({
|
|
|
1538
1609
|
type: "text",
|
|
1539
1610
|
value: payment.refundAddress,
|
|
1540
1611
|
onChange: (e) => payment.setRefundAddress(e.target.value),
|
|
1541
|
-
placeholder: ch &&
|
|
1612
|
+
placeholder: ch && usesEvmAddress(ch.id) ? `Optional \u2014 defaults to ${UNIPORT_ENS_NAME}` : `Enter a ${ch?.name || "source chain"} refund address`,
|
|
1542
1613
|
spellCheck: false,
|
|
1543
1614
|
autoCapitalize: "off",
|
|
1544
1615
|
autoCorrect: "off",
|
|
@@ -1848,6 +1919,7 @@ function UniportModal({
|
|
|
1848
1919
|
] }) })
|
|
1849
1920
|
] });
|
|
1850
1921
|
};
|
|
1922
|
+
const txUrl = (reported, chain, hash) => reported?.startsWith("https://") ? reported : chain ? getExplorerTxUrl(chain, hash) : void 0;
|
|
1851
1923
|
const renderTxHash = (hash, url) => url ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1852
1924
|
"a",
|
|
1853
1925
|
{
|
|
@@ -1937,14 +2009,14 @@ function UniportModal({
|
|
|
1937
2009
|
"Source TX \xB7 ",
|
|
1938
2010
|
payment.selectedChain?.name
|
|
1939
2011
|
] }),
|
|
1940
|
-
renderTxHash(hash, payment.
|
|
2012
|
+
renderTxHash(hash, txUrl(payment.status?.originTxExplorerUrls?.[i], payment.selectedChain?.id, hash))
|
|
1941
2013
|
] }, `o${i}`)),
|
|
1942
2014
|
payment.status?.destinationTxHashes?.map((hash, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1943
2015
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: { color: t.textMuted, fontSize: "11px", margin: "0 0 3px", textTransform: "uppercase", letterSpacing: "0.05em" }, children: [
|
|
1944
2016
|
"Destination TX \xB7 ",
|
|
1945
2017
|
CHAINS[payment.destinationToken.chain].name
|
|
1946
2018
|
] }),
|
|
1947
|
-
renderTxHash(hash,
|
|
2019
|
+
renderTxHash(hash, txUrl(payment.status?.destinationTxExplorerUrls?.[i], payment.destinationToken.chain, hash))
|
|
1948
2020
|
] }, `d${i}`)),
|
|
1949
2021
|
!payment.status?.originTxHashes?.length && !payment.status?.destinationTxHashes?.length && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: t.textMuted, fontSize: "13px", margin: 0 }, children: "Loading transaction details\u2026" })
|
|
1950
2022
|
] }),
|