@circle-fin/app-kit 1.13.0 → 1.15.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +3 -3
  3. package/bridge.cjs +8388 -515
  4. package/bridge.d.cts +640 -61
  5. package/bridge.d.mts +640 -61
  6. package/bridge.d.ts +640 -61
  7. package/bridge.mjs +8389 -516
  8. package/chains.cjs +275 -15
  9. package/chains.d.cts +117 -2
  10. package/chains.d.mts +117 -2
  11. package/chains.d.ts +117 -2
  12. package/chains.mjs +275 -16
  13. package/context.d.cts +577 -57
  14. package/context.d.mts +577 -57
  15. package/context.d.ts +577 -57
  16. package/earn.cjs +973 -271
  17. package/earn.d.cts +577 -57
  18. package/earn.d.mts +577 -57
  19. package/earn.d.ts +577 -57
  20. package/earn.mjs +919 -221
  21. package/estimateBridge.cjs +8388 -518
  22. package/estimateBridge.d.cts +704 -82
  23. package/estimateBridge.d.mts +704 -82
  24. package/estimateBridge.d.ts +704 -82
  25. package/estimateBridge.mjs +8390 -520
  26. package/estimateSwap.cjs +982 -237
  27. package/estimateSwap.d.cts +577 -57
  28. package/estimateSwap.d.mts +577 -57
  29. package/estimateSwap.d.ts +577 -57
  30. package/estimateSwap.mjs +981 -237
  31. package/index.cjs +21401 -8522
  32. package/index.d.cts +6045 -2149
  33. package/index.d.mts +6045 -2149
  34. package/index.d.ts +6045 -2149
  35. package/index.mjs +21401 -8524
  36. package/package.json +17 -6
  37. package/server.cjs +10040 -0
  38. package/server.cjs.map +1 -0
  39. package/server.d.cts +2467 -0
  40. package/server.d.mts +2467 -0
  41. package/server.d.ts +2467 -0
  42. package/server.mjs +10028 -0
  43. package/server.mjs.map +1 -0
  44. package/swap.cjs +982 -237
  45. package/swap.d.cts +577 -57
  46. package/swap.d.mts +577 -57
  47. package/swap.d.ts +577 -57
  48. package/swap.mjs +981 -237
  49. package/unifiedBalance.cjs +20510 -7599
  50. package/unifiedBalance.d.cts +807 -201
  51. package/unifiedBalance.d.mts +807 -201
  52. package/unifiedBalance.d.ts +807 -201
  53. package/unifiedBalance.mjs +20513 -7603
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # @circle-fin/app-kit
2
2
 
