@veridex/sdk 1.1.6 → 1.1.7
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/dist/{EVMClient-CTOtNY8I.d.mts → EVMClient-DqDiFak8.d.mts} +1 -1
- package/dist/auth/prepareAuth.d.mts +5 -4
- package/dist/auth/prepareAuth.js +57 -1415
- package/dist/auth/prepareAuth.js.map +1 -1
- package/dist/auth/prepareAuth.mjs +17 -96
- package/dist/auth/prepareAuth.mjs.map +1 -1
- package/dist/chains/aptos/index.d.mts +1 -1
- package/dist/chains/aptos/index.js +11 -33
- package/dist/chains/aptos/index.js.map +1 -1
- package/dist/chains/aptos/index.mjs +2 -2
- package/dist/chains/avalanche/index.d.mts +2 -2
- package/dist/chains/avalanche/index.js +19 -115
- package/dist/chains/avalanche/index.js.map +1 -1
- package/dist/chains/avalanche/index.mjs +3 -3
- package/dist/chains/evm/index.d.mts +3 -3
- package/dist/chains/evm/index.js +19 -115
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/chains/evm/index.mjs +2 -2
- package/dist/chains/solana/index.d.mts +1 -1
- package/dist/chains/solana/index.js +11 -33
- package/dist/chains/solana/index.js.map +1 -1
- package/dist/chains/solana/index.mjs +2 -2
- package/dist/chains/stacks/index.d.mts +1 -1
- package/dist/chains/stacks/index.js +11 -38
- package/dist/chains/stacks/index.js.map +1 -1
- package/dist/chains/stacks/index.mjs +2 -2
- package/dist/chains/starknet/index.d.mts +36 -2
- package/dist/chains/starknet/index.js +208 -37
- package/dist/chains/starknet/index.js.map +1 -1
- package/dist/chains/starknet/index.mjs +9 -4
- package/dist/chains/sui/index.d.mts +1 -1
- package/dist/chains/sui/index.js +11 -27
- package/dist/chains/sui/index.js.map +1 -1
- package/dist/chains/sui/index.mjs +2 -2
- package/dist/{chunk-ZNIVNPGF.mjs → chunk-3PCAVZUZ.mjs} +173 -37
- package/dist/chunk-3PCAVZUZ.mjs.map +1 -0
- package/dist/{chunk-DQOW3G7M.mjs → chunk-6BINP4RT.mjs} +48 -9
- package/dist/{chunk-DQOW3G7M.mjs.map → chunk-6BINP4RT.mjs.map} +1 -1
- package/dist/{chunk-7KN6Y4GX.mjs → chunk-AK5HWYX4.mjs} +12 -40
- package/dist/chunk-AK5HWYX4.mjs.map +1 -0
- package/dist/{chunk-QVTADARB.mjs → chunk-FPSCAGYS.mjs} +12 -35
- package/dist/chunk-FPSCAGYS.mjs.map +1 -0
- package/dist/{chunk-USVZH4QC.mjs → chunk-H3WRT6Y4.mjs} +20 -117
- package/dist/chunk-H3WRT6Y4.mjs.map +1 -0
- package/dist/{chunk-GXJUY2SC.mjs → chunk-MNH22BM2.mjs} +12 -35
- package/dist/chunk-MNH22BM2.mjs.map +1 -0
- package/dist/chunk-N42LPFPJ.mjs +177 -0
- package/dist/chunk-N42LPFPJ.mjs.map +1 -0
- package/dist/{chunk-D57UJ4L5.mjs → chunk-NKSRF45N.mjs} +12 -29
- package/dist/chunk-NKSRF45N.mjs.map +1 -0
- package/dist/{chunk-2CALEUER.mjs → chunk-SKZLZFE2.mjs} +5 -58
- package/dist/chunk-SKZLZFE2.mjs.map +1 -0
- package/dist/{chunk-NVRAQPSF.mjs → chunk-UF5NWMSQ.mjs} +20 -4
- package/dist/chunk-UF5NWMSQ.mjs.map +1 -0
- package/dist/chunk-WC4X3MAO.mjs +58 -0
- package/dist/chunk-WC4X3MAO.mjs.map +1 -0
- package/dist/{chunk-5FH67KLG.mjs → chunk-XHDOSV2F.mjs} +2 -2
- package/dist/{index-9ercn1sa.d.mts → index-D1nb2JV9.d.mts} +1 -1
- package/dist/index-qyOqd8tx.d.mts +517 -0
- package/dist/index.d.mts +27 -364
- package/dist/index.js +2316 -2473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +978 -51
- package/dist/index.mjs.map +1 -1
- package/dist/passkey.mjs +2 -1
- package/dist/payload.d.mts +22 -28
- package/dist/payload.js +50 -9
- package/dist/payload.js.map +1 -1
- package/dist/payload.mjs +7 -3
- package/dist/platform/index.d.mts +3 -0
- package/dist/platform/index.js +216 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/index.mjs +21 -0
- package/dist/platform/index.mjs.map +1 -0
- package/dist/{portfolio-W2FQ2G3O.mjs → portfolio-MLP2JIFK.mjs} +2 -3
- package/dist/queries/index.mjs +324 -10
- package/dist/queries/index.mjs.map +1 -1
- package/dist/{types-DQ5dtU9x.d.mts → types-CdlEbixV.d.mts} +11 -1
- package/package.json +7 -1
- package/dist/chunk-2CALEUER.mjs.map +0 -1
- package/dist/chunk-72ZA3OYQ.mjs +0 -20
- package/dist/chunk-72ZA3OYQ.mjs.map +0 -1
- package/dist/chunk-7KN6Y4GX.mjs.map +0 -1
- package/dist/chunk-D57UJ4L5.mjs.map +0 -1
- package/dist/chunk-GXJUY2SC.mjs.map +0 -1
- package/dist/chunk-NVRAQPSF.mjs.map +0 -1
- package/dist/chunk-QVTADARB.mjs.map +0 -1
- package/dist/chunk-USVZH4QC.mjs.map +0 -1
- package/dist/chunk-XDIIFIW6.mjs +0 -330
- package/dist/chunk-XDIIFIW6.mjs.map +0 -1
- package/dist/chunk-ZNIVNPGF.mjs.map +0 -1
- package/dist/chunk-ZXMTPBSP.mjs +0 -857
- package/dist/chunk-ZXMTPBSP.mjs.map +0 -1
- /package/dist/{chunk-5FH67KLG.mjs.map → chunk-XHDOSV2F.mjs.map} +0 -0
- /package/dist/{portfolio-W2FQ2G3O.mjs.map → portfolio-MLP2JIFK.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getDefaultHub,
|
|
8
|
-
getEffectivePrimaryHub,
|
|
9
|
-
getFeatureFlags,
|
|
10
|
-
getHubChains,
|
|
11
|
-
getRpcUrlOverride,
|
|
12
|
-
getSupportedChains,
|
|
13
|
-
isChainSupported,
|
|
14
|
-
isHubChain,
|
|
15
|
-
isMultiHubEnabled,
|
|
16
|
-
resetFeatureFlags,
|
|
17
|
-
setFeatureFlags
|
|
18
|
-
} from "./chunk-ZXMTPBSP.mjs";
|
|
2
|
+
AvalancheClient
|
|
3
|
+
} from "./chunk-XHDOSV2F.mjs";
|
|
4
|
+
import {
|
|
5
|
+
PlatformClient
|
|
6
|
+
} from "./chunk-N42LPFPJ.mjs";
|
|
19
7
|
import {
|
|
20
8
|
EVMHubClientAdapter
|
|
21
9
|
} from "./chunk-V636MIV3.mjs";
|
|
10
|
+
import {
|
|
11
|
+
EVMClient
|
|
12
|
+
} from "./chunk-H3WRT6Y4.mjs";
|
|
22
13
|
import {
|
|
23
14
|
SolanaClient
|
|
24
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FPSCAGYS.mjs";
|
|
25
16
|
import {
|
|
26
17
|
AptosClient
|
|
27
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MNH22BM2.mjs";
|
|
28
19
|
import {
|
|
29
20
|
SuiClient
|
|
30
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NKSRF45N.mjs";
|
|
31
22
|
import {
|
|
32
|
-
StarknetClient
|
|
33
|
-
|
|
23
|
+
StarknetClient,
|
|
24
|
+
buildStarknetSessionTransferChallenge,
|
|
25
|
+
signStarknetSessionTransfer
|
|
26
|
+
} from "./chunk-3PCAVZUZ.mjs";
|
|
34
27
|
import {
|
|
35
28
|
STACKS_ACTION_TYPES,
|
|
36
29
|
StacksClient,
|
|
@@ -58,13 +51,7 @@ import {
|
|
|
58
51
|
parseContractPrincipal,
|
|
59
52
|
rsToCompactSignature,
|
|
60
53
|
validatePostConditions
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import {
|
|
63
|
-
AvalancheClient
|
|
64
|
-
} from "./chunk-5FH67KLG.mjs";
|
|
65
|
-
import {
|
|
66
|
-
EVMClient
|
|
67
|
-
} from "./chunk-USVZH4QC.mjs";
|
|
54
|
+
} from "./chunk-AK5HWYX4.mjs";
|
|
68
55
|
import {
|
|
69
56
|
CONSISTENCY_LEVELS,
|
|
70
57
|
GUARDIAN_CONFIG,
|
|
@@ -89,9 +76,11 @@ import {
|
|
|
89
76
|
waitForGuardianSignatures
|
|
90
77
|
} from "./chunk-6QYJKK4L.mjs";
|
|
91
78
|
import {
|
|
79
|
+
HUB_NONCE_DOMAIN,
|
|
80
|
+
TIER_T2_AUTHORITATIVE,
|
|
81
|
+
buildCanonicalChallenge,
|
|
92
82
|
buildChallenge,
|
|
93
83
|
buildGaslessChallenge,
|
|
94
|
-
createGaslessMessageHash,
|
|
95
84
|
createMessageHash,
|
|
96
85
|
decodeActionPayload,
|
|
97
86
|
decodeBridgeAction,
|
|
@@ -111,7 +100,7 @@ import {
|
|
|
111
100
|
parseAmount,
|
|
112
101
|
solanaAddressToBytes32,
|
|
113
102
|
trimTo20Bytes
|
|
114
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-6BINP4RT.mjs";
|
|
115
104
|
import {
|
|
116
105
|
ARBITRUM_SEPOLIA_TOKENS,
|
|
117
106
|
BASE_SEPOLIA_TOKENS,
|
|
@@ -133,11 +122,13 @@ import {
|
|
|
133
122
|
import {
|
|
134
123
|
PasskeyManager,
|
|
135
124
|
VERIDEX_RP_ID,
|
|
136
|
-
buildRelayerApiUrl,
|
|
137
125
|
detectRpId,
|
|
138
|
-
normalizeRelayerOrigin,
|
|
139
126
|
supportsRelatedOrigins
|
|
140
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-SKZLZFE2.mjs";
|
|
128
|
+
import {
|
|
129
|
+
buildRelayerApiUrl,
|
|
130
|
+
normalizeRelayerOrigin
|
|
131
|
+
} from "./chunk-WC4X3MAO.mjs";
|
|
141
132
|
import {
|
|
142
133
|
base64URLDecode,
|
|
143
134
|
base64URLEncode,
|
|
@@ -1024,6 +1015,20 @@ var RelayerClient = class _RelayerClient {
|
|
|
1024
1015
|
// ========================================================================
|
|
1025
1016
|
// Relay Operations
|
|
1026
1017
|
// ========================================================================
|
|
1018
|
+
async getDispatchDestination(targetChain) {
|
|
1019
|
+
return await this.fetch(`/api/v1/dispatch-destinations/${targetChain}`);
|
|
1020
|
+
}
|
|
1021
|
+
async getUserNonce(userKeyHash) {
|
|
1022
|
+
const response = await this.fetch(`/api/v1/nonce/${userKeyHash}`);
|
|
1023
|
+
if (typeof response.nonce !== "string" || !/^\d+$/.test(response.nonce)) {
|
|
1024
|
+
throw new Error("Relayer returned an invalid Hub nonce");
|
|
1025
|
+
}
|
|
1026
|
+
const nonce = BigInt(response.nonce);
|
|
1027
|
+
if (nonce > 0xffffffffffffffffn) {
|
|
1028
|
+
throw new Error("Relayer Hub nonce exceeds uint64");
|
|
1029
|
+
}
|
|
1030
|
+
return nonce;
|
|
1031
|
+
}
|
|
1027
1032
|
/**
|
|
1028
1033
|
* Submit a VAA for relay to destination chain
|
|
1029
1034
|
*/
|
|
@@ -2765,6 +2770,844 @@ function createSpendingLimitsManager(config) {
|
|
|
2765
2770
|
return new SpendingLimitsManager(config);
|
|
2766
2771
|
}
|
|
2767
2772
|
|
|
2773
|
+
// src/featureFlags.ts
|
|
2774
|
+
var DEFAULT_FLAGS = {
|
|
2775
|
+
multiHub: false,
|
|
2776
|
+
primaryHub: "base"
|
|
2777
|
+
};
|
|
2778
|
+
var _flags = { ...DEFAULT_FLAGS };
|
|
2779
|
+
function getFeatureFlags() {
|
|
2780
|
+
return { ..._flags };
|
|
2781
|
+
}
|
|
2782
|
+
function setFeatureFlags(flags) {
|
|
2783
|
+
_flags = { ..._flags, ...flags };
|
|
2784
|
+
}
|
|
2785
|
+
function resetFeatureFlags() {
|
|
2786
|
+
_flags = { ...DEFAULT_FLAGS };
|
|
2787
|
+
}
|
|
2788
|
+
function isMultiHubEnabled() {
|
|
2789
|
+
return _flags.multiHub;
|
|
2790
|
+
}
|
|
2791
|
+
function getEffectivePrimaryHub() {
|
|
2792
|
+
if (!_flags.multiHub) {
|
|
2793
|
+
return "base";
|
|
2794
|
+
}
|
|
2795
|
+
return _flags.primaryHub;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
// src/presets.ts
|
|
2799
|
+
var CHAIN_NAMES = {
|
|
2800
|
+
// EVM L2s (Hub-capable)
|
|
2801
|
+
BASE: "base",
|
|
2802
|
+
OPTIMISM: "optimism",
|
|
2803
|
+
ARBITRUM: "arbitrum",
|
|
2804
|
+
SCROLL: "scroll",
|
|
2805
|
+
BLAST: "blast",
|
|
2806
|
+
MANTLE: "mantle",
|
|
2807
|
+
// EVM L1s
|
|
2808
|
+
ETHEREUM: "ethereum",
|
|
2809
|
+
POLYGON: "polygon",
|
|
2810
|
+
BSC: "bsc",
|
|
2811
|
+
AVALANCHE: "avalanche",
|
|
2812
|
+
FANTOM: "fantom",
|
|
2813
|
+
CELO: "celo",
|
|
2814
|
+
MOONBEAM: "moonbeam",
|
|
2815
|
+
// EVM L1s (High Performance)
|
|
2816
|
+
MONAD: "monad",
|
|
2817
|
+
// Non-EVM
|
|
2818
|
+
SOLANA: "solana",
|
|
2819
|
+
APTOS: "aptos",
|
|
2820
|
+
SUI: "sui",
|
|
2821
|
+
STARKNET: "starknet",
|
|
2822
|
+
STACKS: "stacks",
|
|
2823
|
+
NEAR: "near",
|
|
2824
|
+
SEI: "sei"
|
|
2825
|
+
};
|
|
2826
|
+
var CHAIN_PRESETS = {
|
|
2827
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2828
|
+
// BASE - Primary Hub Chain
|
|
2829
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2830
|
+
base: {
|
|
2831
|
+
displayName: "Base",
|
|
2832
|
+
type: "evm",
|
|
2833
|
+
canBeHub: true,
|
|
2834
|
+
testnet: {
|
|
2835
|
+
name: "Base Sepolia",
|
|
2836
|
+
chainId: 84532,
|
|
2837
|
+
wormholeChainId: 10004,
|
|
2838
|
+
rpcUrl: "https://sepolia.base.org",
|
|
2839
|
+
explorerUrl: "https://sepolia.basescan.org",
|
|
2840
|
+
isEvm: true,
|
|
2841
|
+
contracts: {
|
|
2842
|
+
hub: "0xD5D29b6EaeE6FF4b765e704298a7e48D22607059",
|
|
2843
|
+
vaultFactory: "0xb25b73D5FeD5693dcd1Bb78f8e33387B59A022EC",
|
|
2844
|
+
vaultImplementation: "0x2CB8397df988c1880d9e5cFfF65bfC22D7D90EE6",
|
|
2845
|
+
wormholeCoreBridge: "0x79A1027a6A159502049F10906D333EC57E95F083",
|
|
2846
|
+
tokenBridge: "0x86F55A04690fd7815A3D802bD587e83eA888B239"
|
|
2847
|
+
}
|
|
2848
|
+
},
|
|
2849
|
+
mainnet: {
|
|
2850
|
+
name: "Base",
|
|
2851
|
+
chainId: 8453,
|
|
2852
|
+
wormholeChainId: 30,
|
|
2853
|
+
rpcUrl: "https://mainnet.base.org",
|
|
2854
|
+
explorerUrl: "https://basescan.org",
|
|
2855
|
+
isEvm: true,
|
|
2856
|
+
contracts: {
|
|
2857
|
+
// TODO: Deploy mainnet contracts
|
|
2858
|
+
wormholeCoreBridge: "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
|
|
2859
|
+
tokenBridge: "0x8d2de8d2f73F1F4cAB472AC9A881C9b123C79627"
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
},
|
|
2863
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2864
|
+
// OPTIMISM - Secondary Hub / Spoke
|
|
2865
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2866
|
+
optimism: {
|
|
2867
|
+
displayName: "Optimism",
|
|
2868
|
+
type: "evm",
|
|
2869
|
+
canBeHub: true,
|
|
2870
|
+
testnet: {
|
|
2871
|
+
name: "Optimism Sepolia",
|
|
2872
|
+
chainId: 11155420,
|
|
2873
|
+
wormholeChainId: 10005,
|
|
2874
|
+
rpcUrl: "https://sepolia.optimism.io",
|
|
2875
|
+
explorerUrl: "https://sepolia-optimism.etherscan.io",
|
|
2876
|
+
isEvm: true,
|
|
2877
|
+
contracts: {
|
|
2878
|
+
vaultFactory: "0x3c5e4aCdC8Cd53ae5ae603B4c511885191fBb868",
|
|
2879
|
+
vaultImplementation: "0xA45dBF322c5A3028687fEEB161603d3BCe02e119",
|
|
2880
|
+
wormholeCoreBridge: "0x31377888146f3253211EFEf5c676D41ECe7D58Fe",
|
|
2881
|
+
tokenBridge: "0x99737Ec4B815d816c49A385943baf0380e75c0Ac"
|
|
2882
|
+
}
|
|
2883
|
+
},
|
|
2884
|
+
mainnet: {
|
|
2885
|
+
name: "Optimism",
|
|
2886
|
+
chainId: 10,
|
|
2887
|
+
wormholeChainId: 24,
|
|
2888
|
+
rpcUrl: "https://mainnet.optimism.io",
|
|
2889
|
+
explorerUrl: "https://optimistic.etherscan.io",
|
|
2890
|
+
isEvm: true,
|
|
2891
|
+
contracts: {
|
|
2892
|
+
wormholeCoreBridge: "0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722",
|
|
2893
|
+
tokenBridge: "0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b"
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
},
|
|
2897
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2898
|
+
// ARBITRUM
|
|
2899
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2900
|
+
arbitrum: {
|
|
2901
|
+
displayName: "Arbitrum",
|
|
2902
|
+
type: "evm",
|
|
2903
|
+
canBeHub: true,
|
|
2904
|
+
testnet: {
|
|
2905
|
+
name: "Arbitrum Sepolia",
|
|
2906
|
+
chainId: 421614,
|
|
2907
|
+
wormholeChainId: 10003,
|
|
2908
|
+
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
|
|
2909
|
+
explorerUrl: "https://sepolia.arbiscan.io",
|
|
2910
|
+
isEvm: true,
|
|
2911
|
+
contracts: {
|
|
2912
|
+
vaultFactory: "0xB9C3e6bad3c6f26956be4a4bb5a366376Fd3045D",
|
|
2913
|
+
vaultImplementation: "0x8601881b94B68B09b485f407317686103d3CB681",
|
|
2914
|
+
wormholeCoreBridge: "0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35",
|
|
2915
|
+
tokenBridge: "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"
|
|
2916
|
+
}
|
|
2917
|
+
},
|
|
2918
|
+
mainnet: {
|
|
2919
|
+
name: "Arbitrum",
|
|
2920
|
+
chainId: 42161,
|
|
2921
|
+
wormholeChainId: 23,
|
|
2922
|
+
rpcUrl: "https://arb1.arbitrum.io/rpc",
|
|
2923
|
+
explorerUrl: "https://arbiscan.io",
|
|
2924
|
+
isEvm: true,
|
|
2925
|
+
contracts: {
|
|
2926
|
+
wormholeCoreBridge: "0xa5f208e072434bC67592E4C49C1B991BA79BCA46",
|
|
2927
|
+
tokenBridge: "0x0b2402144Bb366A632D14B83F244D2e0e21bD39c"
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
},
|
|
2931
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2932
|
+
// ETHEREUM
|
|
2933
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2934
|
+
ethereum: {
|
|
2935
|
+
displayName: "Ethereum",
|
|
2936
|
+
type: "evm",
|
|
2937
|
+
canBeHub: false,
|
|
2938
|
+
testnet: {
|
|
2939
|
+
name: "Sepolia",
|
|
2940
|
+
chainId: 11155111,
|
|
2941
|
+
wormholeChainId: 10002,
|
|
2942
|
+
rpcUrl: "https://ethereum-sepolia-rpc.publicnode.com",
|
|
2943
|
+
explorerUrl: "https://sepolia.etherscan.io",
|
|
2944
|
+
isEvm: true,
|
|
2945
|
+
contracts: {
|
|
2946
|
+
vaultFactory: "0x265c10763B4d16AD970bC3d7670c645e37f63AF4",
|
|
2947
|
+
vaultImplementation: "0x942426C94652ebC48f4f404928016B95ADb1DA25",
|
|
2948
|
+
wormholeCoreBridge: "0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78",
|
|
2949
|
+
tokenBridge: "0xDB5492265f6038831E89f495670FF909aDe94bd9"
|
|
2950
|
+
}
|
|
2951
|
+
},
|
|
2952
|
+
mainnet: {
|
|
2953
|
+
name: "Ethereum",
|
|
2954
|
+
chainId: 1,
|
|
2955
|
+
wormholeChainId: 2,
|
|
2956
|
+
rpcUrl: "https://eth.llamarpc.com",
|
|
2957
|
+
explorerUrl: "https://etherscan.io",
|
|
2958
|
+
isEvm: true,
|
|
2959
|
+
contracts: {
|
|
2960
|
+
wormholeCoreBridge: "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B",
|
|
2961
|
+
tokenBridge: "0x3ee18B2214AFF97000D974cf647E7C347E8fa585"
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2966
|
+
// POLYGON
|
|
2967
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2968
|
+
polygon: {
|
|
2969
|
+
displayName: "Polygon",
|
|
2970
|
+
type: "evm",
|
|
2971
|
+
canBeHub: false,
|
|
2972
|
+
testnet: {
|
|
2973
|
+
name: "Polygon Amoy",
|
|
2974
|
+
chainId: 80002,
|
|
2975
|
+
wormholeChainId: 10007,
|
|
2976
|
+
rpcUrl: "https://rpc-amoy.polygon.technology",
|
|
2977
|
+
explorerUrl: "https://amoy.polygonscan.com",
|
|
2978
|
+
isEvm: true,
|
|
2979
|
+
contracts: {
|
|
2980
|
+
wormholeCoreBridge: "0x0CBE91CF822c73C2315FB05100C2F714765d5c20",
|
|
2981
|
+
tokenBridge: "0x0290FB167208Af455bB137780163b7B7a9a10C16"
|
|
2982
|
+
}
|
|
2983
|
+
},
|
|
2984
|
+
mainnet: {
|
|
2985
|
+
name: "Polygon",
|
|
2986
|
+
chainId: 137,
|
|
2987
|
+
wormholeChainId: 5,
|
|
2988
|
+
rpcUrl: "https://polygon-rpc.com",
|
|
2989
|
+
explorerUrl: "https://polygonscan.com",
|
|
2990
|
+
isEvm: true,
|
|
2991
|
+
contracts: {
|
|
2992
|
+
wormholeCoreBridge: "0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7",
|
|
2993
|
+
tokenBridge: "0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
},
|
|
2997
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
2998
|
+
// BSC
|
|
2999
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3000
|
+
bsc: {
|
|
3001
|
+
displayName: "BNB Chain",
|
|
3002
|
+
type: "evm",
|
|
3003
|
+
canBeHub: false,
|
|
3004
|
+
testnet: {
|
|
3005
|
+
name: "BSC Testnet",
|
|
3006
|
+
chainId: 97,
|
|
3007
|
+
wormholeChainId: 4,
|
|
3008
|
+
rpcUrl: "https://data-seed-prebsc-1-s1.binance.org:8545",
|
|
3009
|
+
explorerUrl: "https://testnet.bscscan.com",
|
|
3010
|
+
isEvm: true,
|
|
3011
|
+
contracts: {
|
|
3012
|
+
wormholeCoreBridge: "0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D",
|
|
3013
|
+
tokenBridge: "0x9dcF9D205C9De35334D646BeE44b2D2859712A09"
|
|
3014
|
+
}
|
|
3015
|
+
},
|
|
3016
|
+
mainnet: {
|
|
3017
|
+
name: "BNB Chain",
|
|
3018
|
+
chainId: 56,
|
|
3019
|
+
wormholeChainId: 4,
|
|
3020
|
+
rpcUrl: "https://bsc-dataseed.binance.org",
|
|
3021
|
+
explorerUrl: "https://bscscan.com",
|
|
3022
|
+
isEvm: true,
|
|
3023
|
+
contracts: {
|
|
3024
|
+
wormholeCoreBridge: "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B",
|
|
3025
|
+
tokenBridge: "0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7"
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
},
|
|
3029
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3030
|
+
// AVALANCHE — ACP-204 Native P-256 + ICM Teleporter + Hub-Capable
|
|
3031
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3032
|
+
avalanche: {
|
|
3033
|
+
displayName: "Avalanche",
|
|
3034
|
+
type: "evm",
|
|
3035
|
+
canBeHub: true,
|
|
3036
|
+
// ACP-204 provides native P-256 at 0x0100 (6,900 gas)
|
|
3037
|
+
testnet: {
|
|
3038
|
+
name: "Avalanche Fuji",
|
|
3039
|
+
chainId: 43113,
|
|
3040
|
+
wormholeChainId: 6,
|
|
3041
|
+
rpcUrl: "https://api.avax-test.network/ext/bc/C/rpc",
|
|
3042
|
+
explorerUrl: "https://testnet.snowtrace.io",
|
|
3043
|
+
isEvm: true,
|
|
3044
|
+
contracts: {
|
|
3045
|
+
// Veridex Hub (deployed via deploy-avalanche.ts)
|
|
3046
|
+
hub: "",
|
|
3047
|
+
// No Hub on Fuji — Hub is on Base Sepolia
|
|
3048
|
+
vaultFactory: "0x9e9716442e908A9b61F11432cC38024DD390cd2a",
|
|
3049
|
+
vaultImplementation: "0xE0b9919ffDf3415355Db369C8FfA5Dd4e000052c",
|
|
3050
|
+
// Wormhole bridges (canonical Fuji addresses)
|
|
3051
|
+
wormholeCoreBridge: "0x7bbcE28e64B3F8b84d876Ab298393c38ad7aac4C",
|
|
3052
|
+
tokenBridge: "0x61E44E506Ca5659E6c0bba9b678586fA2d729756",
|
|
3053
|
+
// Avalanche-specific: ACP-204 P-256 verifier wrapper
|
|
3054
|
+
p256Verifier: "0xB5d29EA1E2e90A24D6506E2a6a269506a12974CC",
|
|
3055
|
+
// Avalanche-specific: ICM Spoke for cross-L1 session bridging
|
|
3056
|
+
icmSpoke: "0x9fCFC608086539A69839EfA9628884dB75ac07D0",
|
|
3057
|
+
// Chainlink price feeds (Fuji testnet)
|
|
3058
|
+
chainlinkAvaxUsd: "0x5498BB86BC934c8D34FDA08E81D444153d0D06aD",
|
|
3059
|
+
chainlinkUsdcUsd: "0x7898AcCC83587C3C55116c5230C17a6Cd9C71bad",
|
|
3060
|
+
chainlinkUsdtUsd: "0x7898AcCC83587C3C55116c5230C17a6Cd9C71bad"
|
|
3061
|
+
},
|
|
3062
|
+
hubChainId: 10004
|
|
3063
|
+
// Base Sepolia (primary Hub)
|
|
3064
|
+
},
|
|
3065
|
+
mainnet: {
|
|
3066
|
+
name: "Avalanche",
|
|
3067
|
+
chainId: 43114,
|
|
3068
|
+
wormholeChainId: 6,
|
|
3069
|
+
rpcUrl: "https://api.avax.network/ext/bc/C/rpc",
|
|
3070
|
+
explorerUrl: "https://snowtrace.io",
|
|
3071
|
+
isEvm: true,
|
|
3072
|
+
contracts: {
|
|
3073
|
+
wormholeCoreBridge: "0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c",
|
|
3074
|
+
tokenBridge: "0x0e082F06FF657D94310cB8cE8B0D9a04541d8052",
|
|
3075
|
+
// Chainlink price feeds (Avalanche mainnet)
|
|
3076
|
+
chainlinkAvaxUsd: "0x0A77230d17318075983913bC2145DB16C7366156",
|
|
3077
|
+
chainlinkUsdcUsd: "0xF096872672F44d6EBA71458D74fe67F9a77a23B9",
|
|
3078
|
+
chainlinkUsdtUsd: "0xEBE676ee90Fe1112671f19b6B7459bC678B67e8a"
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
},
|
|
3082
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3083
|
+
// SCROLL
|
|
3084
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3085
|
+
scroll: {
|
|
3086
|
+
displayName: "Scroll",
|
|
3087
|
+
type: "evm",
|
|
3088
|
+
canBeHub: false,
|
|
3089
|
+
testnet: {
|
|
3090
|
+
name: "Scroll Sepolia",
|
|
3091
|
+
chainId: 534351,
|
|
3092
|
+
wormholeChainId: 34,
|
|
3093
|
+
rpcUrl: "https://sepolia-rpc.scroll.io",
|
|
3094
|
+
explorerUrl: "https://sepolia.scrollscan.com",
|
|
3095
|
+
isEvm: true,
|
|
3096
|
+
contracts: {
|
|
3097
|
+
wormholeCoreBridge: "0x055F47F1250012C6B20c436570a76e52c17Af2D5",
|
|
3098
|
+
tokenBridge: "0x22427d90B7dA3fA4642F7025A854c7254E4e45BF"
|
|
3099
|
+
}
|
|
3100
|
+
},
|
|
3101
|
+
mainnet: {
|
|
3102
|
+
name: "Scroll",
|
|
3103
|
+
chainId: 534352,
|
|
3104
|
+
wormholeChainId: 34,
|
|
3105
|
+
rpcUrl: "https://rpc.scroll.io",
|
|
3106
|
+
explorerUrl: "https://scrollscan.com",
|
|
3107
|
+
isEvm: true,
|
|
3108
|
+
contracts: {
|
|
3109
|
+
wormholeCoreBridge: "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
|
|
3110
|
+
tokenBridge: "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
},
|
|
3114
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3115
|
+
// BLAST
|
|
3116
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3117
|
+
blast: {
|
|
3118
|
+
displayName: "Blast",
|
|
3119
|
+
type: "evm",
|
|
3120
|
+
canBeHub: false,
|
|
3121
|
+
testnet: {
|
|
3122
|
+
name: "Blast Sepolia",
|
|
3123
|
+
chainId: 168587773,
|
|
3124
|
+
wormholeChainId: 36,
|
|
3125
|
+
rpcUrl: "https://sepolia.blast.io",
|
|
3126
|
+
explorerUrl: "https://sepolia.blastscan.io",
|
|
3127
|
+
isEvm: true,
|
|
3128
|
+
contracts: {
|
|
3129
|
+
wormholeCoreBridge: "0x473e002D7add6fB67a4964F13bFd61280Ca46886",
|
|
3130
|
+
tokenBridge: "0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"
|
|
3131
|
+
}
|
|
3132
|
+
},
|
|
3133
|
+
mainnet: {
|
|
3134
|
+
name: "Blast",
|
|
3135
|
+
chainId: 81457,
|
|
3136
|
+
wormholeChainId: 36,
|
|
3137
|
+
rpcUrl: "https://rpc.blast.io",
|
|
3138
|
+
explorerUrl: "https://blastscan.io",
|
|
3139
|
+
isEvm: true,
|
|
3140
|
+
contracts: {
|
|
3141
|
+
wormholeCoreBridge: "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
|
|
3142
|
+
tokenBridge: "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
},
|
|
3146
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3147
|
+
// MANTLE
|
|
3148
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3149
|
+
mantle: {
|
|
3150
|
+
displayName: "Mantle",
|
|
3151
|
+
type: "evm",
|
|
3152
|
+
canBeHub: false,
|
|
3153
|
+
testnet: {
|
|
3154
|
+
name: "Mantle Sepolia",
|
|
3155
|
+
chainId: 5003,
|
|
3156
|
+
wormholeChainId: 35,
|
|
3157
|
+
rpcUrl: "https://rpc.sepolia.mantle.xyz",
|
|
3158
|
+
explorerUrl: "https://sepolia.mantlescan.xyz",
|
|
3159
|
+
isEvm: true,
|
|
3160
|
+
contracts: {
|
|
3161
|
+
wormholeCoreBridge: "0x376428e7f26D5867e69201b275553C45B09EE090",
|
|
3162
|
+
tokenBridge: "0x75Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D"
|
|
3163
|
+
}
|
|
3164
|
+
},
|
|
3165
|
+
mainnet: {
|
|
3166
|
+
name: "Mantle",
|
|
3167
|
+
chainId: 5e3,
|
|
3168
|
+
wormholeChainId: 35,
|
|
3169
|
+
rpcUrl: "https://rpc.mantle.xyz",
|
|
3170
|
+
explorerUrl: "https://mantlescan.xyz",
|
|
3171
|
+
isEvm: true,
|
|
3172
|
+
contracts: {
|
|
3173
|
+
wormholeCoreBridge: "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
|
|
3174
|
+
tokenBridge: "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
},
|
|
3178
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3179
|
+
// FANTOM
|
|
3180
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3181
|
+
fantom: {
|
|
3182
|
+
displayName: "Fantom",
|
|
3183
|
+
type: "evm",
|
|
3184
|
+
canBeHub: false,
|
|
3185
|
+
testnet: {
|
|
3186
|
+
name: "Fantom Testnet",
|
|
3187
|
+
chainId: 4002,
|
|
3188
|
+
wormholeChainId: 10,
|
|
3189
|
+
rpcUrl: "https://rpc.testnet.fantom.network",
|
|
3190
|
+
explorerUrl: "https://testnet.ftmscan.com",
|
|
3191
|
+
isEvm: true,
|
|
3192
|
+
contracts: {
|
|
3193
|
+
wormholeCoreBridge: "0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7",
|
|
3194
|
+
tokenBridge: "0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8"
|
|
3195
|
+
}
|
|
3196
|
+
},
|
|
3197
|
+
mainnet: {
|
|
3198
|
+
name: "Fantom",
|
|
3199
|
+
chainId: 250,
|
|
3200
|
+
wormholeChainId: 10,
|
|
3201
|
+
rpcUrl: "https://rpcapi.fantom.network",
|
|
3202
|
+
explorerUrl: "https://ftmscan.com",
|
|
3203
|
+
isEvm: true,
|
|
3204
|
+
contracts: {
|
|
3205
|
+
wormholeCoreBridge: "0x126783A6Cb203a3E35344528B26ca3a0489a1485",
|
|
3206
|
+
tokenBridge: "0x7C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2"
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
},
|
|
3210
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3211
|
+
// CELO
|
|
3212
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3213
|
+
celo: {
|
|
3214
|
+
displayName: "Celo",
|
|
3215
|
+
type: "evm",
|
|
3216
|
+
canBeHub: false,
|
|
3217
|
+
testnet: {
|
|
3218
|
+
name: "Celo Alfajores",
|
|
3219
|
+
chainId: 44787,
|
|
3220
|
+
wormholeChainId: 14,
|
|
3221
|
+
rpcUrl: "https://alfajores-forno.celo-testnet.org",
|
|
3222
|
+
explorerUrl: "https://alfajores.celoscan.io",
|
|
3223
|
+
isEvm: true,
|
|
3224
|
+
contracts: {
|
|
3225
|
+
wormholeCoreBridge: "0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56",
|
|
3226
|
+
tokenBridge: "0x05ca6037eC51F8b712eD2E6Fa72219FEaE74E153"
|
|
3227
|
+
}
|
|
3228
|
+
},
|
|
3229
|
+
mainnet: {
|
|
3230
|
+
name: "Celo",
|
|
3231
|
+
chainId: 42220,
|
|
3232
|
+
wormholeChainId: 14,
|
|
3233
|
+
rpcUrl: "https://forno.celo.org",
|
|
3234
|
+
explorerUrl: "https://celoscan.io",
|
|
3235
|
+
isEvm: true,
|
|
3236
|
+
contracts: {
|
|
3237
|
+
wormholeCoreBridge: "0xa321448d90d4e5b0A732867c18eA198e75CAC48E",
|
|
3238
|
+
tokenBridge: "0x796Dff6D74F3E27060B71255Fe517BFb23C93eed"
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
},
|
|
3242
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3243
|
+
// MOONBEAM
|
|
3244
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3245
|
+
moonbeam: {
|
|
3246
|
+
displayName: "Moonbeam",
|
|
3247
|
+
type: "evm",
|
|
3248
|
+
canBeHub: false,
|
|
3249
|
+
testnet: {
|
|
3250
|
+
name: "Moonbase Alpha",
|
|
3251
|
+
chainId: 1287,
|
|
3252
|
+
wormholeChainId: 16,
|
|
3253
|
+
rpcUrl: "https://rpc.api.moonbase.moonbeam.network",
|
|
3254
|
+
explorerUrl: "https://moonbase.moonscan.io",
|
|
3255
|
+
isEvm: true,
|
|
3256
|
+
contracts: {
|
|
3257
|
+
wormholeCoreBridge: "0xa5B7D85a8f27dd7907dc8FdC21FA5657D5E2F901",
|
|
3258
|
+
tokenBridge: "0xbc976D4b9D57E57c3cA52e1Fd136C45FF7955A96"
|
|
3259
|
+
}
|
|
3260
|
+
},
|
|
3261
|
+
mainnet: {
|
|
3262
|
+
name: "Moonbeam",
|
|
3263
|
+
chainId: 1284,
|
|
3264
|
+
wormholeChainId: 16,
|
|
3265
|
+
rpcUrl: "https://rpc.api.moonbeam.network",
|
|
3266
|
+
explorerUrl: "https://moonscan.io",
|
|
3267
|
+
isEvm: true,
|
|
3268
|
+
contracts: {
|
|
3269
|
+
wormholeCoreBridge: "0xC8e2b0cD52Cf01b0Ce87d389Daa3d414d4cE29f3",
|
|
3270
|
+
tokenBridge: "0xb1731c586ca89a23809861c6103F0b96B3F57D92"
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
},
|
|
3274
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3275
|
+
// MONAD - High-Performance L1 with EIP-7951 P256 + Agent Gateway
|
|
3276
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3277
|
+
monad: {
|
|
3278
|
+
displayName: "Monad",
|
|
3279
|
+
type: "evm",
|
|
3280
|
+
canBeHub: true,
|
|
3281
|
+
// Has native P-256 precompile (EIP-7951)
|
|
3282
|
+
testnet: {
|
|
3283
|
+
name: "Monad Testnet",
|
|
3284
|
+
chainId: 10143,
|
|
3285
|
+
wormholeChainId: 10048,
|
|
3286
|
+
rpcUrl: "https://testnet-rpc.monad.xyz",
|
|
3287
|
+
explorerUrl: "https://testnet.monadvision.com",
|
|
3288
|
+
isEvm: true,
|
|
3289
|
+
contracts: {
|
|
3290
|
+
vaultFactory: "0x50F2c37584823A6cc293bd0d7647D558d05CA4C1",
|
|
3291
|
+
vaultImplementation: "0x53d4D3943d0E524836f0B1955AbB216449F538fF",
|
|
3292
|
+
wormholeCoreBridge: "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd",
|
|
3293
|
+
// Agent Gateway contracts
|
|
3294
|
+
serviceDirectory: "0x2d20f29E1f5B24294B3F125B47f2a22a7012a35E"
|
|
3295
|
+
},
|
|
3296
|
+
hubChainId: 10004
|
|
3297
|
+
// Base Sepolia
|
|
3298
|
+
},
|
|
3299
|
+
mainnet: {
|
|
3300
|
+
name: "Monad",
|
|
3301
|
+
chainId: 143,
|
|
3302
|
+
wormholeChainId: 0,
|
|
3303
|
+
// TBD
|
|
3304
|
+
rpcUrl: "https://rpc.monad.xyz",
|
|
3305
|
+
explorerUrl: "https://monadscan.com",
|
|
3306
|
+
isEvm: true,
|
|
3307
|
+
contracts: {
|
|
3308
|
+
wormholeCoreBridge: "0x194B123c5E96B9b2E49763619985790Dc241CAC0",
|
|
3309
|
+
tokenBridge: "0x0B2719cdA2F10595369e6673ceA3Ee2EDFa13BA7"
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
},
|
|
3313
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3314
|
+
// SEI
|
|
3315
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3316
|
+
sei: {
|
|
3317
|
+
displayName: "Sei",
|
|
3318
|
+
type: "evm",
|
|
3319
|
+
canBeHub: false,
|
|
3320
|
+
testnet: {
|
|
3321
|
+
name: "Sei Atlantic-2",
|
|
3322
|
+
chainId: 1328,
|
|
3323
|
+
wormholeChainId: 40,
|
|
3324
|
+
rpcUrl: "https://evm-rpc-testnet.sei-apis.com",
|
|
3325
|
+
explorerUrl: "https://seitrace.com/?chain=atlantic-2",
|
|
3326
|
+
isEvm: true,
|
|
3327
|
+
contracts: {
|
|
3328
|
+
vaultFactory: "0x07F608AFf6d63b68029488b726d895c4Bb593038",
|
|
3329
|
+
vaultImplementation: "0xD66153fccFB6731fB6c4944FbD607ba86A76a1f6",
|
|
3330
|
+
wormholeCoreBridge: "0x0000000000000000000000000000000000000000"
|
|
3331
|
+
}
|
|
3332
|
+
},
|
|
3333
|
+
mainnet: {
|
|
3334
|
+
name: "Sei",
|
|
3335
|
+
chainId: 1329,
|
|
3336
|
+
wormholeChainId: 32,
|
|
3337
|
+
rpcUrl: "https://evm-rpc.sei-apis.com",
|
|
3338
|
+
explorerUrl: "https://seitrace.com",
|
|
3339
|
+
isEvm: true,
|
|
3340
|
+
contracts: {
|
|
3341
|
+
wormholeCoreBridge: "0x0000000000000000000000000000000000000000"
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
},
|
|
3345
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3346
|
+
// SOLANA
|
|
3347
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3348
|
+
solana: {
|
|
3349
|
+
displayName: "Solana",
|
|
3350
|
+
type: "solana",
|
|
3351
|
+
canBeHub: false,
|
|
3352
|
+
testnet: {
|
|
3353
|
+
name: "Solana Devnet",
|
|
3354
|
+
chainId: 0,
|
|
3355
|
+
wormholeChainId: 1,
|
|
3356
|
+
rpcUrl: "https://api.devnet.solana.com",
|
|
3357
|
+
explorerUrl: "https://explorer.solana.com",
|
|
3358
|
+
isEvm: false,
|
|
3359
|
+
contracts: {
|
|
3360
|
+
hub: "64ZZBdmGd1YT6Fok7PELvAdfoXyR4PHxHnRqHNqZHJ13",
|
|
3361
|
+
wormholeCoreBridge: "3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5",
|
|
3362
|
+
tokenBridge: "DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"
|
|
3363
|
+
}
|
|
3364
|
+
},
|
|
3365
|
+
mainnet: {
|
|
3366
|
+
name: "Solana",
|
|
3367
|
+
chainId: 0,
|
|
3368
|
+
wormholeChainId: 1,
|
|
3369
|
+
rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
3370
|
+
explorerUrl: "https://explorer.solana.com",
|
|
3371
|
+
isEvm: false,
|
|
3372
|
+
contracts: {
|
|
3373
|
+
wormholeCoreBridge: "worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth",
|
|
3374
|
+
tokenBridge: "wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb"
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
},
|
|
3378
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3379
|
+
// APTOS
|
|
3380
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3381
|
+
aptos: {
|
|
3382
|
+
displayName: "Aptos",
|
|
3383
|
+
type: "aptos",
|
|
3384
|
+
canBeHub: false,
|
|
3385
|
+
testnet: {
|
|
3386
|
+
name: "Aptos Testnet",
|
|
3387
|
+
chainId: 0,
|
|
3388
|
+
wormholeChainId: 22,
|
|
3389
|
+
rpcUrl: "https://fullnode.testnet.aptoslabs.com/v1",
|
|
3390
|
+
explorerUrl: "https://explorer.aptoslabs.com",
|
|
3391
|
+
isEvm: false,
|
|
3392
|
+
contracts: {
|
|
3393
|
+
hub: "0x9e8641143245ab8b93af1417a1fbc698d40fd351a25f6c17e4210e59bf82c9c7",
|
|
3394
|
+
wormholeCoreBridge: "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625",
|
|
3395
|
+
tokenBridge: "0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"
|
|
3396
|
+
}
|
|
3397
|
+
},
|
|
3398
|
+
mainnet: {
|
|
3399
|
+
name: "Aptos",
|
|
3400
|
+
chainId: 0,
|
|
3401
|
+
wormholeChainId: 22,
|
|
3402
|
+
rpcUrl: "https://fullnode.mainnet.aptoslabs.com/v1",
|
|
3403
|
+
explorerUrl: "https://explorer.aptoslabs.com",
|
|
3404
|
+
isEvm: false,
|
|
3405
|
+
contracts: {
|
|
3406
|
+
wormholeCoreBridge: "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625",
|
|
3407
|
+
tokenBridge: "0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
},
|
|
3411
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3412
|
+
// SUI
|
|
3413
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3414
|
+
sui: {
|
|
3415
|
+
displayName: "Sui",
|
|
3416
|
+
type: "sui",
|
|
3417
|
+
canBeHub: false,
|
|
3418
|
+
testnet: {
|
|
3419
|
+
name: "Sui Testnet",
|
|
3420
|
+
chainId: 0,
|
|
3421
|
+
wormholeChainId: 21,
|
|
3422
|
+
rpcUrl: "https://fullnode.testnet.sui.io:443",
|
|
3423
|
+
explorerUrl: "https://suiscan.xyz/testnet",
|
|
3424
|
+
isEvm: false,
|
|
3425
|
+
contracts: {
|
|
3426
|
+
hub: "0xaf36d8bc349883b23e78b00a342a656c799319508600583eaee9121ffaa7f5f7",
|
|
3427
|
+
wormholeCoreBridge: "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"
|
|
3428
|
+
}
|
|
3429
|
+
},
|
|
3430
|
+
mainnet: {
|
|
3431
|
+
name: "Sui",
|
|
3432
|
+
chainId: 0,
|
|
3433
|
+
wormholeChainId: 21,
|
|
3434
|
+
rpcUrl: "https://fullnode.mainnet.sui.io:443",
|
|
3435
|
+
explorerUrl: "https://suiscan.xyz/mainnet",
|
|
3436
|
+
isEvm: false,
|
|
3437
|
+
contracts: {
|
|
3438
|
+
wormholeCoreBridge: "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
},
|
|
3442
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3443
|
+
// STARKNET
|
|
3444
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3445
|
+
starknet: {
|
|
3446
|
+
displayName: "Starknet",
|
|
3447
|
+
type: "starknet",
|
|
3448
|
+
canBeHub: false,
|
|
3449
|
+
testnet: {
|
|
3450
|
+
name: "Starknet Sepolia",
|
|
3451
|
+
chainId: 0,
|
|
3452
|
+
wormholeChainId: 50001,
|
|
3453
|
+
// Custom bridge (non-Wormhole)
|
|
3454
|
+
rpcUrl: "https://starknet-sepolia-rpc.publicnode.com",
|
|
3455
|
+
explorerUrl: "https://sepolia.starkscan.co",
|
|
3456
|
+
isEvm: false,
|
|
3457
|
+
contracts: {
|
|
3458
|
+
hub: "0x7bb7cbe7d82e910b296611b582035a207343431f98bdd7b692bddfdd6f28737",
|
|
3459
|
+
wormholeCoreBridge: "0x30d2e7f26dc75819cfddcd7caa26a76b681d5918f219c99060c42ce1e3f69e4"
|
|
3460
|
+
},
|
|
3461
|
+
hubChainId: 10004
|
|
3462
|
+
// Base Sepolia
|
|
3463
|
+
},
|
|
3464
|
+
mainnet: {
|
|
3465
|
+
name: "Starknet",
|
|
3466
|
+
chainId: 0,
|
|
3467
|
+
wormholeChainId: 50001,
|
|
3468
|
+
rpcUrl: "https://starknet-mainnet.public.blastapi.io/rpc/v0_7",
|
|
3469
|
+
explorerUrl: "https://starkscan.co",
|
|
3470
|
+
isEvm: false,
|
|
3471
|
+
contracts: {
|
|
3472
|
+
// TODO: Deploy mainnet contracts
|
|
3473
|
+
wormholeCoreBridge: ""
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3476
|
+
},
|
|
3477
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3478
|
+
// STACKS
|
|
3479
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3480
|
+
stacks: {
|
|
3481
|
+
displayName: "Stacks",
|
|
3482
|
+
type: "stacks",
|
|
3483
|
+
canBeHub: false,
|
|
3484
|
+
testnet: {
|
|
3485
|
+
name: "Stacks Testnet",
|
|
3486
|
+
chainId: 2147483648,
|
|
3487
|
+
// CAIP-2: stacks:2147483648
|
|
3488
|
+
wormholeChainId: 60,
|
|
3489
|
+
// Official Wormhole chain ID for Stacks
|
|
3490
|
+
rpcUrl: "https://api.testnet.hiro.so",
|
|
3491
|
+
explorerUrl: "https://explorer.hiro.so/?chain=testnet",
|
|
3492
|
+
isEvm: false,
|
|
3493
|
+
contracts: {
|
|
3494
|
+
// Spoke contract: identity + session management
|
|
3495
|
+
hub: "STWJ9E8J5NPKB4MT1378G6XWNFGAKRY1E6D6PYSM.veridex-spoke",
|
|
3496
|
+
// Vault contract: STX/sBTC custody
|
|
3497
|
+
vaultFactory: "STWJ9E8J5NPKB4MT1378G6XWNFGAKRY1E6D6PYSM.veridex-vault",
|
|
3498
|
+
wormholeCoreBridge: "",
|
|
3499
|
+
// Phase 2: Wormhole integration contracts
|
|
3500
|
+
wormholeVerifier: "STWJ9E8J5NPKB4MT1378G6XWNFGAKRY1E6D6PYSM.veridex-wormhole-verifier",
|
|
3501
|
+
vaultVaa: "STWJ9E8J5NPKB4MT1378G6XWNFGAKRY1E6D6PYSM.veridex-vault-vaa"
|
|
3502
|
+
},
|
|
3503
|
+
hubChainId: 10004
|
|
3504
|
+
// Base Sepolia
|
|
3505
|
+
},
|
|
3506
|
+
mainnet: {
|
|
3507
|
+
name: "Stacks",
|
|
3508
|
+
chainId: 1,
|
|
3509
|
+
// CAIP-2: stacks:1
|
|
3510
|
+
wormholeChainId: 60,
|
|
3511
|
+
rpcUrl: "https://api.hiro.so",
|
|
3512
|
+
explorerUrl: "https://explorer.hiro.so",
|
|
3513
|
+
isEvm: false,
|
|
3514
|
+
contracts: {
|
|
3515
|
+
// TODO: Deploy mainnet contracts
|
|
3516
|
+
wormholeCoreBridge: ""
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
},
|
|
3520
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3521
|
+
// NEAR
|
|
3522
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
3523
|
+
near: {
|
|
3524
|
+
displayName: "Near",
|
|
3525
|
+
type: "near",
|
|
3526
|
+
canBeHub: false,
|
|
3527
|
+
testnet: {
|
|
3528
|
+
name: "Near Testnet",
|
|
3529
|
+
chainId: 0,
|
|
3530
|
+
wormholeChainId: 15,
|
|
3531
|
+
rpcUrl: "https://rpc.testnet.near.org",
|
|
3532
|
+
explorerUrl: "https://explorer.testnet.near.org",
|
|
3533
|
+
isEvm: false,
|
|
3534
|
+
contracts: {
|
|
3535
|
+
wormholeCoreBridge: "wormhole.wormhole.testnet",
|
|
3536
|
+
tokenBridge: "token.wormhole.testnet"
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3539
|
+
mainnet: {
|
|
3540
|
+
name: "Near",
|
|
3541
|
+
chainId: 0,
|
|
3542
|
+
wormholeChainId: 15,
|
|
3543
|
+
rpcUrl: "https://rpc.mainnet.near.org",
|
|
3544
|
+
explorerUrl: "https://explorer.near.org",
|
|
3545
|
+
isEvm: false,
|
|
3546
|
+
contracts: {
|
|
3547
|
+
wormholeCoreBridge: "contract.wormhole_crypto.near",
|
|
3548
|
+
tokenBridge: "contract.portalbridge.near"
|
|
3549
|
+
}
|
|
3550
|
+
}
|
|
3551
|
+
}
|
|
3552
|
+
};
|
|
3553
|
+
var _rpcOverrides = {};
|
|
3554
|
+
function configureDefaultRpcUrls(overrides) {
|
|
3555
|
+
for (const key of Object.keys(_rpcOverrides)) {
|
|
3556
|
+
delete _rpcOverrides[key];
|
|
3557
|
+
}
|
|
3558
|
+
Object.assign(_rpcOverrides, overrides);
|
|
3559
|
+
}
|
|
3560
|
+
function getRpcUrlOverride(chain, network) {
|
|
3561
|
+
return _rpcOverrides[chain]?.[network];
|
|
3562
|
+
}
|
|
3563
|
+
function getChainConfig(chain, network = "testnet") {
|
|
3564
|
+
const preset = CHAIN_PRESETS[chain];
|
|
3565
|
+
if (!preset) {
|
|
3566
|
+
throw new Error(
|
|
3567
|
+
`Unknown chain: "${chain}". Supported chains: ${Object.keys(CHAIN_PRESETS).join(", ")}`
|
|
3568
|
+
);
|
|
3569
|
+
}
|
|
3570
|
+
const config = preset[network];
|
|
3571
|
+
const rpcOverride = getRpcUrlOverride(chain, network);
|
|
3572
|
+
if (rpcOverride) {
|
|
3573
|
+
return { ...config, rpcUrl: rpcOverride };
|
|
3574
|
+
}
|
|
3575
|
+
return config;
|
|
3576
|
+
}
|
|
3577
|
+
function getChainPreset(chain) {
|
|
3578
|
+
const preset = CHAIN_PRESETS[chain];
|
|
3579
|
+
if (!preset) {
|
|
3580
|
+
throw new Error(
|
|
3581
|
+
`Unknown chain: "${chain}". Supported chains: ${Object.keys(CHAIN_PRESETS).join(", ")}`
|
|
3582
|
+
);
|
|
3583
|
+
}
|
|
3584
|
+
return preset;
|
|
3585
|
+
}
|
|
3586
|
+
function getSupportedChains() {
|
|
3587
|
+
return Object.keys(CHAIN_PRESETS);
|
|
3588
|
+
}
|
|
3589
|
+
function getHubChains() {
|
|
3590
|
+
if (!isMultiHubEnabled()) {
|
|
3591
|
+
const primary = getEffectivePrimaryHub();
|
|
3592
|
+
return [primary];
|
|
3593
|
+
}
|
|
3594
|
+
return Object.entries(CHAIN_PRESETS).filter(([_, preset]) => preset.canBeHub).map(([name]) => name);
|
|
3595
|
+
}
|
|
3596
|
+
function isChainSupported(chain) {
|
|
3597
|
+
return chain in CHAIN_PRESETS;
|
|
3598
|
+
}
|
|
3599
|
+
function isHubChain(chain) {
|
|
3600
|
+
if (!isMultiHubEnabled()) {
|
|
3601
|
+
return chain === getEffectivePrimaryHub();
|
|
3602
|
+
}
|
|
3603
|
+
const preset = CHAIN_PRESETS[chain];
|
|
3604
|
+
return preset?.canBeHub ?? false;
|
|
3605
|
+
}
|
|
3606
|
+
function getDefaultHub(network = "testnet") {
|
|
3607
|
+
const primary = getEffectivePrimaryHub();
|
|
3608
|
+
return CHAIN_PRESETS[primary][network];
|
|
3609
|
+
}
|
|
3610
|
+
|
|
2768
3611
|
// src/core/AccountManager.ts
|
|
2769
3612
|
function isRecoveryCapableChain(chain) {
|
|
2770
3613
|
return typeof chain.getGuardians === "function" && typeof chain.getRecoveryStatus === "function";
|
|
@@ -3852,10 +4695,13 @@ var GasSponsor = class {
|
|
|
3852
4695
|
constructor(config = {}) {
|
|
3853
4696
|
this.config = config;
|
|
3854
4697
|
this.chains = config.testnet !== false ? TESTNET_CHAINS2 : MAINNET_CHAINS2;
|
|
3855
|
-
if (config.integratorSponsorKey) {
|
|
4698
|
+
if ((config.integratorSponsorKey || config.sponsorPrivateKey) && !config.allowLegacyPrivateKeyFallback) {
|
|
4699
|
+
console.warn("[Veridex SDK] Raw sponsor private-key fallback is disabled. Configure relayerUrl instead.");
|
|
4700
|
+
}
|
|
4701
|
+
if (config.allowLegacyPrivateKeyFallback && config.integratorSponsorKey) {
|
|
3856
4702
|
this.integratorWallet = new ethers6.Wallet(config.integratorSponsorKey);
|
|
3857
4703
|
}
|
|
3858
|
-
if (config.sponsorPrivateKey) {
|
|
4704
|
+
if (config.allowLegacyPrivateKeyFallback && config.sponsorPrivateKey) {
|
|
3859
4705
|
this.sponsorWallet = new ethers6.Wallet(config.sponsorPrivateKey);
|
|
3860
4706
|
}
|
|
3861
4707
|
}
|
|
@@ -4211,6 +5057,7 @@ var VeridexSDK = class {
|
|
|
4211
5057
|
// TODO: Use relayerApiKey when relayer integration is complete (Issue #8)
|
|
4212
5058
|
// private readonly relayerApiKey?: string;
|
|
4213
5059
|
queryApiKey;
|
|
5060
|
+
dispatchDestinations;
|
|
4214
5061
|
testnet;
|
|
4215
5062
|
sponsorPrivateKey;
|
|
4216
5063
|
chainRpcUrls;
|
|
@@ -4223,6 +5070,7 @@ var VeridexSDK = class {
|
|
|
4223
5070
|
this.sponsorPrivateKey = config.sponsorPrivateKey;
|
|
4224
5071
|
this.chainRpcUrls = config.chainRpcUrls;
|
|
4225
5072
|
this.queryApiKey = config.queryApiKey ?? config.relayerApiKey;
|
|
5073
|
+
this.dispatchDestinations = config.dispatchDestinations ?? {};
|
|
4226
5074
|
this.passkey = new PasskeyManager({
|
|
4227
5075
|
relayerUrl: config.relayerUrl
|
|
4228
5076
|
});
|
|
@@ -4254,6 +5102,7 @@ var VeridexSDK = class {
|
|
|
4254
5102
|
sponsorPrivateKey: config.sponsorPrivateKey,
|
|
4255
5103
|
// Integrator-provided sponsorship (takes priority over Veridex)
|
|
4256
5104
|
integratorSponsorKey: config.integratorSponsorKey,
|
|
5105
|
+
allowLegacyPrivateKeyFallback: config.allowLegacyPrivateKeyFallback,
|
|
4257
5106
|
// Relayer for remote sponsorship (future primary method)
|
|
4258
5107
|
relayerUrl: config.relayerUrl,
|
|
4259
5108
|
relayerApiKey: config.relayerApiKey,
|
|
@@ -4315,6 +5164,51 @@ var VeridexSDK = class {
|
|
|
4315
5164
|
MAX_PREPARED_TRANSFER_TTL
|
|
4316
5165
|
);
|
|
4317
5166
|
}
|
|
5167
|
+
async getVerifiedDispatchDestination(targetChain) {
|
|
5168
|
+
if (!this.relayer) {
|
|
5169
|
+
throw new VeridexError("RELAYER_ERROR" /* RELAYER_ERROR */, "Relayer not configured.");
|
|
5170
|
+
}
|
|
5171
|
+
const normalize = (destination) => {
|
|
5172
|
+
if (destination.targetChain !== targetChain || !Number.isInteger(destination.veridexChainId) || destination.veridexChainId <= 0 || destination.veridexChainId > 4294967295 || destination.minTier !== 3) {
|
|
5173
|
+
throw new VeridexError(
|
|
5174
|
+
"INVALID_PAYLOAD" /* INVALID_PAYLOAD */,
|
|
5175
|
+
`Invalid v3 destination metadata for target chain ${targetChain}.`
|
|
5176
|
+
);
|
|
5177
|
+
}
|
|
5178
|
+
let executor;
|
|
5179
|
+
try {
|
|
5180
|
+
executor = ethers7.hexlify(ethers7.zeroPadValue(destination.executor, 32)).toLowerCase();
|
|
5181
|
+
} catch {
|
|
5182
|
+
throw new VeridexError(
|
|
5183
|
+
"INVALID_PAYLOAD" /* INVALID_PAYLOAD */,
|
|
5184
|
+
`Invalid v3 executor for target chain ${targetChain}.`
|
|
5185
|
+
);
|
|
5186
|
+
}
|
|
5187
|
+
if (executor === ethers7.ZeroHash) {
|
|
5188
|
+
throw new VeridexError(
|
|
5189
|
+
"INVALID_PAYLOAD" /* INVALID_PAYLOAD */,
|
|
5190
|
+
`Zero v3 executor for target chain ${targetChain}.`
|
|
5191
|
+
);
|
|
5192
|
+
}
|
|
5193
|
+
return { ...destination, executor };
|
|
5194
|
+
};
|
|
5195
|
+
const pinned = this.dispatchDestinations[targetChain];
|
|
5196
|
+
if (!pinned) {
|
|
5197
|
+
throw new VeridexError(
|
|
5198
|
+
"UNSUPPORTED_FEATURE" /* UNSUPPORTED_FEATURE */,
|
|
5199
|
+
`Target chain ${targetChain} has no locally pinned v3 deployment.`
|
|
5200
|
+
);
|
|
5201
|
+
}
|
|
5202
|
+
const trusted = normalize(pinned);
|
|
5203
|
+
const advertised = normalize(await this.relayer.getDispatchDestination(targetChain));
|
|
5204
|
+
if (trusted.veridexChainId !== advertised.veridexChainId || trusted.executor !== advertised.executor || trusted.minTier !== advertised.minTier) {
|
|
5205
|
+
throw new VeridexError(
|
|
5206
|
+
"RELAYER_ERROR" /* RELAYER_ERROR */,
|
|
5207
|
+
`Relayer destination metadata does not match the pinned deployment for chain ${targetChain}.`
|
|
5208
|
+
);
|
|
5209
|
+
}
|
|
5210
|
+
return trusted;
|
|
5211
|
+
}
|
|
4318
5212
|
getChainConfig() {
|
|
4319
5213
|
return this.chain.getConfig();
|
|
4320
5214
|
}
|
|
@@ -4691,6 +5585,7 @@ var VeridexSDK = class {
|
|
|
4691
5585
|
throw new VeridexError("RELAYER_ERROR" /* RELAYER_ERROR */, "Relayer not configured. Please provide relayerUrl in SDK config.");
|
|
4692
5586
|
}
|
|
4693
5587
|
const startTime = Date.now();
|
|
5588
|
+
const destination = await this.getVerifiedDispatchDestination(params.sourceChain);
|
|
4694
5589
|
onProgress?.({
|
|
4695
5590
|
status: "preparing",
|
|
4696
5591
|
step: 0,
|
|
@@ -4698,7 +5593,7 @@ var VeridexSDK = class {
|
|
|
4698
5593
|
message: "Preparing gasless bridge..."
|
|
4699
5594
|
});
|
|
4700
5595
|
const actionPayload = await this.buildBridgePayload(params);
|
|
4701
|
-
const nonce = await this.
|
|
5596
|
+
const nonce = await this.relayer.getUserNonce(credential.keyHash);
|
|
4702
5597
|
const chainConfig = this.chain.getConfig();
|
|
4703
5598
|
const hubChainId = chainConfig.hubChainId ?? chainConfig.wormholeChainId;
|
|
4704
5599
|
onProgress?.({
|
|
@@ -4707,12 +5602,11 @@ var VeridexSDK = class {
|
|
|
4707
5602
|
totalSteps: 6,
|
|
4708
5603
|
message: "Sign with your passkey..."
|
|
4709
5604
|
});
|
|
4710
|
-
const challenge = buildGaslessChallenge(
|
|
4711
|
-
|
|
5605
|
+
const challenge = buildGaslessChallenge({
|
|
5606
|
+
...destination,
|
|
4712
5607
|
actionPayload,
|
|
4713
|
-
nonce
|
|
4714
|
-
|
|
4715
|
-
);
|
|
5608
|
+
nonce
|
|
5609
|
+
});
|
|
4716
5610
|
const signature = await this.passkey.sign(challenge);
|
|
4717
5611
|
onProgress?.({
|
|
4718
5612
|
status: "dispatching",
|
|
@@ -4730,8 +5624,11 @@ var VeridexSDK = class {
|
|
|
4730
5624
|
publicKeyX: "0x" + credential.publicKeyX.toString(16).padStart(64, "0"),
|
|
4731
5625
|
publicKeyY: "0x" + credential.publicKeyY.toString(16).padStart(64, "0"),
|
|
4732
5626
|
targetChain: params.sourceChain,
|
|
5627
|
+
veridexChainId: destination.veridexChainId,
|
|
5628
|
+
executor: destination.executor,
|
|
5629
|
+
minTier: destination.minTier,
|
|
4733
5630
|
actionPayload,
|
|
4734
|
-
nonce:
|
|
5631
|
+
nonce: nonce.toString()
|
|
4735
5632
|
};
|
|
4736
5633
|
const relayerResult = await this.relayer.submitSignedAction(submitRequest);
|
|
4737
5634
|
if (!relayerResult.success) {
|
|
@@ -5225,15 +6122,18 @@ var VeridexSDK = class {
|
|
|
5225
6122
|
throw new VeridexError("RELAYER_ERROR" /* RELAYER_ERROR */, "Relayer not configured. Please provide relayerUrl in SDK config.");
|
|
5226
6123
|
}
|
|
5227
6124
|
const chainConfig = this.chain.getConfig();
|
|
6125
|
+
const destination = await this.getVerifiedDispatchDestination(params.targetChain);
|
|
6126
|
+
const nonce = await this.relayer.getUserNonce(credential.keyHash);
|
|
5228
6127
|
const actionPayload = await this.buildTransferPayload(params);
|
|
5229
6128
|
const { authenticateAndPrepare } = await import("./auth/prepareAuth.mjs");
|
|
5230
6129
|
const prepared = await authenticateAndPrepare(
|
|
5231
6130
|
{
|
|
5232
6131
|
credential,
|
|
5233
6132
|
targetChain: params.targetChain,
|
|
6133
|
+
destination,
|
|
6134
|
+
nonce,
|
|
5234
6135
|
actionPayload
|
|
5235
|
-
}
|
|
5236
|
-
this.queryApiKey ?? ""
|
|
6136
|
+
}
|
|
5237
6137
|
);
|
|
5238
6138
|
const submitRequest = JSON.parse(new TextDecoder().decode(prepared.serializedTx));
|
|
5239
6139
|
submitRequest.actionPayload = actionPayload;
|
|
@@ -5305,7 +6205,7 @@ var VeridexSDK = class {
|
|
|
5305
6205
|
const wormholeChainId = chainConfig.wormholeChainId;
|
|
5306
6206
|
const tokenList = getAllTokens(wormholeChainId);
|
|
5307
6207
|
const erc20Tokens = tokenList.filter((t) => !isNativeToken(t.address)).map((t) => t.address);
|
|
5308
|
-
const { queryPortfolio } = await import("./portfolio-
|
|
6208
|
+
const { queryPortfolio } = await import("./portfolio-MLP2JIFK.mjs");
|
|
5309
6209
|
const result = await queryPortfolio(credential.keyHash, this.queryApiKey, {
|
|
5310
6210
|
network: this.testnet ? "testnet" : "mainnet",
|
|
5311
6211
|
vaultAddresses: { [wormholeChainId]: vaultAddress },
|
|
@@ -5668,7 +6568,7 @@ var VeridexSDK = class {
|
|
|
5668
6568
|
const tokenList = getAllTokens(wormholeChainId);
|
|
5669
6569
|
const erc20Tokens = tokenList.filter((t) => !isNativeToken(t.address)).map((t) => t.address);
|
|
5670
6570
|
const rpcUrl = this.chainRpcUrls?.[wormholeChainId] ?? chainConfig.rpcUrl;
|
|
5671
|
-
const { queryPortfolio } = await import("./portfolio-
|
|
6571
|
+
const { queryPortfolio } = await import("./portfolio-MLP2JIFK.mjs");
|
|
5672
6572
|
const result = await queryPortfolio(credential.keyHash, this.queryApiKey, {
|
|
5673
6573
|
network: this.testnet ? "testnet" : "mainnet",
|
|
5674
6574
|
vaultAddresses: { [wormholeChainId]: vaultAddress },
|
|
@@ -6473,6 +7373,7 @@ function createSDK(chain, config = {}) {
|
|
|
6473
7373
|
testnet: network === "testnet",
|
|
6474
7374
|
relayerUrl: config.relayerUrl ?? DEFAULT_PUBLIC_RELAYER_URLS[network],
|
|
6475
7375
|
relayerApiKey: config.relayerApiKey,
|
|
7376
|
+
dispatchDestinations: config.dispatchDestinations,
|
|
6476
7377
|
sponsorPrivateKey: config.sponsorPrivateKey,
|
|
6477
7378
|
integratorSponsorKey: config.integratorSponsorKey,
|
|
6478
7379
|
chainRpcUrls: Object.keys(chainRpcUrls).length > 0 ? chainRpcUrls : void 0
|
|
@@ -7207,7 +8108,8 @@ var CrossOriginAuth = class {
|
|
|
7207
8108
|
appOrigin: typeof window !== "undefined" ? window.location.origin : "",
|
|
7208
8109
|
sessionPublicKey: options?.sessionPublicKey ?? "",
|
|
7209
8110
|
permissions: options?.permissions ?? ["read", "transfer"],
|
|
7210
|
-
expiresInMs: options?.expiresInMs ?? 36e5
|
|
8111
|
+
expiresInMs: options?.expiresInMs ?? 36e5,
|
|
8112
|
+
environment: options?.environment ?? "test"
|
|
7211
8113
|
})
|
|
7212
8114
|
});
|
|
7213
8115
|
if (!response.ok) {
|
|
@@ -7304,7 +8206,8 @@ var CrossOriginAuth = class {
|
|
|
7304
8206
|
keyHash: bootstrap.credential.keyHash,
|
|
7305
8207
|
sessionPublicKey: "",
|
|
7306
8208
|
permissions: options?.permissions,
|
|
7307
|
-
expiresInMs: options?.expiresInMs
|
|
8209
|
+
expiresInMs: options?.expiresInMs,
|
|
8210
|
+
environment: options?.environment
|
|
7308
8211
|
});
|
|
7309
8212
|
const result = await this.authenticate(this.decodeBase64Url(challenge.value));
|
|
7310
8213
|
session = {
|
|
@@ -7321,7 +8224,8 @@ var CrossOriginAuth = class {
|
|
|
7321
8224
|
keyHash: bootstrap.credential.keyHash,
|
|
7322
8225
|
sessionPublicKey: bootstrap.sessionPublicKey,
|
|
7323
8226
|
permissions: options?.permissions,
|
|
7324
|
-
expiresInMs: options?.expiresInMs
|
|
8227
|
+
expiresInMs: options?.expiresInMs,
|
|
8228
|
+
environment: options?.environment
|
|
7325
8229
|
});
|
|
7326
8230
|
session = await this.connectWithVeridex({
|
|
7327
8231
|
sessionChallengeId: challenge.id,
|
|
@@ -7331,6 +8235,10 @@ var CrossOriginAuth = class {
|
|
|
7331
8235
|
}
|
|
7332
8236
|
const serverSession = await this.createServerSession(session);
|
|
7333
8237
|
session.serverSessionId = serverSession.id;
|
|
8238
|
+
session.appId = serverSession.appId;
|
|
8239
|
+
session.tenantId = serverSession.tenantId;
|
|
8240
|
+
session.environment = serverSession.environment;
|
|
8241
|
+
session.chargeAuthorizationId = options?.chargeAuthorizationId;
|
|
7334
8242
|
return { session, serverSession };
|
|
7335
8243
|
}
|
|
7336
8244
|
};
|
|
@@ -7375,6 +8283,15 @@ function sendAuthError(error, code, targetOrigin) {
|
|
|
7375
8283
|
}
|
|
7376
8284
|
}
|
|
7377
8285
|
|
|
8286
|
+
// src/index.ts
|
|
8287
|
+
import {
|
|
8288
|
+
CHARGE_AUTHORIZATION_SIGNATURE_DOMAIN,
|
|
8289
|
+
chargeAuthorizationPayer,
|
|
8290
|
+
chargeAuthorizationSigningPayload,
|
|
8291
|
+
createChargeAuthorization,
|
|
8292
|
+
verifyChargeAuthorizationSignature
|
|
8293
|
+
} from "@veridex/platform-events";
|
|
8294
|
+
|
|
7378
8295
|
// src/core/InjectedWalletAdapter.ts
|
|
7379
8296
|
import { ethers as ethers8 } from "ethers";
|
|
7380
8297
|
var InjectedWalletAdapter = class {
|
|
@@ -9382,6 +10299,7 @@ export {
|
|
|
9382
10299
|
CHAIN_DISPLAY_INFO,
|
|
9383
10300
|
CHAIN_NAMES,
|
|
9384
10301
|
CHAIN_PRESETS,
|
|
10302
|
+
CHARGE_AUTHORIZATION_SIGNATURE_DOMAIN,
|
|
9385
10303
|
CONFIG_TYPE,
|
|
9386
10304
|
CONSISTENCY_LEVELS,
|
|
9387
10305
|
ChainDetector,
|
|
@@ -9409,6 +10327,7 @@ export {
|
|
|
9409
10327
|
GUARDIAN_CONFIG,
|
|
9410
10328
|
GasSponsor,
|
|
9411
10329
|
HUB_ABI,
|
|
10330
|
+
HUB_NONCE_DOMAIN,
|
|
9412
10331
|
IDENTITY_REGISTRY_ABI,
|
|
9413
10332
|
IDENTITY_REGISTRY_READ_ABI,
|
|
9414
10333
|
IndexedDBSessionStorage,
|
|
@@ -9425,6 +10344,7 @@ export {
|
|
|
9425
10344
|
PROTECTED_ACTION,
|
|
9426
10345
|
PROTOCOL_VERSION,
|
|
9427
10346
|
PasskeyManager,
|
|
10347
|
+
PlatformClient,
|
|
9428
10348
|
PolicyViolationError,
|
|
9429
10349
|
REPUTATION_REGISTRY_ABI,
|
|
9430
10350
|
REPUTATION_REGISTRY_READ_ABI,
|
|
@@ -9439,6 +10359,7 @@ export {
|
|
|
9439
10359
|
StarknetClient,
|
|
9440
10360
|
SuiClient,
|
|
9441
10361
|
TESTNET_CHAINS,
|
|
10362
|
+
TIER_T2_AUTHORITATIVE,
|
|
9442
10363
|
TOKEN_REGISTRY,
|
|
9443
10364
|
TransactionParser,
|
|
9444
10365
|
TransactionTracker,
|
|
@@ -9456,24 +10377,28 @@ export {
|
|
|
9456
10377
|
WalletManager,
|
|
9457
10378
|
base64URLDecode,
|
|
9458
10379
|
base64URLEncode,
|
|
10380
|
+
buildCanonicalChallenge,
|
|
9459
10381
|
buildCapabilityMatrix,
|
|
9460
10382
|
buildChallenge,
|
|
9461
10383
|
buildGaslessChallenge,
|
|
9462
10384
|
buildSbtcWithdrawalPostConditions,
|
|
9463
10385
|
buildExecutePostConditions as buildStacksExecutePostConditions,
|
|
10386
|
+
buildStarknetSessionTransferChallenge,
|
|
9464
10387
|
buildStxDepositPostConditions,
|
|
9465
10388
|
buildStxWithdrawalPostConditions,
|
|
9466
10389
|
calculatePercentage,
|
|
10390
|
+
chargeAuthorizationPayer,
|
|
10391
|
+
chargeAuthorizationSigningPayload,
|
|
9467
10392
|
computeKeyHash,
|
|
9468
10393
|
computeSessionKeyHash,
|
|
9469
10394
|
configureDefaultRpcUrls,
|
|
9470
10395
|
createAuditEntry,
|
|
9471
10396
|
createChainClient,
|
|
9472
10397
|
createChainDetector,
|
|
10398
|
+
createChargeAuthorization,
|
|
9473
10399
|
createCrossOriginAuth,
|
|
9474
10400
|
createEnterpriseSDK,
|
|
9475
10401
|
createGasSponsor,
|
|
9476
|
-
createGaslessMessageHash,
|
|
9477
10402
|
createHubSDK,
|
|
9478
10403
|
createInjectedWalletAdapter,
|
|
9479
10404
|
createMainnetSDK,
|
|
@@ -9590,6 +10515,7 @@ export {
|
|
|
9590
10515
|
sendAuthError,
|
|
9591
10516
|
sendAuthResponse,
|
|
9592
10517
|
setFeatureFlags,
|
|
10518
|
+
signStarknetSessionTransfer,
|
|
9593
10519
|
signWithSessionKey,
|
|
9594
10520
|
solanaAddressToBytes32,
|
|
9595
10521
|
buildExecuteHash as stacksBuildExecuteHash,
|
|
@@ -9613,6 +10539,7 @@ export {
|
|
|
9613
10539
|
validateSessionConfig,
|
|
9614
10540
|
validateSessionCreationPolicy,
|
|
9615
10541
|
validatePostConditions as validateStacksPostConditions,
|
|
10542
|
+
verifyChargeAuthorizationSignature,
|
|
9616
10543
|
verifySessionSignature,
|
|
9617
10544
|
waitForGuardianSignatures
|
|
9618
10545
|
};
|