@rhinestone/sdk 2.0.0-beta.33 → 2.0.0-beta.34

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.
@@ -1,13 +1,20 @@
1
1
  type EvmCaip2ChainId = `eip155:${number}`;
2
2
  type SolanaCaip2ChainId = `solana:${string}`;
3
3
  type TronCaip2ChainId = `tron:${string}`;
4
- type Caip2ChainId = EvmCaip2ChainId | SolanaCaip2ChainId | TronCaip2ChainId;
4
+ type HyperCoreCaip2ChainId = 'hypercore:mainnet';
5
+ type Caip2ChainId = EvmCaip2ChainId | SolanaCaip2ChainId | TronCaip2ChainId | HyperCoreCaip2ChainId;
5
6
  declare function toCaip2(chainId: number): Caip2ChainId;
6
7
  declare function fromCaip2(chainId: string): number;
7
8
  declare function isCaip2(chainId: string): chainId is Caip2ChainId;
8
9
  declare function isEvmCaip2(chainId: string): chainId is EvmCaip2ChainId;
9
- /** True when a numeric chain id corresponds to a known non-eip155 namespace. */
10
+ /**
11
+ * True when a numeric chain id is genuinely non-EVM (Solana / Tron). HyperCore
12
+ * (1337) is EVM-settled, so this is `false` for it even though its wire id is
13
+ * the non-eip155 `hypercore:mainnet` namespace — `registry.ts` /
14
+ * `execution/utils.ts` rely on HyperCore being EVM-classified here. Sourced
15
+ * from the shared-configs registry `vmType`.
16
+ */
10
17
  declare function isNonEvmChainId(chainId: number): boolean;
11
- export type { Caip2ChainId, EvmCaip2ChainId, SolanaCaip2ChainId, TronCaip2ChainId, };
18
+ export type { Caip2ChainId, EvmCaip2ChainId, SolanaCaip2ChainId, TronCaip2ChainId, HyperCoreCaip2ChainId, };
12
19
  export { fromCaip2, isCaip2, isEvmCaip2, isNonEvmChainId, toCaip2 };
13
20
  //# sourceMappingURL=caip2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"caip2.d.ts","sourceRoot":"","sources":["../../../orchestrator/caip2.ts"],"names":[],"mappings":"AAOA,KAAK,eAAe,GAAG,UAAU,MAAM,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;AAED,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,eAAe,CAE/D;AAED;;;;;;GAMG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,YAAY,EACV,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACtB,CAAA;AACD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,CAAA"}
@@ -1,52 +1,49 @@
1
- // CAIP-2 wire format. Mirrors the orchestrator's caip2.ts namespace registry
2
- // Solana / Tron synthetic numeric ids round-trip through the same CAIP-2
3
- // strings the orchestrator emits, so the SDK and orchestrator agree on the
4
- // wire shape without needing the user to think about CAIP-2 themselves.
1
+ // CAIP-2 wire format. The namespace numeric-id mapping is owned by
2
+ // `@rhinestone/shared-configs` (the same source the orchestrator uses), so the
3
+ // SDK and orchestrator can't drift on the wire shape adding a chain is a
4
+ // shared-configs registry entry, not a hand-maintained table in each repo.
5
+ // HyperCore is a first-class `virtual` registry entry there: its canonical id
6
+ // is `hypercore:mainnet` (EVM-settled, so `isNonEvmChainId(1337) === false`).
5
7
  //
6
8
  // Spec: https://chainagnostic.org/CAIPs/caip-2
9
+ import { chainIdFromCaip2, getCaip2, isNonEvmChainId as isNonEvmChainIdFromRegistry, } from '@rhinestone/shared-configs';
7
10
  const EIP155_CAIP2_REGEX = /^eip155:\d+$/;
8
- const NON_EIP155_CAIP2_REGEX = /^(?:solana|tron):[-_a-zA-Z0-9]{1,32}$/;
9
- // Synthetic numeric ids ↔ CAIP-2 strings for non-eip155 chains. Must match
10
- // the orchestrator's NON_EIP155_CAIP2_TO_ID exactly — these flow over the
11
- // wire and any drift would cause routing failures.
12
- const NON_EIP155_ID_TO_CAIP2 = {
13
- 792703809: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
14
- 728126428: 'tron:0x2b6653dc',
15
- };
16
- const NON_EIP155_CAIP2_TO_ID = Object.fromEntries(Object.entries(NON_EIP155_ID_TO_CAIP2).map(([id, caip2]) => [
17
- caip2,
18
- Number(id),
19
- ]));
20
11
  function toCaip2(chainId) {
21
12
  if (!Number.isInteger(chainId) || chainId < 0) {
22
13
  throw new Error(`Invalid chain id: ${chainId}`);
23
14
  }
24
- const nonEvm = NON_EIP155_ID_TO_CAIP2[chainId];
25
- if (nonEvm)
26
- return nonEvm;
27
- return `eip155:${chainId}`;
15
+ // `getCaip2` returns the registry-declared caip2 (Solana/Tron/HyperCore) or
16
+ // the `eip155:<id>` fallback for plain EVM chains.
17
+ return getCaip2(chainId);
28
18
  }