3
+ ## 1.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add an `onramp` namespace and a `@circle-fin/app-kit/server` entry point. `kit.onramp` can fetch a session and mount the Arc Onramp widget (`mountIframe` / `openWindow`). `createAppServerKit` validates onramp credentials and mints sessions on the server.
8
+ - Add Arc mainnet (`Blockchain.Arc`, chainId 5042) as a supported chain. Arc is wired for CCTP v2 bridging (`BridgeChain.Arc`, domain 26) with Circle's Forwarding Service enabled for Arc as a destination, and for Gateway v1 (`UnifiedBalanceChain.Arc`).
9
+ - Add Arc mainnet (`Blockchain.Arc`, chainId 5042) as an EarnKit-selectable chain alongside Arc Testnet. `EarnChain.Arc` is now exposed for earn operations, and the Earn Service provider maps `Blockchain.Arc` to the `ARC` Earn API chain and reports it in `supportedChains`. App Kit re-exports this through its `earn` namespace, so `EarnChain.Arc` is selectable via App Kit as well.
10
+ - Add Arc mainnet as a destination for FAST cross-chain deposits. You can now call `depositFor` with a cross-chain source and Arc mainnet (`UnifiedBalanceChain.Arc`) as the destination; previously that destination was rejected as unsupported.
11
+ - Enable Arc mainnet swaps for USDC and EURC. `SwapChain.Arc` is accepted by swap operations, the Arc mainnet EURC token locator is registered, and Arc mainnet USDC EIP-2612 permit metadata (name "USDC", version "2") is included for gasless approvals.
12
+ - Bridge EURC between Base and Ethereum mainnet
13
+
14
+ App Kit now supports EURC transfers between Base and Ethereum mainnet through Circle's CCTPx protocol. Pass `EURC` as `token` on `bridge` and `estimateBridge`:
15
+
16
+ ```ts
17
+ import { AppKit } from "@circle-fin/app-kit";
18
+
19
+ const kit = new AppKit();
20
+
21
+ const result = await kit.bridge({
22
+ token: "EURC",
23
+ from: { adapter, chain: "Base" },
24
+ to: { adapter, chain: "Ethereum" },
25
+ amount: "100",
26
+ });
27
+ ```
28
+
29
+ CCTPx also supports `cirBTC`, `wETH`, `EURC`, and raw `bytes32` token ids on eligible testnet routes.
30
+
31
+ - Routed results support provider-defined token identifiers while bare `BridgeResult` and `EstimateResult` types remain USDC-specific for source compatibility.
32
+ - `bridge` and `estimateBridge` reject custom fees on non-USDC routes. CCTPx routes accept `feePayment` only when omitted or set to `'source'`, and `useForwarder` only when omitted or set to `true`.
33
+ - Route discovery continues to other providers when one provider's route check fails. If no provider supports the route, App Kit preserves retryable failures on the resulting error.
34
+
35
+ - Make Arc mainnet a CCTPx endpoint
36
+
37
+ Arc mainnet's chain definition gains `cctpx.serviceAddress`, pointing at the mainnet
38
+ CrossChainTokenService. `isCCTPXSupported(Chains.Arc)` becomes `true`, so Arc joins the
39
+ chains reported by `CCTPXBridgingProvider.getSupportedChains()`, and by Bridge Kit and App
40
+ Kit through it.
41
+
42
+ A chain being eligible does not by itself make a route usable: the token registry must list
43
+ the token with a deployment on both endpoints' CCTP domains.
44
+
45
+ - Enable CCTPx on Arbitrum, Avalanche, Optimism and Polygon mainnet
46
+
47
+ These four chain definitions gain `cctpx.serviceAddress`, pointing at the mainnet
48
+ CrossChainTokenService. They join Ethereum and Base in the chains reported by
49
+ `CCTPXBridgingProvider.getSupportedChains()`, and by Bridge Kit and App Kit through it.
50
+
51
+ A chain being eligible does not by itself make a route usable: the token registry must list
52
+ the token with a deployment on both endpoints' CCTP domains.
53
+
54
+ - Reuse an `estimate` quote when bridging (CCTPx)
55
+
56
+ Pass the `quote` returned by `estimateBridge` into `bridge` so the fee
57
+ you were quoted is the fee you pay. Treat the value as opaque and pass
58
+ it back unmodified.
59
+
60
+ Do not pass a quote into `estimateBridge`. If the supplied quote is
61
+ stale or does not match the requested fee token and speed, CCTPx
62
+ fetches a fresh quote and adds `QUOTE_NOT_REUSED` to `result.warnings`,
63
+ which means the fee paid may differ from the one quoted. A CCTPx quote
64
+ passed to a plain USDC bridge is ignored. Re-estimate whenever the
65
+ transfer changes.
66
+
67
+ - Enable Circle's Forwarding Service as a destination for Arc mainnet. The Forwarding Service now supports Gateway transaction types on Arc, so a Gateway `spend` with `useForwarder: true` to an Arc mainnet destination is now accepted instead of being rejected up front.
68
+
69
+ ## 1.14.0
70
+
71
+ ### Minor Changes
72
+
73
+ - Add fast cross-chain deposits and fee estimation to Unified Balance Kit.
74
+
75
+ ## Fast cross-chain deposits
76
+
77
+ `deposit` and `depositFor` now accept a `to` field and a `config.transferSpeed`
78
+ of `'FAST'` to burn USDC on the source chain and credit a Gateway balance on a
79
+ different destination chain in a single relayed flow:
80
+
81
+ ```typescript
82
+ const result = await kit.deposit({
83
+ from,
84
+ amount: "10",
85
+ token: "USDC",
86
+ to: { chain: "Arc_Testnet" },
87
+ config: { transferSpeed: "FAST" },
88
+ });
89
+ ```
90
+
91
+ `DepositResult` now includes `fees`, `progress`, `sourceChain`, and
92
+ `destinationChain` on the fast path.
93
+
94
+ ## Fee estimation
95
+
96
+ New `estimateDeposit` method returns an itemized fee breakdown and a signed
97
+ quote that can be passed directly into a subsequent `deposit` / `depositFor` to
98
+ lock the price:
99
+
100
+ ```typescript
101
+ const estimate = await kit.estimateDeposit({
102
+ from,
103
+ amount: "10",
104
+ token: "USDC",
105
+ to: { chain: "Arc_Testnet" },
106
+ config: { transferSpeed: "FAST" },
107
+ });
108
+
109
+ // Spread the estimate at the top level; re-attach `from` (which holds the signer).
110
+ // The signed `quote` inside the estimate locks the quoted fee for this call.
111
+ const result = await kit.deposit({ ...estimate, from });
112
+ ```
113
+
114
+ `estimateDeposit` is also available on `AppKit` via
115
+ `kit.unifiedBalance.estimateDeposit(...)`.
116
+
117
+ ### Patch Changes
118
+
119
+ - Fix `getSupportedChains({ sourceFeeSupported: true })` over-reporting source-fee
120
+ bridging support. Previously, source-fee eligibility was inferred from a contract
121
+ address shared with the fast-deposit forwarding path, causing fast-deposit-only chains
122
+ to appear supported and fail at the Quote API instead of being rejected client-side.
123
+ Source-fee support is now gated on an explicit allowlist of eligible source chains.
124
+
3
125
  ## 1.13.0
