@zkp2p/pay-shared 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Centralized chain configuration for ZKP2P Pay.
3
+ *
4
+ * All supported chains and their USDC addresses are defined here.
5
+ * Import this module instead of duplicating chain configs in each app.
6
+ */
7
+ export declare const BASE_CHAIN_ID = 8453;
8
+ export declare const HYPEREVM_CHAIN_ID = 999;
9
+ export declare const SOLANA_CHAIN_ID = 34268394551451;
10
+ export declare const SUPPORTED_DESTINATION_TOKEN_ALIASES: readonly ["USDC", "USDT"];
11
+ export type DestinationTokenAlias = (typeof SUPPORTED_DESTINATION_TOKEN_ALIASES)[number];
12
+ export declare const DEFAULT_DESTINATION_TOKEN_ALIAS: DestinationTokenAlias;
13
+ /**
14
+ * Chain configuration interface.
15
+ *
16
+ * Note: We don't store spokePoolAddress for each chain because bridging
17
+ * always originates from Base, and the hook contract handles the Base SpokePool.
18
+ */
19
+ export interface ChainConfig {
20
+ chainId: number;
21
+ name: string;
22
+ shortName: string;
23
+ usdcAddress: string;
24
+ isOriginChain: boolean;
25
+ isEvm: boolean;
26
+ explorerUrl?: string;
27
+ }
28
+ export declare const MAINNET_CHAINS: Record<number, ChainConfig>;
29
+ /**
30
+ * Normalize destination token aliases (USDC/USDT) into canonical uppercase symbols.
31
+ * Returns null if the value is empty or not a known alias.
32
+ */
33
+ export declare function normalizeDestinationTokenAlias(value: string | null | undefined): DestinationTokenAlias | null;
34
+ /**
35
+ * Check whether a value is a supported destination token alias.
36
+ */
37
+ export declare function isDestinationTokenAlias(value: string | null | undefined): value is DestinationTokenAlias;
38
+ /**
39
+ * Resolve destination token alias, falling back to the hard default.
40
+ */
41
+ export declare function resolveDefaultDestinationTokenAlias(value: string | null | undefined): DestinationTokenAlias;
42
+ /**
43
+ * Parse a user-provided chain selection into a supported chain ID.
44
+ * Accepts numeric chain IDs as well as common aliases (e.g. "polygon", "arb", "sol").
45
+ */
46
+ export declare function parseSupportedChainSelection(value: string): number | null;
47
+ /**
48
+ * Get chain configurations.
49
+ */
50
+ export declare function getChainConfigs(): Record<number, ChainConfig>;
51
+ /**
52
+ * Get chain config by chain ID.
53
+ */
54
+ export declare function getChainConfig(chainId: number): ChainConfig | undefined;
55
+ /**
56
+ * Check if chain ID is the origin chain (Base).
57
+ */
58
+ export declare function isOriginChain(chainId: number): boolean;
59
+ /**
60
+ * Check if chain ID is an EVM chain.
61
+ */
62
+ export declare function isEvmChain(chainId: number): boolean;
63
+ /**
64
+ * Get origin chain ID for current environment.
65
+ */
66
+ export declare function getOriginChainId(): number;
67
+ /**
68
+ * Get USDC address for a chain.
69
+ */
70
+ export declare function getUsdcAddress(chainId: number): string | undefined;
71
+ /**
72
+ * Resolve destination token alias to chain-specific token address.
73
+ * Supported aliases:
74
+ * - USDC: map to configured USDC address
75
+ * - USDT: map to configured USDT address (if available)
76
+ * - fallback: return token string as provided (for explicit token addresses)
77
+ */
78
+ export declare function resolveDestinationTokenAddress(destinationToken: string, destinationChainId: number): string | null;
79
+ /**
80
+ * Get supported destination token aliases for a destination chain.
81
+ * Token support is derived from resolvable token addresses for the chain.
82
+ */
83
+ export declare function getSupportedDestinationTokenAliasesForChain(destinationChainId: number): DestinationTokenAlias[];
84
+ /**
85
+ * Get all supported chain IDs.
86
+ */
87
+ export declare function getSupportedChainIds(): number[];
88
+ /**
89
+ * Get destination chain IDs (excludes origin).
90
+ */
91
+ export declare function getDestinationChainIds(): number[];
92
+ /**
93
+ * Get EVM chain IDs only.
94
+ */
95
+ export declare function getEvmChainIds(): number[];
96
+ /**
97
+ * Get non-EVM chain IDs (e.g., Solana).
98
+ */
99
+ export declare function getNonEvmChainIds(): number[];
100
+ /**
101
+ * Get chain name for display.
102
+ */
103
+ export declare function getChainName(chainId: number): string;
104
+ /**
105
+ * Get chain short name for badges/tags.
106
+ */
107
+ export declare function getChainShortName(chainId: number): string;
108
+ /**
109
+ * Get explorer URL for a chain.
110
+ */
111
+ export declare function getExplorerUrl(chainId: number): string | undefined;
112
+ /**
113
+ * Array of supported chains for UI dropdowns.
114
+ * Includes origin chain marked with isOrigin flag.
115
+ */
116
+ export declare const SUPPORTED_CHAINS: {
117
+ chainId: number;
118
+ name: string;
119
+ shortName: string;
120
+ isOrigin: boolean;
121
+ isEvm: boolean;
122
+ }[];
123
+ /**
124
+ * Array of destination chains only (excludes Base).
125
+ */
126
+ export declare const DESTINATION_CHAINS: {
127
+ chainId: number;
128
+ name: string;
129
+ shortName: string;
130
+ isOrigin: boolean;
131
+ isEvm: boolean;
132
+ }[];
133
+ /**
134
+ * Mapping of chain ID to name for backward compatibility.
135
+ */
136
+ export declare const SupportedChainsMap: Record<number, string>;
137
+ //# sourceMappingURL=chains.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"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"}
package/dist/chains.js ADDED
@@ -0,0 +1,341 @@
1
+ /**
2
+ * Centralized chain configuration for ZKP2P Pay.
3
+ *
4
+ * All supported chains and their USDC addresses are defined here.
5
+ * Import this module instead of duplicating chain configs in each app.
6
+ */
7
+ // Chain IDs
8
+ export const BASE_CHAIN_ID = 8453;
9
+ export const HYPEREVM_CHAIN_ID = 999;
10
+ export const SOLANA_CHAIN_ID = 34268394551451;
11
+ export const SUPPORTED_DESTINATION_TOKEN_ALIASES = ['USDC', 'USDT'];
12
+ export const DEFAULT_DESTINATION_TOKEN_ALIAS = 'USDC';
13
+ // Mainnet chain configurations
14
+ export const MAINNET_CHAINS = {
15
+ // Origin chain (Base)
16
+ [BASE_CHAIN_ID]: {
17
+ chainId: BASE_CHAIN_ID,
18
+ name: 'Base',
19
+ shortName: 'BASE',
20
+ usdcAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
21
+ isOriginChain: true,
22
+ isEvm: true,
23
+ explorerUrl: 'https://basescan.org',
24
+ },
25
+ // EVM Destination chains
26
+ 1: {
27
+ chainId: 1,
28
+ name: 'Ethereum',
29
+ shortName: 'ETH',
30
+ usdcAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
31
+ isOriginChain: false,
32
+ isEvm: true,
33
+ explorerUrl: 'https://etherscan.io',
34
+ },
35
+ 10: {
36
+ chainId: 10,
37
+ name: 'Optimism',
38
+ shortName: 'OP',
39
+ usdcAddress: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
40
+ isOriginChain: false,
41
+ isEvm: true,
42
+ explorerUrl: 'https://optimistic.etherscan.io',
43
+ },
44
+ 42161: {
45
+ chainId: 42161,
46
+ name: 'Arbitrum',
47
+ shortName: 'ARB',
48
+ usdcAddress: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
49
+ isOriginChain: false,
50
+ isEvm: true,
51
+ explorerUrl: 'https://arbiscan.io',
52
+ },
53
+ 137: {
54
+ chainId: 137,
55
+ name: 'Polygon',
56
+ shortName: 'MATIC',
57
+ usdcAddress: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
58
+ isOriginChain: false,
59
+ isEvm: true,
60
+ explorerUrl: 'https://polygonscan.com',
61
+ },
62
+ 480: {
63
+ chainId: 480,
64
+ name: 'World Chain',
65
+ shortName: 'WLD',
66
+ usdcAddress: '0x79A02482A880bCE3F13e09Da970dC34db4CD24d1', // USDC.e on World Chain
67
+ isOriginChain: false,
68
+ isEvm: true,
69
+ explorerUrl: 'https://worldscan.org',
70
+ },
71
+ 56: {
72
+ chainId: 56,
73
+ name: 'BNB Smart Chain',
74
+ shortName: 'BNB',
75
+ usdcAddress: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
76
+ isOriginChain: false,
77
+ isEvm: true,
78
+ explorerUrl: 'https://bscscan.com',
79
+ },
80
+ [HYPEREVM_CHAIN_ID]: {
81
+ chainId: HYPEREVM_CHAIN_ID,
82
+ name: 'Hyperliquid',
83
+ shortName: 'HL',
84
+ usdcAddress: '0xb88339CB7199b77E23DB6E890353E22632Ba630f', // Native USDC on HyperEVM
85
+ isOriginChain: false,
86
+ isEvm: true,
87
+ explorerUrl: 'https://hyperscan.xyz',
88
+ },
89
+ // Non-EVM Destination chains
90
+ [SOLANA_CHAIN_ID]: {
91
+ chainId: SOLANA_CHAIN_ID,
92
+ name: 'Solana',
93
+ shortName: 'SOL',
94
+ usdcAddress: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
95
+ isOriginChain: false,
96
+ isEvm: false,
97
+ explorerUrl: 'https://solscan.io',
98
+ },
99
+ };
100
+ function normalizeChainSelectionKey(value) {
101
+ return value.trim().toLowerCase().replace(/[^a-z0-9]/g, '');
102
+ }
103
+ const SUPPORTED_CHAIN_IDS = Object.keys(MAINNET_CHAINS).map(Number);
104
+ const SUPPORTED_CHAIN_ID_SET = new Set(SUPPORTED_CHAIN_IDS);
105
+ const CHAIN_SELECTION_ALIASES = {
106
+ base: 8453,
107
+ ethereum: 1,
108
+ eth: 1,
109
+ optimism: 10,
110
+ op: 10,
111
+ arbitrum: 42161,
112
+ arb: 42161,
113
+ polygon: 137,
114
+ matic: 137,
115
+ world: 480,
116
+ worldchain: 480,
117
+ bnb: 56,
118
+ bsc: 56,
119
+ binancesmartchain: 56,
120
+ hyperliquid: 999,
121
+ hyperevm: 999,
122
+ hl: 999,
123
+ solana: 34268394551451,
124
+ sol: 34268394551451,
125
+ };
126
+ for (const chainId of SUPPORTED_CHAIN_IDS) {
127
+ const chainConfig = MAINNET_CHAINS[chainId];
128
+ const normalizedName = normalizeChainSelectionKey(chainConfig.name);
129
+ const normalizedShortName = normalizeChainSelectionKey(chainConfig.shortName);
130
+ if (!(normalizedName in CHAIN_SELECTION_ALIASES)) {
131
+ CHAIN_SELECTION_ALIASES[normalizedName] = chainId;
132
+ }
133
+ if (!(normalizedShortName in CHAIN_SELECTION_ALIASES)) {
134
+ CHAIN_SELECTION_ALIASES[normalizedShortName] = chainId;
135
+ }
136
+ }
137
+ const DESTINATION_TOKEN_ADDRESSES = {
138
+ // Ethereum
139
+ 1: {
140
+ usdt: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
141
+ },
142
+ // Optimism
143
+ 10: {
144
+ usdt: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
145
+ },
146
+ // BNB Smart Chain
147
+ 56: {
148
+ usdt: '0x55d398326f99059fF775485246999027B3197955',
149
+ },
150
+ // Arbitrum
151
+ 42161: {
152
+ usdt: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
153
+ },
154
+ // Polygon
155
+ 137: {
156
+ usdt: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
157
+ },
158
+ // Hyperliquid
159
+ 999: {
160
+ usdt: '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb',
161
+ },
162
+ };
163
+ function isKnownDestinationTokenAlias(value) {
164
+ return SUPPORTED_DESTINATION_TOKEN_ALIASES.includes(value);
165
+ }
166
+ /**
167
+ * Normalize destination token aliases (USDC/USDT) into canonical uppercase symbols.
168
+ * Returns null if the value is empty or not a known alias.
169
+ */
170
+ export function normalizeDestinationTokenAlias(value) {
171
+ const normalized = value?.trim().toUpperCase();
172
+ if (!normalized) {
173
+ return null;
174
+ }
175
+ return isKnownDestinationTokenAlias(normalized) ? normalized : null;
176
+ }
177
+ /**
178
+ * Check whether a value is a supported destination token alias.
179
+ */
180
+ export function isDestinationTokenAlias(value) {
181
+ return normalizeDestinationTokenAlias(value) !== null;
182
+ }
183
+ /**
184
+ * Resolve destination token alias, falling back to the hard default.
185
+ */
186
+ export function resolveDefaultDestinationTokenAlias(value) {
187
+ return normalizeDestinationTokenAlias(value) ?? DEFAULT_DESTINATION_TOKEN_ALIAS;
188
+ }
189
+ /**
190
+ * Parse a user-provided chain selection into a supported chain ID.
191
+ * Accepts numeric chain IDs as well as common aliases (e.g. "polygon", "arb", "sol").
192
+ */
193
+ export function parseSupportedChainSelection(value) {
194
+ const trimmed = value.trim();
195
+ if (!trimmed) {
196
+ return null;
197
+ }
198
+ if (/^\d+$/.test(trimmed)) {
199
+ const parsed = Number(trimmed);
200
+ return SUPPORTED_CHAIN_ID_SET.has(parsed) ? parsed : null;
201
+ }
202
+ const normalized = normalizeChainSelectionKey(trimmed);
203
+ return CHAIN_SELECTION_ALIASES[normalized] ?? null;
204
+ }
205
+ /**
206
+ * Get chain configurations.
207
+ */
208
+ export function getChainConfigs() {
209
+ return MAINNET_CHAINS;
210
+ }
211
+ /**
212
+ * Get chain config by chain ID.
213
+ */
214
+ export function getChainConfig(chainId) {
215
+ return getChainConfigs()[chainId];
216
+ }
217
+ /**
218
+ * Check if chain ID is the origin chain (Base).
219
+ */
220
+ export function isOriginChain(chainId) {
221
+ const chain = getChainConfig(chainId);
222
+ return chain?.isOriginChain ?? false;
223
+ }
224
+ /**
225
+ * Check if chain ID is an EVM chain.
226
+ */
227
+ export function isEvmChain(chainId) {
228
+ const chain = getChainConfig(chainId);
229
+ return chain?.isEvm ?? true; // Default to EVM if unknown
230
+ }
231
+ /**
232
+ * Get origin chain ID for current environment.
233
+ */
234
+ export function getOriginChainId() {
235
+ const chains = getChainConfigs();
236
+ const originChain = Object.values(chains).find((c) => c.isOriginChain);
237
+ return originChain?.chainId ?? BASE_CHAIN_ID;
238
+ }
239
+ /**
240
+ * Get USDC address for a chain.
241
+ */
242
+ export function getUsdcAddress(chainId) {
243
+ return getChainConfig(chainId)?.usdcAddress;
244
+ }
245
+ /**
246
+ * Resolve destination token alias to chain-specific token address.
247
+ * Supported aliases:
248
+ * - USDC: map to configured USDC address
249
+ * - USDT: map to configured USDT address (if available)
250
+ * - fallback: return token string as provided (for explicit token addresses)
251
+ */
252
+ export function resolveDestinationTokenAddress(destinationToken, destinationChainId) {
253
+ const token = destinationToken.trim();
254
+ if (!token) {
255
+ return null;
256
+ }
257
+ const chainId = destinationChainId;
258
+ const tokenAlias = normalizeDestinationTokenAlias(token);
259
+ const chainAddresses = DESTINATION_TOKEN_ADDRESSES[chainId];
260
+ if (tokenAlias === 'USDC') {
261
+ return getUsdcAddress(chainId) ?? null;
262
+ }
263
+ if (tokenAlias === 'USDT') {
264
+ return chainAddresses?.usdt ?? null;
265
+ }
266
+ return token;
267
+ }
268
+ /**
269
+ * Get supported destination token aliases for a destination chain.
270
+ * Token support is derived from resolvable token addresses for the chain.
271
+ */
272
+ export function getSupportedDestinationTokenAliasesForChain(destinationChainId) {
273
+ return SUPPORTED_DESTINATION_TOKEN_ALIASES.filter((tokenAlias) => Boolean(resolveDestinationTokenAddress(tokenAlias, destinationChainId)));
274
+ }
275
+ /**
276
+ * Get all supported chain IDs.
277
+ */
278
+ export function getSupportedChainIds() {
279
+ return [...SUPPORTED_CHAIN_IDS];
280
+ }
281
+ /**
282
+ * Get destination chain IDs (excludes origin).
283
+ */
284
+ export function getDestinationChainIds() {
285
+ return Object.entries(getChainConfigs())
286
+ .filter(([, cfg]) => !cfg.isOriginChain)
287
+ .map(([id]) => Number(id));
288
+ }
289
+ /**
290
+ * Get EVM chain IDs only.
291
+ */
292
+ export function getEvmChainIds() {
293
+ return Object.entries(getChainConfigs())
294
+ .filter(([, cfg]) => cfg.isEvm)
295
+ .map(([id]) => Number(id));
296
+ }
297
+ /**
298
+ * Get non-EVM chain IDs (e.g., Solana).
299
+ */
300
+ export function getNonEvmChainIds() {
301
+ return Object.entries(getChainConfigs())
302
+ .filter(([, cfg]) => !cfg.isEvm)
303
+ .map(([id]) => Number(id));
304
+ }
305
+ /**
306
+ * Get chain name for display.
307
+ */
308
+ export function getChainName(chainId) {
309
+ return getChainConfig(chainId)?.name ?? `Chain ${chainId}`;
310
+ }
311
+ /**
312
+ * Get chain short name for badges/tags.
313
+ */
314
+ export function getChainShortName(chainId) {
315
+ return getChainConfig(chainId)?.shortName ?? `${chainId}`;
316
+ }
317
+ /**
318
+ * Get explorer URL for a chain.
319
+ */
320
+ export function getExplorerUrl(chainId) {
321
+ return getChainConfig(chainId)?.explorerUrl;
322
+ }
323
+ /**
324
+ * Array of supported chains for UI dropdowns.
325
+ * Includes origin chain marked with isOrigin flag.
326
+ */
327
+ export const SUPPORTED_CHAINS = Object.values(MAINNET_CHAINS).map((chain) => ({
328
+ chainId: chain.chainId,
329
+ name: chain.name,
330
+ shortName: chain.shortName,
331
+ isOrigin: chain.isOriginChain,
332
+ isEvm: chain.isEvm,
333
+ }));
334
+ /**
335
+ * Array of destination chains only (excludes Base).
336
+ */
337
+ export const DESTINATION_CHAINS = SUPPORTED_CHAINS.filter((c) => !c.isOrigin);
338
+ /**
339
+ * Mapping of chain ID to name for backward compatibility.
340
+ */
341
+ export const SupportedChainsMap = Object.fromEntries(Object.entries(MAINNET_CHAINS).map(([id, cfg]) => [Number(id), cfg.name]));
@@ -0,0 +1,3 @@
1
+ export * from './types.js';
2
+ export * from './chains.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './types.js';
2
+ export * from './chains.js';