uniport-sdk 0.0.5 → 0.0.7

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 CHANGED
@@ -91,6 +91,8 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
91
91
  | Base | `baseUSDC` | USDC |
92
92
  | Base | `baseCbBTC` | cbBTC |
93
93
  | Base | `baseBRETT` | BRETT |
94
+ | Scroll | `scrollETH` | ETH |
95
+ | Scroll | `scrollUSDT` | USDT |
94
96
  | Optimism | `optimismETH` | ETH |
95
97
  | Optimism | `optimismUSDC` | USDC |
96
98
  | Optimism | `optimismUSDT` | USDT |
@@ -120,6 +122,36 @@ Legacy short aliases such as `arbUSDC` and `ethUSDC` are still accepted for back
120
122
  | Starknet | `starknetSTRK` | STRK |
121
123
  | Berachain | `berachainBERA` | BERA |
122
124
  | Zcash | `zcashZEC` | ZEC |
125
+ | Stellar | `stellarXLM` | XLM |
126
+ | Stellar | `stellarUSDC` | USDC |
127
+
128
+ ## Display amounts
129
+
130
+ Cross-chain quotes routinely land on odd decimals — e.g. paying exactly 5 USDC
131
+ may quote as `0.002703957684923543 ETH` on the destination side. The built-in
132
+ `UniportModal` rounds all displayed estimates to 6 significant digits via
133
+ `formatDisplayAmount` so payers see something readable (e.g. `0.0027040`).
134
+ This is display-only: the actual quote, deposit amount, and settlement values
135
+ are never altered — only the text shown in the UI is rounded.
136
+
137
+ ## Memo-required chains
138
+
139
+ Some chains (currently: Stellar) require a memo alongside the deposit address
140
+ — sending funds without it can make the deposit unrecoverable. `UniportModal`
141
+ automatically requests the correct deposit mode for these chains and displays
142
+ the memo prominently, with its own copy button, right next to the deposit
143
+ address. `needsMemoDeposit(chain)` is exported if you need this in custom UI.
144
+
145
+ Note: the underlying 1Click API's own documentation suggests TON and XRP may
146
+ also need this, but that isn't the case for the chains actively supported
147
+ today (verified directly against the live API) — only Stellar currently
148
+ requires it. If this changes, `CHAINS_REQUIRING_MEMO` in `core/tokens.ts` is
149
+ the single place to update.
150
+
151
+ Stellar also has a chain-specific quirk worth knowing: non-native assets
152
+ (e.g. Stellar USDC) require the receiving address to have an established
153
+ trustline for that asset, or funds cannot be delivered. `UniportModal` warns
154
+ about this when a refund address is entered for a non-XLM Stellar token.
123
155
 
124
156
  ## Core Exports
125
157
 
@@ -134,6 +166,8 @@ The package exports:
134
166
  - `getExplorerTxUrl` — block-explorer transaction URL for a given chain
135
167
  - `isEvmChain` — whether a `ChainId` is EVM-compatible
136
168
  - `resolveEnsName` — resolve any `.eth` name via the ENSIdeas API
169
+ - `formatDisplayAmount` — rounds a human-readable amount to 6 significant digits for UI display only (never use the result for on-chain amounts)
170
+ - `needsMemoDeposit` — whether a `ChainId` requires a memo alongside its deposit address
137
171
  - token constants such as `arbitrumUSDC`, `ethereumUSDC`, and `solanaSOL`
138
172
 
139
173
  ## Errors