4
126
 
5
127
  ### Minor Changes
package/README.md CHANGED
@@ -65,8 +65,8 @@ 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 **51 chains** with **1250 total bridge routes** through Circle's CCTPv2
69
- - **Mainnet (25 chains)**: Arbitrum, Avalanche, Base, Codex, Cronos, Edge, Ethereum, HyperEVM, Injective, Ink, Linea, Monad, Morph, OP Mainnet, Pharos, Plasma, Plume, Polygon PoS, Sei, Solana, Sonic, Unichain, World Chain, XDC, X Layer
68
+ - **🌍 Multi-chain support**: Bridge across **52 chains** with **1300 total bridge routes** through Circle's CCTPv2
69
+ - **Mainnet (26 chains)**: Arbitrum, Arc, Avalanche, Base, Codex, Cronos, Edge, Ethereum, HyperEVM, Injective, Ink, Linea, Monad, Morph, OP Mainnet, Pharos, Plasma, Plume, Polygon PoS, Sei, Solana, Sonic, Unichain, World Chain, XDC, X Layer
70
70
  - **Testnet (26 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, Plasma Testnet, Plume Testnet, Polygon PoS Amoy, Sei Testnet, Solana Devnet, Sonic Testnet, Unichain Sepolia, World Chain Sepolia, XDC Apothem, X Layer Testnet
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`
@@ -163,7 +163,7 @@ const result = await kit.bridge({
163
163
  })
164
164
  ```
165
165
 
166
- A curated subset of 37 CCTPv2-supported chains is available for import from App Kit.
166
+ A curated subset of 40 CCTPv2-supported chains is available for import from App Kit.
167
167
 
168
168
  ## Quick Start
169
169