@circle-fin/app-kit 1.12.1 → 1.14.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 +115 -0
- package/README.md +31 -12
- package/bridge.cjs +3231 -340
- package/bridge.d.cts +141 -17
- package/bridge.d.mts +141 -17
- package/bridge.d.ts +141 -17
- package/bridge.mjs +3233 -342
- package/chains.cjs +261 -8
- package/chains.d.cts +135 -1
- package/chains.d.mts +135 -1
- package/chains.d.ts +135 -1
- package/chains.mjs +260 -9
- package/context.d.cts +141 -17
- package/context.d.mts +141 -17
- package/context.d.ts +141 -17
- package/earn.cjs +887 -63
- package/earn.d.cts +141 -17
- package/earn.d.mts +141 -17
- package/earn.d.ts +141 -17
- package/earn.mjs +883 -63
- package/estimateBridge.cjs +3231 -340
- package/estimateBridge.d.cts +257 -18
- package/estimateBridge.d.mts +257 -18
- package/estimateBridge.d.ts +257 -18
- package/estimateBridge.mjs +3233 -342
- package/estimateSwap.cjs +988 -146
- package/estimateSwap.d.cts +141 -17
- package/estimateSwap.d.mts +141 -17
- package/estimateSwap.d.ts +141 -17
- package/estimateSwap.mjs +987 -146
- package/index.cjs +6828 -894
- package/index.d.cts +1621 -258
- package/index.d.mts +1621 -258
- package/index.d.ts +1621 -258
- package/index.mjs +6830 -896
- package/package.json +6 -6
- package/swap.cjs +988 -146
- package/swap.d.cts +148 -18
- package/swap.d.mts +148 -18
- package/swap.d.ts +148 -18
- package/swap.mjs +987 -146
- package/unifiedBalance.cjs +22219 -9689
- package/unifiedBalance.d.cts +620 -162
- package/unifiedBalance.d.mts +620 -162
- package/unifiedBalance.d.ts +620 -162
- package/unifiedBalance.mjs +22348 -9819
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,120 @@
|
|
|
1
1
|
# @circle-fin/app-kit
|
|
2
2
|
|
|
3
|
+
## 1.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add fast cross-chain deposits and fee estimation to Unified Balance Kit.
|
|
8
|
+
|
|
9
|
+
## Fast cross-chain deposits
|
|
10
|
+
|
|
11
|
+
`deposit` and `depositFor` now accept a `to` field and a `config.transferSpeed`
|
|
12
|
+
of `'FAST'` to burn USDC on the source chain and credit a Gateway balance on a
|
|
13
|
+
different destination chain in a single relayed flow:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
const result = await kit.deposit({
|
|
17
|
+
from,
|
|
18
|
+
amount: "10",
|
|
19
|
+
token: "USDC",
|
|
20
|
+
to: { chain: "Arc_Testnet" },
|
|
21
|
+
config: { transferSpeed: "FAST" },
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`DepositResult` now includes `fees`, `progress`, `sourceChain`, and
|
|
26
|
+
`destinationChain` on the fast path.
|
|
27
|
+
|
|
28
|
+
## Fee estimation
|
|
29
|
+
|
|
30
|
+
New `estimateDeposit` method returns an itemized fee breakdown and a signed
|
|
31
|
+
quote that can be passed directly into a subsequent `deposit` / `depositFor` to
|
|
32
|
+
lock the price:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
const estimate = await kit.estimateDeposit({
|
|
36
|
+
from,
|
|
37
|
+
amount: "10",
|
|
38
|
+
token: "USDC",
|
|
39
|
+
to: { chain: "Arc_Testnet" },
|
|
40
|
+
config: { transferSpeed: "FAST" },
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Spread the estimate at the top level; re-attach `from` (which holds the signer).
|
|
44
|
+
// The signed `quote` inside the estimate locks the quoted fee for this call.
|
|
45
|
+
const result = await kit.deposit({ ...estimate, from });
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`estimateDeposit` is also available on `AppKit` via
|
|
49
|
+
`kit.unifiedBalance.estimateDeposit(...)`.
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Fix `getSupportedChains({ sourceFeeSupported: true })` over-reporting source-fee
|
|
54
|
+
bridging support. Previously, source-fee eligibility was inferred from a contract
|
|
55
|
+
address shared with the fast-deposit forwarding path, causing fast-deposit-only chains
|
|
56
|
+
to appear supported and fail at the Quote API instead of being rejected client-side.
|
|
57
|
+
Source-fee support is now gated on an explicit allowlist of eligible source chains.
|
|
58
|
+
|
|
59
|
+
## 1.13.0
|
|
60
|
+
|
|
61
|
+
### Minor Changes
|
|
62
|
+
|
|
63
|
+
- Add Plasma (mainnet and testnet) support. Bridge USDC to and from Plasma via CCTP v2 in Bridge Kit and App Kit using `'Plasma'` or `'Plasma_Testnet'` as source or destination. No change required unless you want these routes.
|
|
64
|
+
- Configure custom HTTP headers for Circle Gateway API requests through
|
|
65
|
+
`GatewayV1Config` and `UnifiedBalanceKitConfig`. AppKit's existing top-level
|
|
66
|
+
`headers` option now also applies to Unified Balance Gateway requests, while
|
|
67
|
+
`unifiedBalance.headers` can override it.
|
|
68
|
+
|
|
69
|
+
The headers are sent with every Gateway API request the provider makes —
|
|
70
|
+
balances, deposits, spend estimate, transfer, forwarder status polling, and
|
|
71
|
+
`/v1/info` — and are merged on top of the SDK defaults (such as
|
|
72
|
+
`Content-Type`) rather than replacing them.
|
|
73
|
+
|
|
74
|
+
- Bridge Kit and App Kit now support receive-exact forwarded USDC transfers with
|
|
75
|
+
`config.feePayment: 'source'`. Estimates return the exact recipient amount,
|
|
76
|
+
signed source-chain fee breakdown, total wallet debit, quote expiry, and an
|
|
77
|
+
opaque signed quote. Caller-supplied quotes commit to the estimated price and
|
|
78
|
+
are rejected when they are invalid, mismatched, expired, or too close to
|
|
79
|
+
expiry; omitting the quote lets the kit fetch one automatically. Quote responses
|
|
80
|
+
now support both timestamp and source-chain block expiries, and execution
|
|
81
|
+
validates claimability against the current chain tip before burning.
|
|
82
|
+
Source-fee bridges emit the same
|
|
83
|
+
`approve`/`burn`/`mint` step events as the standard bridge path. The CCTP v2
|
|
84
|
+
provider now also supports explicit mint recipient and destination-caller
|
|
85
|
+
inputs for signed-fee burns and exposes `emitBridgeStep` for kit-level
|
|
86
|
+
orchestration.
|
|
87
|
+
|
|
88
|
+
Receive-exact source-paid fees are now available on every CCTP v2 EVM source
|
|
89
|
+
chain the Fee Service supports (FAST where pre-finality is offered, otherwise
|
|
90
|
+
STANDARD), rather than only the initial set of sources. Discover the
|
|
91
|
+
source-fee-capable chains with
|
|
92
|
+
`bridgeKit.getSupportedChains({ sourceFeeSupported: true })` or
|
|
93
|
+
`appKit.getSupportedChains('bridge', { sourceFeeSupported: true })`.
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Accept Circle API keys as the credential for service-backed swap and earn
|
|
98
|
+
operations via the new `config.apiKey` field. Previously only `kitKey` values
|
|
99
|
+
were accepted, so a Circle API key was rejected before it could be used.
|
|
100
|
+
|
|
101
|
+
`config.kitKey` is deprecated but still works, so no change is required. Move to
|
|
102
|
+
`config.apiKey` when convenient; when both are set, `apiKey` wins. `apiKey` is
|
|
103
|
+
also stripped from results and error traces, matching `kitKey`.
|
|
104
|
+
|
|
105
|
+
- Forwarded EVM→Solana bridges now create the recipient's Associated Token
|
|
106
|
+
Account (ATA). When a CCTP v2 burn is forwarded (`destination.useForwarder`) to
|
|
107
|
+
a Solana destination, the provider emits `cctp-forward` hookData carrying
|
|
108
|
+
`createAta` + the recipient's owner key, instructing Circle's relayer to create
|
|
109
|
+
the recipient ATA (idempotently, at the relayer's expense) before minting. This
|
|
110
|
+
prevents mints from targeting a non-existent ATA for fresh Solana wallets, which
|
|
111
|
+
previously left forwarded transfers unclaimed. Bridges made through Bridge Kit
|
|
112
|
+
and App Kit inherit this fix automatically.
|
|
113
|
+
|
|
114
|
+
EVM destinations are unchanged — they continue to receive the empty forwarding
|
|
115
|
+
frame. The CCTP v2 provider also exposes a new `getForwarderHookData` utility
|
|
116
|
+
that builds the destination-appropriate forwarding frame.
|
|
117
|
+
|
|
3
118
|
## 1.12.1
|
|
4
119
|
|
|
5
120
|
### Patch Changes
|
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 **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
|
|
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`
|
|
73
73
|
- **🎯 Flexible adapters**: Supporting EVM (Viem, Ethers) and Solana (@solana/web3)
|
|
@@ -203,7 +203,7 @@ const result = await kit.swap({
|
|
|
203
203
|
tokenOut: 'USDT',
|
|
204
204
|
amountIn: '100.0',
|
|
205
205
|
config: {
|
|
206
|
-
|
|
206
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
207
207
|
},
|
|
208
208
|
})
|
|
209
209
|
|
|
@@ -214,7 +214,7 @@ const daiSwap = await kit.swap({
|
|
|
214
214
|
tokenOut: 'USDC',
|
|
215
215
|
amountIn: '500.0',
|
|
216
216
|
config: {
|
|
217
|
-
|
|
217
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
218
218
|
},
|
|
219
219
|
})
|
|
220
220
|
|
|
@@ -225,7 +225,7 @@ const nativeSwap = await kit.swap({
|
|
|
225
225
|
tokenOut: 'USDC',
|
|
226
226
|
amountIn: '1.5',
|
|
227
227
|
config: {
|
|
228
|
-
|
|
228
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
229
229
|
},
|
|
230
230
|
})
|
|
231
231
|
```
|
|
@@ -249,7 +249,7 @@ const swapEstimate = await kit.estimateSwap({
|
|
|
249
249
|
tokenOut: 'USDT',
|
|
250
250
|
amountIn: '100.0',
|
|
251
251
|
config: {
|
|
252
|
-
|
|
252
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
253
253
|
},
|
|
254
254
|
})
|
|
255
255
|
|
|
@@ -483,6 +483,25 @@ await kit.send({
|
|
|
483
483
|
})
|
|
484
484
|
```
|
|
485
485
|
|
|
486
|
+
### Authentication
|
|
487
|
+
|
|
488
|
+
Service-backed operations take a Circle API key as `config.apiKey`. Omit it to
|
|
489
|
+
use the permissionless (keyless) path.
|
|
490
|
+
|
|
491
|
+
```typescript
|
|
492
|
+
config: {
|
|
493
|
+
apiKey: process.env.CIRCLE_API_KEY, // <ENV>_API_KEY:<keyId>:<keySecret>
|
|
494
|
+
}
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
The API key is a server-only secret — supplying it from a browser throws. Hold
|
|
498
|
+
it on your server and forward the prepared transaction to the client.
|
|
499
|
+
|
|
500
|
+
> **Migrating from `kitKey`:** `config.kitKey` is deprecated in favor of
|
|
501
|
+
> `config.apiKey`. It keeps working, and legacy `KIT_KEY:<keyId>:<keySecret>`
|
|
502
|
+
> values are still accepted, so you can move over at your own pace. When both
|
|
503
|
+
> fields are set, `apiKey` wins.
|
|
504
|
+
|
|
486
505
|
### Swap Parameters
|
|
487
506
|
|
|
488
507
|
For explicit same-chain swaps:
|
|
@@ -514,7 +533,7 @@ await kit.swap({
|
|
|
514
533
|
tokenOut: 'USDC',
|
|
515
534
|
amountIn: '100.0',
|
|
516
535
|
config: {
|
|
517
|
-
|
|
536
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
518
537
|
},
|
|
519
538
|
})
|
|
520
539
|
|
|
@@ -525,7 +544,7 @@ await kit.swap({
|
|
|
525
544
|
tokenOut: 'USDT',
|
|
526
545
|
amountIn: '500.0', // SDK automatically handles 18-decimal precision
|
|
527
546
|
config: {
|
|
528
|
-
|
|
547
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
529
548
|
},
|
|
530
549
|
})
|
|
531
550
|
|
|
@@ -536,7 +555,7 @@ await kit.swap({
|
|
|
536
555
|
tokenOut: 'USDC',
|
|
537
556
|
amountIn: '2.5',
|
|
538
557
|
config: {
|
|
539
|
-
|
|
558
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
540
559
|
},
|
|
541
560
|
})
|
|
542
561
|
```
|
|
@@ -584,7 +603,7 @@ await kit.swap({
|
|
|
584
603
|
tokenOut: 'USDT',
|
|
585
604
|
amountIn: '1000',
|
|
586
605
|
config: {
|
|
587
|
-
|
|
606
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
588
607
|
customFee: {
|
|
589
608
|
value: '10',
|
|
590
609
|
recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0',
|
|
@@ -716,7 +735,7 @@ const result = await kit.swap({
|
|
|
716
735
|
tokenOut: 'USDT',
|
|
717
736
|
amountIn: '100.0',
|
|
718
737
|
config: {
|
|
719
|
-
|
|
738
|
+
apiKey: process.env.CIRCLE_API_KEY,
|
|
720
739
|
},
|
|
721
740
|
})
|
|
722
741
|
|