@circle-fin/app-kit 1.14.0 → 1.15.1
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 +72 -0
- package/README.md +3 -3
- package/bridge.cjs +7464 -454
- package/bridge.d.cts +585 -61
- package/bridge.d.mts +585 -61
- package/bridge.d.ts +585 -61
- package/bridge.mjs +7464 -454
- package/chains.cjs +146 -5
- package/chains.d.cts +108 -2
- package/chains.d.mts +108 -2
- package/chains.d.ts +108 -2
- package/chains.mjs +146 -6
- package/context.d.cts +522 -57
- package/context.d.mts +522 -57
- package/context.d.ts +522 -57
- package/earn.cjs +478 -181
- package/earn.d.cts +522 -57
- package/earn.d.mts +522 -57
- package/earn.d.ts +522 -57
- package/earn.mjs +478 -181
- package/estimateBridge.cjs +7464 -457
- package/estimateBridge.d.cts +643 -82
- package/estimateBridge.d.mts +643 -82
- package/estimateBridge.d.ts +643 -82
- package/estimateBridge.mjs +7464 -457
- package/estimateSwap.cjs +528 -185
- package/estimateSwap.d.cts +522 -57
- package/estimateSwap.d.mts +522 -57
- package/estimateSwap.d.ts +522 -57
- package/estimateSwap.mjs +528 -185
- package/index.cjs +11548 -2936
- package/index.d.cts +5073 -1738
- package/index.d.mts +5073 -1738
- package/index.d.ts +5073 -1738
- package/index.mjs +11547 -2937
- package/package.json +17 -6
- package/server.cjs +10040 -0
- package/server.cjs.map +1 -0
- package/server.d.cts +2467 -0
- package/server.d.mts +2467 -0
- package/server.d.ts +2467 -0
- package/server.mjs +10028 -0
- package/server.mjs.map +1 -0
- package/swap.cjs +528 -185
- package/swap.d.cts +522 -57
- package/swap.d.mts +522 -57
- package/swap.d.ts +522 -57
- package/swap.mjs +528 -185
- package/unifiedBalance.cjs +742 -44
- package/unifiedBalance.d.cts +223 -1
- package/unifiedBalance.d.mts +223 -1
- package/unifiedBalance.d.ts +223 -1
- package/unifiedBalance.mjs +742 -44
package/unifiedBalance.d.ts
CHANGED
|
@@ -166,6 +166,30 @@ interface BaseChainDefinition {
|
|
|
166
166
|
* ```
|
|
167
167
|
*/
|
|
168
168
|
kitContracts?: KitContracts;
|
|
169
|
+
/**
|
|
170
|
+
* Optional CCTPx configuration.
|
|
171
|
+
*
|
|
172
|
+
* @description When provided, the chain supports CCTPx (Cross-Chain Token Service).
|
|
173
|
+
* CCTPx is a service-level protocol layered on top of CCTP v2's message-passing layer
|
|
174
|
+
* that enables cross-chain transfers of registered tokens (Circle-issued or otherwise).
|
|
175
|
+
*
|
|
176
|
+
* The CCTS contract is deployed via CREATE3 so its address is deterministic and may
|
|
177
|
+
* be committed to chain config ahead of the on-chain deployment.
|
|
178
|
+
*
|
|
179
|
+
* Use the {@link isCCTPXSupported} type guard to check if a chain has CCTPx support
|
|
180
|
+
* before accessing this property.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* if (isCCTPXSupported(chain)) {
|
|
185
|
+
* console.log('CCTS address:', chain.cctpx.serviceAddress)
|
|
186
|
+
* }
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @see {@link CCTPXChainConfig} for the structure of CCTPx configuration.
|
|
190
|
+
* @see {@link isCCTPXSupported} for checking CCTPx support.
|
|
191
|
+
*/
|
|
192
|
+
cctpx?: CCTPXChainConfig;
|
|
169
193
|
/**
|
|
170
194
|
* Optional Gateway contract configuration for Gateway protocol support.
|
|
171
195
|
*
|
|
@@ -485,6 +509,34 @@ interface CCTPConfig {
|
|
|
485
509
|
destination: boolean;
|
|
486
510
|
};
|
|
487
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* Configuration for Circle's Cross-Chain Token Service (CCTS) — the CCTPx protocol.
|
|
514
|
+
*
|
|
515
|
+
* @category Types
|
|
516
|
+
*
|
|
517
|
+
* @description Contains the CCTS proxy contract address on a given chain. The CCTS
|
|
518
|
+
* contract is the service-level entry point for CCTPx cross-chain transfers of
|
|
519
|
+
* registered tokens (Circle-issued or otherwise). Addresses are deterministic via CREATE3
|
|
520
|
+
* and may be committed to chain config ahead of the on-chain deploy.
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```typescript
|
|
524
|
+
* const cctpxConfig: CCTPXChainConfig = {
|
|
525
|
+
* serviceAddress: '0x1234567890abcdef1234567890abcdef12345678'
|
|
526
|
+
* }
|
|
527
|
+
* ```
|
|
528
|
+
*/
|
|
529
|
+
interface CCTPXChainConfig {
|
|
530
|
+
/**
|
|
531
|
+
* The CrossChainTokenService (CCTS) proxy contract address on this chain.
|
|
532
|
+
*
|
|
533
|
+
* @description Deterministic CREATE3 address. Used by the SDK as the `to` field
|
|
534
|
+
* when calling `crossChainTransfer` and `resolveTokenManager`.
|
|
535
|
+
*
|
|
536
|
+
* @example "0x1234567890abcdef1234567890abcdef12345678"
|
|
537
|
+
*/
|
|
538
|
+
serviceAddress: string;
|
|
539
|
+
}
|
|
488
540
|
/**
|
|
489
541
|
* Available kit contract types for enhanced chain functionality.
|
|
490
542
|
*
|
|
@@ -691,9 +743,10 @@ declare enum Blockchain {
|
|
|
691
743
|
Algorand_Testnet = "Algorand_Testnet",
|
|
692
744
|
Aptos = "Aptos",
|
|
693
745
|
Aptos_Testnet = "Aptos_Testnet",
|
|
694
|
-
Arc_Testnet = "Arc_Testnet",
|
|
695
746
|
Arbitrum = "Arbitrum",
|
|
696
747
|
Arbitrum_Sepolia = "Arbitrum_Sepolia",
|
|
748
|
+
Arc = "Arc",
|
|
749
|
+
Arc_Testnet = "Arc_Testnet",
|
|
697
750
|
Avalanche = "Avalanche",
|
|
698
751
|
Avalanche_Fuji = "Avalanche_Fuji",
|
|
699
752
|
Base = "Base",
|
|
@@ -807,6 +860,7 @@ declare enum Blockchain {
|
|
|
807
860
|
*/
|
|
808
861
|
declare enum BridgeChain {
|
|
809
862
|
Arbitrum = "Arbitrum",
|
|
863
|
+
Arc = "Arc",
|
|
810
864
|
Avalanche = "Avalanche",
|
|
811
865
|
Base = "Base",
|
|
812
866
|
Codex = "Codex",
|
|
@@ -907,6 +961,7 @@ type BridgeChainIdentifier = ChainDefinition | BridgeChain | `${BridgeChain}`;
|
|
|
907
961
|
* @see {@link UnifiedBalanceChainIdentifier} for the type that accepts these values.
|
|
908
962
|
*/
|
|
909
963
|
declare enum UnifiedBalanceChain {
|
|
964
|
+
Arc = "Arc",
|
|
910
965
|
Arbitrum = "Arbitrum",
|
|
911
966
|
Avalanche = "Avalanche",
|
|
912
967
|
Base = "Base",
|
|
@@ -2131,6 +2186,171 @@ interface CCTPActionMap {
|
|
|
2131
2186
|
readonly v2: CCTPv2ActionMap;
|
|
2132
2187
|
}
|
|
2133
2188
|
|
|
2189
|
+
/**
|
|
2190
|
+
* Action map for Circle's CCTPx protocol operations.
|
|
2191
|
+
*
|
|
2192
|
+
* Define the parameter schemas for CCTPx actions that enable cross-chain transfers
|
|
2193
|
+
* of registered tokens (Circle-issued or otherwise) through Circle's `CrossChainTokenService`
|
|
2194
|
+
* (CCTS) contract.
|
|
2195
|
+
*
|
|
2196
|
+
* @remarks
|
|
2197
|
+
* CCTPx is a service-level protocol layered on top of CCTP v2's message-passing layer.
|
|
2198
|
+
* The CCTS contract coordinates token locking/burning, fee collection, and cross-chain
|
|
2199
|
+
* message dispatch. The SDK obtains a signed fee quote from IRIS, then calls
|
|
2200
|
+
* `crossChainTransfer` on CCTS with the quote bytes verbatim and the native fee as
|
|
2201
|
+
* `msg.value`. The auto-relay flow handled by Circle's Orbit relayer (paid for via the
|
|
2202
|
+
* `FORWARD` fee component included in the signed quote) means no separate
|
|
2203
|
+
* `receiveMessage` step is required on the destination.
|
|
2204
|
+
*
|
|
2205
|
+
* USDC and EURC bridging continues to use CCTP v2 (`cctp.v2.*`) actions, not CCTPx.
|
|
2206
|
+
*
|
|
2207
|
+
* @example
|
|
2208
|
+
* ```typescript
|
|
2209
|
+
* import type { ActionPayload } from '@core/adapter'
|
|
2210
|
+
*
|
|
2211
|
+
* const transferParams: ActionPayload<'cctpx.crossChainTransfer'> = {
|
|
2212
|
+
* tokenId: '0xabc123...',
|
|
2213
|
+
* amount: 1_000_000n,
|
|
2214
|
+
* destinationDomain: 1,
|
|
2215
|
+
* destinationAddress: '0xRecipient',
|
|
2216
|
+
* destinationCaller: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
2217
|
+
* minFinalityThreshold: 1000,
|
|
2218
|
+
* claim: { signedQuote: '0xdeadbeef...', refundAddress: '0xSenderEOA...' },
|
|
2219
|
+
* autoExecuteHookData: false,
|
|
2220
|
+
* hookData: '0x',
|
|
2221
|
+
* serviceAddress: '0xCCTSProxy...',
|
|
2222
|
+
* nativeFeeAmount: 100_000n,
|
|
2223
|
+
* fromChain,
|
|
2224
|
+
* }
|
|
2225
|
+
* ```
|
|
2226
|
+
*/
|
|
2227
|
+
interface CCTPXActionMap {
|
|
2228
|
+
/**
|
|
2229
|
+
* Initiate a CCTPx cross-chain transfer through the `CrossChainTokenService` contract.
|
|
2230
|
+
*
|
|
2231
|
+
* Encode and submit a `crossChainTransfer(...)` call to the CCTS proxy on the source
|
|
2232
|
+
* chain, passing the IRIS-signed fee quote bytes verbatim and the native fee as
|
|
2233
|
+
* `msg.value`. The contract emits CCTP v2's `MessageSent` event, which IRIS attests
|
|
2234
|
+
* to before Circle's Orbit relayer auto-executes the destination mint.
|
|
2235
|
+
*
|
|
2236
|
+
* @remarks
|
|
2237
|
+
* The caller (typically `CCTPXBridgingProvider`) is responsible for:
|
|
2238
|
+
* - Resolving `tokenId` and the per-chain `tokenAddress` from the IRIS token registry
|
|
2239
|
+
* - Approving the per-token `TokenManager` for `amount` before this call
|
|
2240
|
+
* - Fetching `claim.signedQuote` and computing `nativeFeeAmount` from IRIS
|
|
2241
|
+
*
|
|
2242
|
+
* This action only encodes and submits the on-chain call; it does not perform any
|
|
2243
|
+
* off-chain orchestration.
|
|
2244
|
+
*/
|
|
2245
|
+
crossChainTransfer: ActionParameters & {
|
|
2246
|
+
/**
|
|
2247
|
+
* The CCTPx tokenId for the asset being transferred.
|
|
2248
|
+
*
|
|
2249
|
+
* Provided as a 32-byte hex string assigned by CCTPx at registration time.
|
|
2250
|
+
* The same `tokenId` is used across all chains for a given token; per-chain
|
|
2251
|
+
* `tokenAddress` is resolved from the IRIS token registry separately.
|
|
2252
|
+
*/
|
|
2253
|
+
tokenId: string;
|
|
2254
|
+
/**
|
|
2255
|
+
* Amount of the token to transfer, in the token's smallest units.
|
|
2256
|
+
*/
|
|
2257
|
+
amount: bigint;
|
|
2258
|
+
/**
|
|
2259
|
+
* CCTP domain identifier of the destination chain.
|
|
2260
|
+
*
|
|
2261
|
+
* CCTPx reuses CCTP v2 domain numbering; pass `dstChain.cctp.domain`.
|
|
2262
|
+
*/
|
|
2263
|
+
destinationDomain: number;
|
|
2264
|
+
/**
|
|
2265
|
+
* Recipient address on the destination chain, encoded as bytes.
|
|
2266
|
+
*
|
|
2267
|
+
* For EVM destinations this is a 20-byte address encoded as a hex string.
|
|
2268
|
+
*/
|
|
2269
|
+
destinationAddress: string;
|
|
2270
|
+
/**
|
|
2271
|
+
* `bytes32` value restricting which address may execute on the destination.
|
|
2272
|
+
*
|
|
2273
|
+
* Omit (or pass the 32-byte zero hash) to allow permissionless relay — the
|
|
2274
|
+
* default for auto-relayed CCTPx transfers. When omitted, the handler
|
|
2275
|
+
* substitutes the zero hash.
|
|
2276
|
+
*
|
|
2277
|
+
* @defaultValue `ZERO_HASH` — permissionless relay
|
|
2278
|
+
*/
|
|
2279
|
+
destinationCaller?: string;
|
|
2280
|
+
/**
|
|
2281
|
+
* Minimum finality threshold for attestation eligibility.
|
|
2282
|
+
*
|
|
2283
|
+
* Use `1000` for FAST transfers (pre-finality) or `2000` for SLOW transfers
|
|
2284
|
+
* (full finality). For FAST, the `claim.signedQuote` must include a
|
|
2285
|
+
* `PRE_FINALITY` item; otherwise the on-chain call reverts.
|
|
2286
|
+
*/
|
|
2287
|
+
minFinalityThreshold: number;
|
|
2288
|
+
/**
|
|
2289
|
+
* The CCTS fee-quote claim — maps 1:1 to the on-chain
|
|
2290
|
+
* `IFeeManager.QuoteClaim` tuple.
|
|
2291
|
+
*
|
|
2292
|
+
* The contract requires a tuple here, not a flat bytes blob. Encoding the
|
|
2293
|
+
* signed quote without the tuple wrapper produces a different function
|
|
2294
|
+
* selector and the call will revert.
|
|
2295
|
+
*/
|
|
2296
|
+
claim: {
|
|
2297
|
+
/**
|
|
2298
|
+
* IRIS-signed fee quote bytes, passed verbatim to the contract.
|
|
2299
|
+
*
|
|
2300
|
+
* Obtained from `POST /v1/quote/cctpx/{tokenId}/{src}/{dst}`. Contains the
|
|
2301
|
+
* version-prefixed ABI-encoded `Quote` struct and Circle's signature; the
|
|
2302
|
+
* `FeeManager` contract validates the signature against the quote items.
|
|
2303
|
+
*/
|
|
2304
|
+
signedQuote: string;
|
|
2305
|
+
/**
|
|
2306
|
+
* Address that receives any native-fee refund from `FeeManager`.
|
|
2307
|
+
*
|
|
2308
|
+
* Forwarded verbatim to `FeeManager` for refund attribution. The contract
|
|
2309
|
+
* accepts `address(0)` (the zero address) to disable refunds, so omitting
|
|
2310
|
+
* this field is safe; the handler will substitute the zero address.
|
|
2311
|
+
*
|
|
2312
|
+
* @defaultValue `ZERO_ADDRESS` — refunds disabled
|
|
2313
|
+
*/
|
|
2314
|
+
refundAddress?: string;
|
|
2315
|
+
};
|
|
2316
|
+
/**
|
|
2317
|
+
* Whether the destination chain should auto-execute the hook data.
|
|
2318
|
+
*
|
|
2319
|
+
* For basic transfers this is `false`. Reserved for advanced integrations
|
|
2320
|
+
* that bundle a post-mint hook on the destination.
|
|
2321
|
+
*/
|
|
2322
|
+
autoExecuteHookData: boolean;
|
|
2323
|
+
/**
|
|
2324
|
+
* Optional hook data bytes passed through to the destination handler.
|
|
2325
|
+
*
|
|
2326
|
+
* Pass `'0x'` (empty bytes) for basic transfers.
|
|
2327
|
+
*/
|
|
2328
|
+
hookData: string;
|
|
2329
|
+
/**
|
|
2330
|
+
* The `CrossChainTokenService` proxy address on the source chain.
|
|
2331
|
+
*
|
|
2332
|
+
* Used as the transaction `to` field. Typically sourced from
|
|
2333
|
+
* `srcChain.cctpx.serviceAddress` — but is passed as an explicit parameter
|
|
2334
|
+
* so the action does not depend on chain-config narrowing at the call site.
|
|
2335
|
+
*/
|
|
2336
|
+
serviceAddress: string;
|
|
2337
|
+
/**
|
|
2338
|
+
* Native gas amount to send as `msg.value`.
|
|
2339
|
+
*
|
|
2340
|
+
* Must exactly equal `sum(quote.items[].amount)` when `feeToken` is the
|
|
2341
|
+
* native currency (the P0 default). The contract verifies the value against
|
|
2342
|
+
* the signed quote; do not over-send.
|
|
2343
|
+
*/
|
|
2344
|
+
nativeFeeAmount: bigint;
|
|
2345
|
+
/**
|
|
2346
|
+
* Source chain definition.
|
|
2347
|
+
*
|
|
2348
|
+
* Provides the adapter with chain context (chainId, RPC, etc.) for the call.
|
|
2349
|
+
*/
|
|
2350
|
+
fromChain: ChainDefinition;
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2134
2354
|
/**
|
|
2135
2355
|
* Permit signature standards for gasless token approvals.
|
|
2136
2356
|
*
|
|
@@ -3226,6 +3446,8 @@ interface NativeActionMap {
|
|
|
3226
3446
|
interface ActionMap {
|
|
3227
3447
|
/** CCTP-specific operations with automatic address resolution. */
|
|
3228
3448
|
readonly cctp: CCTPActionMap;
|
|
3449
|
+
/** CCTPx operations (CrossChainTokenService) for cross-chain transfers of registered tokens (Circle-issued or otherwise). */
|
|
3450
|
+
readonly cctpx: CCTPXActionMap;
|
|
3229
3451
|
/** Gateway Wallet operations, versioned (e.g. gateway.v1.deposit). */
|
|
3230
3452
|
readonly gateway: GatewayActionMap;
|
|
3231
3453
|
/** Native token operations (ETH, SOL, MATIC, etc.). */
|