@circle-fin/provider-cctp-v2 1.8.5 → 1.10.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,48 @@
1
1
  # @circle-fin/provider-cctp-v2
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `burnWithFees` for the CCTP v2 prepaid-FORWARD path via `TokenMessengerWithFees`.
8
+
9
+ `CCTPV2BridgingProvider.burnWithFees` prepares the source-chain
10
+ `depositForBurnWithHookAndFees` burn for the GenericExecutor FORWARD flow:
11
+ fees are collected up front against a signed quote, `mintRecipient` and
12
+ `destinationCaller` are both set to the GenericExecutor, and the GE
13
+ `hookData` is passed through the `cctp-forward` wrapper.
14
+
15
+ Also exports the `resolveFeePayment` fee-channel helper and the
16
+ `prepaidForwardErrors` utilities (`assertForwardHookData`,
17
+ `mapPrepaidForwardError`, `hasForwardHook`, `PREPAID_FORWARD_REVERT_NAMES`).
18
+
19
+ ### Patch Changes
20
+
21
+ - Support keyless / signing-strategy viem adapters on the batched bridge (approve + burn) path.
22
+
23
+ ## 1.9.0
24
+
25
+ ### Minor Changes
26
+
27
+ - Add support for bridging USDC to and from Cronos (mainnet and testnet) via CCTP v2.
28
+ - Add a `headers` config option to forward custom HTTP headers with CCTP
29
+ attestation API requests.
30
+
31
+ `CCTPV2Config`, `BridgeKitConfig`, and the AppKit context now accept an optional
32
+ `headers` map. The headers are sent with every Circle attestation (Iris) API
33
+ request the CCTP v2 provider makes — attestation fetch, re-attestation, and
34
+ relayer mint status polling — and are merged on top of the SDK defaults (such
35
+ as `Content-Type`) rather than replacing them.
36
+
37
+ ### Patch Changes
38
+
39
+ - Fix transactions failing with an out-of-gas error on chains that enforce the
40
+ EIP-7623 calldata gas floor (e.g. Cronos). Bridge transactions on affected
41
+ chains now use a safe minimum gas limit automatically — no configuration
42
+ change needed.
43
+ - Fix a missing runtime dependency (`pino`) that could cause `Could not find package`
44
+ errors under strict module resolvers (Deno, Supabase Edge Runtime, pnpm).
45
+
3
46
  ## 1.8.5
4
47
 
5
48
  ### Patch Changes
@@ -109,6 +152,7 @@
109
152
  behalf. This removes most destination-side orchestration from client code.
110
153
 
111
154
  What this enables:
155
+
112
156
  - Opt-in forwarding with `useForwarder: true` so Circle handles destination mint
113
157
  submission.
114
158
  - Forwarder-only destinations (no destination adapter required) using
@@ -123,6 +167,7 @@
123
167
  capability checks.
124
168
 
125
169
  Compatibility:
170
+
126
171
  - Existing non-forwarded bridge flows remain unchanged.
127
172
  - If you set `config.maxFee` manually, include any expected forwarding fee.
128
173
 
@@ -144,6 +189,7 @@
144
189
  ### Minor Changes
145
190
 
146
191
  - Add attestation expiry detection utilities for CCTP v2 fast transfers:
192
+
147
193
  - `isAttestationExpired(attestation, currentBlockNumber)` - Check if an attestation has expired based on the destination chain's current block/slot
148
194
  - `getBlocksUntilExpiry(attestation, currentBlockNumber)` - Get the number of blocks remaining until expiry (returns `null` for attestations that never expire)
149
195
  - `isMintFailureRelatedToAttestation(error)` - Detect if a mint failure was caused by attestation expiry to know when to call `reAttest()`
@@ -171,6 +217,7 @@
171
217
  ### Patch Changes
172
218
 
173
219
  - Improved how the retry function handles bridge transfers stuck in a pending state:
220
+
174
221
  - The retry function now properly waits for pending transactions to complete before continuing with the next steps, instead of failing or skipping them
