@circle-fin/app-kit 1.8.0 → 1.9.0
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/CHANGELOG.md +53 -0
- package/README.md +3 -3
- package/bridge.cjs +469 -231
- package/bridge.d.cts +16 -2
- package/bridge.d.mts +16 -2
- package/bridge.d.ts +16 -2
- package/bridge.mjs +469 -231
- package/chains.cjs +94 -0
- package/chains.d.cts +2 -0
- package/chains.d.mts +2 -0
- package/chains.d.ts +2 -0
- package/chains.mjs +94 -0
- package/context.d.cts +16 -2
- package/context.d.mts +16 -2
- package/context.d.ts +16 -2
- package/earn.cjs +438 -208
- package/earn.d.cts +33 -13
- package/earn.d.mts +33 -13
- package/earn.d.ts +33 -13
- package/earn.mjs +438 -208
- package/estimateBridge.cjs +469 -231
- package/estimateBridge.d.cts +16 -2
- package/estimateBridge.d.mts +16 -2
- package/estimateBridge.d.ts +16 -2
- package/estimateBridge.mjs +469 -231
- package/estimateSwap.cjs +210 -87
- package/estimateSwap.d.cts +16 -2
- package/estimateSwap.d.mts +16 -2
- package/estimateSwap.d.ts +16 -2
- package/estimateSwap.mjs +210 -87
- package/index.cjs +884 -413
- package/index.d.cts +284 -27
- package/index.d.mts +284 -27
- package/index.d.ts +284 -27
- package/index.mjs +884 -413
- package/package.json +12 -6
- package/swap.cjs +210 -87
- package/swap.d.cts +16 -2
- package/swap.d.mts +16 -2
- package/swap.d.ts +16 -2
- package/swap.mjs +210 -87
- package/unifiedBalance.cjs +119 -5
- package/unifiedBalance.d.cts +2 -0
- package/unifiedBalance.d.mts +2 -0
- package/unifiedBalance.d.ts +2 -0
- package/unifiedBalance.mjs +119 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @circle-fin/app-kit
|
|
2
2
|
|
|
3
|
+
## 1.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add support for bridging USDC to and from Cronos (mainnet and testnet) via CCTP v2.
|
|
8
|
+
- Support `token: 'EURC'` in App Kit `send()` and `estimateSend()`.
|
|
9
|
+
|
|
10
|
+
`EURC` is now a recognized token alias alongside `USDC`, `USDT`, and `NATIVE`.
|
|
11
|
+
On chains where EURC is deployed (the chain definition's `eurcAddress` is set,
|
|
12
|
+
e.g. Arc Testnet), `send({ token: 'EURC', ... })` resolves the EURC contract
|
|
13
|
+
address and routes the transfer through the generic token transfer action with
|
|
14
|
+
6 decimals. On chains without an `eurcAddress`, `EURC` is rejected with an
|
|
15
|
+
`INPUT_UNSUPPORTED_TOKEN` error.
|
|
16
|
+
|
|
17
|
+
Previously `send()` rejected `token: 'EURC'` outright — even on chains where
|
|
18
|
+
EURC was configured — because `EURC` was not in the send token alias list.
|
|
19
|
+
|
|
20
|
+
- Add a `headers` config option to forward custom HTTP headers with CCTP
|
|
21
|
+
attestation API requests.
|
|
22
|
+
|
|
23
|
+
`CCTPV2Config`, `BridgeKitConfig`, and the AppKit context now accept an optional
|
|
24
|
+
`headers` map. The headers are sent with every Circle attestation (Iris) API
|
|
25
|
+
request the CCTP v2 provider makes — attestation fetch, re-attestation, and
|
|
26
|
+
relayer mint status polling — and are merged on top of the SDK defaults (such
|
|
27
|
+
as `Content-Type`) rather than replacing them.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Fix withdrawal fee metadata being dropped, and correctly surface errors for pending profit-and-loss (PnL) calculations.
|
|
32
|
+
- Fix a missing runtime dependency (`@coral-xyz/anchor`, `@noble/curves`, `bn.js`,
|
|
33
|
+
`@ethersproject/keccak256`, and `pino`) that could cause `Could not find package`
|
|
34
|
+
errors under strict module resolvers (Deno, Supabase Edge Runtime, pnpm).
|
|
35
|
+
|
|
36
|
+
## 1.8.1
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Fix same-chain swaps reporting `progress.status: 'FAILED'` (or `'PENDING'`) instead of `'DONE'` and dropping `amountOut`.
|
|
41
|
+
|
|
42
|
+
A same-chain swap completes atomically in its source transaction, which is already confirmed (and checked for revert) before the result is returned. The provider now treats that as a terminal `'DONE'` and briefly polls the status endpoint (a short ~5s budget, returning early as soon as the amount lands) to enrich `amountOut`. Previously a slow, unresolved, or erroneous status response from the service could downgrade an already-successful swap to `'FAILED'`/`'PENDING'` and omit `amountOut`. If the amount is still unresolved when the budget elapses, `swap()` returns `'DONE'` without `amountOut` and the caller can fetch it later via `getSwapStatus`. Cross-chain swaps are unaffected — they still return `'PENDING'` and should be polled to completion with `getSwapStatus`/`waitForSwap`.
|
|
43
|
+
|
|
3
44
|
## 1.8.0
|
|
4
45
|
|
|
5
46
|
### Minor Changes
|
|
@@ -60,6 +101,7 @@
|
|
|
60
101
|
|
|
61
102
|
- Enable Circle's Forwarding Service as a destination for Solana (mainnet and devnet). A Gateway `spend` with `useForwarder: true` to a Solana destination is now accepted instead of being rejected.
|
|
62
103
|
- Add cross-chain swap support to SwapKit, AppKit, and the Stablecoin Service swap provider.
|
|
104
|
+
|
|
63
105
|
- `swap` and `estimate` can now route the output token to another supported chain with `to.chain`.
|
|
64
106
|
- Cross-chain swaps can send the output to a recipient on the destination chain with `to.recipientAddress`.
|
|
65
107
|
- `getSwapStatus` and `waitForSwap` can now track cross-chain swaps until they finish, including progress details for source and destination activity.
|
|
@@ -67,6 +109,7 @@
|
|
|
67
109
|
- Invalid transaction hashes or unsupported chain values are reported as structured validation errors before a status request is sent.
|
|
68
110
|
|
|
69
111
|
- Add `getTokenRates` to SwapKit and AppKit for fetching USD rates for tokens on a chain.
|
|
112
|
+
|
|
70
113
|
- Look up rates by registered token symbol, native token alias (`NATIVE`, `ETH`, `POL`, etc.), raw EVM token address, or Solana mint.
|
|
71
114
|
- Token symbols are resolved through the kit token registry for the requested chain.
|
|
72
115
|
- Native tokens are normalized to the service native-token address before the request is sent.
|
|
@@ -80,6 +123,7 @@
|
|
|
80
123
|
| Code | Name | Type | Recoverability |
|
|
81
124
|
| ------ | ------------- | --------- | -------------- |
|
|
82
125
|
| `8104` | `EARN_PAUSED` | `SERVICE` | `RETRYABLE` |
|
|
126
|
+
|
|
83
127
|
- `@circle-fin/earn-kit` / `@circle-fin/app-kit`: the publicly re-exported
|
|
84
128
|
`EarnError` registry now includes `EARN_PAUSED`. Consumers that branch on
|
|
85
129
|
`EarnError` (or on `recoverability`) gain this value and can detect the
|
|
@@ -125,6 +169,7 @@
|
|
|
125
169
|
A cross-chain `deposit()` returns an `execId` while the bridge (source burn ->
|
|
126
170
|
CCTP attestation -> destination mint) is still settling. Two new kit methods let
|
|
127
171
|
you follow it:
|
|
172
|
+
|
|
128
173
|
- `kit.getCrossChainDepositStatus({ execId })` - read the deposit's current
|
|
129
174
|
bridge status (source, CCTP, and destination hops) once.
|
|
130
175
|
- `kit.waitForCrossChainDeposit({ execId, pollIntervalMs?, maxWaitMs?, signal? })`
|
|
@@ -142,6 +187,7 @@
|
|
|
142
187
|
- Surface the source-collected bridge fees in cross-chain Earn deposit quotes, and let callers pick the CCTP transfer speed.
|
|
143
188
|
|
|
144
189
|
New:
|
|
190
|
+
|
|
145
191
|
- `getDepositQuote` now accepts a cross-chain variant: pass a destination `chain` and `address` that differ from `from.chain` (same `SameChain` / `CrossChain` discriminator pattern as `deposit()`). Same-chain quotes are unchanged.
|
|
146
192
|
- Cross-chain quotes return the source-collected bridge fees in `EarnDepositQuoteInfo.fees` as one entry per fee item. Each entry carries its own `type` (e.g. `'FORWARD'`, `'PRE_FINALITY'`) and `status` (e.g. `'estimated'` for a pre-sign estimate). Same-chain quotes return `fees: []`.
|
|
147
193
|
- Cross-chain `deposit()` and `getDepositQuote()` accept an optional `transferSpeed` (`'FAST'` | `'SLOW'`), forwarded to the bridge prepare request so the quote prices — and the deposit burns — the chosen CCTP finality path.
|
|
@@ -151,6 +197,7 @@
|
|
|
151
197
|
- The cross-chain pre-sign value guard is now fee-aware: the prepared bundle's `feeQuote` (`feeToken` + `items[]`) is parsed, the fee token is pinned to the source token contract, and the signed authorization `value` is checked against `principal + sum(feeQuote.items[].amount)` rather than the principal alone, so fee-bearing deposits are accepted while any other value tampering is still rejected before signing.
|
|
152
198
|
|
|
153
199
|
Notes:
|
|
200
|
+
|
|
154
201
|
- The cross-chain fees are pre-sign **estimates** sourced from the bridge prepare path; the value shown at quote time may differ from the amount locked at deposit/sign. This is signalled per fee via `status: 'estimated'`.
|
|
155
202
|
- Existing same-chain `getDepositQuote` callers are unaffected — the response shape is unchanged for same-chain quotes.
|
|
156
203
|
|
|
@@ -159,6 +206,7 @@
|
|
|
159
206
|
Cross-chain deposits use the same nested `from`/`to` input shape as the other kits: `from: { adapter, chain }` is the source signer and `to: { chain, recipientAddress }` is the Earn destination. `from.chain` and `to.chain` are constrained at compile time to the supported route (Ethereum Sepolia, Arbitrum Sepolia, or Base Sepolia as sources; Arc Testnet as the destination), the source adapter must support `signTypedData`, and amounts accept at most 6 decimal places (USDC precision). Cross-chain results report the bridge `execId`, an API-defined bridge lifecycle `status`, `sourceChain`/`destinationChain`, and the prepared bundle expiry.
|
|
160
207
|
|
|
161
208
|
Every published name keeps its existing shape; cross-chain support lands under new names:
|
|
209
|
+
|
|
162
210
|
- `EarnDepositOutcome` is the new union of `EarnSameChainDepositResult | EarnCrossChainDepositResult`. Narrow with `result.kind === 'cross-chain'` — `kind` is always set at runtime, but optional on the same-chain member so the pre-cross-chain result shape remains assignable.
|
|
163
211
|
- `AnyDepositParams` (kit) and `AnyDepositServiceParams` (provider) are the new param unions of the same-chain and cross-chain variants; `anyDepositParamsSchema` is the matching validation schema.
|
|
164
212
|
- `deposit()` gains overloads: same-chain params resolve to `EarnSameChainDepositResult`, cross-chain params to `EarnCrossChainDepositResult`, so existing same-chain call sites keep their narrow result type.
|
|
@@ -166,11 +214,13 @@
|
|
|
166
214
|
- `EarningProvider` gains an **optional** `supportsCrossChainDeposit(source, destination)` method (mirroring swap-kit's route-aware `supportsRoute`). The kit only routes cross-chain deposits to providers that implement it and return `true`; existing provider implementations keep compiling and never receive cross-chain params.
|
|
167
215
|
|
|
168
216
|
Deprecations (existing aliases keep working):
|
|
217
|
+
|
|
169
218
|
- `EarnDepositResult` — use `EarnSameChainDepositResult`, or `EarnDepositOutcome` for cross-chain-aware code. This alias may repoint to `EarnDepositOutcome` in the next major.
|
|
170
219
|
- `DepositParams` / `DepositServiceParams` — use `SameChainDepositParams` / `SameChainDepositServiceParams`, or the `Any*` unions for cross-chain-aware code.
|
|
171
220
|
- `depositParamsSchema` — use `anyDepositParamsSchema`, which also accepts cross-chain deposit params.
|
|
172
221
|
|
|
173
222
|
Type changes (diagnostic types only):
|
|
223
|
+
|
|
174
224
|
- `EarnErrorTrace`: the deposit variant's `params` is now `AnyDepositServiceParams`, and `steps` may include `EarnBridgeDepositStep` entries for cross-chain deposits.
|
|
175
225
|
- `EarningProvider.retry()` and `EarnKit.retry()` may now resolve to `EarnCrossChainDepositResult` when resuming a cross-chain deposit.
|
|
176
226
|
- `EarnActionName` gains `'crossChainDeposit'`.
|
|
@@ -184,6 +234,7 @@
|
|
|
184
234
|
- EarnKit now validates amount precision and format locally to match the Earn
|
|
185
235
|
Service, so malformed amounts fail fast with a clear SDK error instead of a
|
|
186
236
|
server round-trip.
|
|
237
|
+
|
|
187
238
|
- Same-chain deposit/withdraw/quote amounts are now capped at 6 decimal places
|
|
188
239
|
(USDC/EURC), matching the server and the existing cross-chain amount schema.
|
|
189
240
|
Previously up to 18 decimal places passed local validation and only the
|
|
@@ -321,6 +372,7 @@
|
|
|
321
372
|
### Major Changes
|
|
322
373
|
|
|
323
374
|
- Introducing AppKit — a unified SDK for stablecoin operations combining bridging, swapping, and token transfers in one interface.
|
|
375
|
+
|
|
324
376
|
- `kit.bridge()` — cross-chain USDC transfers via CCTP v2 across 35+ supported chains
|
|
325
377
|
- `kit.swap()` — same-chain token swaps with smart routing across DEX liquidity sources
|
|
326
378
|
- `kit.send()` — same-chain transfers for USDC, USDT, native tokens, and any ERC-20/SPL token by contract address
|
|
@@ -328,6 +380,7 @@
|
|
|
328
380
|
Each operation has a corresponding estimate method (`estimateBridge`, `estimateSwap`, `estimateSend`) to preview fees and output amounts before executing.
|
|
329
381
|
|
|
330
382
|
Additional features:
|
|
383
|
+
|
|
331
384
|
- Unified developer fee configuration across all operations
|
|
332
385
|
- Action event system for monitoring operation lifecycle
|
|
333
386
|
- Tree-shakeable subpath imports (`/bridge`, `/swap`, `/chains`, `/context`)
|
package/README.md
CHANGED
|
@@ -65,9 +65,9 @@ The App Kit provides a **unified interface** for cross-chain transfers, same-cha
|
|
|
65
65
|
- **🔧 Bring your own infrastructure**: Seamlessly integrate with your existing setup when needed
|
|
66
66
|
- **🔒 Production-ready security**: Leverages Circle's CCTPv2 for bridging and trusted swap providers
|
|
67
67
|
- **🚀 Developer experience**: Complete TypeScript support, comprehensive validation, and instant connectivity
|
|
68
|
-
- **🌍 Multi-chain support**: Bridge across **
|
|
69
|
-
- **Mainnet (
|
|
70
|
-
- **Testnet (
|
|
68
|
+
- **🌍 Multi-chain support**: Bridge across **47 chains** with **1058 total bridge routes** through Circle's CCTPv2
|
|
69
|
+
- **Mainnet (23 chains)**: Arbitrum, Avalanche, Base, Codex, Cronos, Edge, Ethereum, HyperEVM, Injective, Ink, Linea, Monad, Morph, OP Mainnet, Pharos, Plume, Polygon PoS, Sei, Solana, Sonic, Unichain, World Chain, XDC
|
|
70
|
+
- **Testnet (24 chains)**: Arc Testnet, Arbitrum Sepolia, Avalanche Fuji, Base Sepolia, Codex Testnet, Cronos Testnet, Edge Testnet, Ethereum Sepolia, HyperEVM Testnet, Injective Testnet, Ink Testnet, Linea Sepolia, Monad Testnet, Morph Testnet, OP Sepolia, Pharos Atlantic, Plume Testnet, Polygon PoS Amoy, Sei Testnet, Solana Devnet, Sonic Testnet, Unichain Sepolia, World Chain Sepolia, XDC Apothem
|
|
71
71
|
- **🔄 Swap support**: Same-chain token swaps powered by Circle's Stablecoin Service
|
|
72
72
|
- **🏦 Earn support**: DeFi lending vault deposits, withdrawals, and reward claims via `kit.earn`
|
|
73
73
|
- **🎯 Flexible adapters**: Supporting EVM (Viem, Ethers) and Solana (@solana/web3)
|