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