@rhinestone/shared-configs 1.10.1 → 1.11.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.
Files changed (67) hide show
  1. package/dist/configs/chains.json +82 -0
  2. package/dist/configs/mainnets.json +6 -0
  3. package/dist/scripts/__tests__/impact-analysis.test.d.ts +0 -1
  4. package/dist/scripts/__tests__/validation.test.d.ts +0 -1
  5. package/dist/scripts/__tests__/validation.test.js +5 -2
  6. package/dist/scripts/generate-abis.d.ts +0 -1
  7. package/dist/scripts/generate.d.ts +0 -1
  8. package/dist/scripts/generate.js +9 -0
  9. package/dist/scripts/impact-analysis.d.ts +0 -1
  10. package/dist/scripts/sync-abis.d.ts +0 -1
  11. package/dist/scripts/validation.d.ts +0 -1
  12. package/dist/src/__tests__/chainFactsClient.test.d.ts +0 -1
  13. package/dist/src/__tests__/chainHasUnpricedTokens.test.d.ts +0 -1
  14. package/dist/src/__tests__/chainVirtualization.test.d.ts +0 -1
  15. package/dist/src/__tests__/chainVirtualization.test.js +71 -18
  16. package/dist/src/abis/index.d.ts +0 -1
  17. package/dist/src/abis/optimized.d.ts +0 -1
  18. package/dist/src/abis/orchestrator.d.ts +0 -1
  19. package/dist/src/abis/relayer.d.ts +0 -1
  20. package/dist/src/chainFactsClient.d.ts +0 -1
  21. package/dist/src/chainVirtualization.d.ts +18 -1
  22. package/dist/src/chainVirtualization.js +24 -0
  23. package/dist/src/chains.d.ts +6 -1
  24. package/dist/src/chains.js +84 -0
  25. package/dist/src/generated/abis.d.ts +0 -1
  26. package/dist/src/generated/chainFactsKey.d.ts +0 -1
  27. package/dist/src/generated/contracts.d.ts +0 -1
  28. package/dist/src/generated/contracts.dev.d.ts +0 -1
  29. package/dist/src/generated/contracts.dev.js +44 -22
  30. package/dist/src/generated/networks.d.ts +2 -1
  31. package/dist/src/generated/networks.js +2 -0
  32. package/dist/src/generated/packageVersion.d.ts +1 -2
  33. package/dist/src/generated/packageVersion.js +1 -1
  34. package/dist/src/hypercore.d.ts +51 -16
  35. package/dist/src/hypercore.js +61 -18
  36. package/dist/src/index.d.ts +5 -6
  37. package/dist/src/index.js +7 -2
  38. package/dist/src/oft.d.ts +0 -1
  39. package/dist/src/types.d.ts +26 -2
  40. package/package.json +7 -2
  41. package/dist/scripts/__tests__/impact-analysis.test.d.ts.map +0 -1
  42. package/dist/scripts/__tests__/validation.test.d.ts.map +0 -1
  43. package/dist/scripts/generate-abis.d.ts.map +0 -1
  44. package/dist/scripts/generate.d.ts.map +0 -1
  45. package/dist/scripts/impact-analysis.d.ts.map +0 -1
  46. package/dist/scripts/sync-abis.d.ts.map +0 -1
  47. package/dist/scripts/validation.d.ts.map +0 -1
  48. package/dist/src/__tests__/chainFactsClient.test.d.ts.map +0 -1
  49. package/dist/src/__tests__/chainHasUnpricedTokens.test.d.ts.map +0 -1
  50. package/dist/src/__tests__/chainVirtualization.test.d.ts.map +0 -1
  51. package/dist/src/abis/index.d.ts.map +0 -1
  52. package/dist/src/abis/optimized.d.ts.map +0 -1
  53. package/dist/src/abis/orchestrator.d.ts.map +0 -1
  54. package/dist/src/abis/relayer.d.ts.map +0 -1
  55. package/dist/src/chainFactsClient.d.ts.map +0 -1
  56. package/dist/src/chainVirtualization.d.ts.map +0 -1
  57. package/dist/src/chains.d.ts.map +0 -1
  58. package/dist/src/generated/abis.d.ts.map +0 -1
  59. package/dist/src/generated/chainFactsKey.d.ts.map +0 -1
  60. package/dist/src/generated/contracts.d.ts.map +0 -1
  61. package/dist/src/generated/contracts.dev.d.ts.map +0 -1
  62. package/dist/src/generated/networks.d.ts.map +0 -1
  63. package/dist/src/generated/packageVersion.d.ts.map +0 -1
  64. package/dist/src/hypercore.d.ts.map +0 -1
  65. package/dist/src/index.d.ts.map +0 -1
  66. package/dist/src/oft.d.ts.map +0 -1
  67. package/dist/src/types.d.ts.map +0 -1
