uniport-sdk 0.0.7 → 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 +38 -16
- package/dist/components/index.cjs +238 -79
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +238 -79
- package/dist/components/index.js.map +1 -1
- package/dist/core/index.cjs +177 -23
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +80 -13
- package/dist/core/index.d.ts +80 -13
- package/dist/core/index.js +154 -22
- package/dist/core/index.js.map +1 -1
- package/dist/{index-Dg_m2bK3.d.cts → index-B6_1AJAS.d.cts} +1 -1
- package/dist/{index-Dg_m2bK3.d.ts → index-B6_1AJAS.d.ts} +1 -1
- package/dist/index.cjs +256 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +233 -80
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/core/index.d.cts
CHANGED
|
@@ -10,14 +10,20 @@
|
|
|
10
10
|
declare const TOKEN_ICONS: {
|
|
11
11
|
readonly USDC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png";
|
|
12
12
|
readonly USDT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png";
|
|
13
|
-
readonly DAI: "https://
|
|
13
|
+
readonly DAI: "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996";
|
|
14
|
+
readonly USDT0: "https://coin-images.coingecko.com/coins/images/53705/large/usdt0.jpg?1737086183";
|
|
15
|
+
readonly USDG: "https://coin-images.coingecko.com/coins/images/51281/large/GDN_USDG_Token_200x200.png?1730484111";
|
|
16
|
+
readonly xDAI: "https://coin-images.coingecko.com/coins/images/11062/large/Identity-Primary-DarkBG.png?1696511004";
|
|
17
|
+
readonly EURe: "https://coin-images.coingecko.com/coins/images/54303/large/eure.jpg?1739167959";
|
|
14
18
|
readonly ETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png";
|
|
15
19
|
readonly WETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";
|
|
16
20
|
readonly BTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png";
|
|
17
21
|
readonly WBTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png";
|
|
22
|
+
readonly cbBTC: "https://coin-images.coingecko.com/coins/images/40143/large/cbbtc.webp?1726136727";
|
|
18
23
|
readonly SUI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/sui/info/logo.png";
|
|
19
24
|
readonly SOL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png";
|
|
20
25
|
readonly NEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png";
|
|
26
|
+
readonly wNEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png";
|
|
21
27
|
readonly ARB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png";
|
|
22
28
|
readonly OP: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/info/logo.png";
|
|
23
29
|
readonly POL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/polygon/info/logo.png";
|
|
@@ -30,20 +36,27 @@ declare const TOKEN_ICONS: {
|
|
|
30
36
|
readonly LTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png";
|
|
31
37
|
readonly BCH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png";
|
|
32
38
|
readonly TON: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ton/info/logo.png";
|
|
39
|
+
readonly GRAM: "https://coin-images.coingecko.com/coins/images/17980/large/Gram_Circular_Badge.png?1781524778";
|
|
33
40
|
readonly TRX: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/tron/info/logo.png";
|
|
34
41
|
readonly XLM: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/stellar/info/logo.png";
|
|
35
42
|
readonly APT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png";
|
|
36
|
-
readonly
|
|
43
|
+
readonly DASH: "https://coin-images.coingecko.com/coins/images/19/large/dash-logo.png?1696501423";
|
|
44
|
+
readonly XPL: "https://coin-images.coingecko.com/coins/images/66489/large/Plasma-symbol-green-1.png?1755142558";
|
|
45
|
+
readonly ADI: "https://coin-images.coingecko.com/coins/images/68846/large/ADI_Token-min.png?1765296433";
|
|
46
|
+
readonly AAVE: "https://coin-images.coingecko.com/coins/images/12645/large/aave-token-round.png?1720472354";
|
|
47
|
+
readonly GMX: "https://coin-images.coingecko.com/coins/images/18323/large/arbit.png?1696517814";
|
|
48
|
+
readonly SAFE: "https://coin-images.coingecko.com/coins/images/27032/large/Artboard_1_copy_8circle-1.png?1696526084";
|
|
49
|
+
readonly COW: "https://coin-images.coingecko.com/coins/images/24384/large/CoW-token_logo.png?1719524382";
|
|
37
50
|
readonly UNI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/logo.png";
|
|
38
51
|
readonly LINK: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x514910771AF9Ca656af840dff83E8264EcF986CA/logo.png";
|
|
39
52
|
readonly SHIB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE/logo.png";
|
|
40
53
|
readonly PEPE: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6982508145454Ce325dDbE47a25d4ec3d2311933/logo.png";
|
|
41
54
|
readonly STRK: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png";
|
|
42
|
-
readonly BERA: "https://
|
|
43
|
-
readonly GNO: "https://
|
|
44
|
-
readonly MON: "https://
|
|
55
|
+
readonly BERA: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008";
|
|
56
|
+
readonly GNO: "https://coin-images.coingecko.com/coins/images/662/large/logo_square_simple_300px.png?1696501854";
|
|
57
|
+
readonly MON: "https://coin-images.coingecko.com/coins/images/38927/large/mon.png?1766029057";
|
|
45
58
|
readonly ZEC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png";
|
|
46
|
-
readonly
|
|
59
|
+
readonly CASHCAT: "https://coin-images.coingecko.com/coins/images/102174280/large/cashcat-logo.jpg?1782922765";
|
|
47
60
|
readonly WIF: "https://s2.coinmarketcap.com/static/img/coins/64x64/28752.png";
|
|
48
61
|
readonly BRETT: "https://s2.coinmarketcap.com/static/img/coins/64x64/29743.png";
|
|
49
62
|
readonly TURBO: "https://s2.coinmarketcap.com/static/img/coins/64x64/24911.png";
|
|
@@ -68,19 +81,31 @@ declare const CHAIN_ICONS: {
|
|
|
68
81
|
readonly aptos: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png";
|
|
69
82
|
readonly gnosis: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/xdai/info/logo.png";
|
|
70
83
|
readonly starknet: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png";
|
|
71
|
-
readonly bera: "https://
|
|
72
|
-
readonly monad: "https://
|
|
84
|
+
readonly bera: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008";
|
|
85
|
+
readonly monad: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/monad/info/logo.png";
|
|
73
86
|
readonly doge: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/doge/info/logo.png";
|
|
74
87
|
readonly ltc: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png";
|
|
75
88
|
readonly bch: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png";
|
|
76
89
|
readonly xrp: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ripple/info/logo.png";
|
|
77
90
|
readonly zec: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png";
|
|
78
91
|
readonly scroll: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/scroll/info/logo.png";
|
|
92
|
+
readonly hypercore: "https://coin-images.coingecko.com/asset_platforms/images/243/large/hyperliquid.png?1713924434";
|
|
93
|
+
readonly plasma: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/plasma/info/logo.png";
|
|
94
|
+
readonly hood: "https://coin-images.coingecko.com/asset_platforms/images/102132299/large/robinhood.png?1782921203";
|
|
95
|
+
readonly xlayer: "https://coin-images.coingecko.com/asset_platforms/images/238/large/x_logo.jpeg?1713243242";
|
|
96
|
+
readonly dash: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/dash/info/logo.png";
|
|
97
|
+
readonly adi: "https://coin-images.coingecko.com/asset_platforms/images/102132311/large/adi-chain.png?1788338099";
|
|
79
98
|
};
|
|
80
99
|
type ChainId = keyof typeof CHAIN_ICONS;
|
|
81
100
|
/** Chains that use EVM-style addresses (0x...), as opposed to chain-specific formats. */
|
|
82
101
|
declare const EVM_CHAINS: ChainId[];
|
|
83
102
|
declare function isEvmChain(chain: ChainId): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Chains whose accounts are 0x EVM keys: every EVM chain plus HyperCore, which
|
|
105
|
+
* isn't an EVM but shares the key format. The default refund address (an EOA)
|
|
106
|
+
* is valid on all of them.
|
|
107
|
+
*/
|
|
108
|
+
declare function usesEvmAddress(chain: ChainId): boolean;
|
|
84
109
|
/**
|
|
85
110
|
* Chains whose deposit transactions require a memo/tag alongside the deposit
|
|
86
111
|
* address (1Click's `depositMode: MEMO`), without which funds can be lost.
|
|
@@ -155,9 +180,7 @@ declare const optimismOP: Token;
|
|
|
155
180
|
declare const solanaSOL: Token;
|
|
156
181
|
declare const solanaUSDC: Token;
|
|
157
182
|
declare const solanaUSDT: Token;
|
|
158
|
-
declare const solanaTRUMP: Token;
|
|
159
183
|
declare const solanaWIF: Token;
|
|
160
|
-
declare const solanaMELANIA: Token;
|
|
161
184
|
declare const bitcoinBTC: Token;
|
|
162
185
|
declare const polygonPOL: Token;
|
|
163
186
|
declare const polygonUSDC: Token;
|
|
@@ -186,6 +209,27 @@ declare const stellarUSDC: Token;
|
|
|
186
209
|
declare const nearNEAR: Token;
|
|
187
210
|
declare const nearUSDC: Token;
|
|
188
211
|
declare const nearUSDT: Token;
|
|
212
|
+
declare const gnosisUSDC: Token;
|
|
213
|
+
declare const gnosisUSDT: Token;
|
|
214
|
+
declare const gnosisXDAI: Token;
|
|
215
|
+
declare const gnosisEURe: Token;
|
|
216
|
+
declare const gnosisGNO: Token;
|
|
217
|
+
declare const gnosisCOW: Token;
|
|
218
|
+
declare const gnosisWETH: Token;
|
|
219
|
+
declare const hyperliquidUSDC: Token;
|
|
220
|
+
declare const hyperliquidNEAR: Token;
|
|
221
|
+
declare const plasmaUSDT0: Token;
|
|
222
|
+
declare const plasmaXPL: Token;
|
|
223
|
+
declare const monadMON: Token;
|
|
224
|
+
declare const monadUSDC: Token;
|
|
225
|
+
declare const monadUSDT0: Token;
|
|
226
|
+
declare const robinhoodETH: Token;
|
|
227
|
+
declare const robinhoodUSDG: Token;
|
|
228
|
+
declare const robinhoodCASHCAT: Token;
|
|
229
|
+
declare const xlayerUSDC: Token;
|
|
230
|
+
declare const xlayerUSDT0: Token;
|
|
231
|
+
declare const dashDASH: Token;
|
|
232
|
+
declare const adiADI: Token;
|
|
189
233
|
declare const CHAINS: Record<ChainId, Chain>;
|
|
190
234
|
declare const ALL_TOKENS: Token[];
|
|
191
235
|
/** Get token by name, e.g. getToken('arbitrumUSDC') */
|
|
@@ -230,12 +274,12 @@ interface QuoteOptions {
|
|
|
230
274
|
originToken: Token;
|
|
231
275
|
/** Destination token (target chain) */
|
|
232
276
|
destinationToken: Token;
|
|
233
|
-
/**
|
|
277
|
+
/** Human-readable input amount for EXACT_INPUT, output amount for EXACT_OUTPUT. */
|
|
234
278
|
amount: string;
|
|
235
279
|
/** Recipient address on destination chain */
|
|
236
280
|
recipient: string;
|
|
237
281
|
/** Refund address on origin chain (if swap fails) */
|
|
238
|
-
refundTo
|
|
282
|
+
refundTo?: string;
|
|
239
283
|
/** Slippage tolerance in basis points (100 = 1%) */
|
|
240
284
|
slippageTolerance?: number;
|
|
241
285
|
/** Swap type (default: EXACT_INPUT) */
|
|
@@ -257,6 +301,18 @@ interface QuoteResult {
|
|
|
257
301
|
memo?: string;
|
|
258
302
|
/** Expected input amount (smallest units) */
|
|
259
303
|
amountIn: string;
|
|
304
|
+
/** Expected input amount in human-readable units */
|
|
305
|
+
amountInFormatted: string;
|
|
306
|
+
/** Minimum accepted input amount (smallest units) */
|
|
307
|
+
minAmountIn?: string;
|
|
308
|
+
/** Friendly amount the payer should send (smallest units) */
|
|
309
|
+
paymentAmountIn: string;
|
|
310
|
+
/** Friendly amount the payer should send in human-readable units */
|
|
311
|
+
paymentAmountInFormatted: string;
|
|
312
|
+
/** Rounded surplus credited to Uniport Intents (smallest units) */
|
|
313
|
+
roundingRemainder: string;
|
|
314
|
+
/** Rounded surplus credited to Uniport Intents in human-readable units */
|
|
315
|
+
roundingRemainderFormatted: string;
|
|
260
316
|
/** Expected output amount (smallest units) */
|
|
261
317
|
amountOut: string;
|
|
262
318
|
/** Human-readable output amount */
|
|
@@ -286,6 +342,10 @@ interface StatusResult {
|
|
|
286
342
|
destinationTxHashes?: string[];
|
|
287
343
|
/** Origin chain transaction hashes (if available) */
|
|
288
344
|
originTxHashes?: string[];
|
|
345
|
+
/** 1Click's explorer link for each destination hash, index-aligned (newer backends only) */
|
|
346
|
+
destinationTxExplorerUrls?: (string | null)[];
|
|
347
|
+
/** 1Click's explorer link for each origin hash, index-aligned (newer backends only) */
|
|
348
|
+
originTxExplorerUrls?: (string | null)[];
|
|
289
349
|
}
|
|
290
350
|
/**
|
|
291
351
|
* Convert human-readable amount to smallest units
|
|
@@ -295,6 +355,13 @@ declare function toSmallestUnits(amount: string, decimals: number): string;
|
|
|
295
355
|
* Convert smallest units to human-readable amount
|
|
296
356
|
*/
|
|
297
357
|
declare function fromSmallestUnits(amount: string, decimals: number): string;
|
|
358
|
+
/** Maximum extra input collected when making EXACT_OUTPUT amounts readable. */
|
|
359
|
+
declare const MAX_EXACT_OUTPUT_ROUNDING_BPS = 25;
|
|
360
|
+
/**
|
|
361
|
+
* Round a smallest-unit amount upward to the shortest decimal representation
|
|
362
|
+
* that adds no more than MAX_EXACT_OUTPUT_ROUNDING_BPS (0.25%).
|
|
363
|
+
*/
|
|
364
|
+
declare function roundUpInputAmount(amount: string, decimals: number, maxIncreaseBps?: number): string;
|
|
298
365
|
/**
|
|
299
366
|
* Generate a deadline timestamp
|
|
300
367
|
*/
|
|
@@ -391,4 +458,4 @@ declare function resolveEnsName(name: string, options?: {
|
|
|
391
458
|
*/
|
|
392
459
|
declare function getUniportDefaultRefundAddress(): Promise<string>;
|
|
393
460
|
|
|
394
|
-
export { ALL_TOKENS, CHAINS, CHAINS_REQUIRING_MEMO, CHAIN_ICONS, type Chain, type ChainId, DEFAULT_HOSTED_BACKEND_URL, DEFAULT_REQUEST_TIMEOUT_MS, EVM_CHAINS, type EnsResolution, type ExecutionStatus, type QuoteOptions, type QuoteResult, type ResolvedUniportConfig, type StatusResult, type SwapType, TOKEN_ICONS, type Token, UNIPORT_ENS_NAME, UNIPORT_FALLBACK_REFUND_ADDRESS, type UniportApiErrorBody, type UniportConfig, UniportError, type UniportErrorCode, aptosAPT, arbitrumARB, arbitrumETH, arbitrumGMX, arbitrumUSDC, arbitrumUSDT, avalancheAVAX, avalancheUSDC, avalancheUSDT, baseBRETT, baseCbBTC, baseETH, baseUSDC, berachainBERA, bitcoinBTC, bitcoinCashBCH, bscBNB, bscUSDC, bscUSDT, cardanoADA, configureUniport, dogecoinDOGE, ethereumAAVE, ethereumDAI, ethereumETH, ethereumLINK, ethereumPEPE, ethereumSAFE, ethereumSHIB, ethereumTURBO, ethereumUNI, ethereumUSDC, ethereumUSDT, ethereumWBTC, formatDisplayAmount, fromSmallestUnits, generateDeadline, getExecutionStatus, getExplorerTxUrl, getQuote, getSupportedChains, getToken, getTokenByAssetId, getTokensByChain, getUniportConfig, getUniportDefaultRefundAddress, isEvmChain, litecoinLTC, nearNEAR, nearUSDC, nearUSDT, needsMemoDeposit, optimismETH, optimismOP, optimismUSDC, optimismUSDT, pollExecutionStatus, polygonPOL, polygonUSDC, polygonUSDT, resolveEnsName, rippleXRP,
|
|
461
|
+
export { ALL_TOKENS, CHAINS, CHAINS_REQUIRING_MEMO, CHAIN_ICONS, type Chain, type ChainId, DEFAULT_HOSTED_BACKEND_URL, DEFAULT_REQUEST_TIMEOUT_MS, EVM_CHAINS, type EnsResolution, type ExecutionStatus, MAX_EXACT_OUTPUT_ROUNDING_BPS, type QuoteOptions, type QuoteResult, type ResolvedUniportConfig, type StatusResult, type SwapType, TOKEN_ICONS, type Token, UNIPORT_ENS_NAME, UNIPORT_FALLBACK_REFUND_ADDRESS, type UniportApiErrorBody, type UniportConfig, UniportError, type UniportErrorCode, adiADI, aptosAPT, arbitrumARB, arbitrumETH, arbitrumGMX, arbitrumUSDC, arbitrumUSDT, avalancheAVAX, avalancheUSDC, avalancheUSDT, baseBRETT, baseCbBTC, baseETH, baseUSDC, berachainBERA, bitcoinBTC, bitcoinCashBCH, bscBNB, bscUSDC, bscUSDT, cardanoADA, configureUniport, dashDASH, dogecoinDOGE, ethereumAAVE, ethereumDAI, ethereumETH, ethereumLINK, ethereumPEPE, ethereumSAFE, ethereumSHIB, ethereumTURBO, ethereumUNI, ethereumUSDC, ethereumUSDT, ethereumWBTC, formatDisplayAmount, fromSmallestUnits, generateDeadline, getExecutionStatus, getExplorerTxUrl, getQuote, getSupportedChains, getToken, getTokenByAssetId, getTokensByChain, getUniportConfig, getUniportDefaultRefundAddress, gnosisCOW, gnosisEURe, gnosisGNO, gnosisUSDC, gnosisUSDT, gnosisWETH, gnosisXDAI, hyperliquidNEAR, hyperliquidUSDC, isEvmChain, litecoinLTC, monadMON, monadUSDC, monadUSDT0, nearNEAR, nearUSDC, nearUSDT, needsMemoDeposit, optimismETH, optimismOP, optimismUSDC, optimismUSDT, plasmaUSDT0, plasmaXPL, pollExecutionStatus, polygonPOL, polygonUSDC, polygonUSDT, resolveEnsName, rippleXRP, robinhoodCASHCAT, robinhoodETH, robinhoodUSDG, roundUpInputAmount, scrollETH, scrollUSDT, solanaSOL, solanaUSDC, solanaUSDT, solanaWIF, starknetSTRK, stellarUSDC, stellarXLM, submitDepositTx, suiSUI, suiUSDC, toSmallestUnits, tonTON, tonUSDT, tronTRX, tronUSDT, usesEvmAddress, xlayerUSDC, xlayerUSDT0, zcashZEC };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -10,14 +10,20 @@
|
|
|
10
10
|
declare const TOKEN_ICONS: {
|
|
11
11
|
readonly USDC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png";
|
|
12
12
|
readonly USDT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png";
|
|
13
|
-
readonly DAI: "https://
|
|
13
|
+
readonly DAI: "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996";
|
|
14
|
+
readonly USDT0: "https://coin-images.coingecko.com/coins/images/53705/large/usdt0.jpg?1737086183";
|
|
15
|
+
readonly USDG: "https://coin-images.coingecko.com/coins/images/51281/large/GDN_USDG_Token_200x200.png?1730484111";
|
|
16
|
+
readonly xDAI: "https://coin-images.coingecko.com/coins/images/11062/large/Identity-Primary-DarkBG.png?1696511004";
|
|
17
|
+
readonly EURe: "https://coin-images.coingecko.com/coins/images/54303/large/eure.jpg?1739167959";
|
|
14
18
|
readonly ETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/info/logo.png";
|
|
15
19
|
readonly WETH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";
|
|
16
20
|
readonly BTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoin/info/logo.png";
|
|
17
21
|
readonly WBTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png";
|
|
22
|
+
readonly cbBTC: "https://coin-images.coingecko.com/coins/images/40143/large/cbbtc.webp?1726136727";
|
|
18
23
|
readonly SUI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/sui/info/logo.png";
|
|
19
24
|
readonly SOL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png";
|
|
20
25
|
readonly NEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png";
|
|
26
|
+
readonly wNEAR: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/near/info/logo.png";
|
|
21
27
|
readonly ARB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png";
|
|
22
28
|
readonly OP: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/info/logo.png";
|
|
23
29
|
readonly POL: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/polygon/info/logo.png";
|
|
@@ -30,20 +36,27 @@ declare const TOKEN_ICONS: {
|
|
|
30
36
|
readonly LTC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png";
|
|
31
37
|
readonly BCH: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png";
|
|
32
38
|
readonly TON: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ton/info/logo.png";
|
|
39
|
+
readonly GRAM: "https://coin-images.coingecko.com/coins/images/17980/large/Gram_Circular_Badge.png?1781524778";
|
|
33
40
|
readonly TRX: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/tron/info/logo.png";
|
|
34
41
|
readonly XLM: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/stellar/info/logo.png";
|
|
35
42
|
readonly APT: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png";
|
|
36
|
-
readonly
|
|
43
|
+
readonly DASH: "https://coin-images.coingecko.com/coins/images/19/large/dash-logo.png?1696501423";
|
|
44
|
+
readonly XPL: "https://coin-images.coingecko.com/coins/images/66489/large/Plasma-symbol-green-1.png?1755142558";
|
|
45
|
+
readonly ADI: "https://coin-images.coingecko.com/coins/images/68846/large/ADI_Token-min.png?1765296433";
|
|
46
|
+
readonly AAVE: "https://coin-images.coingecko.com/coins/images/12645/large/aave-token-round.png?1720472354";
|
|
47
|
+
readonly GMX: "https://coin-images.coingecko.com/coins/images/18323/large/arbit.png?1696517814";
|
|
48
|
+
readonly SAFE: "https://coin-images.coingecko.com/coins/images/27032/large/Artboard_1_copy_8circle-1.png?1696526084";
|
|
49
|
+
readonly COW: "https://coin-images.coingecko.com/coins/images/24384/large/CoW-token_logo.png?1719524382";
|
|
37
50
|
readonly UNI: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/logo.png";
|
|
38
51
|
readonly LINK: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x514910771AF9Ca656af840dff83E8264EcF986CA/logo.png";
|
|
39
52
|
readonly SHIB: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE/logo.png";
|
|
40
53
|
readonly PEPE: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6982508145454Ce325dDbE47a25d4ec3d2311933/logo.png";
|
|
41
54
|
readonly STRK: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png";
|
|
42
|
-
readonly BERA: "https://
|
|
43
|
-
readonly GNO: "https://
|
|
44
|
-
readonly MON: "https://
|
|
55
|
+
readonly BERA: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008";
|
|
56
|
+
readonly GNO: "https://coin-images.coingecko.com/coins/images/662/large/logo_square_simple_300px.png?1696501854";
|
|
57
|
+
readonly MON: "https://coin-images.coingecko.com/coins/images/38927/large/mon.png?1766029057";
|
|
45
58
|
readonly ZEC: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png";
|
|
46
|
-
readonly
|
|
59
|
+
readonly CASHCAT: "https://coin-images.coingecko.com/coins/images/102174280/large/cashcat-logo.jpg?1782922765";
|
|
47
60
|
readonly WIF: "https://s2.coinmarketcap.com/static/img/coins/64x64/28752.png";
|
|
48
61
|
readonly BRETT: "https://s2.coinmarketcap.com/static/img/coins/64x64/29743.png";
|
|
49
62
|
readonly TURBO: "https://s2.coinmarketcap.com/static/img/coins/64x64/24911.png";
|
|
@@ -68,19 +81,31 @@ declare const CHAIN_ICONS: {
|
|
|
68
81
|
readonly aptos: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aptos/info/logo.png";
|
|
69
82
|
readonly gnosis: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/xdai/info/logo.png";
|
|
70
83
|
readonly starknet: "https://coin-images.coingecko.com/coins/images/26433/large/starknet.png";
|
|
71
|
-
readonly bera: "https://
|
|
72
|
-
readonly monad: "https://
|
|
84
|
+
readonly bera: "https://coin-images.coingecko.com/coins/images/25235/large/BERA.png?1738822008";
|
|
85
|
+
readonly monad: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/monad/info/logo.png";
|
|
73
86
|
readonly doge: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/doge/info/logo.png";
|
|
74
87
|
readonly ltc: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/litecoin/info/logo.png";
|
|
75
88
|
readonly bch: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/bitcoincash/info/logo.png";
|
|
76
89
|
readonly xrp: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ripple/info/logo.png";
|
|
77
90
|
readonly zec: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/zcash/info/logo.png";
|
|
78
91
|
readonly scroll: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/scroll/info/logo.png";
|
|
92
|
+
readonly hypercore: "https://coin-images.coingecko.com/asset_platforms/images/243/large/hyperliquid.png?1713924434";
|
|
93
|
+
readonly plasma: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/plasma/info/logo.png";
|
|
94
|
+
readonly hood: "https://coin-images.coingecko.com/asset_platforms/images/102132299/large/robinhood.png?1782921203";
|
|
95
|
+
readonly xlayer: "https://coin-images.coingecko.com/asset_platforms/images/238/large/x_logo.jpeg?1713243242";
|
|
96
|
+
readonly dash: "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/dash/info/logo.png";
|
|
97
|
+
readonly adi: "https://coin-images.coingecko.com/asset_platforms/images/102132311/large/adi-chain.png?1788338099";
|
|
79
98
|
};
|
|
80
99
|
type ChainId = keyof typeof CHAIN_ICONS;
|
|
81
100
|
/** Chains that use EVM-style addresses (0x...), as opposed to chain-specific formats. */
|
|
82
101
|
declare const EVM_CHAINS: ChainId[];
|
|
83
102
|
declare function isEvmChain(chain: ChainId): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Chains whose accounts are 0x EVM keys: every EVM chain plus HyperCore, which
|
|
105
|
+
* isn't an EVM but shares the key format. The default refund address (an EOA)
|
|
106
|
+
* is valid on all of them.
|
|
107
|
+
*/
|
|
108
|
+
declare function usesEvmAddress(chain: ChainId): boolean;
|
|
84
109
|
/**
|
|
85
110
|
* Chains whose deposit transactions require a memo/tag alongside the deposit
|
|
86
111
|
* address (1Click's `depositMode: MEMO`), without which funds can be lost.
|
|
@@ -155,9 +180,7 @@ declare const optimismOP: Token;
|
|
|
155
180
|
declare const solanaSOL: Token;
|
|
156
181
|
declare const solanaUSDC: Token;
|
|
157
182
|
declare const solanaUSDT: Token;
|
|
158
|
-
declare const solanaTRUMP: Token;
|
|
159
183
|
declare const solanaWIF: Token;
|
|
160
|
-
declare const solanaMELANIA: Token;
|
|
161
184
|
declare const bitcoinBTC: Token;
|
|
162
185
|
declare const polygonPOL: Token;
|
|
163
186
|
declare const polygonUSDC: Token;
|
|
@@ -186,6 +209,27 @@ declare const stellarUSDC: Token;
|
|
|
186
209
|
declare const nearNEAR: Token;
|
|
187
210
|
declare const nearUSDC: Token;
|
|
188
211
|
declare const nearUSDT: Token;
|
|
212
|
+
declare const gnosisUSDC: Token;
|
|
213
|
+
declare const gnosisUSDT: Token;
|
|
214
|
+
declare const gnosisXDAI: Token;
|
|
215
|
+
declare const gnosisEURe: Token;
|
|
216
|
+
declare const gnosisGNO: Token;
|
|
217
|
+
declare const gnosisCOW: Token;
|
|
218
|
+
declare const gnosisWETH: Token;
|
|
219
|
+
declare const hyperliquidUSDC: Token;
|
|
220
|
+
declare const hyperliquidNEAR: Token;
|
|
221
|
+
declare const plasmaUSDT0: Token;
|
|
222
|
+
declare const plasmaXPL: Token;
|
|
223
|
+
declare const monadMON: Token;
|
|
224
|
+
declare const monadUSDC: Token;
|
|
225
|
+
declare const monadUSDT0: Token;
|
|
226
|
+
declare const robinhoodETH: Token;
|
|
227
|
+
declare const robinhoodUSDG: Token;
|
|
228
|
+
declare const robinhoodCASHCAT: Token;
|
|
229
|
+
declare const xlayerUSDC: Token;
|
|
230
|
+
declare const xlayerUSDT0: Token;
|
|
231
|
+
declare const dashDASH: Token;
|
|
232
|
+
declare const adiADI: Token;
|
|
189
233
|
declare const CHAINS: Record<ChainId, Chain>;
|
|
190
234
|
declare const ALL_TOKENS: Token[];
|
|
191
235
|
/** Get token by name, e.g. getToken('arbitrumUSDC') */
|
|
@@ -230,12 +274,12 @@ interface QuoteOptions {
|
|
|
230
274
|
originToken: Token;
|
|
231
275
|
/** Destination token (target chain) */
|
|
232
276
|
destinationToken: Token;
|
|
233
|
-
/**
|
|
277
|
+
/** Human-readable input amount for EXACT_INPUT, output amount for EXACT_OUTPUT. */
|
|
234
278
|
amount: string;
|
|
235
279
|
/** Recipient address on destination chain */
|
|
236
280
|
recipient: string;
|
|
237
281
|
/** Refund address on origin chain (if swap fails) */
|
|
238
|
-
refundTo
|
|
282
|
+
refundTo?: string;
|
|
239
283
|
/** Slippage tolerance in basis points (100 = 1%) */
|
|
240
284
|
slippageTolerance?: number;
|
|
241
285
|
/** Swap type (default: EXACT_INPUT) */
|
|
@@ -257,6 +301,18 @@ interface QuoteResult {
|
|
|
257
301
|
memo?: string;
|
|
258
302
|
/** Expected input amount (smallest units) */
|
|
259
303
|
amountIn: string;
|
|
304
|
+
/** Expected input amount in human-readable units */
|
|
305
|
+
amountInFormatted: string;
|
|
306
|
+
/** Minimum accepted input amount (smallest units) */
|
|
307
|
+
minAmountIn?: string;
|
|
308
|
+
/** Friendly amount the payer should send (smallest units) */
|
|
309
|
+
paymentAmountIn: string;
|
|
310
|
+
/** Friendly amount the payer should send in human-readable units */
|
|
311
|
+
paymentAmountInFormatted: string;
|
|
312
|
+
/** Rounded surplus credited to Uniport Intents (smallest units) */
|
|
313
|
+
roundingRemainder: string;
|
|
314
|
+
/** Rounded surplus credited to Uniport Intents in human-readable units */
|
|
315
|
+
roundingRemainderFormatted: string;
|
|
260
316
|
/** Expected output amount (smallest units) */
|
|
261
317
|
amountOut: string;
|
|
262
318
|
/** Human-readable output amount */
|
|
@@ -286,6 +342,10 @@ interface StatusResult {
|
|
|
286
342
|
destinationTxHashes?: string[];
|
|
287
343
|
/** Origin chain transaction hashes (if available) */
|
|
288
344
|
originTxHashes?: string[];
|
|
345
|
+
/** 1Click's explorer link for each destination hash, index-aligned (newer backends only) */
|
|
346
|
+
destinationTxExplorerUrls?: (string | null)[];
|
|
347
|
+
/** 1Click's explorer link for each origin hash, index-aligned (newer backends only) */
|
|
348
|
+
originTxExplorerUrls?: (string | null)[];
|
|
289
349
|
}
|
|
290
350
|
/**
|
|
291
351
|
* Convert human-readable amount to smallest units
|
|
@@ -295,6 +355,13 @@ declare function toSmallestUnits(amount: string, decimals: number): string;
|
|
|
295
355
|
* Convert smallest units to human-readable amount
|
|
296
356
|
*/
|
|
297
357
|
declare function fromSmallestUnits(amount: string, decimals: number): string;
|
|
358
|
+
/** Maximum extra input collected when making EXACT_OUTPUT amounts readable. */
|
|
359
|
+
declare const MAX_EXACT_OUTPUT_ROUNDING_BPS = 25;
|
|
360
|
+
/**
|
|
361
|
+
* Round a smallest-unit amount upward to the shortest decimal representation
|
|
362
|
+
* that adds no more than MAX_EXACT_OUTPUT_ROUNDING_BPS (0.25%).
|
|
363
|
+
*/
|
|
364
|
+
declare function roundUpInputAmount(amount: string, decimals: number, maxIncreaseBps?: number): string;
|
|
298
365
|
/**
|
|
299
366
|
* Generate a deadline timestamp
|
|
300
367
|
*/
|
|
@@ -391,4 +458,4 @@ declare function resolveEnsName(name: string, options?: {
|
|
|
391
458
|
*/
|
|
392
459
|
declare function getUniportDefaultRefundAddress(): Promise<string>;
|
|
393
460
|
|
|
394
|
-
export { ALL_TOKENS, CHAINS, CHAINS_REQUIRING_MEMO, CHAIN_ICONS, type Chain, type ChainId, DEFAULT_HOSTED_BACKEND_URL, DEFAULT_REQUEST_TIMEOUT_MS, EVM_CHAINS, type EnsResolution, type ExecutionStatus, type QuoteOptions, type QuoteResult, type ResolvedUniportConfig, type StatusResult, type SwapType, TOKEN_ICONS, type Token, UNIPORT_ENS_NAME, UNIPORT_FALLBACK_REFUND_ADDRESS, type UniportApiErrorBody, type UniportConfig, UniportError, type UniportErrorCode, aptosAPT, arbitrumARB, arbitrumETH, arbitrumGMX, arbitrumUSDC, arbitrumUSDT, avalancheAVAX, avalancheUSDC, avalancheUSDT, baseBRETT, baseCbBTC, baseETH, baseUSDC, berachainBERA, bitcoinBTC, bitcoinCashBCH, bscBNB, bscUSDC, bscUSDT, cardanoADA, configureUniport, dogecoinDOGE, ethereumAAVE, ethereumDAI, ethereumETH, ethereumLINK, ethereumPEPE, ethereumSAFE, ethereumSHIB, ethereumTURBO, ethereumUNI, ethereumUSDC, ethereumUSDT, ethereumWBTC, formatDisplayAmount, fromSmallestUnits, generateDeadline, getExecutionStatus, getExplorerTxUrl, getQuote, getSupportedChains, getToken, getTokenByAssetId, getTokensByChain, getUniportConfig, getUniportDefaultRefundAddress, isEvmChain, litecoinLTC, nearNEAR, nearUSDC, nearUSDT, needsMemoDeposit, optimismETH, optimismOP, optimismUSDC, optimismUSDT, pollExecutionStatus, polygonPOL, polygonUSDC, polygonUSDT, resolveEnsName, rippleXRP,
|
|
461
|
+
export { ALL_TOKENS, CHAINS, CHAINS_REQUIRING_MEMO, CHAIN_ICONS, type Chain, type ChainId, DEFAULT_HOSTED_BACKEND_URL, DEFAULT_REQUEST_TIMEOUT_MS, EVM_CHAINS, type EnsResolution, type ExecutionStatus, MAX_EXACT_OUTPUT_ROUNDING_BPS, type QuoteOptions, type QuoteResult, type ResolvedUniportConfig, type StatusResult, type SwapType, TOKEN_ICONS, type Token, UNIPORT_ENS_NAME, UNIPORT_FALLBACK_REFUND_ADDRESS, type UniportApiErrorBody, type UniportConfig, UniportError, type UniportErrorCode, adiADI, aptosAPT, arbitrumARB, arbitrumETH, arbitrumGMX, arbitrumUSDC, arbitrumUSDT, avalancheAVAX, avalancheUSDC, avalancheUSDT, baseBRETT, baseCbBTC, baseETH, baseUSDC, berachainBERA, bitcoinBTC, bitcoinCashBCH, bscBNB, bscUSDC, bscUSDT, cardanoADA, configureUniport, dashDASH, dogecoinDOGE, ethereumAAVE, ethereumDAI, ethereumETH, ethereumLINK, ethereumPEPE, ethereumSAFE, ethereumSHIB, ethereumTURBO, ethereumUNI, ethereumUSDC, ethereumUSDT, ethereumWBTC, formatDisplayAmount, fromSmallestUnits, generateDeadline, getExecutionStatus, getExplorerTxUrl, getQuote, getSupportedChains, getToken, getTokenByAssetId, getTokensByChain, getUniportConfig, getUniportDefaultRefundAddress, gnosisCOW, gnosisEURe, gnosisGNO, gnosisUSDC, gnosisUSDT, gnosisWETH, gnosisXDAI, hyperliquidNEAR, hyperliquidUSDC, isEvmChain, litecoinLTC, monadMON, monadUSDC, monadUSDT0, nearNEAR, nearUSDC, nearUSDT, needsMemoDeposit, optimismETH, optimismOP, optimismUSDC, optimismUSDT, plasmaUSDT0, plasmaXPL, pollExecutionStatus, polygonPOL, polygonUSDC, polygonUSDT, resolveEnsName, rippleXRP, robinhoodCASHCAT, robinhoodETH, robinhoodUSDG, roundUpInputAmount, scrollETH, scrollUSDT, solanaSOL, solanaUSDC, solanaUSDT, solanaWIF, starknetSTRK, stellarUSDC, stellarXLM, submitDepositTx, suiSUI, suiUSDC, toSmallestUnits, tonTON, tonUSDT, tronTRX, tronUSDT, usesEvmAddress, xlayerUSDC, xlayerUSDT0, zcashZEC };
|