@circle-fin/bridge-kit 1.1.0 → 1.1.2
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 +124 -0
- package/{chains.cjs.js → chains.cjs} +1 -1
- package/chains.cjs.map +1 -0
- package/{index.cjs.js → index.cjs} +3545 -3444
- package/index.cjs.map +1 -0
- package/index.d.ts +121 -34
- package/index.mjs +3540 -3439
- package/package.json +8 -7
- package/chains.cjs.js.map +0 -1
- package/index.cjs.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# @circle-fin/bridge-kit
|
|
2
|
+
|
|
3
|
+
## 1.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed bug where tokens could be burned when bridging to unsupported chains, and improved error messages to clearly show which chains are supported.
|
|
8
|
+
|
|
9
|
+
**What's Fixed:**
|
|
10
|
+
- **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.
|
|
11
|
+
- **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:
|
|
12
|
+
```
|
|
13
|
+
Invalid chain 'Linea Sepolia': Not supported by this adapter.
|
|
14
|
+
It supports 17 chains: Arbitrum, Base, Ethereum, Polygon, Solana, ...
|
|
15
|
+
```
|
|
16
|
+
- **Correct error codes**: Chain validation errors now use the correct `INVALID_CHAIN` error code instead of `UNSUPPORTED_ROUTE`, making it easier to handle errors programmatically.
|
|
17
|
+
|
|
18
|
+
## 1.1.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Fix CommonJS compatibility by correcting file extensions and package exports. This resolves a "ReferenceError: require is not defined" error that occurred when using packages in CommonJS projects with ts-node.
|
|
23
|
+
|
|
24
|
+
- Fixes a bug where the `recipientAddress` field in the `to` parameter was not being properly propagated to the underlying CCTP v2 provider. This caused custom recipient addresses to be ignored during cross-chain USDC transfers, resulting in funds being minted to the signer's address instead of the intended recipient.
|
|
25
|
+
|
|
26
|
+
With this fix, when you specify a `recipientAddress` in the `to` parameter, the Bridge Kit now correctly passes it through to the provider, ensuring funds are minted to the correct address.
|
|
27
|
+
|
|
28
|
+
**Example usage** (no changes needed if already using this pattern):
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
await kit.bridge({
|
|
32
|
+
from: { adapter: sourceAdapter, chain: 'Ethereum' },
|
|
33
|
+
to: {
|
|
34
|
+
adapter: destAdapter,
|
|
35
|
+
chain: 'Base',
|
|
36
|
+
recipientAddress: '0x...', // Now properly respected
|
|
37
|
+
},
|
|
38
|
+
amount: '10',
|
|
39
|
+
token: 'USDC',
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**No breaking changes** - existing code without `recipientAddress` continues to work unchanged. This fix only affects transfers where you explicitly provide a custom recipient address.
|
|
44
|
+
|
|
45
|
+
## 1.1.0
|
|
46
|
+
|
|
47
|
+
### Minor Changes
|
|
48
|
+
|
|
49
|
+
- Add automatic HTTP request tracking for analytics and debugging. The kit now automatically registers itself when the module loads, enabling Circle to track kit usage and identify issues. Applications can optionally set an external prefix using the new `setExternalPrefix` function to identify themselves in request analytics. All HTTP requests from the kit will include user agent information in the format: `[app/version] bridge-kit/version (runtime)`. This feature requires no code changes for existing users.
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Standardize `maxFee` parameter to accept human-readable values. The `maxFee` parameter in `BridgeConfig` now correctly accepts human-readable token amounts (e.g., `"1"` for 1 USDC, `"0.5"` for 0.5 USDC), matching the behavior of `customFee.value`. This resolves an undocumented inconsistency in the API. If you were previously passing values in smallest units, update to human-readable format: use `"1"` instead of `"1000000"` for 1 USDC.
|
|
54
|
+
- Complete CCTP v2 chain support exports
|
|
55
|
+
|
|
56
|
+
Ensures all 35 chains with CCTP v2 support are properly exported from the `chains` entry point. This fix adds previously missing chain definitions including Codex, HyperEVM, Ink, Plume, Sei, Sonic, Unichain, WorldChain, and XDC networks (both mainnet and testnet variants where applicable).
|
|
57
|
+
|
|
58
|
+
- Add support for Arc Testnet chain definition. Arc is Circle's EVM-compatible Layer-1 blockchain designed for stablecoin finance and asset
|
|
59
|
+
tokenization, featuring USDC as the native gas token and sub-second finality via the Malachite BFT consensus engine.
|
|
60
|
+
- Fix support for developer-controlled address context. Bridge operations now correctly accept an explicit `address` field in the context, allowing developer-controlled adapters to specify which address to use for operations. Previously, this field was incorrectly rejected at runtime.
|
|
61
|
+
- 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.
|
|
62
|
+
|
|
63
|
+
**Breaking Changes:**
|
|
64
|
+
- **Chain ID:** 57054 → 14601
|
|
65
|
+
- **RPC Endpoint:** `https://rpc.blaze.soniclabs.com` → `https://rpc.testnet.soniclabs.com`
|
|
66
|
+
- **USDC Address:** `0xA4879Fed32Ecbef99399e5cbC247E533421C4eC6` → `0x0BA304580ee7c9a980CF72e55f5Ed2E9fd30Bc51`
|
|
67
|
+
|
|
68
|
+
**Migration:** If you were using `SonicTestnet`, your application will automatically connect to the new network upon upgrading. Any accounts, contracts, or transactions on the old Blaze testnet (chainId: 57054) will need to be recreated on the new testnet.
|
|
69
|
+
|
|
70
|
+
## 1.0.0
|
|
71
|
+
|
|
72
|
+
### Major Changes
|
|
73
|
+
|
|
74
|
+
- # Bridge Kit 1.0.0 Release 🎉
|
|
75
|
+
|
|
76
|
+
The core orchestration library for cross-chain USDC transfers - providing a unified, type-safe interface for bridging USDC between heterogeneous blockchain networks.
|
|
77
|
+
|
|
78
|
+
## 🚀 Core Features
|
|
79
|
+
- **Complete Cross-chain Orchestration**: High-level API for USDC transfers between any supported chains
|
|
80
|
+
- **Type-safe APIs**: Exhaustive runtime validation with strict TypeScript support
|
|
81
|
+
- **Deterministic Operations**: Pre-flight simulations and predictable quote generation
|
|
82
|
+
- **Comprehensive Finality Tracking**: Monitor transfer progress across all bridge steps
|
|
83
|
+
|
|
84
|
+
## 🔄 Intelligent Retry System
|
|
85
|
+
|
|
86
|
+
Sophisticated retry mechanism that automatically handles failed or incomplete transfers:
|
|
87
|
+
- **Automatic Recovery**: Resume transfers from the exact point of failure
|
|
88
|
+
- **Step Analysis**: Intelligent detection of which operations completed successfully
|
|
89
|
+
- **Network Resilience**: Handle temporary connectivity issues and gas estimation failures
|
|
90
|
+
- **Multi-step Flow Support**: Retry complex bridge operations involving multiple blockchain transactions
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
// Retry a failed transfer with fresh adapter instances
|
|
94
|
+
const retryResult = await kit.retry(failedResult, {
|
|
95
|
+
from: sourceAdapter,
|
|
96
|
+
to: destAdapter,
|
|
97
|
+
})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 💰 Flexible Fee Management
|
|
101
|
+
|
|
102
|
+
Comprehensive fee system supporting both protocol fees and custom integrator fees:
|
|
103
|
+
- **Transfer Speed Options**: Choose between FAST (with fees) and SLOW (fee-free) transfers
|
|
104
|
+
- **Dynamic Fee Calculation**: Automatic fee estimation based on transfer amount and network conditions
|
|
105
|
+
- **Custom Fee Policies**: Implement your own fee structures with absolute amounts
|
|
106
|
+
- **Multi-chain Fee Support**: Different fee configurations per source chain
|
|
107
|
+
- **Fee Recipient Control**: Specify where fees are sent on the source chain
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Set custom fee policy
|
|
111
|
+
kit.setCustomFeePolicy({
|
|
112
|
+
calculateFee: (params) =>
|
|
113
|
+
params.from.chain.type === 'solana' ? '0.1' : '0.2',
|
|
114
|
+
resolveFeeRecipientAddress: (chain) => getFeeRecipientForChain(chain),
|
|
115
|
+
})
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 🎯 Use Cases
|
|
119
|
+
- **Multi-chain dApp Integration**: Single SDK for all cross-chain USDC needs
|
|
120
|
+
- **Wallet Integration**: Seamless cross-chain transfers for end users
|
|
121
|
+
- **Exchange Integration**: Institutional-grade cross-chain USDC movement
|
|
122
|
+
- **DeFi Protocol Integration**: Bridge USDC liquidity across ecosystems
|
|
123
|
+
|
|
124
|
+
This release provides the foundational orchestration layer for cross-chain USDC applications with production-ready reliability and comprehensive developer tooling.
|
package/chains.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chains.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|