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/README.md
CHANGED
|
@@ -33,7 +33,7 @@ The SDK uses Uniport's hosted backend. No API key or backend URL is required for
|
|
|
33
33
|
|------|------|----------|-------------|
|
|
34
34
|
| `recipient` | `string` | Yes | Recipient wallet address on the destination chain |
|
|
35
35
|
| `destinationToken` | `string` | Yes | Destination token name from the supported token table |
|
|
36
|
-
| `amount` | `string` | No |
|
|
36
|
+
| `amount` | `string` | No | Exact destination amount. If omitted, the payer enters an input amount in the modal |
|
|
37
37
|
| `refundAddress` | `string` | No | Source-chain refund address to prefill in the modal |
|
|
38
38
|
| `label` | `string` | No | Button label |
|
|
39
39
|
| `variant` | `'default' \| 'compact' \| 'outline'` | No | Button style |
|
|
@@ -46,6 +46,8 @@ The SDK uses Uniport's hosted backend. No API key or backend URL is required for
|
|
|
46
46
|
|
|
47
47
|
If `refundAddress` is omitted, the payer can enter it inside the modal. The refund address is on the source chain the payer sends from.
|
|
48
48
|
|
|
49
|
+
When `amount` is supplied, the modal requests that exact destination amount and rounds the quoted input upward only when the increase is at most 0.25%. Rounded surplus and failed-swap refunds are credited to Uniport's configured Intents account. When `amount` is omitted, the payer enters an exact input amount and receives the quoted output.
|
|
50
|
+
|
|
49
51
|
**EVM source chains only:** if the payer leaves the refund address blank, it defaults to Uniport's own address (resolved from `uniport.eth`, with a hardcoded fallback if resolution fails) rather than blocking the payment. This exists because the underlying 1Click API currently requires an explicit refund address — it cannot yet auto-refund to the depositing wallet. On non-EVM chains (Sui, Solana, Bitcoin, etc.) a refund address is still required from the payer, since there is no Uniport-controlled address on those chains to fall back to.
|
|
50
52
|
|
|
51
53
|
## Supported Token Naming
|
|
@@ -61,8 +63,8 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
61
63
|
|
|
62
64
|
| Chain | Token Name | Symbol |
|
|
63
65
|
|-------|------------|--------|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
+
| Stellar | `stellarXLM` | XLM |
|
|
67
|
+
| Stellar | `stellarUSDC` | USDC |
|
|
66
68
|
| Ethereum | `ethereumETH` | ETH |
|
|
67
69
|
| Ethereum | `ethereumUSDC` | USDC |
|
|
68
70
|
| Ethereum | `ethereumUSDT` | USDT |
|
|
@@ -75,28 +77,26 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
75
77
|
| Ethereum | `ethereumPEPE` | PEPE |
|
|
76
78
|
| Ethereum | `ethereumTURBO` | TURBO |
|
|
77
79
|
| Ethereum | `ethereumSAFE` | SAFE |
|
|
78
|
-
| Solana | `solanaSOL` | SOL |
|
|
79
|
-
| Solana | `solanaUSDC` | USDC |
|
|
80
|
-
| Solana | `solanaUSDT` | USDT |
|
|
81
|
-
| Solana | `solanaTRUMP` | TRUMP |
|
|
82
|
-
| Solana | `solanaWIF` | $WIF |
|
|
83
|
-
| Solana | `solanaMELANIA` | MELANIA |
|
|
84
|
-
| Bitcoin | `bitcoinBTC` | BTC |
|
|
85
80
|
| Arbitrum | `arbitrumETH` | ETH |
|
|
86
81
|
| Arbitrum | `arbitrumUSDC` | USDC |
|
|
87
|
-
| Arbitrum | `arbitrumUSDT` |
|
|
82
|
+
| Arbitrum | `arbitrumUSDT` | USDT0 |
|
|
88
83
|
| Arbitrum | `arbitrumARB` | ARB |
|
|
89
84
|
| Arbitrum | `arbitrumGMX` | GMX |
|
|
90
85
|
| Base | `baseETH` | ETH |
|
|
91
86
|
| Base | `baseUSDC` | USDC |
|
|
92
87
|
| Base | `baseCbBTC` | cbBTC |
|
|
93
88
|
| Base | `baseBRETT` | BRETT |
|
|
94
|
-
|
|
|
95
|
-
|
|
|
89
|
+
| Sui | `suiSUI` | SUI |
|
|
90
|
+
| Sui | `suiUSDC` | USDC |
|
|
96
91
|
| Optimism | `optimismETH` | ETH |
|
|
97
92
|
| Optimism | `optimismUSDC` | USDC |
|
|
98
93
|
| Optimism | `optimismUSDT` | USDT |
|
|
99
94
|
| Optimism | `optimismOP` | OP |
|
|
95
|
+
| Solana | `solanaSOL` | SOL |
|
|
96
|
+
| Solana | `solanaUSDC` | USDC |
|
|
97
|
+
| Solana | `solanaUSDT` | USDT |
|
|
98
|
+
| Solana | `solanaWIF` | $WIF |
|
|
99
|
+
| Bitcoin | `bitcoinBTC` | BTC |
|
|
100
100
|
| Polygon | `polygonPOL` | POL |
|
|
101
101
|
| Polygon | `polygonUSDC` | USDC |
|
|
102
102
|
| Polygon | `polygonUSDT` | USDT |
|
|
@@ -106,7 +106,7 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
106
106
|
| BNB Chain | `bscBNB` | BNB |
|
|
107
107
|
| BNB Chain | `bscUSDC` | USDC |
|
|
108
108
|
| BNB Chain | `bscUSDT` | USDT |
|
|
109
|
-
| TON | `tonTON` |
|
|
109
|
+
| TON | `tonTON` | GRAM |
|
|
110
110
|
| TON | `tonUSDT` | USDT |
|
|
111
111
|
| Tron | `tronTRX` | TRX |
|
|
112
112
|
| Tron | `tronUSDT` | USDT |
|
|
@@ -122,8 +122,29 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
|
|
|
122
122
|
| Starknet | `starknetSTRK` | STRK |
|
|
123
123
|
| Berachain | `berachainBERA` | BERA |
|
|
124
124
|
| Zcash | `zcashZEC` | ZEC |
|
|
125
|
-
|
|
|
126
|
-
|
|
|
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 |
|
|
127
148
|
|
|
128
149
|
## Display amounts
|
|
129
150
|
|
|
@@ -165,6 +186,7 @@ The package exports:
|
|
|
165
186
|
- `getExecutionStatus`
|
|
166
187
|
- `getExplorerTxUrl` — block-explorer transaction URL for a given chain
|
|
167
188
|
- `isEvmChain` — whether a `ChainId` is EVM-compatible
|
|
189
|
+
- `usesEvmAddress` — whether a `ChainId` uses 0x EVM accounts (every EVM chain, plus HyperCore)
|
|
168
190
|
- `resolveEnsName` — resolve any `.eth` name via the ENSIdeas API
|
|
169
191
|
- `formatDisplayAmount` — rounds a human-readable amount to 6 significant digits for UI display only (never use the result for on-chain amounts)
|
|
170
192
|
- `needsMemoDeposit` — whether a `ChainId` requires a memo alongside its deposit address
|