29
19
  function fromCaip2(chainId) {
20
+ // eip155 references aren't registry-backed (they compose programmatically),
21
+ // so parse them numerically here. This also keeps accepting the legacy
22
+ // `eip155:1337` HyperCore id for back-compat.
30
23
  if (EIP155_CAIP2_REGEX.test(chainId)) {
31
24
  return Number(chainId.slice('eip155:'.length));
32
25
  }
33
- if (NON_EIP155_CAIP2_REGEX.test(chainId)) {
34
- const id = NON_EIP155_CAIP2_TO_ID[chainId];
35
- if (id !== undefined)
36
- return id;
37
- }
26
+ const id = chainIdFromCaip2(chainId);
27
+ if (id !== undefined)
28
+ return id;
38
29
  throw new Error(`Invalid CAIP-2 chain id: ${chainId}`);
39
30
  }
40
31
  function isCaip2(chainId) {
41
32
  if (EIP155_CAIP2_REGEX.test(chainId))
42
33
  return true;
43
- return chainId in NON_EIP155_CAIP2_TO_ID;
34
+ return chainIdFromCaip2(chainId) !== undefined;
44
35
  }
45
36
  function isEvmCaip2(chainId) {
46
37
  return EIP155_CAIP2_REGEX.test(chainId);
47
38
  }
48
- /** True when a numeric chain id corresponds to a known non-eip155 namespace. */
39
+ /**
40
+ * True when a numeric chain id is genuinely non-EVM (Solana / Tron). HyperCore
41
+ * (1337) is EVM-settled, so this is `false` for it even though its wire id is
42
+ * the non-eip155 `hypercore:mainnet` namespace — `registry.ts` /
43
+ * `execution/utils.ts` rely on HyperCore being EVM-classified here. Sourced
44
+ * from the shared-configs registry `vmType`.
45
+ */
49
46
  function isNonEvmChainId(chainId) {
50
- return chainId in NON_EIP155_ID_TO_CAIP2;
47
+ return isNonEvmChainIdFromRegistry(chainId);
51
48
  }
52
49
  export { fromCaip2, isCaip2, isEvmCaip2, isNonEvmChainId, toCaip2 };
@@ -1,6 +1,6 @@
1
1
  declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
2
2
  declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
3
- declare const SDK_VERSION = "2.0.0-beta.33";
3
+ declare const SDK_VERSION = "2.0.0-beta.34";
4
4
  declare const API_VERSION = "2026-04.blanc";
5
5
  export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
6
6
  //# sourceMappingURL=consts.d.ts.map
@@ -1,5 +1,5 @@
1
1
  const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
2
2
  const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
3
- const SDK_VERSION = '2.0.0-beta.33';
3
+ const SDK_VERSION = '2.0.0-beta.34';
4
4
  const API_VERSION = '2026-04.blanc';
5
5
  export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
@@ -1 +1 @@
1
- {"version":3,"file":"destinations.d.ts","sourceRoot":"","sources":["../../../orchestrator/destinations.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,UAAU,cAAc;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE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,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAI5B,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,WAAW,CAAA;IAC1C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,KAAK,gBAAgB,GAAG,KAAK,GAAG,WAAW,CAAA;AAE3C,QAAA,MAAM,aAAa,EAAE,WAKpB,CAAA;AAED,QAAA,MAAM,WAAW,EAAE,WAKlB,CAAA;AAYD,QAAA,MAAM,gBAAgB,EAAE,WAKvB,CAAA;AAOD,iBAAS,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,WAAW,CAEpE;AAKD,iBAAS,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAEnD;AAED,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAC5E,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,WAAW,GACZ,CAAA"}
@@ -22,7 +22,7 @@ const solanaMainnet = {
22
22
  };
23
23
  const tronMainnet = {
24
24
  name: 'Tron',
25
- caip2: 'tron:0x2b6653dc',
25
+ caip2: 'tron:mainnet',
26
26
  kind: 'tvm',
27
27
  nativeCurrency: { name: 'Tron', symbol: 'TRX', decimals: 6 },
28
28
  };
@@ -30,11 +30,15 @@ const tronMainnet = {
30
30
  // and Tron it settles on an EVM chain (HyperEVM, 999), but the deposit is
31
31
  // solver-mediated: the orchestrator builds the core-deposit executions and the
32
32
  // user signs no destination session, so it belongs with the descriptor-addressed
33
- // destinations rather than the standard EVM signing path. The CAIP-2 reference
34
- // is the virtual id; the orchestrator maps 1337 999 for settlement.
33
+ // destinations rather than the standard EVM signing path. The canonical CAIP-2
34
+ // id is `hypercore:mainnet` (the orchestrator emits this since shared-configs
35
+ // 1.6.14 / RHI-4560; `eip155:1337` was wrong because 1337 is the
36
+ // Hardhat/Ganache local chain id). It still resolves to the numeric virtual id
37
+ // 1337, which the orchestrator maps to 999 for settlement; HyperCore stays
38
+ // EVM-addressed (`isNonEvmChainId(1337) === false`).
35
39
  const hyperCoreMainnet = {
36
40
  name: 'HyperCore',
37
- caip2: 'eip155:1337',
41
+ caip2: 'hypercore:mainnet',
38
42
  kind: 'hypercore',
39
43
  nativeCurrency: { name: 'Hyperliquid', symbol: 'HYPE', decimals: 18 },
40
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/sdk",
3
- "version": "2.0.0-beta.33",
3
+ "version": "2.0.0-beta.34",
4
4
  "description": "End-to-end chain abstraction and modularity toolkit",
5
5
  "author": {
6
6
  "name": "Rhinestone",
@@ -75,7 +75,7 @@
75
75
  "access": "public"
76
76
  },
77
77
  "dependencies": {
78
- "@rhinestone/shared-configs": "1.6.7",
78
+ "@rhinestone/shared-configs": "1.7.0",
79
79
  "solady": "^0.1.26"
80
80
  },
81
81
  "peerDependencies": {