@@ -665,6 +665,10 @@
665
665
  "symbol": "HYPE"
666
666
  },
667
667
  "network": "mainnet",
668
+ "roles": {
669
+ "destination": false,
670
+ "origin": true
671
+ },
668
672
  "settlementLayers": [],
669
673
  "stack": "vanilla",
670
674
  "swapQuoters": [],
@@ -1383,6 +1387,84 @@
1383
1387
  "symbol": "WETH"
1384
1388
  }
1385
1389
  },
1390
+ "1337001": {
1391
+ "caip2": "hypercore:spot",
1392
+ "explorer": {
1393
+ "addressPath": "/explorer/address/",
1394
+ "txPath": "/explorer/tx/",
1395
+ "url": "https://app.hyperliquid.xyz"
1396
+ },
1397
+ "name": "HyperCore Spot",
1398
+ "nativeToken": {
1399
+ "address": "0x0000000000000000000000000000000000000000",
1400
+ "decimals": 18,
1401
+ "symbol": "HYPE"
1402
+ },
1403
+ "network": "mainnet",
1404
+ "roles": {
1405
+ "destination": true,
1406
+ "origin": false
1407
+ },
1408
+ "settlementLayers": [],
1409
+ "stack": "vanilla",
1410
+ "swapQuoters": [],
1411
+ "tokens": [
1412
+ {
1413
+ "address": "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
1414
+ "approvalSlot": null,
1415
+ "balanceSlot": null,
1416
+ "decimals": 6,
1417
+ "pegGroup": "USD",
1418
+ "symbol": "USDC"
1419
+ }
1420
+ ],
1421
+ "virtual": true,
1422
+ "vmType": "evm",
1423
+ "wrappedNativeToken": {
1424
+ "address": "0x0000000000000000000000000000000000000000",
1425
+ "decimals": 18,
1426
+ "symbol": "HYPE"
1427
+ }
1428
+ },
1429
+ "1337002": {
1430
+ "caip2": "hypercore:perp",
1431
+ "explorer": {
1432
+ "addressPath": "/explorer/address/",
1433
+ "txPath": "/explorer/tx/",
1434
+ "url": "https://app.hyperliquid.xyz"
1435
+ },
1436
+ "name": "HyperCore Perp",
1437
+ "nativeToken": {
1438
+ "address": "0x0000000000000000000000000000000000000000",
1439
+ "decimals": 18,
1440
+ "symbol": "HYPE"
1441
+ },
1442
+ "network": "mainnet",
1443
+ "roles": {
1444
+ "destination": true,
1445
+ "origin": false
1446
+ },
1447
+ "settlementLayers": [],
1448
+ "stack": "vanilla",
1449
+ "swapQuoters": [],
1450
+ "tokens": [
1451
+ {
1452
+ "address": "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
1453
+ "approvalSlot": null,
1454
+ "balanceSlot": null,
1455
+ "decimals": 6,
1456
+ "pegGroup": "USD",
1457
+ "symbol": "USDC"
1458
+ }
1459
+ ],
1460
+ "virtual": true,
1461
+ "vmType": "evm",
1462
+ "wrappedNativeToken": {
1463
+ "address": "0x0000000000000000000000000000000000000000",
1464
+ "decimals": 18,
1465
+ "symbol": "HYPE"
1466
+ }
1467
+ },
1386
1468
  "11155111": {
1387
1469
  "caip2": "eip155:11155111",
1388
1470
  "explorer": {
@@ -101,6 +101,12 @@
101
101
  "Alchemy"
102
102
  ]
103
103
  },
