@rhinestone/shared-configs 2.0.0 → 2.1.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,2 +1,2 @@
1
- declare const PACKAGE_VERSION = "2.0.0";
1
+ declare const PACKAGE_VERSION = "2.1.0";
2
2
  export { PACKAGE_VERSION };
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PACKAGE_VERSION = void 0;
4
4
  // Auto-generated by scripts/generate.ts. Do not edit manually.
5
- const PACKAGE_VERSION = "2.0.0";
5
+ const PACKAGE_VERSION = "2.1.0";
6
6
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -1,6 +1,6 @@
1
1
  import { contractAddresses } from "./generated/contracts";
2
2
  import { contractAddresses as contractAddressesDev } from "./generated/contracts.dev";
3
- import type { CctpChainConfig, ChainEntry, ChainExplorer, ChainItem, ChainList, ChainNetwork, ChainStack, ChainRegistry, ChainRoles, NearChainConfig, OftChainConfig, ProviderName, ProviderRegistry, RhinoChainConfig, SettlementConfig, SettlementLayer, SupportedChain, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedTestnet, SwapQuoter } from "./types";
3
+ import type { CctpChainConfig, ChainEntry, ChainExplorer, ChainItem, ChainList, ChainNetwork, ChainStack, ChainRegistry, ChainRoles, NearChainConfig, OftChainConfig, ProviderName, ProviderRegistry, RhinoChainConfig, SettlementConfig, SettlementLayer, SupportedChain, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedTestnet, SwapQuoter, TokenAuthorization, TokenAuthorizationDomain, TokenAuthorizationStandard, TokenEntry } from "./types";
4
4
  import { chains, MainnetNetwork, mainnetChains, OPStackChains, TestnetNetwork, testnetChains } from "./types";
5
5
  import type { PegGroup } from "./types";
6
6
  import { getOftConfig, getSupportedOftTokens, hasOftSupport, OFT_REGISTRY } from "./oft";
@@ -16,5 +16,5 @@ declare const mainnetChainList: ChainList;
16
16
  declare const testnetChainList: ChainList;
17
17
  declare function chainHasUnpricedTokens(chainId: number): boolean;
18
18
  export { chainRegistry, providerRegistry, mainnetChainList, testnetChainList, contractAddresses, contractAddressesDev, chains, mainnetChains, testnetChains, MainnetNetwork, OPStackChains, TestnetNetwork, OFT_REGISTRY, getOftConfig, hasOftSupport, getSupportedOftTokens, chainHasUnpricedTokens, HYPERCORE_SPOT_CHAIN_ID, HYPERCORE_PERP_CHAIN_ID, HYPERCORE_ORIGIN_CHAIN_ID, getHyperCoreDestinationDex, HYPERCORE_SETTLEMENT_CHAIN_ID, CORE_WRITER_PRECOMPILE, CORE_DEPOSIT_WALLET, HYPERCORE_SPOT_DEX, HYPERCORE_DEFAULT_PERP_DEX, HYPERCORE_USDC_ACTIVATION_FEE, getApproveCoreDepositWalletCall, getDepositForCall, isHyperCoreChainId, resolveSettlementChainId, canBeOrigin, canBeDestination, isNonEvmChainId, getNonEvmChainIds, getCaip2, chainIdFromCaip2, createChainFactsClient, CHAIN_FACTS_LATEST_URL, CHAIN_FACTS_PUBLIC_KEY, };
19
- export type { ChainEntry, ChainExplorer, ChainItem, ChainList, ChainNetwork, ChainStack, ChainRegistry, ChainRoles, ProviderRegistry, ProviderName, SwapQuoter, SupportedMainnet, SupportedTestnet, SupportedChain, SupportedOPStackMainnet, SupportedOPStackTestnet, SettlementLayer, SettlementConfig, CctpChainConfig, NearChainConfig, OftChainConfig, RhinoChainConfig, OftConfig, PegGroup, ChainFactsClient, ChainFactsClientOptions, ChainFactsErrorPhase, ChainFactsPayload, ChainFactsSnapshot, ChainFactsSource, };
19
+ export type { ChainEntry, ChainExplorer, ChainItem, ChainList, ChainNetwork, ChainStack, ChainRegistry, ChainRoles, ProviderRegistry, ProviderName, SwapQuoter, SupportedMainnet, SupportedTestnet, SupportedChain, SupportedOPStackMainnet, SupportedOPStackTestnet, SettlementLayer, TokenAuthorization, TokenAuthorizationDomain, TokenAuthorizationStandard, TokenEntry, SettlementConfig, CctpChainConfig, NearChainConfig, OftChainConfig, RhinoChainConfig, OftConfig, PegGroup, ChainFactsClient, ChainFactsClientOptions, ChainFactsErrorPhase, ChainFactsPayload, ChainFactsSnapshot, ChainFactsSource, };
20
20
  export * from "./abis";
