@circle-fin/app-kit 1.12.1 → 1.13.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 CHANGED
@@ -1,5 +1,64 @@
1
1
  # @circle-fin/app-kit
2
2
 
3
+ ## 1.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+ - Configure custom HTTP headers for Circle Gateway API requests through
9
+ `GatewayV1Config` and `UnifiedBalanceKitConfig`. AppKit's existing top-level
10
+ `headers` option now also applies to Unified Balance Gateway requests, while
11
+ `unifiedBalance.headers` can override it.
12
+
13
+ The headers are sent with every Gateway API request the provider makes —
14
+ balances, deposits, spend estimate, transfer, forwarder status polling, and
15
+ `/v1/info` — and are merged on top of the SDK defaults (such as
16
+ `Content-Type`) rather than replacing them.
17
+
18
+ - Bridge Kit and App Kit now support receive-exact forwarded USDC transfers with
19
+ `config.feePayment: 'source'`. Estimates return the exact recipient amount,
20
+ signed source-chain fee breakdown, total wallet debit, quote expiry, and an
21
+ opaque signed quote. Caller-supplied quotes commit to the estimated price and
22
+ are rejected when they are invalid, mismatched, expired, or too close to
23
+ expiry; omitting the quote lets the kit fetch one automatically. Quote responses
24
+ now support both timestamp and source-chain block expiries, and execution
25
+ validates claimability against the current chain tip before burning.
26
+ Source-fee bridges emit the same
27
+ `approve`/`burn`/`mint` step events as the standard bridge path. The CCTP v2
28
+ provider now also supports explicit mint recipient and destination-caller
29
+ inputs for signed-fee burns and exposes `emitBridgeStep` for kit-level
30
+ orchestration.
31
+
32
+ Receive-exact source-paid fees are now available on every CCTP v2 EVM source
33
+ chain the Fee Service supports (FAST where pre-finality is offered, otherwise
34
+ STANDARD), rather than only the initial set of sources. Discover the
35
+ source-fee-capable chains with
36
+ `bridgeKit.getSupportedChains({ sourceFeeSupported: true })` or
37
+ `appKit.getSupportedChains('bridge', { sourceFeeSupported: true })`.
38
+
39
+ ### Patch Changes
40
+
41
+ - Accept Circle API keys as the credential for service-backed swap and earn
42
+ operations via the new `config.apiKey` field. Previously only `kitKey` values
43
+ were accepted, so a Circle API key was rejected before it could be used.
44
+
45
+ `config.kitKey` is deprecated but still works, so no change is required. Move to
46
+ `config.apiKey` when convenient; when both are set, `apiKey` wins. `apiKey` is
47
+ also stripped from results and error traces, matching `kitKey`.
48
+
49
+ - Forwarded EVM→Solana bridges now create the recipient's Associated Token
50
+ Account (ATA). When a CCTP v2 burn is forwarded (`destination.useForwarder`) to
51
+ a Solana destination, the provider emits `cctp-forward` hookData carrying
52
+ `createAta` + the recipient's owner key, instructing Circle's relayer to create
53
+ the recipient ATA (idempotently, at the relayer's expense) before minting. This
54
+ prevents mints from targeting a non-existent ATA for fresh Solana wallets, which
55
+ previously left forwarded transfers unclaimed. Bridges made through Bridge Kit
56
+ and App Kit inherit this fix automatically.
57
+
58
+ EVM destinations are unchanged — they continue to receive the empty forwarding
59
+ frame. The CCTP v2 provider also exposes a new `getForwarderHookData` utility
60
+ that builds the destination-appropriate forwarding frame.
61
+
3
62
  ## 1.12.1
4
63
 
5
64
  ### 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 **49 chains** with **1152 total bridge routes** through Circle's CCTPv2
69
- - **Mainnet (24 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, X Layer
70
- - **Testnet (25 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, X Layer 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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
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
- kitKey: process.env.KIT_KEY,
738
+ apiKey: process.env.CIRCLE_API_KEY,
720
739
  },
721
740
  })
722
741