175
222
  - Validates that required data (like transaction hashes) is present before attempting to continue, throwing clear errors immediately instead of failing silently
176
223
  - Error messages now clearly indicate when "user action is required" for non-actionable states
@@ -180,6 +227,7 @@
180
227
  - Validation errors now use standardized error codes for consistent error handling. All validation failures return the same `KitError` structure as other SDK errors.
181
228
 
182
229
  **Migration:** If you're catching validation errors, update your error handling:
230
+
183
231
  - Check `error.code === 1098` instead of `instanceof ValidationError`
184
232
  - Access details via `error.cause?.trace?.validationErrors` instead of `error.errors`
185
233
 
@@ -197,6 +245,7 @@
197
245
  - Fixed bug where tokens could be burned when bridging to unsupported chains, and improved error messages to clearly show which chains are supported.
198
246
 
199
247
  **What's Fixed:**
248
+
200
249
  - **Prevents fund loss**: Bridge operations now fail immediately if your adapter doesn't support the source or destination chain, **before** any tokens are approved or burned. Previously, tokens could be burned on the source chain before discovering the destination chain was unsupported, requiring manual recovery.
201
250
  - **Better error messages**: When you attempt to use an unsupported chain, the error now clearly lists all chains your adapter supports, making it easy to pick an alternative:
202
251
  ```
@@ -208,6 +257,7 @@
208
257
  - Improved error handling with more informative and consistent error messages.
209
258
 
210
259
  Errors now include:
260
+
211
261
  - Specific error codes for programmatic handling
212
262
  - Error type categorization (BALANCE, ONCHAIN, RPC, NETWORK)
213
263
  - Recoverability information (FATAL vs RETRYABLE)
@@ -231,6 +281,7 @@
231
281
  - Fixes a bug where custom recipient addresses were not respected in cross-chain USDC transfers. Previously, when using `recipientAddress` to specify a different destination address than the signer (common in custody solutions or when bridging to third-party addresses), the provider would incorrectly use the signer's address as the mint recipient, causing transfers to fail or mint to the wrong address.
232
282
 
233
283
  With this fix, the provider now correctly uses `recipientAddress` when provided, while still using the signer's address for transaction authorization. This enables:
284
+
234
285
  - **Third-party transfers**: Bridge USDC to any address without requiring them to sign
235
286
  - **Custody integrations**: Separate signing authority from fund destination
236
287
  - **Developer-controlled flows**: API-based signers can bridge to user-specified recipients
@@ -251,6 +302,7 @@
251
302
  - Update Sonic Testnet chain definition to canonical network. The `SonicTestnet` chain definition now points to the official Sonic Testnet (chainId: 14601) instead of the deprecated Sonic Blaze Testnet (chainId: 57054). The RPC endpoint has been updated to `https://rpc.testnet.soniclabs.com`, the display name simplified to "Sonic Testnet", and the USDC contract address updated to the new deployment.
252
303
 
253
304
  **Breaking Changes:**
305
+
254
306
  - **Chain ID:** 57054 → 14601
255
307
  - **RPC Endpoint:** `https://rpc.blaze.soniclabs.com` → `https://rpc.testnet.soniclabs.com`
256
308
  - **USDC Address:** `0xA4879Fed32Ecbef99399e5cbC247E533421C4eC6` → `0x0BA304580ee7c9a980CF72e55f5Ed2E9fd30Bc51`
@@ -266,6 +318,7 @@
266
318
  Circle's Cross-Chain Transfer Protocol (CCTP) v2 integration - the primary transport layer for secure, native USDC transfers across supported blockchain networks.
267
319
 
268
320
  ## 🚀 Core CCTP Features
321
+
269
322
  - **Native USDC Bridging**: Direct integration with Circle's official CCTP v2 protocol
270
323
  - **Multi-chain Support**: Seamless transfers between EVM chains and Solana
271
324
  - **Attestation Management**: Automatic handling of Circle's attestation service
