@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.
Files changed (53) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +3 -3
  3. package/bridge.cjs +7464 -454
  4. package/bridge.d.cts +585 -61
  5. package/bridge.d.mts +585 -61
  6. package/bridge.d.ts +585 -61
  7. package/bridge.mjs +7464 -454
  8. package/chains.cjs +146 -5
  9. package/chains.d.cts +108 -2
  10. package/chains.d.mts +108 -2
  11. package/chains.d.ts +108 -2
  12. package/chains.mjs +146 -6
  13. package/context.d.cts +522 -57
  14. package/context.d.mts +522 -57
  15. package/context.d.ts +522 -57
  16. package/earn.cjs +478 -181
  17. package/earn.d.cts +522 -57
  18. package/earn.d.mts +522 -57
  19. package/earn.d.ts +522 -57
  20. package/earn.mjs +478 -181
  21. package/estimateBridge.cjs +7464 -457
  22. package/estimateBridge.d.cts +643 -82
  23. package/estimateBridge.d.mts +643 -82
  24. package/estimateBridge.d.ts +643 -82
  25. package/estimateBridge.mjs +7464 -457
  26. package/estimateSwap.cjs +528 -185
  27. package/estimateSwap.d.cts +522 -57
  28. package/estimateSwap.d.mts +522 -57
  29. package/estimateSwap.d.ts +522 -57
  30. package/estimateSwap.mjs +528 -185
  31. package/index.cjs +11548 -2936
  32. package/index.d.cts +5073 -1738
  33. package/index.d.mts +5073 -1738
  34. package/index.d.ts +5073 -1738
  35. package/index.mjs +11547 -2937
  36. package/package.json +17 -6
  37. package/server.cjs +10040 -0
  38. package/server.cjs.map +1 -0
  39. package/server.d.cts +2467 -0
  40. package/server.d.mts +2467 -0
  41. package/server.d.ts +2467 -0
  42. package/server.mjs +10028 -0
  43. package/server.mjs.map +1 -0
  44. package/swap.cjs +528 -185
  45. package/swap.d.cts +522 -57
  46. package/swap.d.mts +522 -57
  47. package/swap.d.ts +522 -57
  48. package/swap.mjs +528 -185
  49. package/unifiedBalance.cjs +742 -44
  50. package/unifiedBalance.d.cts +223 -1
  51. package/unifiedBalance.d.mts +223 -1
  52. package/unifiedBalance.d.ts +223 -1
  53. package/unifiedBalance.mjs +742 -44
package/chains.mjs CHANGED
@@ -61,9 +61,10 @@ import { z } from 'zod';
61
61
  Blockchain["Algorand_Testnet"] = "Algorand_Testnet";
62
62
  Blockchain["Aptos"] = "Aptos";
63
63
  Blockchain["Aptos_Testnet"] = "Aptos_Testnet";
64
- Blockchain["Arc_Testnet"] = "Arc_Testnet";
65
64
  Blockchain["Arbitrum"] = "Arbitrum";
66
65
  Blockchain["Arbitrum_Sepolia"] = "Arbitrum_Sepolia";
66
+ Blockchain["Arc"] = "Arc";
67
+ Blockchain["Arc_Testnet"] = "Arc_Testnet";
67
68
  Blockchain["Avalanche"] = "Avalanche";
68
69
  Blockchain["Avalanche_Fuji"] = "Avalanche_Fuji";
69
70
  Blockchain["Base"] = "Base";
@@ -150,6 +151,7 @@ var SwapChain;
150
151
  SwapChain["XDC"] = "XDC";
151
152
  SwapChain["HyperEVM"] = "HyperEVM";
152
153
  SwapChain["Monad"] = "Monad";
154
+ SwapChain["Arc"] = "Arc";
153
155
  // Testnet chains with swap support
154
156
  SwapChain["Arc_Testnet"] = "Arc_Testnet";
155
157
  })(SwapChain || (SwapChain = {}));
