@rhinestone/shared-configs 1.5.1 → 1.6.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/dist/configs/chains.json +2 -0
- package/dist/scripts/generate.js +2 -0
- package/dist/src/chainVirtualization.d.ts +25 -0
- package/dist/src/chainVirtualization.d.ts.map +1 -0
- package/dist/src/chainVirtualization.js +69 -0
- package/dist/src/chains.d.ts +2 -0
- package/dist/src/chains.d.ts.map +1 -1
- package/dist/src/chains.js +2 -0
- package/dist/src/hypercore.d.ts +101 -0
- package/dist/src/hypercore.d.ts.map +1 -0
- package/dist/src/hypercore.js +138 -0
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +20 -1
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/configs/chains.json
CHANGED
|
@@ -850,6 +850,7 @@
|
|
|
850
850
|
}
|
|
851
851
|
},
|
|
852
852
|
"728126428": {
|
|
853
|
+
"caip2": "tron:0x2b6653dc",
|
|
853
854
|
"name": "Tron",
|
|
854
855
|
"nativeToken": {
|
|
855
856
|
"address": "0x0000000000000000000000000000000000000000",
|
|
@@ -888,6 +889,7 @@
|
|
|
888
889
|
}
|
|
889
890
|
},
|
|
890
891
|
"792703809": {
|
|
892
|
+
"caip2": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
891
893
|
"name": "Solana",
|
|
892
894
|
"nativeToken": {
|
|
893
895
|
"address": "So11111111111111111111111111111111111111112",
|
package/dist/scripts/generate.js
CHANGED
|
@@ -112,6 +112,8 @@ function renderChains(chainRegistry, mainnets, testnets) {
|
|
|
112
112
|
"interface Chain {",
|
|
113
113
|
" name: string;",
|
|
114
114
|
" vmType: VmType;",
|
|
115
|
+
" /** CAIP-2 chain identifier; populated for non-eip155 chains only. */",
|
|
116
|
+
" caip2?: string;",
|
|
115
117
|
" nativeToken: NativeToken;",
|
|
116
118
|
" wrappedNativeToken: NativeToken;",
|
|
117
119
|
" tokens: Token[];",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { VmType } from "./types";
|
|
2
|
+
/** VM kind for a chain id; defaults to `'evm'` for unknown ids. */
|
|
3
|
+
export declare function getVmType(chainId: number): VmType;
|
|
4
|
+
/** True when the chain id's vmType is not `'evm'` (Solana, Tron today). */
|
|
5
|
+
export declare function isNonEvmChainId(chainId: number): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Numeric ids of every non-EVM chain in the registry. Useful for spans / log
|
|
8
|
+
* attrs that want to enumerate the synthetic non-EIP-155 universe.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getNonEvmChainIds(): number[];
|
|
11
|
+
/**
|
|
12
|
+
* Canonical CAIP-2 string for a chain id. Returns the registry-declared
|
|
13
|
+
* `caip2` when present (non-EVM entries today), otherwise falls back to the
|
|
14
|
+
* `eip155:<chainId>` form. Throws nothing — returns the fallback for any
|
|
15
|
+
* unknown id so callers don't need to special-case absent entries.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCaip2(chainId: number): string;
|
|
18
|
+
/**
|
|
19
|
+
* Reverse lookup — find the numeric chain id whose registry-declared
|
|
20
|
+
* `caip2` matches the input, or `undefined` if no entry has it. EVM chains
|
|
21
|
+
* (which omit `caip2` in the registry) are NOT covered by this lookup;
|
|
22
|
+
* callers parse `eip155:N` references on their own.
|
|
23
|
+
*/
|
|
24
|
+
export declare function chainIdFromCaip2(caip2: string): number | undefined;
|
|
25
|
+
//# sourceMappingURL=chainVirtualization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainVirtualization.d.ts","sourceRoot":"","sources":["../../src/chainVirtualization.ts"],"names":[],"mappings":"AAgBA,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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getVmType = getVmType;
|
|
7
|
+
exports.isNonEvmChainId = isNonEvmChainId;
|
|
8
|
+
exports.getNonEvmChainIds = getNonEvmChainIds;
|
|
9
|
+
exports.getCaip2 = getCaip2;
|
|
10
|
+
exports.chainIdFromCaip2 = chainIdFromCaip2;
|
|
11
|
+
/**
|
|
12
|
+
* Chain virtualization helpers — single derivation point for "what kind of
|
|
13
|
+
* chain is this?" queries used at virtual / non-EVM boundaries.
|
|
14
|
+
*
|
|
15
|
+
* Sources every answer from `chainRegistry`'s `vmType` field plus the
|
|
16
|
+
* `caip2` annotation declared in `configs/chains.json` (see
|
|
17
|
+
* `config/non_evm_chains.jsonnet` for the source of truth). Consumers should
|
|
18
|
+
* NOT keep their own copy of "which chainIds are non-EVM" — read from here.
|
|
19
|
+
*
|
|
20
|
+
* HyperCore (1337) is intentionally absent from `chainRegistry` because it
|
|
21
|
+
* has no RPC / providers / native token of its own. Treat it as EVM-shaped
|
|
22
|
+
* (`vmType === 'evm'`) when querying VM-kind; HyperCore-specific behavior
|
|
23
|
+
* lives behind `isHyperCoreChainId` / `resolveSettlementChainId` in
|
|
24
|
+
* `./hypercore.ts`.
|
|
25
|
+
*/
|
|
26
|
+
const chains_json_1 = __importDefault(require("../configs/chains.json"));
|
|
27
|
+
const chainRegistry = chains_json_1.default;
|
|
28
|
+
/** VM kind for a chain id; defaults to `'evm'` for unknown ids. */
|
|
29
|
+
function getVmType(chainId) {
|
|
30
|
+
return chainRegistry[String(chainId)]?.vmType ?? "evm";
|
|
31
|
+
}
|
|
32
|
+
/** True when the chain id's vmType is not `'evm'` (Solana, Tron today). */
|
|
33
|
+
function isNonEvmChainId(chainId) {
|
|
34
|
+
return getVmType(chainId) !== "evm";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Numeric ids of every non-EVM chain in the registry. Useful for spans / log
|
|
38
|
+
* attrs that want to enumerate the synthetic non-EIP-155 universe.
|
|
39
|
+
*/
|
|
40
|
+
function getNonEvmChainIds() {
|
|
41
|
+
return Object.entries(chainRegistry)
|
|
42
|
+
.filter(([, entry]) => entry.vmType !== "evm")
|
|
43
|
+
.map(([id]) => Number(id));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Canonical CAIP-2 string for a chain id. Returns the registry-declared
|
|
47
|
+
* `caip2` when present (non-EVM entries today), otherwise falls back to the
|
|
48
|
+
* `eip155:<chainId>` form. Throws nothing — returns the fallback for any
|
|
49
|
+
* unknown id so callers don't need to special-case absent entries.
|
|
50
|
+
*/
|
|
51
|
+
function getCaip2(chainId) {
|
|
52
|
+
const entry = chainRegistry[String(chainId)];
|
|
53
|
+
if (entry?.caip2)
|
|
54
|
+
return entry.caip2;
|
|
55
|
+
return `eip155:${chainId}`;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reverse lookup — find the numeric chain id whose registry-declared
|
|
59
|
+
* `caip2` matches the input, or `undefined` if no entry has it. EVM chains
|
|
60
|
+
* (which omit `caip2` in the registry) are NOT covered by this lookup;
|
|
61
|
+
* callers parse `eip155:N` references on their own.
|
|
62
|
+
*/
|
|
63
|
+
function chainIdFromCaip2(caip2) {
|
|
64
|
+
for (const [id, entry] of Object.entries(chainRegistry)) {
|
|
65
|
+
if (entry.caip2 === caip2)
|
|
66
|
+
return Number(id);
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
package/dist/src/chains.d.ts
CHANGED
package/dist/src/chains.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7H,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;IACnB,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,kBAAkB,EAAE,WAAW,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,E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AM,CAAC,cAAc,EAAE,KAAK,CAi/BzC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/src/chains.js
CHANGED
|
@@ -921,6 +921,7 @@ const chains = {
|
|
|
921
921
|
]
|
|
922
922
|
},
|
|
923
923
|
"728126428": {
|
|
924
|
+
"caip2": "tron:0x2b6653dc",
|
|
924
925
|
"name": "Tron",
|
|
925
926
|
"nativeToken": {
|
|
926
927
|
"address": "0x0000000000000000000000000000000000000000",
|
|
@@ -960,6 +961,7 @@ const chains = {
|
|
|
960
961
|
"providers": []
|
|
961
962
|
},
|
|
962
963
|
"792703809": {
|
|
964
|
+
"caip2": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
963
965
|
"name": "Solana",
|
|
964
966
|
"nativeToken": {
|
|
965
967
|
"address": "So11111111111111111111111111111111111111112",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Virtual chain id orchestrators use to address HyperCore as a destination.
|
|
4
|
+
* Resolved to HyperEVM (999) at the MetaIntent boundary; the signed EIP-712
|
|
5
|
+
* payload binds to 999, not 1337.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HYPERCORE_CHAIN_ID = 1337;
|
|
8
|
+
/**
|
|
9
|
+
* Real EVM settlement chain for HyperCore destinations. HyperCore is a virtual
|
|
10
|
+
* chain id (1337) with no RPC of its own; funds land on HyperEVM (999), where
|
|
11
|
+
* `depositFor` runs. Consumers that need the settlement chain (RPC, EIP-712
|
|
12
|
+
* domain `chainId`, contract dispatch) translate at their boundary via
|
|
13
|
+
* `resolveSettlementChainId`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const HYPERCORE_SETTLEMENT_CHAIN_ID: number;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a (possibly virtual) chain id to the real settlement chain where
|
|
18
|
+
* orchestrator EVM operations execute. Identity for first-party EVM chains
|
|
19
|
+
* and non-EVM chains (bridge-terminated); maps `HYPERCORE_CHAIN_ID` →
|
|
20
|
+
* `HYPERCORE_SETTLEMENT_CHAIN_ID` for HyperCore destinations.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveSettlementChainId(chainId: number): number;
|
|
23
|
+
/** True when the chain id is a HyperCore virtual destination. */
|
|
24
|
+
export declare function isHyperCoreChainId(chainId: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Hyperliquid CoreWriter precompile on HyperEVM. Not used for USDC delivery
|
|
27
|
+
* — kept as a documented constant for future actions (spot send, vault
|
|
28
|
+
* transfer, usd class transfer, etc.).
|
|
29
|
+
*/
|
|
30
|
+
export declare const CORE_WRITER_PRECOMPILE: Address;
|
|
31
|
+
/**
|
|
32
|
+
* Circle's CoreDepositWallet on HyperEVM mainnet — exposes
|
|
33
|
+
* `deposit(amount, destinationDex)` and `depositFor(recipient, amount, destinationDex)`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const CORE_DEPOSIT_WALLET: Address;
|
|
36
|
+
/** Destination dex selector for HyperCore spot. */
|
|
37
|
+
export declare const HYPERCORE_SPOT_DEX = 4294967295;
|
|
38
|
+
/** Destination dex selector for the default HyperCore perp dex. */
|
|
39
|
+
export declare const HYPERCORE_DEFAULT_PERP_DEX = 0;
|
|
40
|
+
/**
|
|
41
|
+
* USDC fee Hyperliquid burns on the first inbound deposit to a non-activated
|
|
42
|
+
* HyperCore account, in EVM 6-decimal units (1 USDC). Subsequent deposits to
|
|
43
|
+
* the same account skip the fee. Applies to both EOA and smart-contract
|
|
44
|
+
* recipients. Reference: hyperliquid-dev/hyper-evm-lib's CoreExecution simulator
|
|
45
|
+
* (`activationFee = 1e8` in HyperCore 8-decimal wei = 1e6 in EVM 6-decimal wei).
|
|
46
|
+
*/
|
|
47
|
+
export declare const HYPERCORE_USDC_ACTIVATION_FEE = 1000000n;
|
|
48
|
+
export declare const coreDepositWalletAbi: readonly [{
|
|
49
|
+
readonly type: "function";
|
|
50
|
+
readonly name: "deposit";
|
|
51
|
+
readonly inputs: readonly [{
|
|
52
|
+
readonly name: "amount";
|
|
53
|
+
readonly type: "uint256";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "destinationDex";
|
|
56
|
+
readonly type: "uint32";
|
|
57
|
+
}];
|
|
58
|
+
readonly outputs: readonly [];
|
|
59
|
+
readonly stateMutability: "nonpayable";
|
|
60
|
+
}, {
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
readonly name: "depositFor";
|
|
63
|
+
readonly inputs: readonly [{
|
|
64
|
+
readonly name: "recipient";
|
|
65
|
+
readonly type: "address";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "amount";
|
|
68
|
+
readonly type: "uint256";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "destinationDex";
|
|
71
|
+
readonly type: "uint32";
|
|
72
|
+
}];
|
|
73
|
+
readonly outputs: readonly [];
|
|
74
|
+
readonly stateMutability: "nonpayable";
|
|
75
|
+
}];
|
|
76
|
+
/**
|
|
77
|
+
* ERC-7579 single-execution shape returned by the helpers below. Named
|
|
78
|
+
* `HyperCoreExecution` (rather than the bare `Execution`) so it doesn't
|
|
79
|
+
* collide with the orchestrator's own branded `Execution` type at the
|
|
80
|
+
* consumer side.
|
|
81
|
+
*/
|
|
82
|
+
export type HyperCoreExecution = {
|
|
83
|
+
to: Address;
|
|
84
|
+
value: bigint;
|
|
85
|
+
data: Hex;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* ERC20 approve granting `CoreDepositWallet` permission to spend USDC from
|
|
89
|
+
* the multicall executor on HyperEVM.
|
|
90
|
+
*/
|
|
91
|
+
export declare function getApproveCoreDepositWalletCall(usdcAddress: Address, amount: bigint): HyperCoreExecution;
|
|
92
|
+
/**
|
|
93
|
+
* `CoreDepositWallet.depositFor(recipient, amount, destinationDex)` — credits
|
|
94
|
+
* `recipient`'s HyperCore account with `amount` USDC (in HyperEVM 6-decimal
|
|
95
|
+
* units; Hyperliquid handles the wei-precision conversion internally).
|
|
96
|
+
*
|
|
97
|
+
* `destinationDex`: `HYPERCORE_SPOT_DEX` (default) or
|
|
98
|
+
* `HYPERCORE_DEFAULT_PERP_DEX`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function getDepositForCall(recipient: Address, amount: bigint, destinationDex?: number): HyperCoreExecution;
|
|
101
|
+
//# sourceMappingURL=hypercore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hypercore.d.ts","sourceRoot":"","sources":["../../src/hypercore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AA0B5E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAgC,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,OACS,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,OACY,CAAC;AAE/C,mDAAmD;AACnD,eAAO,MAAM,kBAAkB,aAAgB,CAAC;AAEhD,mEAAmE;AACnE,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,WAAa,CAAC;AAExD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBvB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,GACb,kBAAkB,CAUpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,cAAc,GAAE,MAA2B,GAC1C,kBAAkB,CAUpB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.coreDepositWalletAbi = exports.HYPERCORE_USDC_ACTIVATION_FEE = exports.HYPERCORE_DEFAULT_PERP_DEX = exports.HYPERCORE_SPOT_DEX = exports.CORE_DEPOSIT_WALLET = exports.CORE_WRITER_PRECOMPILE = exports.HYPERCORE_SETTLEMENT_CHAIN_ID = exports.HYPERCORE_CHAIN_ID = void 0;
|
|
4
|
+
exports.resolveSettlementChainId = resolveSettlementChainId;
|
|
5
|
+
exports.isHyperCoreChainId = isHyperCoreChainId;
|
|
6
|
+
exports.getApproveCoreDepositWalletCall = getApproveCoreDepositWalletCall;
|
|
7
|
+
exports.getDepositForCall = getDepositForCall;
|
|
8
|
+
const viem_1 = require("viem");
|
|
9
|
+
const networks_1 = require("./generated/networks");
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// HyperCore (Hyperliquid L1) bridging primitives, executed on HyperEVM (999).
|
|
12
|
+
//
|
|
13
|
+
// Native USDC bridging from HyperEVM to HyperCore goes through Circle's
|
|
14
|
+
// CoreDepositWallet contract, not a system-address transfer:
|
|
15
|
+
//
|
|
16
|
+
// 1. ERC20.approve(CoreDepositWallet, amount)
|
|
17
|
+
// 2. CoreDepositWallet.depositFor(recipient, amount, destinationDex)
|
|
18
|
+
//
|
|
19
|
+
// `depositFor` credits an arbitrary HyperCore recipient and lets the caller
|
|
20
|
+
// pick spot vs perp via `destinationDex` (uint32) — `type(uint32).max` for
|
|
21
|
+
// spot, `0` for the default perp dex.
|
|
22
|
+
//
|
|
23
|
+
// Reference (canonical): `CoreWriterLib.bridgeUsdcToCoreFor` in
|
|
24
|
+
// hyperliquid-dev/hyper-evm-lib.
|
|
25
|
+
//
|
|
26
|
+
// HyperEVM (999) and its native USDC live in the chain registry
|
|
27
|
+
// (`MainnetNetwork.HYPEREVM` + `chainRegistry[999].tokens`). HyperCore (1337)
|
|
28
|
+
// is a virtual chain id that doesn't have its own RPC/providers/native token,
|
|
29
|
+
// so it is exported here as a plain constant rather than as a `MainnetNetwork`
|
|
30
|
+
// member.
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
/**
|
|
33
|
+
* Virtual chain id orchestrators use to address HyperCore as a destination.
|
|
34
|
+
* Resolved to HyperEVM (999) at the MetaIntent boundary; the signed EIP-712
|
|
35
|
+
* payload binds to 999, not 1337.
|
|
36
|
+
*/
|
|
37
|
+
exports.HYPERCORE_CHAIN_ID = 1337;
|
|
38
|
+
/**
|
|
39
|
+
* Real EVM settlement chain for HyperCore destinations. HyperCore is a virtual
|
|
40
|
+
* chain id (1337) with no RPC of its own; funds land on HyperEVM (999), where
|
|
41
|
+
* `depositFor` runs. Consumers that need the settlement chain (RPC, EIP-712
|
|
42
|
+
* domain `chainId`, contract dispatch) translate at their boundary via
|
|
43
|
+
* `resolveSettlementChainId`.
|
|
44
|
+
*/
|
|
45
|
+
exports.HYPERCORE_SETTLEMENT_CHAIN_ID = networks_1.MainnetNetwork.HYPEREVM;
|
|
46
|
+
/**
|
|
47
|
+
* Resolves a (possibly virtual) chain id to the real settlement chain where
|
|
48
|
+
* orchestrator EVM operations execute. Identity for first-party EVM chains
|
|
49
|
+
* and non-EVM chains (bridge-terminated); maps `HYPERCORE_CHAIN_ID` →
|
|
50
|
+
* `HYPERCORE_SETTLEMENT_CHAIN_ID` for HyperCore destinations.
|
|
51
|
+
*/
|
|
52
|
+
function resolveSettlementChainId(chainId) {
|
|
53
|
+
return chainId === exports.HYPERCORE_CHAIN_ID ? exports.HYPERCORE_SETTLEMENT_CHAIN_ID : chainId;
|
|
54
|
+
}
|
|
55
|
+
/** True when the chain id is a HyperCore virtual destination. */
|
|
56
|
+
function isHyperCoreChainId(chainId) {
|
|
57
|
+
return chainId === exports.HYPERCORE_CHAIN_ID;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Hyperliquid CoreWriter precompile on HyperEVM. Not used for USDC delivery
|
|
61
|
+
* — kept as a documented constant for future actions (spot send, vault
|
|
62
|
+
* transfer, usd class transfer, etc.).
|
|
63
|
+
*/
|
|
64
|
+
exports.CORE_WRITER_PRECOMPILE = "0x3333333333333333333333333333333333333333";
|
|
65
|
+
/**
|
|
66
|
+
* Circle's CoreDepositWallet on HyperEVM mainnet — exposes
|
|
67
|
+
* `deposit(amount, destinationDex)` and `depositFor(recipient, amount, destinationDex)`.
|
|
68
|
+
*/
|
|
69
|
+
exports.CORE_DEPOSIT_WALLET = "0x6B9E773128f453f5c2C60935Ee2DE2CBc5390A24";
|
|
70
|
+
/** Destination dex selector for HyperCore spot. */
|
|
71
|
+
exports.HYPERCORE_SPOT_DEX = 4_294_967_295; // type(uint32).max
|
|
72
|
+
/** Destination dex selector for the default HyperCore perp dex. */
|
|
73
|
+
exports.HYPERCORE_DEFAULT_PERP_DEX = 0;
|
|
74
|
+
/**
|
|
75
|
+
* USDC fee Hyperliquid burns on the first inbound deposit to a non-activated
|
|
76
|
+
* HyperCore account, in EVM 6-decimal units (1 USDC). Subsequent deposits to
|
|
77
|
+
* the same account skip the fee. Applies to both EOA and smart-contract
|
|
78
|
+
* recipients. Reference: hyperliquid-dev/hyper-evm-lib's CoreExecution simulator
|
|
79
|
+
* (`activationFee = 1e8` in HyperCore 8-decimal wei = 1e6 in EVM 6-decimal wei).
|
|
80
|
+
*/
|
|
81
|
+
exports.HYPERCORE_USDC_ACTIVATION_FEE = 1000000n;
|
|
82
|
+
exports.coreDepositWalletAbi = [
|
|
83
|
+
{
|
|
84
|
+
type: "function",
|
|
85
|
+
name: "deposit",
|
|
86
|
+
inputs: [
|
|
87
|
+
{ name: "amount", type: "uint256" },
|
|
88
|
+
{ name: "destinationDex", type: "uint32" },
|
|
89
|
+
],
|
|
90
|
+
outputs: [],
|
|
91
|
+
stateMutability: "nonpayable",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "function",
|
|
95
|
+
name: "depositFor",
|
|
96
|
+
inputs: [
|
|
97
|
+
{ name: "recipient", type: "address" },
|
|
98
|
+
{ name: "amount", type: "uint256" },
|
|
99
|
+
{ name: "destinationDex", type: "uint32" },
|
|
100
|
+
],
|
|
101
|
+
outputs: [],
|
|
102
|
+
stateMutability: "nonpayable",
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
/**
|
|
106
|
+
* ERC20 approve granting `CoreDepositWallet` permission to spend USDC from
|
|
107
|
+
* the multicall executor on HyperEVM.
|
|
108
|
+
*/
|
|
109
|
+
function getApproveCoreDepositWalletCall(usdcAddress, amount) {
|
|
110
|
+
return {
|
|
111
|
+
to: usdcAddress,
|
|
112
|
+
value: 0n,
|
|
113
|
+
data: (0, viem_1.encodeFunctionData)({
|
|
114
|
+
abi: viem_1.erc20Abi,
|
|
115
|
+
functionName: "approve",
|
|
116
|
+
args: [exports.CORE_DEPOSIT_WALLET, amount],
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* `CoreDepositWallet.depositFor(recipient, amount, destinationDex)` — credits
|
|
122
|
+
* `recipient`'s HyperCore account with `amount` USDC (in HyperEVM 6-decimal
|
|
123
|
+
* units; Hyperliquid handles the wei-precision conversion internally).
|
|
124
|
+
*
|
|
125
|
+
* `destinationDex`: `HYPERCORE_SPOT_DEX` (default) or
|
|
126
|
+
* `HYPERCORE_DEFAULT_PERP_DEX`.
|
|
127
|
+
*/
|
|
128
|
+
function getDepositForCall(recipient, amount, destinationDex = exports.HYPERCORE_SPOT_DEX) {
|
|
129
|
+
return {
|
|
130
|
+
to: exports.CORE_DEPOSIT_WALLET,
|
|
131
|
+
value: 0n,
|
|
132
|
+
data: (0, viem_1.encodeFunctionData)({
|
|
133
|
+
abi: exports.coreDepositWalletAbi,
|
|
134
|
+
functionName: "depositFor",
|
|
135
|
+
args: [recipient, amount, destinationDex],
|
|
136
|
+
}),
|
|
137
|
+
};
|
|
138
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,13 +5,16 @@ import { chains, MainnetNetwork, mainnetChains, OPStackChains, PEG_GROUPS, Testn
|
|
|
5
5
|
import type { PegGroup, VmType } from "./types";
|
|
6
6
|
import { getLayerZeroEid, getOftAdapter, getOftConfig, getOftProgramId, getOftSupportedChains, getSupportedOftTokens, hasOftSupport, OFT_PROGRAM_IDS, OFT_REGISTRY } from "./oft";
|
|
7
7
|
import type { OftConfig } from "./oft";
|
|
8
|
+
import { CORE_DEPOSIT_WALLET, CORE_WRITER_PRECOMPILE, coreDepositWalletAbi, getApproveCoreDepositWalletCall, getDepositForCall, HYPERCORE_CHAIN_ID, HYPERCORE_DEFAULT_PERP_DEX, HYPERCORE_SETTLEMENT_CHAIN_ID, HYPERCORE_SPOT_DEX, HYPERCORE_USDC_ACTIVATION_FEE, isHyperCoreChainId, resolveSettlementChainId } from "./hypercore";
|
|
9
|
+
import type { HyperCoreExecution } from "./hypercore";
|
|
10
|
+
import { chainIdFromCaip2, getCaip2, getNonEvmChainIds, getVmType, isNonEvmChainId } from "./chainVirtualization";
|
|
8
11
|
declare const chainRegistry: ChainRegistry;
|
|
9
12
|
declare const erpcConfig: ErpcConfig;
|
|
10
13
|
declare const providerRegistry: ProviderRegistry;
|
|
11
14
|
declare const mainnetChainList: ChainList;
|
|
12
15
|
declare const testnetChainList: ChainList;
|
|
13
16
|
declare function chainHasUnpricedTokens(chainId: number): boolean;
|
|
14
|
-
export { chainRegistry, erpcConfig, providerRegistry, mainnetChainList, testnetChainList, contractAddresses, contractAddressesDev, chains, mainnetChains, testnetChains, MainnetNetwork, OPStackChains, TestnetNetwork, OFT_REGISTRY, OFT_PROGRAM_IDS, getOftConfig, hasOftSupport, getSupportedOftTokens, getLayerZeroEid, getOftAdapter, getOftProgramId, getOftSupportedChains, PEG_GROUPS, chainHasUnpricedTokens, };
|
|
15
|
-
export type { ChainList, ChainItem, ChainEntry, ChainRegistry, ErpcConfig, ErpcFailsafe, ErpcChainOverride, ProviderRegistry, ProviderName, SwapQuoter, ContractAddresses, SupportedMainnet, SupportedTestnet, SupportedChain, SupportedOPStackMainnet, SupportedOPStackTestnet, SettlementLayer, OftConfig, PegGroup, VmType, };
|
|
17
|
+
export { chainRegistry, erpcConfig, providerRegistry, mainnetChainList, testnetChainList, contractAddresses, contractAddressesDev, chains, mainnetChains, testnetChains, MainnetNetwork, OPStackChains, TestnetNetwork, OFT_REGISTRY, OFT_PROGRAM_IDS, getOftConfig, hasOftSupport, getSupportedOftTokens, getLayerZeroEid, getOftAdapter, getOftProgramId, getOftSupportedChains, PEG_GROUPS, chainHasUnpricedTokens, HYPERCORE_CHAIN_ID, HYPERCORE_SETTLEMENT_CHAIN_ID, CORE_WRITER_PRECOMPILE, CORE_DEPOSIT_WALLET, HYPERCORE_SPOT_DEX, HYPERCORE_DEFAULT_PERP_DEX, HYPERCORE_USDC_ACTIVATION_FEE, coreDepositWalletAbi, getApproveCoreDepositWalletCall, getDepositForCall, isHyperCoreChainId, resolveSettlementChainId, getVmType, isNonEvmChainId, getNonEvmChainIds, getCaip2, chainIdFromCaip2, };
|
|
18
|
+
export type { ChainList, ChainItem, ChainEntry, ChainRegistry, ErpcConfig, ErpcFailsafe, ErpcChainOverride, ProviderRegistry, ProviderName, SwapQuoter, ContractAddresses, SupportedMainnet, SupportedTestnet, SupportedChain, SupportedOPStackMainnet, SupportedOPStackTestnet, SettlementLayer, OftConfig, PegGroup, VmType, HyperCoreExecution, };
|
|
16
19
|
export * from "./abis";
|
|
17
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,MAAM,EACN,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,YAAY,EACb,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,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B,MAAM,EACN,aAAa,EACb,aAAa,EAEb,cAAc,EACd,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,eAAe,EACf,qBAAqB,EAErB,UAAU,EAEV,sBAAsB,EAEtB,kBAAkB,EAClB,6BAA6B,EAC7B,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,oBAAoB,EACpB,+BAA+B,EAC/B,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EAExB,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,GACjB,CAAC;AACF,YAAY,EAEV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,iBAAiB,EAEjB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EAEf,SAAS,EAET,QAAQ,EAER,MAAM,EAEN,kBAAkB,GACnB,CAAC;AAEF,cAAc,QAAQ,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.PEG_GROUPS = exports.getOftSupportedChains = exports.getOftProgramId = exports.getOftAdapter = exports.getLayerZeroEid = exports.getSupportedOftTokens = exports.hasOftSupport = exports.getOftConfig = exports.OFT_PROGRAM_IDS = exports.OFT_REGISTRY = exports.TestnetNetwork = exports.OPStackChains = exports.MainnetNetwork = exports.testnetChains = exports.mainnetChains = exports.chains = exports.contractAddressesDev = exports.contractAddresses = exports.testnetChainList = exports.mainnetChainList = exports.providerRegistry = exports.erpcConfig = exports.chainRegistry = void 0;
|
|
20
|
+
exports.chainIdFromCaip2 = exports.getCaip2 = exports.getNonEvmChainIds = exports.isNonEvmChainId = exports.getVmType = exports.resolveSettlementChainId = exports.isHyperCoreChainId = exports.getDepositForCall = exports.getApproveCoreDepositWalletCall = exports.coreDepositWalletAbi = exports.HYPERCORE_USDC_ACTIVATION_FEE = exports.HYPERCORE_DEFAULT_PERP_DEX = exports.HYPERCORE_SPOT_DEX = exports.CORE_DEPOSIT_WALLET = exports.CORE_WRITER_PRECOMPILE = exports.HYPERCORE_SETTLEMENT_CHAIN_ID = exports.HYPERCORE_CHAIN_ID = exports.PEG_GROUPS = exports.getOftSupportedChains = exports.getOftProgramId = exports.getOftAdapter = exports.getLayerZeroEid = exports.getSupportedOftTokens = exports.hasOftSupport = exports.getOftConfig = exports.OFT_PROGRAM_IDS = exports.OFT_REGISTRY = exports.TestnetNetwork = exports.OPStackChains = exports.MainnetNetwork = exports.testnetChains = exports.mainnetChains = exports.chains = exports.contractAddressesDev = exports.contractAddresses = exports.testnetChainList = exports.mainnetChainList = exports.providerRegistry = exports.erpcConfig = exports.chainRegistry = void 0;
|
|
21
21
|
exports.chainHasUnpricedTokens = chainHasUnpricedTokens;
|
|
22
22
|
const chains_json_1 = __importDefault(require("../configs/chains.json"));
|
|
23
23
|
const erpc_json_1 = __importDefault(require("../configs/erpc.json"));
|
|
@@ -46,6 +46,25 @@ Object.defineProperty(exports, "getSupportedOftTokens", { enumerable: true, get:
|
|
|
46
46
|
Object.defineProperty(exports, "hasOftSupport", { enumerable: true, get: function () { return oft_1.hasOftSupport; } });
|
|
47
47
|
Object.defineProperty(exports, "OFT_PROGRAM_IDS", { enumerable: true, get: function () { return oft_1.OFT_PROGRAM_IDS; } });
|
|
48
48
|
Object.defineProperty(exports, "OFT_REGISTRY", { enumerable: true, get: function () { return oft_1.OFT_REGISTRY; } });
|
|
49
|
+
const hypercore_1 = require("./hypercore");
|
|
50
|
+
Object.defineProperty(exports, "CORE_DEPOSIT_WALLET", { enumerable: true, get: function () { return hypercore_1.CORE_DEPOSIT_WALLET; } });
|
|
51
|
+
Object.defineProperty(exports, "CORE_WRITER_PRECOMPILE", { enumerable: true, get: function () { return hypercore_1.CORE_WRITER_PRECOMPILE; } });
|
|
52
|
+
Object.defineProperty(exports, "coreDepositWalletAbi", { enumerable: true, get: function () { return hypercore_1.coreDepositWalletAbi; } });
|
|
53
|
+
Object.defineProperty(exports, "getApproveCoreDepositWalletCall", { enumerable: true, get: function () { return hypercore_1.getApproveCoreDepositWalletCall; } });
|
|
54
|
+
Object.defineProperty(exports, "getDepositForCall", { enumerable: true, get: function () { return hypercore_1.getDepositForCall; } });
|
|
55
|
+
Object.defineProperty(exports, "HYPERCORE_CHAIN_ID", { enumerable: true, get: function () { return hypercore_1.HYPERCORE_CHAIN_ID; } });
|
|
56
|
+
Object.defineProperty(exports, "HYPERCORE_DEFAULT_PERP_DEX", { enumerable: true, get: function () { return hypercore_1.HYPERCORE_DEFAULT_PERP_DEX; } });
|
|
57
|
+
Object.defineProperty(exports, "HYPERCORE_SETTLEMENT_CHAIN_ID", { enumerable: true, get: function () { return hypercore_1.HYPERCORE_SETTLEMENT_CHAIN_ID; } });
|
|
58
|
+
Object.defineProperty(exports, "HYPERCORE_SPOT_DEX", { enumerable: true, get: function () { return hypercore_1.HYPERCORE_SPOT_DEX; } });
|
|
59
|
+
Object.defineProperty(exports, "HYPERCORE_USDC_ACTIVATION_FEE", { enumerable: true, get: function () { return hypercore_1.HYPERCORE_USDC_ACTIVATION_FEE; } });
|
|
60
|
+
Object.defineProperty(exports, "isHyperCoreChainId", { enumerable: true, get: function () { return hypercore_1.isHyperCoreChainId; } });
|
|
61
|
+
Object.defineProperty(exports, "resolveSettlementChainId", { enumerable: true, get: function () { return hypercore_1.resolveSettlementChainId; } });
|
|
62
|
+
const chainVirtualization_1 = require("./chainVirtualization");
|
|
63
|
+
Object.defineProperty(exports, "chainIdFromCaip2", { enumerable: true, get: function () { return chainVirtualization_1.chainIdFromCaip2; } });
|
|
64
|
+
Object.defineProperty(exports, "getCaip2", { enumerable: true, get: function () { return chainVirtualization_1.getCaip2; } });
|
|
65
|
+
Object.defineProperty(exports, "getNonEvmChainIds", { enumerable: true, get: function () { return chainVirtualization_1.getNonEvmChainIds; } });
|
|
66
|
+
Object.defineProperty(exports, "getVmType", { enumerable: true, get: function () { return chainVirtualization_1.getVmType; } });
|
|
67
|
+
Object.defineProperty(exports, "isNonEvmChainId", { enumerable: true, get: function () { return chainVirtualization_1.isNonEvmChainId; } });
|
|
49
68
|
const chainRegistry = chains_json_1.default;
|
|
50
69
|
exports.chainRegistry = chainRegistry;
|
|
51
70
|
const erpcConfig = erpc_json_1.default;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -37,6 +37,14 @@ interface SwapQuoterConfig {
|
|
|
37
37
|
interface ChainEntry {
|
|
38
38
|
name: string;
|
|
39
39
|
vmType: VmType;
|
|
40
|
+
/**
|
|
41
|
+
* Canonical CAIP-2 chain identifier (`namespace:reference`). Populated for
|
|
42
|
+
* non-eip155 chains (e.g. `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`,
|
|
43
|
+
* `tron:0x2b6653dc`). EVM chains omit this and consumers fall back to
|
|
44
|
+
* `eip155:<chainId>` programmatically.
|
|
45
|
+
* https://chainagnostic.org/CAIPs/caip-2
|
|
46
|
+
*/
|
|
47
|
+
caip2?: string;
|
|
40
48
|
nativeToken: NativeTokenEntry;
|
|
41
49
|
wrappedNativeToken: NativeTokenEntry;
|
|
42
50
|
tokens: TokenEntry[];
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,MAAM,EACN,cAAc,EACd,aAAa,EACb,aA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