@rhinestone/shared-configs 1.8.0 → 1.10.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.
@@ -1 +1 @@
1
- {"version":3,"file":"chainVirtualization.d.ts","sourceRoot":"","sources":["../../src/chainVirtualization.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,SAAS,CAAC;AAIrD,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAI5C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKlE"}
1
+ {"version":3,"file":"chainVirtualization.d.ts","sourceRoot":"","sources":["../../src/chainVirtualization.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,SAAS,CAAC;AAIrD,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAI5C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKlE"}
@@ -44,22 +44,21 @@ function getNonEvmChainIds() {
44
44
  .map(([id]) => Number(id));
45
45
  }
46
46
  /**
47
- * Canonical CAIP-2 string for a chain id. Returns the registry-declared
48
- * `caip2` when present (non-EVM entries today), otherwise falls back to the
49
- * `eip155:<chainId>` form. Throws nothing returns the fallback for any
50
- * unknown id so callers don't need to special-case absent entries.
47
+ * Canonical CAIP-2 string for a chain id, read straight off the registry
48
+ * every entry carries one (see `classifyChainCaip2`). Falls back to the
49
+ * `eip155:<chainId>` form for an id the registry does not know, so callers
50
+ * don't need to special-case an absent entry.
51
51
  */
52
52
  function getCaip2(chainId) {
53
- const entry = chainRegistry[String(chainId)];
54
- if (entry?.caip2)
55
- return entry.caip2;
56
- return `eip155:${chainId}`;
53
+ return chainRegistry[String(chainId)]?.caip2 ?? `eip155:${chainId}`;
57
54
  }
58
55
  /**
59
- * Reverse lookup — find the numeric chain id whose registry-declared
60
- * `caip2` matches the input, or `undefined` if no entry has it. EVM chains
61
- * (which omit `caip2` in the registry) are NOT covered by this lookup;
62
- * callers parse `eip155:N` references on their own.
56
+ * Reverse lookup — the numeric chain id addressed by a CAIP-2 string, or
57
+ * `undefined` if no registry entry uses it.
58
+ *
59
+ * Covers every chain, EVM included: `caip2` is present on all entries, and the
60
+ * generator rejects two chains resolving to the same one, so this is
61
+ * unambiguous.
63
62
  */
64
63
  function chainIdFromCaip2(caip2) {
65
64
  for (const [id, entry] of Object.entries(chainRegistry)) {
@@ -8,6 +8,8 @@ interface Token {
8
8
  pegGroup?: PegGroup;
9
9
  balanceSlot: number | null;
10
10
  approvalSlot: number | null;
11
+ /** Bridge layers that can carry this token on this chain, when known. */
12
+ settlementLayers?: SettlementLayer[];
11
13
  unpriced?: boolean;
12
14
  }
13
15
  interface NativeToken {
@@ -16,6 +18,14 @@ interface NativeToken {
16
18
  symbol: string;
17
19
  decimals: number;
18
20
  }
21
+ interface Explorer {
22
+ /** Origin, no trailing slash. */
23
+ url: string;
24
+ /** Path to an address page, with both slashes (`/address/`). */
25
+ addressPath: string;
26
+ /** Path to a transaction page, with both slashes (`/tx/`). */
27
+ txPath: string;
28
+ }
19
29
  interface Chain {
20
30
  name: string;
21
31
  vmType: VmType;
@@ -23,8 +33,11 @@ interface Chain {
23
33
  network: ChainNetwork;
24
34
  /** Execution stack, for consumers that must synthesise a viem `Chain`. */
25
35
  stack: ChainStack;
26
- /** CAIP-2 chain identifier; populated for non-eip155 chains only. */
27
- caip2?: string;
36
+ /** CAIP-2 chain identifier. Present on every chain: authored for the
37
+ * non-eip155 ones, derived as `eip155:<chainId>` for the rest. */
38
+ caip2: string;
39
+ /** Block explorer, or null for a chain that has none (render plain text). */
40
+ explorer: Explorer | null;
28
41
  /** True for virtual chains (e.g. HyperCore) that settle on another chain. */
29
42
  virtual?: boolean;
30
43
  nativeToken: NativeToken;
@@ -37,5 +50,5 @@ interface Chain {
37
50
  }
38
51
  declare const chains: Record<SupportedChain, Chain>;
39
52
  export { chains };
40
- export type { Chain, Token, NativeToken };
53
+ export type { Chain, Token, NativeToken, Explorer };
41
54
  //# sourceMappingURL=chains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEvJ,UAAU,KAAK;IACb,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,WAAW;I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