@circle-fin/app-kit 1.2.1 → 1.4.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 +20 -0
- package/README.md +6 -2
- package/chains.cjs +630 -5
- package/chains.d.ts +329 -3
- package/chains.mjs +630 -5
- package/index.cjs +19513 -9145
- package/index.d.ts +4548 -299
- package/index.mjs +19514 -9146
- package/package.json +38 -3
package/chains.mjs
CHANGED
|
@@ -166,8 +166,9 @@ var Blockchain;
|
|
|
166
166
|
/**
|
|
167
167
|
* Enum representing chains that support same-chain swaps through the Swap Kit.
|
|
168
168
|
*
|
|
169
|
-
* Unlike the full {@link Blockchain} enum, SwapChain includes
|
|
170
|
-
* networks
|
|
169
|
+
* Unlike the full {@link Blockchain} enum, SwapChain includes mainnet
|
|
170
|
+
* networks and explicitly whitelisted testnets (e.g., {@link Arc_Testnet})
|
|
171
|
+
* where adapter contracts are deployed (CCTPv2 support).
|
|
171
172
|
*
|
|
172
173
|
* Dynamic validation via {@link isSwapSupportedChain} ensures chains
|
|
173
174
|
* automatically work when adapter contracts and supported tokens are deployed.
|
|
@@ -212,6 +213,8 @@ var SwapChain;
|
|
|
212
213
|
SwapChain["XDC"] = "XDC";
|
|
213
214
|
SwapChain["HyperEVM"] = "HyperEVM";
|
|
214
215
|
SwapChain["Monad"] = "Monad";
|
|
216
|
+
// Testnet chains with swap support
|
|
217
|
+
SwapChain["Arc_Testnet"] = "Arc_Testnet";
|
|
215
218
|
})(SwapChain || (SwapChain = {}));
|
|
216
219
|
// -----------------------------------------------------------------------------
|
|
217
220
|
// Bridge Chain Enum (CCTPv2 Supported Chains)
|
|
@@ -308,6 +311,82 @@ var BridgeChain;
|
|
|
308
311
|
BridgeChain["World_Chain_Sepolia"] = "World_Chain_Sepolia";
|
|
309
312
|
BridgeChain["XDC_Apothem"] = "XDC_Apothem";
|
|
310
313
|
})(BridgeChain || (BridgeChain = {}));
|
|
314
|
+
// -----------------------------------------------------------------------------
|
|
315
|
+
// Unified Balance Chain Enum (Gateway V1 Supported Chains)
|
|
316
|
+
// -----------------------------------------------------------------------------
|
|
317
|
+
/**
|
|
318
|
+
* Enumeration of blockchains that support Gateway V1 operations
|
|
319
|
+
* (deposit, spend, balance, delegate, removeFund).
|
|
320
|
+
*
|
|
321
|
+
* Derived from the full {@link Blockchain} enum but filtered to only
|
|
322
|
+
* include chains with active Gateway V1 contract support. When new chains
|
|
323
|
+
* gain Gateway V1 support, they are added to this enum.
|
|
324
|
+
*
|
|
325
|
+
* @enum
|
|
326
|
+
* @category Enums
|
|
327
|
+
*
|
|
328
|
+
* @remarks
|
|
329
|
+
* - This enum is the **canonical source** of Gateway-supported chains.
|
|
330
|
+
* - Use this enum (or its string literals) in unified-balance-kit calls
|
|
331
|
+
* for type safety.
|
|
332
|
+
*
|
|
333
|
+
* @see {@link Blockchain} for the complete list of all known blockchains.
|
|
334
|
+
* @see {@link UnifiedBalanceChainIdentifier} for the type that accepts these values.
|
|
335
|
+
*/
|
|
336
|
+
var UnifiedBalanceChain;
|
|
337
|
+
(function (UnifiedBalanceChain) {
|
|
338
|
+
// Mainnet chains with Gateway V1 support
|
|
339
|
+
UnifiedBalanceChain["Arbitrum"] = "Arbitrum";
|
|
340
|
+
UnifiedBalanceChain["Avalanche"] = "Avalanche";
|
|
341
|
+
UnifiedBalanceChain["Base"] = "Base";
|
|
342
|
+
UnifiedBalanceChain["Ethereum"] = "Ethereum";
|
|
343
|
+
UnifiedBalanceChain["HyperEVM"] = "HyperEVM";
|
|
344
|
+
UnifiedBalanceChain["Optimism"] = "Optimism";
|
|
345
|
+
UnifiedBalanceChain["Polygon"] = "Polygon";
|
|
346
|
+
UnifiedBalanceChain["Sei"] = "Sei";
|
|
347
|
+
UnifiedBalanceChain["Solana"] = "Solana";
|
|
348
|
+
UnifiedBalanceChain["Sonic"] = "Sonic";
|
|
349
|
+
UnifiedBalanceChain["Unichain"] = "Unichain";
|
|
350
|
+
UnifiedBalanceChain["World_Chain"] = "World_Chain";
|
|
351
|
+
// Testnet chains with Gateway V1 support
|
|
352
|
+
UnifiedBalanceChain["Arbitrum_Sepolia"] = "Arbitrum_Sepolia";
|
|
353
|
+
UnifiedBalanceChain["Arc_Testnet"] = "Arc_Testnet";
|
|
354
|
+
UnifiedBalanceChain["Avalanche_Fuji"] = "Avalanche_Fuji";
|
|
355
|
+
UnifiedBalanceChain["Base_Sepolia"] = "Base_Sepolia";
|
|
356
|
+
UnifiedBalanceChain["Ethereum_Sepolia"] = "Ethereum_Sepolia";
|
|
357
|
+
UnifiedBalanceChain["HyperEVM_Testnet"] = "HyperEVM_Testnet";
|
|
358
|
+
UnifiedBalanceChain["Optimism_Sepolia"] = "Optimism_Sepolia";
|
|
359
|
+
UnifiedBalanceChain["Polygon_Amoy_Testnet"] = "Polygon_Amoy_Testnet";
|
|
360
|
+
UnifiedBalanceChain["Sei_Testnet"] = "Sei_Testnet";
|
|
361
|
+
UnifiedBalanceChain["Solana_Devnet"] = "Solana_Devnet";
|
|
362
|
+
UnifiedBalanceChain["Sonic_Testnet"] = "Sonic_Testnet";
|
|
363
|
+
UnifiedBalanceChain["Unichain_Sepolia"] = "Unichain_Sepolia";
|
|
364
|
+
UnifiedBalanceChain["World_Chain_Sepolia"] = "World_Chain_Sepolia";
|
|
365
|
+
})(UnifiedBalanceChain || (UnifiedBalanceChain = {}));
|
|
366
|
+
// Earn Chain Enum
|
|
367
|
+
// -----------------------------------------------------------------------------
|
|
368
|
+
/**
|
|
369
|
+
* Enumeration of blockchains that support earn (vault deposit/withdraw)
|
|
370
|
+
* operations through the Earn Kit.
|
|
371
|
+
*
|
|
372
|
+
* Currently only Ethereum mainnet is supported. Additional chains
|
|
373
|
+
* will be added as vault protocol support expands.
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```typescript
|
|
377
|
+
* import { EarnChain } from '@core/chains'
|
|
378
|
+
*
|
|
379
|
+
* const result = await earnKit.deposit({
|
|
380
|
+
* from: { adapter, chain: EarnChain.Ethereum },
|
|
381
|
+
* vaultAddress: '0x...',
|
|
382
|
+
* amount: '100',
|
|
383
|
+
* })
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
var EarnChain;
|
|
387
|
+
(function (EarnChain) {
|
|
388
|
+
EarnChain["Ethereum"] = "Ethereum";
|
|
389
|
+
})(EarnChain || (EarnChain = {}));
|
|
311
390
|
|
|
312
391
|
/**
|
|
313
392
|
* Helper function to define a chain with proper TypeScript typing.
|
|
@@ -610,6 +689,70 @@ const BRIDGE_CONTRACT_EVM_MAINNET = '0xB3FA262d0fB521cc93bE83d87b322b8A23DAf3F0'
|
|
|
610
689
|
* on EVM-compatible chains. Use this address for mainnet adapter integrations.
|
|
611
690
|
*/
|
|
612
691
|
const ADAPTER_CONTRACT_EVM_MAINNET = '0x7FB8c7260b63934d8da38aF902f87ae6e284a845';
|
|
692
|
+
/**
|
|
693
|
+
* The adapter contract address for EVM testnet networks.
|
|
694
|
+
*
|
|
695
|
+
* This contract serves as an adapter for integrating with various protocols
|
|
696
|
+
* on EVM-compatible testnet chains. Use this address for testnet adapter
|
|
697
|
+
* integrations (e.g., Arc Testnet).
|
|
698
|
+
*/
|
|
699
|
+
const ADAPTER_CONTRACT_EVM_TESTNET = '0xBBD70b01a1CAbc96d5b7b129Ae1AAabdf50dd40b';
|
|
700
|
+
/**
|
|
701
|
+
* The GatewayWallet contract address for EVM mainnet networks.
|
|
702
|
+
*
|
|
703
|
+
* This contract manages wallet operations for Gateway transactions
|
|
704
|
+
* on mainnet environments across EVM-compatible chains.
|
|
705
|
+
*/
|
|
706
|
+
const GATEWAY_WALLET_EVM_MAINNET = '0x77777777Dcc4d5A8B6E418Fd04D8997ef11000eE';
|
|
707
|
+
/**
|
|
708
|
+
* The GatewayMinter contract address for EVM mainnet networks.
|
|
709
|
+
*
|
|
710
|
+
* This contract handles minting operations for Gateway transactions
|
|
711
|
+
* on mainnet environments across EVM-compatible chains.
|
|
712
|
+
*/
|
|
713
|
+
const GATEWAY_MINTER_EVM_MAINNET = '0x2222222d7164433c4C09B0b0D809a9b52C04C205';
|
|
714
|
+
/**
|
|
715
|
+
* The GatewayWallet contract address for EVM testnet networks.
|
|
716
|
+
*
|
|
717
|
+
* This contract manages wallet operations for Gateway transactions
|
|
718
|
+
* on testnet environments across EVM-compatible chains.
|
|
719
|
+
*/
|
|
720
|
+
const GATEWAY_WALLET_EVM_TESTNET = '0x0077777d7EBA4688BDeF3E311b846F25870A19B9';
|
|
721
|
+
/**
|
|
722
|
+
* The GatewayMinter contract address for EVM testnet networks.
|
|
723
|
+
*
|
|
724
|
+
* This contract handles minting operations for Gateway transactions
|
|
725
|
+
* on testnet environments across EVM-compatible chains.
|
|
726
|
+
*/
|
|
727
|
+
const GATEWAY_MINTER_EVM_TESTNET = '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B';
|
|
728
|
+
/**
|
|
729
|
+
* The GatewayWallet program address for Solana mainnet.
|
|
730
|
+
*
|
|
731
|
+
* This program manages wallet operations for Gateway transactions
|
|
732
|
+
* on Solana mainnet.
|
|
733
|
+
*/
|
|
734
|
+
const GATEWAY_WALLET_SOLANA_MAINNET = 'GATEwy4YxeiEbRJLwB6dXgg7q61e6zBPrMzYj5h1pRXQ';
|
|
735
|
+
/**
|
|
736
|
+
* The GatewayMinter program address for Solana mainnet.
|
|
737
|
+
*
|
|
738
|
+
* This program handles minting operations for Gateway transactions
|
|
739
|
+
* on Solana mainnet.
|
|
740
|
+
*/
|
|
741
|
+
const GATEWAY_MINTER_SOLANA_MAINNET = 'GATEm5SoBJiSw1v2Pz1iPBgUYkXzCUJ27XSXhDfSyzVZ';
|
|
742
|
+
/**
|
|
743
|
+
* The GatewayWallet program address for Solana devnet.
|
|
744
|
+
*
|
|
745
|
+
* This program manages wallet operations for Gateway transactions
|
|
746
|
+
* on Solana devnet.
|
|
747
|
+
*/
|
|
748
|
+
const GATEWAY_WALLET_SOLANA_DEVNET = 'GATEwdfmYNELfp5wDmmR6noSr2vHnAfBPMm2PvCzX5vu';
|
|
749
|
+
/**
|
|
750
|
+
* The GatewayMinter program address for Solana devnet.
|
|
751
|
+
*
|
|
752
|
+
* This program handles minting operations for Gateway transactions
|
|
753
|
+
* on Solana devnet.
|
|
754
|
+
*/
|
|
755
|
+
const GATEWAY_MINTER_SOLANA_DEVNET = 'GATEmKK2ECL1brEngQZWCgMWPbvrEYqsV6u29dAaHavr';
|
|
613
756
|
|
|
614
757
|
/**
|
|
615
758
|
* Arc Testnet chain definition
|
|
@@ -658,6 +801,20 @@ const ArcTestnet = defineChain({
|
|
|
658
801
|
},
|
|
659
802
|
kitContracts: {
|
|
660
803
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
804
|
+
adapter: ADAPTER_CONTRACT_EVM_TESTNET,
|
|
805
|
+
},
|
|
806
|
+
gateway: {
|
|
807
|
+
domain: 26,
|
|
808
|
+
contracts: {
|
|
809
|
+
v1: {
|
|
810
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
811
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
812
|
+
},
|
|
813
|
+
},
|
|
814
|
+
forwarderSupported: {
|
|
815
|
+
source: true,
|
|
816
|
+
destination: true,
|
|
817
|
+
},
|
|
661
818
|
},
|
|
662
819
|
});
|
|
663
820
|
|
|
@@ -709,6 +866,19 @@ const Arbitrum = defineChain({
|
|
|
709
866
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
710
867
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
711
868
|
},
|
|
869
|
+
gateway: {
|
|
870
|
+
domain: 3,
|
|
871
|
+
contracts: {
|
|
872
|
+
v1: {
|
|
873
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
874
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
875
|
+
},
|
|
876
|
+
},
|
|
877
|
+
forwarderSupported: {
|
|
878
|
+
source: true,
|
|
879
|
+
destination: true,
|
|
880
|
+
},
|
|
881
|
+
},
|
|
712
882
|
});
|
|
713
883
|
|
|
714
884
|
/**
|
|
@@ -758,6 +928,19 @@ const ArbitrumSepolia = defineChain({
|
|
|
758
928
|
kitContracts: {
|
|
759
929
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
760
930
|
},
|
|
931
|
+
gateway: {
|
|
932
|
+
domain: 3,
|
|
933
|
+
contracts: {
|
|
934
|
+
v1: {
|
|
935
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
936
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
937
|
+
},
|
|
938
|
+
},
|
|
939
|
+
forwarderSupported: {
|
|
940
|
+
source: true,
|
|
941
|
+
destination: true,
|
|
942
|
+
},
|
|
943
|
+
},
|
|
761
944
|
});
|
|
762
945
|
|
|
763
946
|
/**
|
|
@@ -808,6 +991,19 @@ const Avalanche = defineChain({
|
|
|
808
991
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
809
992
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
810
993
|
},
|
|
994
|
+
gateway: {
|
|
995
|
+
domain: 1,
|
|
996
|
+
contracts: {
|
|
997
|
+
v1: {
|
|
998
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
999
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
1000
|
+
},
|
|
1001
|
+
},
|
|
1002
|
+
forwarderSupported: {
|
|
1003
|
+
source: true,
|
|
1004
|
+
destination: true,
|
|
1005
|
+
},
|
|
1006
|
+
},
|
|
811
1007
|
});
|
|
812
1008
|
|
|
813
1009
|
/**
|
|
@@ -857,6 +1053,19 @@ const AvalancheFuji = defineChain({
|
|
|
857
1053
|
kitContracts: {
|
|
858
1054
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
859
1055
|
},
|
|
1056
|
+
gateway: {
|
|
1057
|
+
domain: 1,
|
|
1058
|
+
contracts: {
|
|
1059
|
+
v1: {
|
|
1060
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
1061
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
1062
|
+
},
|
|
1063
|
+
},
|
|
1064
|
+
forwarderSupported: {
|
|
1065
|
+
source: true,
|
|
1066
|
+
destination: true,
|
|
1067
|
+
},
|
|
1068
|
+
},
|
|
860
1069
|
});
|
|
861
1070
|
|
|
862
1071
|
/**
|
|
@@ -907,6 +1116,19 @@ const Base = defineChain({
|
|
|
907
1116
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
908
1117
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
909
1118
|
},
|
|
1119
|
+
gateway: {
|
|
1120
|
+
domain: 6,
|
|
1121
|
+
contracts: {
|
|
1122
|
+
v1: {
|
|
1123
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
1124
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
forwarderSupported: {
|
|
1128
|
+
source: true,
|
|
1129
|
+
destination: true,
|
|
1130
|
+
},
|
|
1131
|
+
},
|
|
910
1132
|
});
|
|
911
1133
|
|
|
912
1134
|
/**
|
|
@@ -956,6 +1178,19 @@ const BaseSepolia = defineChain({
|
|
|
956
1178
|
kitContracts: {
|
|
957
1179
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
958
1180
|
},
|
|
1181
|
+
gateway: {
|
|
1182
|
+
domain: 6,
|
|
1183
|
+
contracts: {
|
|
1184
|
+
v1: {
|
|
1185
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
1186
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
1187
|
+
},
|
|
1188
|
+
},
|
|
1189
|
+
forwarderSupported: {
|
|
1190
|
+
source: true,
|
|
1191
|
+
destination: true,
|
|
1192
|
+
},
|
|
1193
|
+
},
|
|
959
1194
|
});
|
|
960
1195
|
|
|
961
1196
|
/**
|
|
@@ -1200,7 +1435,10 @@ const Ethereum = defineChain({
|
|
|
1200
1435
|
chainId: 1,
|
|
1201
1436
|
isTestnet: false,
|
|
1202
1437
|
explorerUrl: 'https://etherscan.io/tx/{hash}',
|
|
1203
|
-
rpcEndpoints: [
|
|
1438
|
+
rpcEndpoints: [
|
|
1439
|
+
'https://ethereum-rpc.publicnode.com',
|
|
1440
|
+
'https://ethereum.publicnode.com',
|
|
1441
|
+
],
|
|
1204
1442
|
eurcAddress: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c',
|
|
1205
1443
|
usdcAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
1206
1444
|
usdtAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',
|
|
@@ -1230,6 +1468,19 @@ const Ethereum = defineChain({
|
|
|
1230
1468
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
1231
1469
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
1232
1470
|
},
|
|
1471
|
+
gateway: {
|
|
1472
|
+
domain: 0,
|
|
1473
|
+
contracts: {
|
|
1474
|
+
v1: {
|
|
1475
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
1476
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
1477
|
+
},
|
|
1478
|
+
},
|
|
1479
|
+
forwarderSupported: {
|
|
1480
|
+
source: true,
|
|
1481
|
+
destination: true,
|
|
1482
|
+
},
|
|
1483
|
+
},
|
|
1233
1484
|
});
|
|
1234
1485
|
|
|
1235
1486
|
/**
|
|
@@ -1250,7 +1501,7 @@ const EthereumSepolia = defineChain({
|
|
|
1250
1501
|
chainId: 11155111,
|
|
1251
1502
|
isTestnet: true,
|
|
1252
1503
|
explorerUrl: 'https://sepolia.etherscan.io/tx/{hash}',
|
|
1253
|
-
rpcEndpoints: ['https://sepolia.
|
|
1504
|
+
rpcEndpoints: ['https://ethereum-sepolia-rpc.publicnode.com'],
|
|
1254
1505
|
eurcAddress: '0x08210F9170F89Ab7658F0B5E3fF39b0E03C594D4',
|
|
1255
1506
|
usdcAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',
|
|
1256
1507
|
usdtAddress: null,
|
|
@@ -1279,6 +1530,19 @@ const EthereumSepolia = defineChain({
|
|
|
1279
1530
|
kitContracts: {
|
|
1280
1531
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
1281
1532
|
},
|
|
1533
|
+
gateway: {
|
|
1534
|
+
domain: 0,
|
|
1535
|
+
contracts: {
|
|
1536
|
+
v1: {
|
|
1537
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
1538
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
1539
|
+
},
|
|
1540
|
+
},
|
|
1541
|
+
forwarderSupported: {
|
|
1542
|
+
source: true,
|
|
1543
|
+
destination: true,
|
|
1544
|
+
},
|
|
1545
|
+
},
|
|
1282
1546
|
});
|
|
1283
1547
|
|
|
1284
1548
|
/**
|
|
@@ -1348,7 +1612,7 @@ const HyperEVM = defineChain({
|
|
|
1348
1612
|
},
|
|
1349
1613
|
chainId: 999,
|
|
1350
1614
|
isTestnet: false,
|
|
1351
|
-
explorerUrl: 'https://
|
|
1615
|
+
explorerUrl: 'https://hyperevmscan.io/tx/{hash}',
|
|
1352
1616
|
rpcEndpoints: ['https://rpc.hyperliquid.xyz/evm'],
|
|
1353
1617
|
eurcAddress: null,
|
|
1354
1618
|
usdcAddress: '0xb88339CB7199b77E23DB6E890353E22632Ba630f',
|
|
@@ -1373,6 +1637,19 @@ const HyperEVM = defineChain({
|
|
|
1373
1637
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
1374
1638
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
1375
1639
|
},
|
|
1640
|
+
gateway: {
|
|
1641
|
+
domain: 19,
|
|
1642
|
+
contracts: {
|
|
1643
|
+
v1: {
|
|
1644
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
1645
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
1646
|
+
},
|
|
1647
|
+
},
|
|
1648
|
+
forwarderSupported: {
|
|
1649
|
+
source: true,
|
|
1650
|
+
destination: true,
|
|
1651
|
+
},
|
|
1652
|
+
},
|
|
1376
1653
|
});
|
|
1377
1654
|
|
|
1378
1655
|
/**
|
|
@@ -1417,6 +1694,19 @@ const HyperEVMTestnet = defineChain({
|
|
|
1417
1694
|
kitContracts: {
|
|
1418
1695
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
1419
1696
|
},
|
|
1697
|
+
gateway: {
|
|
1698
|
+
domain: 19,
|
|
1699
|
+
contracts: {
|
|
1700
|
+
v1: {
|
|
1701
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
1702
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
1703
|
+
},
|
|
1704
|
+
},
|
|
1705
|
+
forwarderSupported: {
|
|
1706
|
+
source: true,
|
|
1707
|
+
destination: true,
|
|
1708
|
+
},
|
|
1709
|
+
},
|
|
1420
1710
|
});
|
|
1421
1711
|
|
|
1422
1712
|
/**
|
|
@@ -1951,6 +2241,19 @@ const Optimism = defineChain({
|
|
|
1951
2241
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
1952
2242
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
1953
2243
|
},
|
|
2244
|
+
gateway: {
|
|
2245
|
+
domain: 2,
|
|
2246
|
+
contracts: {
|
|
2247
|
+
v1: {
|
|
2248
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
2249
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
2250
|
+
},
|
|
2251
|
+
},
|
|
2252
|
+
forwarderSupported: {
|
|
2253
|
+
source: true,
|
|
2254
|
+
destination: true,
|
|
2255
|
+
},
|
|
2256
|
+
},
|
|
1954
2257
|
});
|
|
1955
2258
|
|
|
1956
2259
|
/**
|
|
@@ -2000,6 +2303,19 @@ const OptimismSepolia = defineChain({
|
|
|
2000
2303
|
kitContracts: {
|
|
2001
2304
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
2002
2305
|
},
|
|
2306
|
+
gateway: {
|
|
2307
|
+
domain: 2,
|
|
2308
|
+
contracts: {
|
|
2309
|
+
v1: {
|
|
2310
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
2311
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
2312
|
+
},
|
|
2313
|
+
},
|
|
2314
|
+
forwarderSupported: {
|
|
2315
|
+
source: true,
|
|
2316
|
+
destination: true,
|
|
2317
|
+
},
|
|
2318
|
+
},
|
|
2003
2319
|
});
|
|
2004
2320
|
|
|
2005
2321
|
/**
|
|
@@ -2188,6 +2504,19 @@ const Polygon = defineChain({
|
|
|
2188
2504
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2189
2505
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
2190
2506
|
},
|
|
2507
|
+
gateway: {
|
|
2508
|
+
domain: 7,
|
|
2509
|
+
contracts: {
|
|
2510
|
+
v1: {
|
|
2511
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
2512
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
2513
|
+
},
|
|
2514
|
+
},
|
|
2515
|
+
forwarderSupported: {
|
|
2516
|
+
source: true,
|
|
2517
|
+
destination: true,
|
|
2518
|
+
},
|
|
2519
|
+
},
|
|
2191
2520
|
});
|
|
2192
2521
|
|
|
2193
2522
|
/**
|
|
@@ -2237,6 +2566,19 @@ const PolygonAmoy = defineChain({
|
|
|
2237
2566
|
kitContracts: {
|
|
2238
2567
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
2239
2568
|
},
|
|
2569
|
+
gateway: {
|
|
2570
|
+
domain: 7,
|
|
2571
|
+
contracts: {
|
|
2572
|
+
v1: {
|
|
2573
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
2574
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
2575
|
+
},
|
|
2576
|
+
},
|
|
2577
|
+
forwarderSupported: {
|
|
2578
|
+
source: true,
|
|
2579
|
+
destination: true,
|
|
2580
|
+
},
|
|
2581
|
+
},
|
|
2240
2582
|
});
|
|
2241
2583
|
|
|
2242
2584
|
/**
|
|
@@ -2283,6 +2625,19 @@ const Sei = defineChain({
|
|
|
2283
2625
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2284
2626
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
2285
2627
|
},
|
|
2628
|
+
gateway: {
|
|
2629
|
+
domain: 16,
|
|
2630
|
+
contracts: {
|
|
2631
|
+
v1: {
|
|
2632
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
2633
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
2634
|
+
},
|
|
2635
|
+
},
|
|
2636
|
+
forwarderSupported: {
|
|
2637
|
+
source: true,
|
|
2638
|
+
destination: true,
|
|
2639
|
+
},
|
|
2640
|
+
},
|
|
2286
2641
|
});
|
|
2287
2642
|
|
|
2288
2643
|
/**
|
|
@@ -2327,6 +2682,19 @@ const SeiTestnet = defineChain({
|
|
|
2327
2682
|
kitContracts: {
|
|
2328
2683
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
2329
2684
|
},
|
|
2685
|
+
gateway: {
|
|
2686
|
+
domain: 16,
|
|
2687
|
+
contracts: {
|
|
2688
|
+
v1: {
|
|
2689
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
2690
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
2691
|
+
},
|
|
2692
|
+
},
|
|
2693
|
+
forwarderSupported: {
|
|
2694
|
+
source: true,
|
|
2695
|
+
destination: true,
|
|
2696
|
+
},
|
|
2697
|
+
},
|
|
2330
2698
|
});
|
|
2331
2699
|
|
|
2332
2700
|
/**
|
|
@@ -2371,6 +2739,19 @@ const Sonic = defineChain({
|
|
|
2371
2739
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2372
2740
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
2373
2741
|
},
|
|
2742
|
+
gateway: {
|
|
2743
|
+
domain: 13,
|
|
2744
|
+
contracts: {
|
|
2745
|
+
v1: {
|
|
2746
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
2747
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
2748
|
+
},
|
|
2749
|
+
},
|
|
2750
|
+
forwarderSupported: {
|
|
2751
|
+
source: true,
|
|
2752
|
+
destination: true,
|
|
2753
|
+
},
|
|
2754
|
+
},
|
|
2374
2755
|
});
|
|
2375
2756
|
|
|
2376
2757
|
/**
|
|
@@ -2414,6 +2795,19 @@ const SonicTestnet = defineChain({
|
|
|
2414
2795
|
kitContracts: {
|
|
2415
2796
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
2416
2797
|
},
|
|
2798
|
+
gateway: {
|
|
2799
|
+
domain: 13,
|
|
2800
|
+
contracts: {
|
|
2801
|
+
v1: {
|
|
2802
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
2803
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
2804
|
+
},
|
|
2805
|
+
},
|
|
2806
|
+
forwarderSupported: {
|
|
2807
|
+
source: true,
|
|
2808
|
+
destination: true,
|
|
2809
|
+
},
|
|
2810
|
+
},
|
|
2417
2811
|
});
|
|
2418
2812
|
|
|
2419
2813
|
/**
|
|
@@ -2462,6 +2856,19 @@ const Solana = defineChain({
|
|
|
2462
2856
|
kitContracts: {
|
|
2463
2857
|
bridge: 'DFaauJEjmiHkPs1JG89A4p95hDWi9m9SAEERY1LQJiC3',
|
|
2464
2858
|
},
|
|
2859
|
+
gateway: {
|
|
2860
|
+
domain: 5,
|
|
2861
|
+
contracts: {
|
|
2862
|
+
v1: {
|
|
2863
|
+
wallet: GATEWAY_WALLET_SOLANA_MAINNET,
|
|
2864
|
+
minter: GATEWAY_MINTER_SOLANA_MAINNET,
|
|
2865
|
+
},
|
|
2866
|
+
},
|
|
2867
|
+
forwarderSupported: {
|
|
2868
|
+
source: true,
|
|
2869
|
+
destination: false,
|
|
2870
|
+
},
|
|
2871
|
+
},
|
|
2465
2872
|
});
|
|
2466
2873
|
|
|
2467
2874
|
/**
|
|
@@ -2510,6 +2917,19 @@ const SolanaDevnet = defineChain({
|
|
|
2510
2917
|
bridge: 'DFaauJEjmiHkPs1JG89A4p95hDWi9m9SAEERY1LQJiC3',
|
|
2511
2918
|
},
|
|
2512
2919
|
rpcEndpoints: ['https://api.devnet.solana.com'],
|
|
2920
|
+
gateway: {
|
|
2921
|
+
domain: 5,
|
|
2922
|
+
contracts: {
|
|
2923
|
+
v1: {
|
|
2924
|
+
wallet: GATEWAY_WALLET_SOLANA_DEVNET,
|
|
2925
|
+
minter: GATEWAY_MINTER_SOLANA_DEVNET,
|
|
2926
|
+
},
|
|
2927
|
+
},
|
|
2928
|
+
forwarderSupported: {
|
|
2929
|
+
source: true,
|
|
2930
|
+
destination: false,
|
|
2931
|
+
},
|
|
2932
|
+
},
|
|
2513
2933
|
});
|
|
2514
2934
|
|
|
2515
2935
|
/**
|
|
@@ -2684,6 +3104,19 @@ const Unichain = defineChain({
|
|
|
2684
3104
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2685
3105
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
2686
3106
|
},
|
|
3107
|
+
gateway: {
|
|
3108
|
+
domain: 10,
|
|
3109
|
+
contracts: {
|
|
3110
|
+
v1: {
|
|
3111
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
3112
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
3113
|
+
},
|
|
3114
|
+
},
|
|
3115
|
+
forwarderSupported: {
|
|
3116
|
+
source: true,
|
|
3117
|
+
destination: true,
|
|
3118
|
+
},
|
|
3119
|
+
},
|
|
2687
3120
|
});
|
|
2688
3121
|
|
|
2689
3122
|
/**
|
|
@@ -2733,6 +3166,19 @@ const UnichainSepolia = defineChain({
|
|
|
2733
3166
|
kitContracts: {
|
|
2734
3167
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
2735
3168
|
},
|
|
3169
|
+
gateway: {
|
|
3170
|
+
domain: 10,
|
|
3171
|
+
contracts: {
|
|
3172
|
+
v1: {
|
|
3173
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
3174
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
3175
|
+
},
|
|
3176
|
+
},
|
|
3177
|
+
forwarderSupported: {
|
|
3178
|
+
source: true,
|
|
3179
|
+
destination: true,
|
|
3180
|
+
},
|
|
3181
|
+
},
|
|
2736
3182
|
});
|
|
2737
3183
|
|
|
2738
3184
|
/**
|
|
@@ -2777,6 +3223,19 @@ const WorldChain = defineChain({
|
|
|
2777
3223
|
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2778
3224
|
adapter: ADAPTER_CONTRACT_EVM_MAINNET,
|
|
2779
3225
|
},
|
|
3226
|
+
gateway: {
|
|
3227
|
+
domain: 14,
|
|
3228
|
+
contracts: {
|
|
3229
|
+
v1: {
|
|
3230
|
+
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
3231
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
3232
|
+
},
|
|
3233
|
+
},
|
|
3234
|
+
forwarderSupported: {
|
|
3235
|
+
source: true,
|
|
3236
|
+
destination: true,
|
|
3237
|
+
},
|
|
3238
|
+
},
|
|
2780
3239
|
});
|
|
2781
3240
|
|
|
2782
3241
|
/**
|
|
@@ -2823,6 +3282,19 @@ const WorldChainSepolia = defineChain({
|
|
|
2823
3282
|
kitContracts: {
|
|
2824
3283
|
bridge: BRIDGE_CONTRACT_EVM_TESTNET,
|
|
2825
3284
|
},
|
|
3285
|
+
gateway: {
|
|
3286
|
+
domain: 14,
|
|
3287
|
+
contracts: {
|
|
3288
|
+
v1: {
|
|
3289
|
+
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
3290
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
3291
|
+
},
|
|
3292
|
+
},
|
|
3293
|
+
forwarderSupported: {
|
|
3294
|
+
source: true,
|
|
3295
|
+
destination: true,
|
|
3296
|
+
},
|
|
3297
|
+
},
|
|
2826
3298
|
});
|
|
2827
3299
|
|
|
2828
3300
|
/**
|
|
@@ -2964,6 +3436,87 @@ defineChain({
|
|
|
2964
3436
|
cctp: null,
|
|
2965
3437
|
});
|
|
2966
3438
|
|
|
3439
|
+
/**
|
|
3440
|
+
* Zod schema for validating Gateway v1 contract addresses.
|
|
3441
|
+
*
|
|
3442
|
+
* @example
|
|
3443
|
+
* ```typescript
|
|
3444
|
+
* gatewayV1ContractsSchema.parse({
|
|
3445
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
3446
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
3447
|
+
* })
|
|
3448
|
+
* ```
|
|
3449
|
+
*/
|
|
3450
|
+
const gatewayV1ContractsSchema = z
|
|
3451
|
+
.object({
|
|
3452
|
+
wallet: z
|
|
3453
|
+
.string({
|
|
3454
|
+
required_error: 'Gateway wallet address is required. Please provide a valid contract address.',
|
|
3455
|
+
invalid_type_error: 'Gateway wallet address must be a string.',
|
|
3456
|
+
})
|
|
3457
|
+
.min(1, 'Gateway wallet address cannot be empty.'),
|
|
3458
|
+
minter: z
|
|
3459
|
+
.string({
|
|
3460
|
+
required_error: 'Gateway minter address is required. Please provide a valid contract address.',
|
|
3461
|
+
invalid_type_error: 'Gateway minter address must be a string.',
|
|
3462
|
+
})
|
|
3463
|
+
.min(1, 'Gateway minter address cannot be empty.'),
|
|
3464
|
+
})
|
|
3465
|
+
.strict(); // Reject any additional properties not defined in the schema
|
|
3466
|
+
/**
|
|
3467
|
+
* Zod schema for validating the versioned Gateway contracts map.
|
|
3468
|
+
*
|
|
3469
|
+
* @description Mirrors the {@link GatewayContracts} type: a partial map of
|
|
3470
|
+
* protocol versions to their contract addresses, following the same pattern
|
|
3471
|
+
* as {@link CCTPContracts}.
|
|
3472
|
+
*
|
|
3473
|
+
* @example
|
|
3474
|
+
* ```typescript
|
|
3475
|
+
* gatewayContractsSchema.parse({
|
|
3476
|
+
* v1: {
|
|
3477
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
3478
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
3479
|
+
* }
|
|
3480
|
+
* })
|
|
3481
|
+
* ```
|
|
3482
|
+
*/
|
|
3483
|
+
const gatewayContractsSchema = z
|
|
3484
|
+
.object({
|
|
3485
|
+
v1: gatewayV1ContractsSchema.optional(),
|
|
3486
|
+
})
|
|
3487
|
+
.strict(); // Reject any additional properties not defined in the schema
|
|
3488
|
+
/**
|
|
3489
|
+
* Zod schema for validating the full Gateway configuration.
|
|
3490
|
+
*
|
|
3491
|
+
* @description Mirrors the {@link GatewayConfig} type: a domain number plus
|
|
3492
|
+
* a versioned contracts map, following the same pattern as {@link CCTPConfig}.
|
|
3493
|
+
*
|
|
3494
|
+
* @example
|
|
3495
|
+
* ```typescript
|
|
3496
|
+
* gatewayConfigSchema.parse({
|
|
3497
|
+
* domain: 6,
|
|
3498
|
+
* contracts: {
|
|
3499
|
+
* v1: {
|
|
3500
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
3501
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
3502
|
+
* }
|
|
3503
|
+
* }
|
|
3504
|
+
* })
|
|
3505
|
+
* ```
|
|
3506
|
+
*/
|
|
3507
|
+
const gatewayConfigSchema = z
|
|
3508
|
+
.object({
|
|
3509
|
+
domain: z.number({
|
|
3510
|
+
required_error: 'Gateway domain is required. Please provide a valid domain number.',
|
|
3511
|
+
invalid_type_error: 'Gateway domain must be a number.',
|
|
3512
|
+
}),
|
|
3513
|
+
contracts: gatewayContractsSchema,
|
|
3514
|
+
forwarderSupported: z.object({
|
|
3515
|
+
source: z.boolean(),
|
|
3516
|
+
destination: z.boolean(),
|
|
3517
|
+
}),
|
|
3518
|
+
})
|
|
3519
|
+
.strict(); // Reject any additional properties not defined in the schema
|
|
2967
3520
|
/**
|
|
2968
3521
|
* Base schema for common chain definition properties.
|
|
2969
3522
|
* This contains all properties shared between EVM and non-EVM chains.
|
|
@@ -3002,6 +3555,7 @@ const baseChainDefinitionSchema = z.object({
|
|
|
3002
3555
|
adapter: z.string().optional(),
|
|
3003
3556
|
})
|
|
3004
3557
|
.optional(),
|
|
3558
|
+
gateway: gatewayConfigSchema.optional(),
|
|
3005
3559
|
});
|
|
3006
3560
|
/**
|
|
3007
3561
|
* Zod schema for validating EVM chain definitions specifically.
|
|
@@ -3175,6 +3729,77 @@ z.union([
|
|
|
3175
3729
|
message: `Chain "${chainDef.name}" (${chainDef.chain}) is not supported for bridging. Only chains in the BridgeChain enum support CCTPv2 bridging.`,
|
|
3176
3730
|
})),
|
|
3177
3731
|
]);
|
|
3732
|
+
/**
|
|
3733
|
+
* Zod schema for validating earn-specific chain identifiers.
|
|
3734
|
+
*
|
|
3735
|
+
* Validate that the provided chain is supported for earn (vault
|
|
3736
|
+
* deposit/withdraw) operations. Currently only Ethereum is
|
|
3737
|
+
* supported.
|
|
3738
|
+
*
|
|
3739
|
+
* Accept an EarnChain enum value, a matching string literal, or
|
|
3740
|
+
* a ChainDefinition for a supported chain.
|
|
3741
|
+
*
|
|
3742
|
+
* @example
|
|
3743
|
+
* ```typescript
|
|
3744
|
+
* import { earnChainIdentifierSchema } from '@core/chains'
|
|
3745
|
+
* import { EarnChain, Ethereum } from '@core/chains'
|
|
3746
|
+
*
|
|
3747
|
+
* // Valid
|
|
3748
|
+
* earnChainIdentifierSchema.parse(EarnChain.Ethereum)
|
|
3749
|
+
* earnChainIdentifierSchema.parse('Ethereum')
|
|
3750
|
+
* earnChainIdentifierSchema.parse(Ethereum)
|
|
3751
|
+
*
|
|
3752
|
+
* // Invalid (throws ZodError)
|
|
3753
|
+
* earnChainIdentifierSchema.parse('Solana')
|
|
3754
|
+
* ```
|
|
3755
|
+
*/
|
|
3756
|
+
z.union([
|
|
3757
|
+
z.string().refine((val) => val in EarnChain, (val) => ({
|
|
3758
|
+
message: `"${val}" is not a supported earn chain. ` +
|
|
3759
|
+
`Supported chains: ${Object.values(EarnChain).join(', ')}`,
|
|
3760
|
+
})),
|
|
3761
|
+
z.nativeEnum(EarnChain),
|
|
3762
|
+
chainDefinitionSchema.refine((chain) => chain.chain in EarnChain, (chain) => ({
|
|
3763
|
+
message: `"${chain.chain}" is not a supported earn chain. ` +
|
|
3764
|
+
`Supported chains: ${Object.values(EarnChain).join(', ')}`,
|
|
3765
|
+
})),
|
|
3766
|
+
]);
|
|
3767
|
+
/**
|
|
3768
|
+
* Zod schema for validating unified balance chain identifiers.
|
|
3769
|
+
*
|
|
3770
|
+
* This schema validates that the provided chain is supported for unified balance operations.
|
|
3771
|
+
* It accepts either a UnifiedBalanceChain enum value, a string matching a UnifiedBalanceChain value,
|
|
3772
|
+
* or a ChainDefinition for a supported chain.
|
|
3773
|
+
*
|
|
3774
|
+
* Use this schema when validating chain parameters for unified balance operations to ensure
|
|
3775
|
+
* only Gateway V1-supported chains are accepted at runtime.
|
|
3776
|
+
*
|
|
3777
|
+
* @example
|
|
3778
|
+
* ```typescript
|
|
3779
|
+
* import { unifiedBalanceChainIdentifierSchema } from '@core/chains/validation'
|
|
3780
|
+
* import { UnifiedBalanceChain, Chains } from '@core/chains'
|
|
3781
|
+
*
|
|
3782
|
+
* // Valid - UnifiedBalanceChain enum value
|
|
3783
|
+
* unifiedBalanceChainIdentifierSchema.parse(UnifiedBalanceChain.Ethereum)
|
|
3784
|
+
*
|
|
3785
|
+
* // Valid - string literal
|
|
3786
|
+
* unifiedBalanceChainIdentifierSchema.parse('Ethereum')
|
|
3787
|
+
*
|
|
3788
|
+
* // Invalid - Algorand is not in UnifiedBalanceChain (throws ZodError)
|
|
3789
|
+
* unifiedBalanceChainIdentifierSchema.parse('Algorand')
|
|
3790
|
+
* ```
|
|
3791
|
+
*
|
|
3792
|
+
* @see {@link UnifiedBalanceChain} for the enum of supported chains.
|
|
3793
|
+
*/
|
|
3794
|
+
const supportedUnifiedBalanceChains = Object.keys(UnifiedBalanceChain).join(', ');
|
|
3795
|
+
z.union([
|
|
3796
|
+
z.string().refine((val) => val in UnifiedBalanceChain, (val) => ({
|
|
3797
|
+
message: `Chain "${val}" is not supported for unified balance operations. Supported chains: ${supportedUnifiedBalanceChains}.`,
|
|
3798
|
+
})),
|
|
3799
|
+
chainDefinitionSchema.refine((chainDef) => chainDef.chain in UnifiedBalanceChain, (chainDef) => ({
|
|
3800
|
+
message: `Chain "${chainDef.name}" (${chainDef.chain}) is not supported for unified balance operations. Supported chains: ${supportedUnifiedBalanceChains}.`,
|
|
3801
|
+
})),
|
|
3802
|
+
]);
|
|
3178
3803
|
|
|
3179
3804
|
/**
|
|
3180
3805
|
* @packageDocumentation
|