@circle-fin/provider-cctp-v2 1.8.4 → 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 +44 -0
- package/README.md +5 -5
- package/index.cjs +422 -173
- package/index.d.cts +103 -0
- package/index.d.mts +103 -0
- package/index.d.ts +103 -0
- package/index.mjs +422 -173
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
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
|
+
|
|
26
|
+
## 1.8.5
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Internal dependency updates. No user-facing changes.
|
|
31
|
+
|
|
3
32
|
## 1.8.4
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -103,6 +132,7 @@
|
|
|
103
132
|
behalf. This removes most destination-side orchestration from client code.
|
|
104
133
|
|
|
105
134
|
What this enables:
|
|
135
|
+
|
|
106
136
|
- Opt-in forwarding with `useForwarder: true` so Circle handles destination mint
|
|
107
137
|
submission.
|
|
108
138
|
- Forwarder-only destinations (no destination adapter required) using
|
|
@@ -117,6 +147,7 @@
|
|
|
117
147
|
capability checks.
|
|
118
148
|
|
|
119
149
|
Compatibility:
|
|
150
|
+
|
|
120
151
|
- Existing non-forwarded bridge flows remain unchanged.
|
|
121
152
|
- If you set `config.maxFee` manually, include any expected forwarding fee.
|
|
122
153
|
|
|
@@ -138,6 +169,7 @@
|
|
|
138
169
|
### Minor Changes
|
|
139
170
|
|
|
140
171
|
- Add attestation expiry detection utilities for CCTP v2 fast transfers:
|
|
172
|
+
|
|
141
173
|
- `isAttestationExpired(attestation, currentBlockNumber)` - Check if an attestation has expired based on the destination chain's current block/slot
|
|
142
174
|
- `getBlocksUntilExpiry(attestation, currentBlockNumber)` - Get the number of blocks remaining until expiry (returns `null` for attestations that never expire)
|
|
143
175
|
- `isMintFailureRelatedToAttestation(error)` - Detect if a mint failure was caused by attestation expiry to know when to call `reAttest()`
|
|
@@ -165,6 +197,7 @@
|
|
|
165
197
|
### Patch Changes
|
|
166
198
|
|
|
167
199
|
- Improved how the retry function handles bridge transfers stuck in a pending state:
|
|
200
|
+
|
|
168
201
|
- The retry function now properly waits for pending transactions to complete before continuing with the next steps, instead of failing or skipping them
|
|
169
202
|
- Validates that required data (like transaction hashes) is present before attempting to continue, throwing clear errors immediately instead of failing silently
|
|
170
203
|
- Error messages now clearly indicate when "user action is required" for non-actionable states
|
|
@@ -174,6 +207,7 @@
|
|
|
174
207
|
- Validation errors now use standardized error codes for consistent error handling. All validation failures return the same `KitError` structure as other SDK errors.
|
|
175
208
|
|
|
176
209
|
**Migration:** If you're catching validation errors, update your error handling:
|
|
210
|
+
|
|
177
211
|
- Check `error.code === 1098` instead of `instanceof ValidationError`
|
|
178
212
|
- Access details via `error.cause?.trace?.validationErrors` instead of `error.errors`
|
|
179
213
|
|
|
@@ -191,6 +225,7 @@
|
|
|
191
225
|
- Fixed bug where tokens could be burned when bridging to unsupported chains, and improved error messages to clearly show which chains are supported.
|
|
192
226
|
|
|
193
227
|
**What's Fixed:**
|
|
228
|
+
|
|
194
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.
|
|
195
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:
|
|
196
231
|
```
|
|
@@ -202,6 +237,7 @@
|
|
|
202
237
|
- Improved error handling with more informative and consistent error messages.
|
|
203
238
|
|
|
204
239
|
Errors now include:
|
|
240
|
+
|
|
205
241
|
- Specific error codes for programmatic handling
|
|
206
242
|
- Error type categorization (BALANCE, ONCHAIN, RPC, NETWORK)
|
|
207
243
|
- Recoverability information (FATAL vs RETRYABLE)
|
|
@@ -225,6 +261,7 @@
|
|
|
225
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.
|
|
226
262
|
|
|
227
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
|
+
|
|
228
265
|
- **Third-party transfers**: Bridge USDC to any address without requiring them to sign
|
|
229
266
|
- **Custody integrations**: Separate signing authority from fund destination
|
|
230
267
|
- **Developer-controlled flows**: API-based signers can bridge to user-specified recipients
|
|
@@ -245,6 +282,7 @@
|
|
|
245
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.
|
|
246
283
|
|
|
247
284
|
**Breaking Changes:**
|
|
285
|
+
|
|
248
286
|
- **Chain ID:** 57054 → 14601
|
|
249
287
|
- **RPC Endpoint:** `https://rpc.blaze.soniclabs.com` → `https://rpc.testnet.soniclabs.com`
|
|
250
288
|
- **USDC Address:** `0xA4879Fed32Ecbef99399e5cbC247E533421C4eC6` → `0x0BA304580ee7c9a980CF72e55f5Ed2E9fd30Bc51`
|
|
@@ -260,6 +298,7 @@
|
|
|
260
298
|
Circle's Cross-Chain Transfer Protocol (CCTP) v2 integration - the primary transport layer for secure, native USDC transfers across supported blockchain networks.
|
|
261
299
|
|
|
262
300
|
## 🚀 Core CCTP Features
|
|
301
|
+
|
|
263
302
|
- **Native USDC Bridging**: Direct integration with Circle's official CCTP v2 protocol
|
|
264
303
|
- **Multi-chain Support**: Seamless transfers between EVM chains and Solana
|
|
265
304
|
- **Attestation Management**: Automatic handling of Circle's attestation service
|
|
@@ -267,12 +306,14 @@
|
|
|
267
306
|
## ⚡ Transfer Speed Options
|
|
268
307
|
|
|
269
308
|
**FAST Transfers**
|
|
309
|
+
|
|
270
310
|
- Optimized for speed with Circle's fast liquidity network
|
|
271
311
|
- Dynamic fee calculation based on transfer amount and network conditions
|
|
272
312
|
- Automatic fee estimation with 10% buffer for fluctuations
|
|
273
313
|
- Typical completion time: ~1 minute
|
|
274
314
|
|
|
275
315
|
**SLOW Transfers**
|
|
316
|
+
|
|
276
317
|
- Zero protocol fees for cost-optimized transfers
|
|
277
318
|
- Standard CCTP attestation flow
|
|
278
319
|
- Typical completion time: 10-20 minutes
|
|
@@ -296,18 +337,21 @@
|
|
|
296
337
|
```
|
|
297
338
|
|
|
298
339
|
## 🔄 Advanced Retry Support
|
|
340
|
+
|
|
299
341
|
- **Step-by-step Recovery**: Resume from burn, attestation, or mint phases
|
|
300
342
|
- **Automatic State Analysis**: Intelligent detection of completion status
|
|
301
343
|
- **Network Resilience**: Handle temporary API and RPC failures
|
|
302
344
|
- **Transaction Resubmission**: Retry failed blockchain transactions
|
|
303
345
|
|
|
304
346
|
## 💰 Fee Management
|
|
347
|
+
|
|
305
348
|
- **Dynamic Fee Calculation**: Real-time fee estimation from Circle's API
|
|
306
349
|
- **Custom Fee Limits**: Set maximum fees to control costs
|
|
307
350
|
- **Protocol Fee Transparency**: Clear breakdown of all fees involved
|
|
308
351
|
- **Multi-chain Fee Support**: Different fee structures per chain pair
|
|
309
352
|
|
|
310
353
|
## 🛡️ Security & Reliability
|
|
354
|
+
|
|
311
355
|
- **No Custom Cryptography**: Uses only Circle's audited smart contracts
|
|
312
356
|
- **Deterministic Operations**: Predictable outcomes and gas estimation
|
|
313
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
|
|
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
|
|
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 **
|
|
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
|
|