@@ -157,6 +159,7 @@ var BridgeChain;
157
159
  (function(BridgeChain) {
158
160
  // Mainnet chains with CCTPv2 support
159
161
  BridgeChain["Arbitrum"] = "Arbitrum";
162
+ BridgeChain["Arc"] = "Arc";
160
163
  BridgeChain["Avalanche"] = "Avalanche";
161
164
  BridgeChain["Base"] = "Base";
162
165
  BridgeChain["Codex"] = "Codex";
@@ -212,6 +215,7 @@ var BridgeChain;
212
215
  var UnifiedBalanceChain;
213
216
  (function(UnifiedBalanceChain) {
214
217
  // Mainnet chains with Gateway V1 support
218
+ UnifiedBalanceChain["Arc"] = "Arc";
215
219
  UnifiedBalanceChain["Arbitrum"] = "Arbitrum";
216
220
  UnifiedBalanceChain["Avalanche"] = "Avalanche";
217
221
  UnifiedBalanceChain["Base"] = "Base";
@@ -241,6 +245,7 @@ var UnifiedBalanceChain;
241
245
  })(UnifiedBalanceChain || (UnifiedBalanceChain = {}));
242
246
  var EarnChain;
243
247
  (function(EarnChain) {
248
+ EarnChain["Arc"] = "Arc";
244
249
  EarnChain["Arc_Testnet"] = "Arc_Testnet";
245
250
  })(EarnChain || (EarnChain = {}));
246
251
  /**
@@ -257,8 +262,11 @@ var EarnChain;
257
262
  * console.log(EARN_BRIDGE_SOURCE_BLOCKCHAINS.join(', '))
258
263
  * ```
259
264
  */ const EARN_BRIDGE_SOURCE_BLOCKCHAINS = [
265
+ "Arbitrum",
260
266
  "Arbitrum_Sepolia",
267
+ "Base",
261
268
  "Base_Sepolia",
269
+ "Ethereum",
262
270
  "Ethereum_Sepolia"
263
271
  ];
264
272
  /**
@@ -272,6 +280,7 @@ var EarnChain;
272
280
  * console.log(EARN_BRIDGE_DESTINATION_BLOCKCHAINS.join(', '))
273
281
  * ```
274
282
  */ const EARN_BRIDGE_DESTINATION_BLOCKCHAINS = [
283
+ "Arc",
275
284
  "Arc_Testnet"
276
285
  ];
277
286
 
@@ -577,6 +586,25 @@ var EarnChain;
577
586
  * EVM-compatible chains. Use this address when deploying or testing
578
587
  * cross-chain USDC transfers on test networks.
579
588
  */ const BRIDGE_CONTRACT_EVM_TESTNET = '0xC5567a5E3370d4DBfB0540025078e283e36A363d';
589
+ /**
590
+ * The CrossChainTokenService (CCTPx) service address for EVM testnet networks.
591
+ *
592
+ * This service coordinates CCTPx cross-chain token operations on testnet
593
+ * environments and is shared by every EVM test network CCTPx supports. Read the
594
+ * chain definitions via `isCCTPXSupported` rather than trusting a list here,
595
+ * which goes stale as deployments land.
596
+ */ const CCTPX_SERVICE_ADDRESS_EVM_TESTNET = '0x63753E722bd2C2A5DF6EE19C5106662208B81077';
597
+ /**
598
+ * CrossChainTokenService (CCTS) proxy address for CCTPx on EVM **mainnet**.
599
+ *
600
+ * @remarks
601
+ * A distinct deployment from {@link CCTPX_SERVICE_ADDRESS_EVM_TESTNET}, shared
602
+ * by every EVM mainnet chain that CCTPx supports. A chain becomes
603
+ * CCTPx-eligible only once its definition carries this as
604
+ * `cctpx.serviceAddress`, and a route additionally needs both of its endpoints
605
+ * eligible — so adding a chain here is the deliberate, reviewable step that
606
+ * opens mainnet CCTPx for it.
607
+ */ const CCTPX_SERVICE_ADDRESS_EVM_MAINNET = '0x431871229103b780868f8C6BB820cd16ECf942BC';
580
608
  /**
581
609
  * The bridge contract address for EVM mainnet networks.
582
610
  *
@@ -685,6 +713,76 @@ var EarnChain;
685
713
  * Identical across all testnet EVM destination chains.
686
714
  */ const GENERIC_EXECUTOR_EVM_TESTNET = '0xEdC81040756AcCfF070c21D37b265b9D0b5Ba45e';
687
715
 
716
+ /**
717
+ * Arc Mainnet chain definition
718
+ * @remarks
719
+ * This represents the official production network for the Arc blockchain,
720
+ * Circle's EVM-compatible Layer-1 designed for stablecoin finance
721
+ * and asset tokenization. Arc uses USDC as the native gas token and
722
+ * features the Malachite Byzantine Fault Tolerant (BFT) consensus
723
+ * engine for sub-second finality.
724
+ */ const Arc = defineChain({
725
+ type: 'evm',
726
+ chain: Blockchain.Arc,
727
+ name: 'Arc',
728
+ title: 'Arc Mainnet',
729
+ nativeCurrency: {
730
+ name: 'USDC',
731
+ symbol: 'USDC',
732
+ // Arc uses native USDC with 18 decimals for gas payments (EVM standard).
733
+ // Note: The ERC-20 USDC contract at usdcAddress uses 6 decimals.
734
+ // See: https://docs.arc.network/arc/references/contract-addresses
735
+ decimals: 18
736
+ },
737
+ chainId: 5042,
738
+ isTestnet: false,
739
+ explorerUrl: 'https://explorer.arc.io/tx/{hash}',
740
+ rpcEndpoints: [
741
+ 'https://rpc.mainnet.arc.io/'
742
+ ],
743
+ eurcAddress: '0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1',
744
+ usdcAddress: '0x3600000000000000000000000000000000000000',
745
+ usdtAddress: null,
746
+ cctp: {
747
+ domain: 26,
748
+ contracts: {
749
+ v2: {
750
+ type: 'split',
751
+ tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
752
+ messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
753
+ confirmations: 1,
754
+ fastConfirmations: 1
755
+ }
756
+ },
757
+ forwarderSupported: {
758
+ source: false,
759
+ destination: true
760
+ }
761
+ },
762
+ cctpx: {
763
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
764
+ },
765
+ kitContracts: {
766
+ bridge: BRIDGE_CONTRACT_EVM_MAINNET,
767
+ adapter: ADAPTER_CONTRACT_EVM_MAINNET
768
+ },
769
+ gateway: {
770
+ domain: 26,
771
+ contracts: {
772
+ v1: {
773
+ wallet: GATEWAY_WALLET_EVM_MAINNET,
774
+ minter: GATEWAY_MINTER_EVM_MAINNET,
775
+ depositForHandler: DEPOSIT_FOR_HANDLER_EVM_MAINNET,
776
+ genericExecutor: GENERIC_EXECUTOR_EVM_MAINNET
777
+ }
778
+ },
779
+ forwarderSupported: {
780
+ source: true,
781
+ destination: true
782
+ }
783
+ }
784
+ });
785
+
688
786
  /**
689
787
  * Arc Testnet chain definition
690
788
  * @remarks
@@ -732,6 +830,9 @@ var EarnChain;
732
830
  destination: true
733
831
  }
734
832
  },
833
+ cctpx: {
834
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
835
+ },
735
836
  kitContracts: {
736
837
  bridge: BRIDGE_CONTRACT_EVM_TESTNET,
737
838
  adapter: ADAPTER_CONTRACT_EVM_TESTNET
@@ -799,6 +900,9 @@ var EarnChain;
799
900
  destination: true
800
901
  }
801
902
  },
903
+ cctpx: {
904
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
905
+ },
802
906
  kitContracts: {
803
907
  bridge: BRIDGE_CONTRACT_EVM_MAINNET,
804
908
  adapter: ADAPTER_CONTRACT_EVM_MAINNET
@@ -864,6 +968,9 @@ var EarnChain;
864
968
  destination: true
865
969
  }
866
970
  },
971
+ cctpx: {
972
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
973
+ },
867
974
  kitContracts: {
868
975
  bridge: BRIDGE_CONTRACT_EVM_TESTNET,
869
976
  adapter: ADAPTER_CONTRACT_EVM_TESTNET
@@ -929,6 +1036,9 @@ var EarnChain;
929
1036
  destination: true
930
1037
  }
931
1038
  },
1039
+ cctpx: {
1040
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
1041
+ },
932
1042
  kitContracts: {
933
1043
  bridge: BRIDGE_CONTRACT_EVM_MAINNET,
934
1044
  adapter: ADAPTER_CONTRACT_EVM_MAINNET
@@ -996,6 +1106,9 @@ var EarnChain;
996
1106
  rpcEndpoints: [
997
1107
  'https://api.avax-test.network/ext/bc/C/rpc'
998
1108
  ],
1109
+ cctpx: {
1110
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
1111
+ },
999
1112
  kitContracts: {
1000
1113
  bridge: BRIDGE_CONTRACT_EVM_TESTNET
1001
1114
  },
@@ -1063,6 +1176,9 @@ var EarnChain;
1063
1176
  destination: true
1064
1177
  }
1065
1178
  },
1179
+ cctpx: {
1180
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
1181
+ },
1066
1182
  kitContracts: {
1067
1183
  bridge: BRIDGE_CONTRACT_EVM_MAINNET,
1068
1184
  adapter: ADAPTER_CONTRACT_EVM_MAINNET
@@ -1128,6 +1244,9 @@ var EarnChain;
1128
1244
  destination: true
1129
1245
  }
1130
1246
  },
1247
+ cctpx: {
1248
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
1249
+ },
1131
1250
  kitContracts: {
1132
1251
  bridge: BRIDGE_CONTRACT_EVM_TESTNET,
1133
1252
  adapter: ADAPTER_CONTRACT_EVM_TESTNET
@@ -1520,6 +1639,9 @@ var EarnChain;
1520
1639
  destination: true
1521
1640
  }
1522
1641
  },
1642
+ cctpx: {
1643
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
1644
+ },
1523
1645
  kitContracts: {
1524
1646
  bridge: BRIDGE_CONTRACT_EVM_MAINNET,
1525
1647
  adapter: ADAPTER_CONTRACT_EVM_MAINNET
@@ -1585,6 +1707,9 @@ var EarnChain;
1585
1707
  destination: true
1586
1708
  }
1587
1709
  },
1710
+ cctpx: {
1711
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
1712
+ },
1588
1713
  kitContracts: {
1589
1714
  bridge: BRIDGE_CONTRACT_EVM_TESTNET,
1590
1715
  adapter: ADAPTER_CONTRACT_EVM_TESTNET
@@ -2416,6 +2541,9 @@ var EarnChain;
2416
2541
  destination: true
2417
2542
  }
2418
2543
  },
2544
+ cctpx: {
2545
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
2546
+ },
2419
2547
  kitContracts: {
2420
2548
  bridge: BRIDGE_CONTRACT_EVM_MAINNET,
2421
2549
  adapter: ADAPTER_CONTRACT_EVM_MAINNET
@@ -2481,6 +2609,9 @@ var EarnChain;
2481
2609
  destination: true
2482
2610
  }
2483
2611
  },
2612
+ cctpx: {
2613
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
2614
+ },
2484
2615
  kitContracts: {
2485
2616
  bridge: BRIDGE_CONTRACT_EVM_TESTNET
2486
2617
  },
@@ -2876,6 +3007,9 @@ var EarnChain;
2876
3007
  destination: true
2877
3008
  }
2878
3009
  },
3010
+ cctpx: {
3011
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_MAINNET
3012
+ },
2879
3013
  kitContracts: {
2880
3014
  bridge: BRIDGE_CONTRACT_EVM_MAINNET,
2881
3015
  adapter: ADAPTER_CONTRACT_EVM_MAINNET
@@ -2944,6 +3078,9 @@ var EarnChain;
2944
3078
  destination: true
2945
3079
  }
2946
3080
  },
3081
+ cctpx: {
3082
+ serviceAddress: CCTPX_SERVICE_ADDRESS_EVM_TESTNET
3083
+ },
2947
3084
  kitContracts: {
2948
3085
  bridge: BRIDGE_CONTRACT_EVM_TESTNET
2949
3086
  },
@@ -4113,6 +4250,7 @@ var EarnChain;
4113
4250
  usdcAddress: z.string().nullable(),
4114
4251
  usdtAddress: z.string().nullable(),
4115
4252
  cctp: z.any().nullable(),
4253
+ cctpx: z.any().optional(),
4116
4254
  kitContracts: z.object({
4117
4255
  bridge: z.string().optional(),
4118
4256
  adapter: z.string().optional()
@@ -4318,14 +4456,15 @@ const EARN_BRIDGE_DESTINATION_CHAIN_VALUES = EARN_BRIDGE_DESTINATION_BLOCKCHAINS
4318
4456
  * Zod schema for validating the source chain of a cross-chain Earn deposit.
4319
4457
  *
4320
4458
  * Accept a supported source Blockchain value, a matching string literal, or a
4321
- * ChainDefinition for a supported source chain. Source chains are Ethereum
4322
- * Sepolia, Arbitrum Sepolia, and Base Sepolia.
4459
+ * ChainDefinition for a supported source chain. Source chains are Ethereum,
4460
+ * Arbitrum, and Base (mainnet and testnet).
4323
4461
  *
4324
4462
  * @example
4325
4463
  * ```typescript
4326
4464
  * import { earnBridgeSourceChainIdentifierSchema } from '@core/chains'
4327
4465
  *
4328
4466
  * // Valid
4467
+ * earnBridgeSourceChainIdentifierSchema.parse('Ethereum')
4329
4468
  * earnBridgeSourceChainIdentifierSchema.parse('Ethereum_Sepolia')
4330
4469
  *
4331
4470
  * // Invalid (throws ZodError)
@@ -4344,14 +4483,15 @@ const EARN_BRIDGE_DESTINATION_CHAIN_VALUES = EARN_BRIDGE_DESTINATION_BLOCKCHAINS
4344
4483
  * deposit.
4345
4484
  *
4346
4485
  * Accept a supported destination Blockchain value, a matching string literal,
4347
- * or a ChainDefinition for a supported destination chain. Currently only Arc
4348
- * Testnet is supported.
4486
+ * or a ChainDefinition for a supported destination chain. Arc (mainnet) and
4487
+ * Arc Testnet are supported.
4349
4488
  *
4350
4489
  * @example
4351
4490
  * ```typescript
4352
4491
  * import { earnBridgeDestinationChainIdentifierSchema } from '@core/chains'
4353
4492
  *
4354
4493
  * // Valid
4494
+ * earnBridgeDestinationChainIdentifierSchema.parse('Arc')
4355
4495
  * earnBridgeDestinationChainIdentifierSchema.parse('Arc_Testnet')
4356
4496
  *
4357
4497
  * // Invalid (throws ZodError)
@@ -4423,5 +4563,5 @@ const swapTokenEnumSchema = z.enum([
4423
4563
  * ```
4424
4564
  */ z.string().transform((value)=>value.toUpperCase()).pipe(swapTokenEnumSchema);
4425
4565
 
4426
- export { Arbitrum, ArbitrumSepolia, ArcTestnet, Avalanche, AvalancheFuji, Base, BaseSepolia, Codex, CodexTestnet, Ethereum, EthereumSepolia, HyperEVM, HyperEVMTestnet, Ink, InkTestnet, Linea, LineaSepolia, Optimism, OptimismSepolia, Plasma, PlasmaTestnet, Plume, PlumeTestnet, Polygon, PolygonAmoy, Sei, SeiTestnet, Solana, SolanaDevnet, Sonic, SonicTestnet, Unichain, UnichainSepolia, WorldChain, WorldChainSepolia, XDC, XDCApothem, XLayer, XLayerTestnet };
4566
+ export { Arbitrum, ArbitrumSepolia, Arc, ArcTestnet, Avalanche, AvalancheFuji, Base, BaseSepolia, Codex, CodexTestnet, Ethereum, EthereumSepolia, HyperEVM, HyperEVMTestnet, Ink, InkTestnet, Linea, LineaSepolia, Optimism, OptimismSepolia, Plasma, PlasmaTestnet, Plume, PlumeTestnet, Polygon, PolygonAmoy, Sei, SeiTestnet, Solana, SolanaDevnet, Sonic, SonicTestnet, Unichain, UnichainSepolia, WorldChain, WorldChainSepolia, XDC, XDCApothem, XLayer, XLayerTestnet };
4427
4567
  //# sourceMappingURL=chains.mjs.map