@circle-fin/provider-cctp-v2 1.8.5 → 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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @circle-fin/provider-cctp-v2
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
+ - Add a `headers` config option to forward custom HTTP headers with CCTP
9
+ attestation API requests.
10
+
11
+ `CCTPV2Config`, `BridgeKitConfig`, and the AppKit context now accept an optional
12
+ `headers` map. The headers are sent with every Circle attestation (Iris) API
13
+ request the CCTP v2 provider makes — attestation fetch, re-attestation, and
14
+ relayer mint status polling — and are merged on top of the SDK defaults (such
15
+ as `Content-Type`) rather than replacing them.
16
+
17
+ ### Patch Changes
18
+
19
+ - Fix transactions failing with an out-of-gas error on chains that enforce the
20
+ EIP-7623 calldata gas floor (e.g. Cronos). Bridge transactions on affected
21
+ chains now use a safe minimum gas limit automatically — no configuration
22
+ change needed.
23
+ - Fix a missing runtime dependency (`pino`) that could cause `Could not find package`
24
+ errors under strict module resolvers (Deno, Supabase Edge Runtime, pnpm).
25
+
3
26
  ## 1.8.5
4
27
 
5
28
  ### Patch Changes
@@ -109,6 +132,7 @@
109
132
  behalf. This removes most destination-side orchestration from client code.
110
133
 
111
134
  What this enables:
135
+
112
136
  - Opt-in forwarding with `useForwarder: true` so Circle handles destination mint
113
137
  submission.
114
138
  - Forwarder-only destinations (no destination adapter required) using
@@ -123,6 +147,7 @@
123
147
  capability checks.
124
148
 
125
149
  Compatibility:
150
+
126
151
  - Existing non-forwarded bridge flows remain unchanged.
127
152
  - If you set `config.maxFee` manually, include any expected forwarding fee.
128
153
 
@@ -144,6 +169,7 @@
144
169
  ### Minor Changes
145
170
 
146
171
  - Add attestation expiry detection utilities for CCTP v2 fast transfers:
172
+
147
173
  - `isAttestationExpired(attestation, currentBlockNumber)` - Check if an attestation has expired based on the destination chain's current block/slot
148
174
  - `getBlocksUntilExpiry(attestation, currentBlockNumber)` - Get the number of blocks remaining until expiry (returns `null` for attestations that never expire)
149
175
  - `isMintFailureRelatedToAttestation(error)` - Detect if a mint failure was caused by attestation expiry to know when to call `reAttest()`
@@ -171,6 +197,7 @@
171
197
  ### Patch Changes
172
198
 
173
199
  - Improved how the retry function handles bridge transfers stuck in a pending state:
200
+
174
201
  - The retry function now properly waits for pending transactions to complete before continuing with the next steps, instead of failing or skipping them
175
202
  - Validates that required data (like transaction hashes) is present before attempting to continue, throwing clear errors immediately instead of failing silently
176
203
  - Error messages now clearly indicate when "user action is required" for non-actionable states
@@ -180,6 +207,7 @@
180
207
  - Validation errors now use standardized error codes for consistent error handling. All validation failures return the same `KitError` structure as other SDK errors.
181
208
 
182
209
  **Migration:** If you're catching validation errors, update your error handling:
210
+
183
211
  - Check `error.code === 1098` instead of `instanceof ValidationError`
184
212
  - Access details via `error.cause?.trace?.validationErrors` instead of `error.errors`
185
213
 
@@ -197,6 +225,7 @@
197
225
  - Fixed bug where tokens could be burned when bridging to unsupported chains, and improved error messages to clearly show which chains are supported.
198
226
 
199
227
  **What's Fixed:**
228
+
200
229
  - **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
230
  - **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
231
  ```
@@ -208,6 +237,7 @@
208
237
  - Improved error handling with more informative and consistent error messages.
209
238
 
210
239
  Errors now include:
240
+
211
241
  - Specific error codes for programmatic handling
212
242
  - Error type categorization (BALANCE, ONCHAIN, RPC, NETWORK)
213
243
  - Recoverability information (FATAL vs RETRYABLE)
@@ -231,6 +261,7 @@
231
261
  - 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
262
 
233
263
  With this fix, the provider now correctly uses `recipientAddress` when provided, while still using the signer's address for transaction authorization. This enables:
264
+
234
265
  - **Third-party transfers**: Bridge USDC to any address without requiring them to sign
235
266
  - **Custody integrations**: Separate signing authority from fund destination
236
267
  - **Developer-controlled flows**: API-based signers can bridge to user-specified recipients
@@ -251,6 +282,7 @@
251
282
  - 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
283
 
253
284
  **Breaking Changes:**
285
+
254
286
  - **Chain ID:** 57054 → 14601
255
287
  - **RPC Endpoint:** `https://rpc.blaze.soniclabs.com` → `https://rpc.testnet.soniclabs.com`
256
288
  - **USDC Address:** `0xA4879Fed32Ecbef99399e5cbC247E533421C4eC6` → `0x0BA304580ee7c9a980CF72e55f5Ed2E9fd30Bc51`
@@ -266,6 +298,7 @@
266
298
  Circle's Cross-Chain Transfer Protocol (CCTP) v2 integration - the primary transport layer for secure, native USDC transfers across supported blockchain networks.
267
299
 
268
300
  ## 🚀 Core CCTP Features
301
+
269
302
  - **Native USDC Bridging**: Direct integration with Circle's official CCTP v2 protocol
270
303
  - **Multi-chain Support**: Seamless transfers between EVM chains and Solana
271
304
  - **Attestation Management**: Automatic handling of Circle's attestation service
@@ -273,12 +306,14 @@
273
306
  ## ⚡ Transfer Speed Options
274
307
 
275
308
  **FAST Transfers**
309
+
276
310
  - Optimized for speed with Circle's fast liquidity network
277
311
  - Dynamic fee calculation based on transfer amount and network conditions
278
312
  - Automatic fee estimation with 10% buffer for fluctuations
279
313
  - Typical completion time: ~1 minute
280
314
 
281
315
  **SLOW Transfers**
316
+
282
317
  - Zero protocol fees for cost-optimized transfers
283
318
  - Standard CCTP attestation flow
284
319
  - Typical completion time: 10-20 minutes
@@ -302,18 +337,21 @@
302
337
  ```
303
338
 
304
339
  ## 🔄 Advanced Retry Support
340
+
305
341
  - **Step-by-step Recovery**: Resume from burn, attestation, or mint phases
306
342
  - **Automatic State Analysis**: Intelligent detection of completion status
307
343
  - **Network Resilience**: Handle temporary API and RPC failures
308
344
  - **Transaction Resubmission**: Retry failed blockchain transactions
309
345
 
310
346
  ## 💰 Fee Management
347
+
311
348
  - **Dynamic Fee Calculation**: Real-time fee estimation from Circle's API
312
349
  - **Custom Fee Limits**: Set maximum fees to control costs
313
350
  - **Protocol Fee Transparency**: Clear breakdown of all fees involved
314
351
  - **Multi-chain Fee Support**: Different fee structures per chain pair
315
352
 
316
353
  ## 🛡️ Security & Reliability
354
+
317
355
  - **No Custom Cryptography**: Uses only Circle's audited smart contracts
318
356
  - **Deterministic Operations**: Predictable outcomes and gas estimation
319
357
  - **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