@rhinestone/shared-configs 2.0.1 → 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.
- package/README.md +41 -0
- package/dist/configs/chains.json +452 -0
- package/dist/scripts/__tests__/validation.test.js +215 -0
- package/dist/scripts/audit-token-authorizations.d.ts +1 -0
- package/dist/scripts/audit-token-authorizations.js +541 -0
- package/dist/scripts/generate.js +3 -1
- package/dist/scripts/validation.js +97 -2
- package/dist/src/chains.d.ts +3 -1
- package/dist/src/chains.js +452 -0
- package/dist/src/generated/networks.d.ts +1105 -1105
- package/dist/src/generated/packageVersion.d.ts +1 -1
- package/dist/src/generated/packageVersion.js +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/types.d.ts +47 -2
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const PACKAGE_VERSION = "2.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
|
|
5
|
+
const PACKAGE_VERSION = "2.1.0";
|
|
6
6
|
exports.PACKAGE_VERSION = PACKAGE_VERSION;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/src/types.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -368,4 +413,4 @@ interface ErpcConfig {
|
|
|
368
413
|
providerIdPrefix: Record<string, string>;
|
|
369
414
|
}
|
|
370
415
|
export { OPStackChains, MainnetNetwork, TestnetNetwork, mainnetChains, testnetChains, chains, PEG_GROUPS };
|
|
371
|
-
export type { CctpChainConfig, ChainItem, ChainEntry, ChainExplorer, ChainNetwork, ChainRegistry, ChainRoles, ChainStack, ChainList, ContractAddresses, NearChainConfig, OftChainConfig, ProviderIds, 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
|
|
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",
|