104
+ "1337001": {
105
+ "providers": []
106
+ },
107
+ "1337002": {
108
+ "providers": []
109
+ },
104
110
  "728126428": {
105
111
  "providers": []
106
112
  },
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=impact-analysis.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=validation.test.d.ts.map
@@ -368,12 +368,15 @@ function errorsFor(chain) {
368
368
  (0, bun_test_1.it)("leaves every shipped chain with a well-formed explorer", () => {
369
369
  // HyperCore was the last null. Its explorer is authored (viem ships no
370
370
  // HyperCore chain) and must stay Hyperliquid's own — a HyperCore txHash is
371
- // a Core L1 hash that a HyperEVM scanner cannot resolve.
371
+ // a Core L1 hash that a HyperEVM scanner cannot resolve. Both delivery
372
+ // venues are the same Core L1, so both carry it.
372
373
  const withoutExplorer = Object.entries(index_1.chainRegistry)
373
374
  .filter(([, e]) => e.explorer == null)
374
375
  .map(([id]) => id);
375
376
  (0, bun_test_1.expect)(withoutExplorer).toEqual([]);
376
- (0, bun_test_1.expect)(index_1.chainRegistry["1337"].explorer.url).toBe("https://app.hyperliquid.xyz");
377
+ for (const venueId of ["1337001", "1337002"]) {
378
+ (0, bun_test_1.expect)(index_1.chainRegistry[venueId].explorer.url, venueId).toBe("https://app.hyperliquid.xyz");
379
+ }
377
380
  for (const [id, entry] of Object.entries(index_1.chainRegistry)) {
378
381
  const explorer = entry.explorer;
379
382
  if (explorer === null)
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=generate-abis.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=generate.d.ts.map
@@ -134,6 +134,9 @@ function renderChains(chainRegistry, mainnets, testnets) {
134
134
  " explorer: Explorer | null;",
135
135
  " /** True for virtual chains (e.g. HyperCore) that settle on another chain. */",
136
136
  " virtual?: boolean;",
137
+ " /** Which directions of transfer the chain supports; absent means both.",
138
+ " * Read via `canBeOrigin` / `canBeDestination` rather than directly. */",
139
+ " roles?: { origin: boolean; destination: boolean };",
137
140
  " nativeToken: NativeToken;",
138
141
  " wrappedNativeToken: NativeToken;",
139
142
  " tokens: Token[];",
@@ -244,6 +247,7 @@ const mapWildcardDeployments = (deployments) => {
244
247
  samechainAdapter: deployments.samechainAdapterArbiterImpl,
245
248
  smartSessionEmissary: deployments.smartSessionEmissary,
246
249
  smartSessionLens: deployments.smartSessionLens,
250
+ swapper: deployments.swapper,
247
251
  });
248
252
  };
249
253
  const mapChainDeployments = (deployments, external) => {
@@ -273,6 +277,11 @@ const mapChainDeployments = (deployments, external) => {
273
277
  appFeeCollector: external?.contracts?.appFeeCollector,
274
278
  appFeePot: external?.contracts?.appFeePot,
275
279
  oftProxy: deployments.oftProxy,
280
+ // Swapper is CREATE2-deterministic so it dedups to the wildcard scope
281
+ // (mapWildcardDeployments); its TokenTransferProxy is emitted per-chain as an
282
+ // external/derived address, so it's mapped here (RHI-4896).
283
+ swapper: deployments.swapper,
284
+ tokenTransferProxy: external?.tokenTransferProxy?.address,
276
285
  });
277
286
  };
278
287
  function collectContracts(addrConfig) {
@@ -28,4 +28,3 @@ export interface ImpactAnalysis {
28
28
  }
29
29
  export declare function analyzeImpact(base: ChainRegistry, pr: ChainRegistry): ImpactAnalysis;
30
30
  export declare function renderMarkdown(analysis: ImpactAnalysis): string;
31
- //# sourceMappingURL=impact-analysis.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=sync-abis.d.ts.map
@@ -171,4 +171,3 @@ export declare function validateChainConfig(chains: ChainRegistry): ValidationRe
171
171
  * Returns an empty string when there are no issues.
172
172
  */
173
173
  export declare function formatValidationIssues(result: ValidationResult): string;
174
- //# sourceMappingURL=validation.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=chainFactsClient.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=chainHasUnpricedTokens.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=chainVirtualization.test.d.ts.map
@@ -2,15 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const bun_test_1 = require("bun:test");
4
4
  const index_1 = require("../index");
5
- const HYPERCORE_CAIP2 = "hypercore:mainnet";
5
+ const HYPERCORE_SPOT_CAIP2 = "hypercore:spot";
6
+ const HYPERCORE_PERP_CAIP2 = "hypercore:perp";
6
7
  const SOLANA_CAIP2 = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
7
8
  const TRON_CAIP2 = "tron:mainnet";
8
9
  (0, bun_test_1.describe)("chainVirtualization", () => {
9
10
  (0, bun_test_1.describe)("getCaip2", () => {
10
- (0, bun_test_1.it)("emits the canonical hypercore id for HyperCore (not eip155:1337)", () => {
11
- // Data-driven from the `hypercore:mainnet` registry entry, exactly like
12
- // Solana/Tron — no special-casing in the codec.
13
- (0, bun_test_1.expect)((0, index_1.getCaip2)(index_1.HYPERCORE_CHAIN_ID)).toBe(HYPERCORE_CAIP2);
11
+ (0, bun_test_1.it)("emits a distinct canonical id per HyperCore venue", () => {
12
+ // Data-driven from the registry entries, exactly like Solana/Tron — no
13
+ // special-casing in the codec. The two must not collapse: the venue is
14
+ // the whole point of splitting them (RHI-5510).
15
+ (0, bun_test_1.expect)((0, index_1.getCaip2)(index_1.HYPERCORE_SPOT_CHAIN_ID)).toBe(HYPERCORE_SPOT_CAIP2);
16
+ (0, bun_test_1.expect)((0, index_1.getCaip2)(index_1.HYPERCORE_PERP_CHAIN_ID)).toBe(HYPERCORE_PERP_CAIP2);
17
+ (0, bun_test_1.expect)(index_1.HYPERCORE_SPOT_CHAIN_ID).not.toBe(index_1.HYPERCORE_PERP_CHAIN_ID);
14
18
  });
15
19
  (0, bun_test_1.it)("emits the registry caip2 for non-EVM chains", () => {
16
20
  (0, bun_test_1.expect)((0, index_1.getCaip2)(index_1.MainnetNetwork.SOLANA)).toBe(SOLANA_CAIP2);
@@ -23,8 +27,15 @@ const TRON_CAIP2 = "tron:mainnet";
23
27
  });
24
28
  });
25
29
  (0, bun_test_1.describe)("chainIdFromCaip2", () => {
26
- (0, bun_test_1.it)("resolves the canonical hypercore id back to 1337", () => {
27
- (0, bun_test_1.expect)((0, index_1.chainIdFromCaip2)(HYPERCORE_CAIP2)).toBe(index_1.HYPERCORE_CHAIN_ID);
30
+ (0, bun_test_1.it)("resolves each HyperCore venue back to its own chain id", () => {
31
+ (0, bun_test_1.expect)((0, index_1.chainIdFromCaip2)(HYPERCORE_SPOT_CAIP2)).toBe(index_1.HYPERCORE_SPOT_CHAIN_ID);
32
+ (0, bun_test_1.expect)((0, index_1.chainIdFromCaip2)(HYPERCORE_PERP_CAIP2)).toBe(index_1.HYPERCORE_PERP_CHAIN_ID);
33
+ });
34
+ (0, bun_test_1.it)("resolves the origin id, which is not a delivery venue", () => {
35
+ // `hypercore:mainnet` is the Core L1 as a deposit SOURCE, so it still
36
+ // resolves. What stops it being used as a delivery target is its role,
37
+ // not its absence — see the roles tests below.
38
+ (0, bun_test_1.expect)((0, index_1.chainIdFromCaip2)("hypercore:mainnet")).toBe(1337);
28
39
  });
29
40
  (0, bun_test_1.it)("resolves registry non-EVM caip2 strings", () => {
30
41
  (0, bun_test_1.expect)((0, index_1.chainIdFromCaip2)(SOLANA_CAIP2)).toBe(index_1.MainnetNetwork.SOLANA);
@@ -47,22 +58,64 @@ const TRON_CAIP2 = "tron:mainnet";
47
58
  for (const id of [
48
59
  index_1.MainnetNetwork.SOLANA,
49
60
  index_1.MainnetNetwork.TRON,
50
- index_1.HYPERCORE_CHAIN_ID,
61
+ index_1.HYPERCORE_SPOT_CHAIN_ID,
62
+ index_1.HYPERCORE_PERP_CHAIN_ID,
51
63
  ]) {
52
64
  (0, bun_test_1.expect)((0, index_1.chainIdFromCaip2)((0, index_1.getCaip2)(id))).toBe(id);
53
65
  }
54
66
  });
67
+ (0, bun_test_1.describe)("chain roles", () => {
68
+ (0, bun_test_1.it)("splits HyperCore by direction: Core L1 originates, venues receive", () => {
69
+ // Deposits arrive from the Core L1 without naming a venue; a delivery
70
+ // must name the account it credits. Declaring it here is what makes a
71
+ // perp *deposit source* unrepresentable rather than merely unimplemented,
72
+ // and all three ids share the `hypercore:` namespace — so a namespace
73
+ // switch could not draw this line at any level of effort.
74
+ (0, bun_test_1.expect)((0, index_1.canBeOrigin)(1337)).toBe(true);
75
+ (0, bun_test_1.expect)((0, index_1.canBeDestination)(1337)).toBe(false);
76
+ for (const venue of [index_1.HYPERCORE_SPOT_CHAIN_ID, index_1.HYPERCORE_PERP_CHAIN_ID]) {
77
+ (0, bun_test_1.expect)((0, index_1.canBeOrigin)(venue)).toBe(false);
78
+ (0, bun_test_1.expect)((0, index_1.canBeDestination)(venue)).toBe(true);
79
+ }
80
+ });
81
+ (0, bun_test_1.it)("defaults both directions for chains that declare no roles", () => {
82
+ // Absent `roles` must mean both, so adding the field is a no-op for every
83
+ // chain that predates it. Tron is in this list deliberately: a consumer
84
+ // may advertise less than the registry permits, and one does, but that is
85
+ // the consumer's policy and must not be pushed down here.
86
+ for (const id of [
87
+ index_1.MainnetNetwork.ETHEREUM,
88
+ index_1.MainnetNetwork.BASE,
89
+ index_1.MainnetNetwork.SOLANA,
90
+ index_1.MainnetNetwork.TRON,
91
+ ]) {
92
+ (0, bun_test_1.expect)((0, index_1.canBeOrigin)(id)).toBe(true);
93
+ (0, bun_test_1.expect)((0, index_1.canBeDestination)(id)).toBe(true);
94
+ }
95
+ });
96
+ (0, bun_test_1.it)("defaults both directions for an unknown chain id", () => {
97
+ (0, bun_test_1.expect)((0, index_1.canBeOrigin)(999_999_999)).toBe(true);
98
+ (0, bun_test_1.expect)((0, index_1.canBeDestination)(999_999_999)).toBe(true);
99
+ });
100
+ });
55
101
  (0, bun_test_1.describe)("HyperCore stays EVM-classified", () => {
56
- (0, bun_test_1.it)("is a virtual EVM registry entry, not a non-EVM chain", () => {
57
- // The canonical id changing must not flip HyperCore's routing — it is
58
- // EVM-addressed and settles on HyperEVM (999).
59
- const entry = index_1.chainRegistry[String(index_1.HYPERCORE_CHAIN_ID)];
60
- (0, bun_test_1.expect)(entry).toBeDefined();
61
- (0, bun_test_1.expect)(entry.vmType).toBe("evm");
62
- (0, bun_test_1.expect)(entry.virtual).toBe(true);
63
- (0, bun_test_1.expect)(entry.caip2).toBe(HYPERCORE_CAIP2);
64
- (0, bun_test_1.expect)((0, index_1.isNonEvmChainId)(index_1.HYPERCORE_CHAIN_ID)).toBe(false);
65
- (0, bun_test_1.expect)((0, index_1.getNonEvmChainIds)()).not.toContain(index_1.HYPERCORE_CHAIN_ID);
102
+ (0, bun_test_1.it)("both venues are virtual EVM registry entries, not non-EVM chains", () => {
103
+ // Splitting by venue must not flip HyperCore's routing — both are
104
+ // EVM-addressed and settle on HyperEVM (999). Classifying either as
105
+ // non-EVM would make `recipient` required and skip address
106
+ // normalisation, neither of which is true here.
107
+ for (const [id, caip2] of [
108
+ [index_1.HYPERCORE_SPOT_CHAIN_ID, HYPERCORE_SPOT_CAIP2],
109
+ [index_1.HYPERCORE_PERP_CHAIN_ID, HYPERCORE_PERP_CAIP2],
110
+ ]) {
111
+ const entry = index_1.chainRegistry[String(id)];
112
+ (0, bun_test_1.expect)(entry).toBeDefined();
113
+ (0, bun_test_1.expect)(entry.vmType).toBe("evm");
114
+ (0, bun_test_1.expect)(entry.virtual).toBe(true);
115
+ (0, bun_test_1.expect)(entry.caip2).toBe(caip2);
116
+ (0, bun_test_1.expect)((0, index_1.isNonEvmChainId)(id)).toBe(false);
117
+ (0, bun_test_1.expect)((0, index_1.getNonEvmChainIds)()).not.toContain(id);
118
+ }
66
119
  });
67
120
  (0, bun_test_1.it)("still classifies genuine non-EVM chains", () => {
68
121
  (0, bun_test_1.expect)((0, index_1.isNonEvmChainId)(index_1.MainnetNetwork.SOLANA)).toBe(true);
@@ -1,3 +1,2 @@
1
1
  export { routerAbi, routerHelperAbi, emissaryAbi, intentExecutorAbi, safeRelayExecutorAbi, intentExecutorAdapterAbi, intentExecutorAdapterGasRefundAbi, acrossAdapterAbi, ecoAdapterAbi, relayAdapterAbi, sameChainAdapterAbi, paymasterAbi, multicallAbi, multicallHandlerAbi, acrossAdapterOptimizedAbi, ecoAdapterOptimizedAbi, relayAdapterOptimizedAbi, routeTupleAbi, rewardTupleAbi, multicallAbi as multiCallAbi, singlecallAdapterAbi, oftFeeAdapterAbi, oftAdapterProxyAbi, } from "./orchestrator";
2
2
  export { directRouteAbi, wethAbi, relayerPotV1Abi, singleCallAbi, } from "./relayer";
3
- //# sourceMappingURL=index.d.ts.map
@@ -340,4 +340,3 @@ export declare const relayAdapterOptimizedAbi: readonly [{
340
340
  readonly internalType: "bytes32";
341
341
  }];
342
342
  }];
343
- //# sourceMappingURL=optimized.d.ts.map
@@ -8158,4 +8158,3 @@ export declare const relayAdapterOptimizedAbi: readonly [{
8158
8158
  readonly internalType: "bytes32";
8159
8159
  }];
8160
8160
  }];
8161
- //# sourceMappingURL=orchestrator.d.ts.map
@@ -1218,4 +1218,3 @@ export declare const directRouteAbi: readonly [{
1218
1218
  }];
1219
1219
  readonly stateMutability: "nonpayable";
1220
1220
  }];
1221
- //# sourceMappingURL=relayer.d.ts.map
@@ -54,4 +54,3 @@ interface ChainFactsClient {
54
54
  declare function createChainFactsClient(options?: ChainFactsClientOptions): ChainFactsClient;
55
55
  export { createChainFactsClient };
56
56
  export type { ChainFactsClient, ChainFactsClientOptions, ChainFactsErrorPhase, ChainFactsPayload, ChainFactsSnapshot, ChainFactsSource, };
57
- //# sourceMappingURL=chainFactsClient.d.ts.map
@@ -1,6 +1,24 @@
1
1
  import type { VmType } from "./types";
2
2
  /** VM kind for a chain id; defaults to `'evm'` for unknown ids. */
3
3
  export declare function getVmType(chainId: number): VmType;
4
+ /**
5
+ * Whether funds can ARRIVE from this chain — i.e. it is a valid deposit source.
6
+ *
7
+ * Absent `roles` means both directions, so every ordinary chain answers true
8
+ * without declaring anything. A consumer may narrow this further; it may not
9
+ * widen it.
10
+ */
11
+ export declare function canBeOrigin(chainId: number): boolean;
12
+ /**
13
+ * Whether funds can be DELIVERED to this chain — i.e. it is a valid intent
14
+ * destination.
15
+ *
16
+ * False for `hypercore:mainnet`: deposits arrive from the Core L1 venue-agnostically,
17
+ * but a delivery must name the account it credits, so `hypercore:spot` /
18
+ * `hypercore:perp` are the only HyperCore destinations. Answering that from data
19
+ * is what lets a consumer refuse the ambiguous id without knowing its number.
20
+ */
21
+ export declare function canBeDestination(chainId: number): boolean;
4
22
  /** True when the chain id's vmType is not `'evm'` (Solana, Tron today). */
5
23
  export declare function isNonEvmChainId(chainId: number): boolean;
6
24
  /**
@@ -24,4 +42,3 @@ export declare function getCaip2(chainId: number): string;
24
42
  * unambiguous.
25
43
  */
26
44
  export declare function chainIdFromCaip2(caip2: string): number | undefined;
27
- //# sourceMappingURL=chainVirtualization.d.ts.map
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getVmType = getVmType;
7
+ exports.canBeOrigin = canBeOrigin;
8
+ exports.canBeDestination = canBeDestination;
7
9
  exports.isNonEvmChainId = isNonEvmChainId;
8
10
  exports.getNonEvmChainIds = getNonEvmChainIds;
9
11
  exports.getCaip2 = getCaip2;
@@ -30,6 +32,28 @@ const chainRegistry = chains_json_1.default;
30
32
  function getVmType(chainId) {
31
33
  return chainRegistry[String(chainId)]?.vmType ?? "evm";
32
34
  }
35
+ /**
36
+ * Whether funds can ARRIVE from this chain — i.e. it is a valid deposit source.
37
+ *
38
+ * Absent `roles` means both directions, so every ordinary chain answers true
39
+ * without declaring anything. A consumer may narrow this further; it may not
40
+ * widen it.
41
+ */
42
+ function canBeOrigin(chainId) {
43
+ return chainRegistry[String(chainId)]?.roles?.origin ?? true;
44
+ }
45
+ /**
46
+ * Whether funds can be DELIVERED to this chain — i.e. it is a valid intent
47
+ * destination.
48
+ *
49
+ * False for `hypercore:mainnet`: deposits arrive from the Core L1 venue-agnostically,
50
+ * but a delivery must name the account it credits, so `hypercore:spot` /
51
+ * `hypercore:perp` are the only HyperCore destinations. Answering that from data
52
+ * is what lets a consumer refuse the ambiguous id without knowing its number.
53
+ */
54
+ function canBeDestination(chainId) {
55
+ return chainRegistry[String(chainId)]?.roles?.destination ?? true;
56
+ }
33
57
  /** True when the chain id's vmType is not `'evm'` (Solana, Tron today). */
34
58
  function isNonEvmChainId(chainId) {
35
59
  return getVmType(chainId) !== "evm";
@@ -40,6 +40,12 @@ interface Chain {
40
40
  explorer: Explorer | null;
41
41
  /** True for virtual chains (e.g. HyperCore) that settle on another chain. */
42
42
  virtual?: boolean;
43
+ /** Which directions of transfer the chain supports; absent means both.
44
+ * Read via `canBeOrigin` / `canBeDestination` rather than directly. */
45
+ roles?: {
46
+ origin: boolean;
47
+ destination: boolean;
48
+ };
43
49
  nativeToken: NativeToken;
44
50
  wrappedNativeToken: NativeToken;
45
51
  tokens: Token[];
@@ -51,4 +57,3 @@ interface Chain {
51
57
  declare const chains: Record<SupportedChain, Chain>;
52
58
  export { chains };
53
59
  export type { Chain, Token, NativeToken, Explorer };
54
- //# sourceMappingURL=chains.d.ts.map
@@ -706,6 +706,10 @@ const chains = {
706
706
  "symbol": "HYPE"
707
707
  },
708
708
  "network": "mainnet",
709
+ "roles": {
710
+ "destination": false,
711
+ "origin": true
712
+ },
709
713
  "settlementLayers": [],
710
714
  "stack": "vanilla",
711
715
  "swapQuoters": [],
@@ -1467,6 +1471,86 @@ const chains = {
1467
1471
  "Alchemy"
1468
1472
  ]
1469
1473
  },
1474
+ "1337001": {
1475
+ "caip2": "hypercore:spot",
1476
+ "explorer": {
1477
+ "addressPath": "/explorer/address/",
1478
+ "txPath": "/explorer/tx/",
1479
+ "url": "https://app.hyperliquid.xyz"
1480
+ },
1481
+ "name": "HyperCore Spot",
1482
+ "nativeToken": {
1483
+ "address": "0x0000000000000000000000000000000000000000",
1484
+ "decimals": 18,
1485
+ "symbol": "HYPE"
1486
+ },
1487
+ "network": "mainnet",
1488
+ "roles": {
1489
+ "destination": true,
1490
+ "origin": false
1491
+ },
1492
+ "settlementLayers": [],
1493
+ "stack": "vanilla",
1494
+ "swapQuoters": [],
1495
+ "tokens": [
1496
+ {
1497
+ "address": "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
1498
+ "approvalSlot": null,
1499
+ "balanceSlot": null,
1500
+ "decimals": 6,
1501
+ "pegGroup": "USD",
1502
+ "symbol": "USDC"
1503
+ }
1504
+ ],
1505
+ "virtual": true,
1506
+ "vmType": "evm",
1507
+ "wrappedNativeToken": {
1508
+ "address": "0x0000000000000000000000000000000000000000",
1509
+ "decimals": 18,
1510
+ "symbol": "HYPE"
1511
+ },
1512
+ "providers": []
1513
+ },
1514
+ "1337002": {
1515
+ "caip2": "hypercore:perp",
1516
+ "explorer": {
1517
+ "addressPath": "/explorer/address/",
1518
+ "txPath": "/explorer/tx/",
1519
+ "url": "https://app.hyperliquid.xyz"
1520
+ },
1521
+ "name": "HyperCore Perp",
1522
+ "nativeToken": {
1523
+ "address": "0x0000000000000000000000000000000000000000",
1524
+ "decimals": 18,
1525
+ "symbol": "HYPE"
1526
+ },
1527
+ "network": "mainnet",
1528
+ "roles": {
1529
+ "destination": true,
1530
+ "origin": false
1531
+ },
1532
+ "settlementLayers": [],
1533
+ "stack": "vanilla",
1534
+ "swapQuoters": [],
1535
+ "tokens": [
1536
+ {
1537
+ "address": "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
1538
+ "approvalSlot": null,
1539
+ "balanceSlot": null,
1540
+ "decimals": 6,
1541
+ "pegGroup": "USD",
1542
+ "symbol": "USDC"
1543
+ }
1544
+ ],
1545
+ "virtual": true,
1546
+ "vmType": "evm",
1547
+ "wrappedNativeToken": {
1548
+ "address": "0x0000000000000000000000000000000000000000",
1549
+ "decimals": 18,
1550
+ "symbol": "HYPE"
1551
+ },
1552
+ "providers": []
1553
+ },
1470
1554
  "11155111": {
1471
1555
  "caip2": "eip155:11155111",
1472
1556
  "explorer": {
@@ -33,4 +33,3 @@ declare const abiSignatures: {
33
33
  };
34
34
  export { abiSignatures };
35
35
  export type AbiSignatureMap = typeof abiSignatures;
36
- //# sourceMappingURL=abis.d.ts.map
@@ -2,4 +2,3 @@ declare const CHAIN_FACTS_PUBLIC_KEY = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQ5n8
2
2
  /** Where the signed chain-facts artifact is published. */
3
3
  declare const CHAIN_FACTS_LATEST_URL = "https://facts.rhinestone.dev/latest.json";
4
4
  export { CHAIN_FACTS_PUBLIC_KEY, CHAIN_FACTS_LATEST_URL };
5
- //# sourceMappingURL=chainFactsKey.d.ts.map
@@ -3,4 +3,3 @@ type ContractAddresses = Record<string, Record<string, Address>>;
3
3
  declare const contractAddresses: ContractAddresses;
4
4
  export { contractAddresses };
5
5
  export type { ContractAddresses };
6
- //# sourceMappingURL=contracts.d.ts.map
@@ -3,4 +3,3 @@ type ContractAddresses = Record<string, Record<string, Address>>;
3
3
  declare const contractAddresses: ContractAddresses;
4
4
  export { contractAddresses };
5
5
  export type { ContractAddresses };
6
- //# sourceMappingURL=contracts.dev.d.ts.map