@@ -1,5 +1,5 @@
1
1
  /** biome-ignore-all lint/style/useLiteralEnumMembers: readability */
2
- import type { Address } from 'viem';
2
+ import type { Address, Hex } from 'viem';
3
3
  import { chains, MainnetNetwork, mainnetChains, OPStackChains, TestnetNetwork, testnetChains } from './generated/networks';
4
4
  type EnumNumberValues<E> = Extract<E[keyof E], number>;
5
5
  type SupportedTestnet = EnumNumberValues<typeof TestnetNetwork>;
@@ -27,6 +27,39 @@ type ChainNetwork = 'mainnet' | 'testnet';
27
27
  * to keep working.
28
28
  */
29
29
  type ChainStack = 'op-stack' | 'zksync' | 'celo' | 'vanilla';
30
+ /** Token-native EIP-712 authorization standards understood by consumers. */
31
+ type TokenAuthorizationStandard = 'erc3009' | 'erc2612';
32
+ /** Exact EIP-712 domain fields used by the deployed token. */
33
+ interface CanonicalTokenAuthorizationDomain {
34
+ name: string;
35
+ version: string;
36
+ chainId: number;
37
+ verifyingContract: Address;
38
+ salt?: never;
39
+ }
40
+ /** Legacy Polygon-style domain that encodes the chain id as a bytes32 salt. */
41
+ interface SaltedTokenAuthorizationDomain {
42
+ name: string;
43
+ version: string;
44
+ verifyingContract: Address;
45
+ salt: Hex;
46
+ chainId?: never;
47
+ }
48
+ type TokenAuthorizationDomain = CanonicalTokenAuthorizationDomain | SaltedTokenAuthorizationDomain;
49
+ /**
50
+ * Signed authorizations implemented by the token contract itself.
51
+ *
52
+ * Permit2 is intentionally not represented here: it is an external contract
53
+ * and depends on the owner's token allowance, not on token implementation.
54
+ */
55
+ interface TokenAuthorization {
56
+ standards: TokenAuthorizationStandard[];
57
+ domain: TokenAuthorizationDomain;
58
+ /** Exact value returned by the deployed token's DOMAIN_SEPARATOR(). */
59
+ domainSeparator: Hex;
60
+ /** Whether these token-native signature paths accept EOAs only. */
61
+ eoaOnly: boolean;
62
+ }
30
63
  declare const PEG_GROUPS: Record<PegGroup, {
31
64
  tolerance: number;
32
65
  }>;