@@ -273,12 +326,14 @@
273
326
  ## ⚡ Transfer Speed Options
274
327
 
275
328
  **FAST Transfers**
329
+
276
330
  - Optimized for speed with Circle's fast liquidity network
277
331
  - Dynamic fee calculation based on transfer amount and network conditions
278
332
  - Automatic fee estimation with 10% buffer for fluctuations
279
333
  - Typical completion time: ~1 minute
280
334
 
281
335
  **SLOW Transfers**
336
+
282
337
  - Zero protocol fees for cost-optimized transfers
283
338
  - Standard CCTP attestation flow
284
339
  - Typical completion time: 10-20 minutes
@@ -302,18 +357,21 @@
302
357
  ```
303
358
 
304
359
  ## 🔄 Advanced Retry Support
360
+
305
361
  - **Step-by-step Recovery**: Resume from burn, attestation, or mint phases
306
362
  - **Automatic State Analysis**: Intelligent detection of completion status
307
363
  - **Network Resilience**: Handle temporary API and RPC failures
308
364
  - **Transaction Resubmission**: Retry failed blockchain transactions
309
365
 
310
366
  ## 💰 Fee Management
367
+
311
368
  - **Dynamic Fee Calculation**: Real-time fee estimation from Circle's API
312
369
  - **Custom Fee Limits**: Set maximum fees to control costs
313
370
  - **Protocol Fee Transparency**: Clear breakdown of all fees involved
314
371
  - **Multi-chain Fee Support**: Different fee structures per chain pair
315
372
 
316
373
  ## 🛡️ Security & Reliability
374
+
317
375
  - **No Custom Cryptography**: Uses only Circle's audited smart contracts
318
376
  - **Deterministic Operations**: Predictable outcomes and gas estimation
319
377
  - **Comprehensive Validation**: Runtime parameter validation and type safety
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  **Circle's Cross-Chain Transfer Protocol v2 provider for Bridge Kit**
11
11
 
12
- _Native USDC bridging across 45 chains using Circle's battle-tested protocols._
12
+ _Native USDC bridging across 47 chains using Circle's battle-tested protocols._
13
13
 
14
14
  </div>
15
15
 
@@ -130,7 +130,7 @@ const result = await provider.bridge({
130
130
  - ✅ **Native USDC bridging** - Move real USDC between supported networks
131
131
  - ✅ **CCTP v2 integration** - Direct integration with Circle's CCTP v2 protocol
132
132
  - ✅ **Comprehensive validation** - Route validation and parameter checking
133
- - ✅ **Multi-chain support** - Works across all 45 CCTPv2-supported chains
133
+ - ✅ **Multi-chain support** - Works across all 47 CCTPv2-supported chains
134
134
  - ✅ **Type safety** - Full TypeScript support with detailed error handling
135
135
  - ✅ **Bridge speeds** - Support for both FAST and SLOW bridge configurations
136
136
  - ✅ **Forwarder integration** - Circle's Orbit relayer handles attestation and mint automatically
@@ -138,15 +138,15 @@ const result = await provider.bridge({
138
138
 
139
139
  ## Supported Chains & Routes
140
140
 
141
- The provider supports **968 total bridge routes** across these chains:
141
+ The provider supports **1058 total bridge routes** across these chains:
142
142
 
143
143
  ### Mainnet Chains
144
144
 
145
- **Arbitrum**, **Avalanche**, **Base**, **Codex**, **Edge**, **Ethereum**, **HyperEVM**, **Injective**, **Ink**, **Linea**, **Monad**, **Morph**, **OP Mainnet**, **Pharos**, **Plume**, **Polygon PoS**, **Sei**, **Solana**, **Sonic**, **Unichain**, **World Chain**, **XDC**
145
+ **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**
146
146
 
147
147
  ### Testnet Chains
148
148
 
149
- **Arc Testnet**, **Arbitrum Sepolia**, **Avalanche Fuji**, **Base Sepolia**, **Codex 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**
149
+ **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**
150
150
 
151
151
  ## Error Handling
152
152