@@ -39,6 +72,18 @@ interface TokenEntry {
39
72
  pegGroup?: PegGroup;
40
73
  balanceSlot: number | null;
41
74
  approvalSlot: number | null;
75
+ /**
76
+ * Token-native signed authorization support, when explicitly verified.
77
+ *
78
+ * `domain` contains the exact EIP-712 signing fields and `domainSeparator`
79
+ * pins the value returned by the deployed token. Consumers should derive the
80
+ * separator from `domain`, compare it with both the pinned value and the live
81
+ * contract, and fail closed before collecting a signature if either differs.
82
+ *
83
+ * Absent means "no verified native authorization capability", not that an
84
+ * external path such as Permit2 is unavailable.
85
+ */
86
+ authorization?: TokenAuthorization;
42
87
  /**
43
88
  * Bridge layers that can carry *this token* on this chain, when known.
44
89
  *
@@ -268,6 +313,44 @@ interface ChainEntry {
268
313
  * say so). This is the outer bound: what the chain itself permits.
269
314
  */
270
315
  roles?: ChainRoles;
316
+ /**
317
+ * What the deposit-ingestion vendors call this chain.
318
+ *
319
+ * These are the last identifiers that made adding a chain a code change: a
320
+ * chain missing from deposit-processor's Alchemy map is never considered for
321
+ * webhook creation, one missing from its Zerion map is never ingested, and a
322
+ * chain in neither publishes `deposit: false` and turns into a refund-only
323
+ * chain. Neither id is derivable from anything else here.
324
+ *
325
+ * On `ChainEntry` rather than under a consumer's namespace because an
326
+ * Alchemy network name is a fact about the chain, not about deposit-processor:
327
+ * the next service to adopt a vendor reads the same key instead of another
328
+ * service's.
329
+ *
330
+ * `null` is an answer, and a different one from absence: the vendor was
331
+ * checked and does not serve this chain. Both null means the chain cannot take
332
+ * deposits at all. Absence, by contrast, would mean an artifact published
333
+ * before this field existed — which is why it is required here, on the same
334
+ * reasoning as `network` and `stack`: the read-client refuses any artifact
335
+ * older than the registry bundled with the package reading it, so a package
336
+ * whose bundled registry carries this can only accept remote artifacts that
337
+ * carry it too.
338
+ */
339
+ providerIds: ProviderIds;
340
+ /**
341
+ * Whether we open smart sessions on this chain.
342
+ *
343
+ * A declared policy, not a derived one. The underlying constraint is where the
344
+ * SmartSession modules are deployed — which `bootstrap_full` does everywhere,
345
+ * making deployment necessary but not sufficient, since we still decline to
346
+ * open sessions on testnets. `@rhinestone/sdk` gates nothing here: its chain
347
+ * catalog resolves any chain by id, so this is the only statement of the
348
+ * answer.
349
+ *
350
+ * A consumer rejects `setup-account` for a chain that is `false`. Required for
351
+ * the same reason as `providerIds`.
352
+ */
353
+ sessionCapable: boolean;
271
354
  nativeToken: NativeTokenEntry;
272
355
  wrappedNativeToken: NativeTokenEntry;
273
356
  tokens: TokenEntry[];
@@ -276,6 +359,16 @@ interface ChainEntry {
276
359
  swapQuoters: SwapQuoter[];
277
360
  swapQuoterConfig?: Partial<Record<SwapQuoter, SwapQuoterConfig>>;
278
361
  }
362
+ /**
363
+ * Vendor-keyed, so a chain states each vendor's own name for it once. `null`
364
+ * means checked and unsupported — see `ChainEntry.providerIds`.
365
+ */
366
+ interface ProviderIds {
367
+ /** Alchemy Notify network name, e.g. `BASE_MAINNET`. */
368
+ alchemy: string | null;
369
+ /** Zerion chain slug, e.g. `binance-smart-chain`. */
370
+ zerion: string | null;
371
+ }
279
372
  type ContractAddresses = Record<string, Record<string, Address>>;
280
373
  interface ChainRegistry {
281
374
  [chainId: string]: ChainEntry;
@@ -320,4 +413,4 @@ interface ErpcConfig {
320
413
  providerIdPrefix: Record<string, string>;
321
414
  }
322
415
  export { OPStackChains, MainnetNetwork, TestnetNetwork, mainnetChains, testnetChains, chains, PEG_GROUPS };
323
- export type { CctpChainConfig, ChainItem, ChainEntry, ChainExplorer, ChainNetwork, ChainRegistry, ChainRoles, ChainStack, ChainList, ContractAddresses, NearChainConfig, OftChainConfig, ProviderRegistry, ProviderName, RhinoChainConfig, SettlementConfig, SettlementLayer, SupportedTestnet, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedChain, SwapQuoter, SwapQuoterConfig, PegGroup, VmType, ErpcFailsafe, ErpcChainOverride, ErpcConfig, };
416
+ export type { CctpChainConfig, ChainItem, ChainEntry, ChainExplorer, ChainNetwork, ChainRegistry, ChainRoles, ChainStack, ChainList, ContractAddresses, NearChainConfig, OftChainConfig, ProviderIds, ProviderRegistry, ProviderName, RhinoChainConfig, SettlementConfig, SettlementLayer, TokenAuthorization, TokenAuthorizationDomain, TokenAuthorizationStandard, TokenEntry, SupportedTestnet, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedChain, SwapQuoter, SwapQuoterConfig, PegGroup, VmType, ErpcFailsafe, ErpcChainOverride, ErpcConfig, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/shared-configs",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Reusable configuration files for Rhinestone services",
5
5
  "author": {
6
6
  "name": "Rhinestone",
@@ -27,6 +27,7 @@
27
27
  "generate:abis": "bun run scripts/generate-abis.ts",
28
28
  "generate:abis:extract": "bun run scripts/generate-abis.ts --extract",
29
29
  "sync:abis": "bun run scripts/sync-abis.ts",
30
+ "audit:token-authorizations": "bun run scripts/audit-token-authorizations.ts",
30
31
  "check:vendor-drift": "bun run scripts/vendor-drift/main.ts",
31
32
  "compile": "tsc",
32
33
  "test": "bun test",