@qntx/wallet-chains 0.13.0 → 0.14.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.
Files changed (61) hide show
  1. package/README.md +13 -10
  2. package/dist/{account-ref-D2rW_qlI.mjs → account-ref-BFTeEyHt.mjs} +2 -2
  3. package/dist/{account-ref-D2rW_qlI.mjs.map → account-ref-BFTeEyHt.mjs.map} +1 -1
  4. package/dist/assemble-8GvNDony.mjs +405 -0
  5. package/dist/assemble-8GvNDony.mjs.map +1 -0
  6. package/dist/assemble-B3sO9Fvc.mjs +629 -0
  7. package/dist/assemble-B3sO9Fvc.mjs.map +1 -0
  8. package/dist/assemble-BdiPo0ZX.mjs +32 -0
  9. package/dist/assemble-BdiPo0ZX.mjs.map +1 -0
  10. package/dist/assets-sg2_Z3nZ.mjs +200 -0
  11. package/dist/assets-sg2_Z3nZ.mjs.map +1 -0
  12. package/dist/bitcoin-sign.d.mts +3 -0
  13. package/dist/bitcoin-sign.mjs +52 -18
  14. package/dist/bitcoin-sign.mjs.map +1 -1
  15. package/dist/bitcoin.d.mts +123 -7
  16. package/dist/bitcoin.mjs +162 -69
  17. package/dist/bitcoin.mjs.map +1 -1
  18. package/dist/evm-sign.d.mts +3 -1
  19. package/dist/evm-sign.mjs +25 -108
  20. package/dist/evm-sign.mjs.map +1 -1
  21. package/dist/evm.d.mts +152 -28
  22. package/dist/evm.mjs +2216 -753
  23. package/dist/evm.mjs.map +1 -1
  24. package/dist/families-BlgplKAJ.mjs +412 -0
  25. package/dist/families-BlgplKAJ.mjs.map +1 -0
  26. package/dist/index-CIRaHKpx.d.mts +941 -0
  27. package/dist/index.d.mts +2 -2
  28. package/dist/index.mjs +1 -1
  29. package/dist/networks.d.mts +29 -0
  30. package/dist/networks.mjs +245 -0
  31. package/dist/networks.mjs.map +1 -0
  32. package/dist/plan-wCnxHqRu.mjs +1311 -0
  33. package/dist/plan-wCnxHqRu.mjs.map +1 -0
  34. package/dist/solana-sign.d.mts +3 -0
  35. package/dist/solana-sign.mjs +23 -10
  36. package/dist/solana-sign.mjs.map +1 -1
  37. package/dist/solana.d.mts +117 -34
  38. package/dist/solana.mjs +796 -99
  39. package/dist/solana.mjs.map +1 -1
  40. package/dist/src-CHB_z45M.mjs +387 -0
  41. package/dist/src-CHB_z45M.mjs.map +1 -0
  42. package/dist/tasks-7AFv3PQn.mjs +86 -0
  43. package/dist/tasks-7AFv3PQn.mjs.map +1 -0
  44. package/dist/token-call-DH22g8BL.mjs +914 -0
  45. package/dist/token-call-DH22g8BL.mjs.map +1 -0
  46. package/dist/tron-sign.d.mts +10 -0
  47. package/dist/tron-sign.mjs +36 -0
  48. package/dist/tron-sign.mjs.map +1 -0
  49. package/dist/tron.d.mts +328 -0
  50. package/dist/tron.mjs +1484 -0
  51. package/dist/tron.mjs.map +1 -0
  52. package/dist/typed-data-CE9h4U0F.d.mts +51 -0
  53. package/dist/{typed-data-B4PJ1v8F.mjs → typed-data-DRtKULsH.mjs} +158 -10
  54. package/dist/typed-data-DRtKULsH.mjs.map +1 -0
  55. package/package.json +17 -10
  56. package/dist/index-DpL5hvPl.d.mts +0 -354
  57. package/dist/message-zf3XHwwc.mjs +0 -188
  58. package/dist/message-zf3XHwwc.mjs.map +0 -1
  59. package/dist/src-8NZeEnrW.mjs +0 -67
  60. package/dist/src-8NZeEnrW.mjs.map +0 -1
  61. package/dist/typed-data-B4PJ1v8F.mjs.map +0 -1
package/dist/evm.d.mts CHANGED
@@ -1,5 +1,9 @@
1
- import { d as EvmTransaction, l as DisplayIntent, r as AssetAmount, v as SignRequest, x as Verifiability } from "./index-DpL5hvPl.mjs";
1
+ import { F as SignRequest, G as Verifiability, _ as EvmTransaction, a as AssetAmount, i as Assembled, m as EcdsaTask, p as DisplayIntent, z as TaskKey } from "./index-CIRaHKpx.mjs";
2
+ import { a as parseTypedData, i as TypedDataInput, n as TYPED_FIELD_BUDGET, o as typedDataFields, r as TYPED_FIELD_CODE_POINTS, s as typedDataHashes } from "./typed-data-CE9h4U0F.mjs";
2
3
  import "ox/AbiFunction";
4
+ import "ox/Hex";
5
+ import "ox/Authorization";
6
+ import "ox/Signature";
3
7
  /** The native asset id in `AssetFlow` and simulated asset changes. */
4
8
  export declare const EVM_NATIVE_ASSET = "native";
5
9
  /** EIP-55 checksummed address, e.g. `0x52908400098527886E0F7030069857D2E4169EE7`. */
@@ -9,7 +13,7 @@ export declare function checksumEvmAddress(address: string): string;
9
13
  export declare function evmAddressFromPublicKey(pubkey: Uint8Array): string;
10
14
  export declare const isCanonicalHex: (value: string) => boolean;
11
15
  export declare const canonicalHex: (value: bigint) => string;
12
- /** The EIP-155 part of a CAIP-2 `network` string, e.g. `eip155:1` → 1. */
16
+ /** The EIP-155 part of a CAIP-2 `network` string, e.g. `eip155:1` → 1. Chain 0 does not exist. */
13
17
  export declare const networkChainId: (network: string) => number;
14
18
  /**
15
19
  * Canonicalizes an EVM transaction: exact key sets per type, all required fields present, `0x`
@@ -25,6 +29,12 @@ type EvmToken = {
25
29
  readonly symbol: string;
26
30
  readonly decimals: number;
27
31
  readonly name?: string;
32
+ /**
33
+ * "native-alias": an ERC-20 view that moves the chain's native balance — its calls are described
34
+ * like any listed token's, but it is never counted as a separate balance nor offered by
35
+ * discovery. "wrapped-native": a WETH9-style deposit/withdraw contract.
36
+ */
37
+ readonly role?: "native-alias" | "wrapped-native";
28
38
  };
29
39
  type EvmTokenTable = Readonly<Record<string, Readonly<Record<string, EvmToken>>>>;
30
40
  /** The built-in table. */
@@ -75,30 +85,17 @@ type Execution = {
75
85
  };
76
86
  /** Decodes an `execute` call; undefined unless the encoding is canonical batch-default mode. */
77
87
  export declare const decodeBatchExecute: (data: string) => ReadonlyArray<Execution> | undefined;
78
- type TypedDataField = {
79
- readonly name: string;
80
- readonly type: string;
81
- };
82
- /**
83
- * The subset of the EIP-712 document the wallet needs to see before handing it to ox's validator —
84
- * object with `types`, `primaryType`, `domain` and `message` of the right shapes.
85
- */
86
- type TypedDataInput = {
87
- readonly types: Record<string, ReadonlyArray<TypedDataField>>;
88
- readonly primaryType: string;
89
- readonly domain: Record<string, unknown>;
90
- readonly message: Record<string, unknown>;
91
- };
92
- type ParsedTypedData = {
93
- readonly json: TypedDataInput;
94
- };
95
- /** Parses the EIP-712 JSON source and validates its shape with ox. */
96
- export declare const parseTypedData: (typedData: string) => ParsedTypedData;
97
88
  /**
98
89
  * Canonical MultiSendCallOnly deployments (safe-global/safe-deployments): 1.3.0, the 1.3.0 eip155
99
90
  * variant and 1.4.1, lowercase for a checksum-insensitive compare.
100
91
  */
101
92
  export declare const SAFE_MULTISEND_CALL_ONLY: ReadonlySet<string>;
93
+ /**
94
+ * The most items any side of an order may carry before the document is too large to show in full:
95
+ * Seaport offer/consideration, UniswapX outputs. Over the limit the decoder blinds the document
96
+ * with `typed-data-oversize` rather than let the prompt truncate what it signs.
97
+ */
98
+ export declare const ORDER_ITEMS = 8;
102
99
  /**
103
100
  * The EIP-55 address that produced `result` for `request` — a `chain.sign` round-trip check
104
101
  * (`{kind:"evm.transaction",signedTransaction}` | `{kind,signature}`).
@@ -118,13 +115,14 @@ export declare const ALLOWANCE_HOLDER = "0x0000000000001fF3684f28c67538d4D072C22
118
115
  /** Chains whose AllowanceHolder + Settler deployment this decoder recognises. */
119
116
  export declare const ZEROX_CHAINS: ReadonlySet<number>;
120
117
  /**
121
- * Whether `address` is a taker-feature (2) 0x Settler on `chainId`. Settlers deploy as a CREATE2
122
- * shim whose CREATE child is the contract: `salt = (feature << 128) | (chainId << 64) | nonce`,
123
- * `shim = CREATE2(deployer, salt, initHash)`, `settler = CREATE(shim, 1)`. Settler is redeployed
124
- * roughly monthly, so nonces 1..256 leave decades of headroom; the loop runs 512 keccaks and is
125
- * only reached for an AllowanceHolder `exec`. Feature 5 (bridge) is deliberately not matched.
118
+ * Whether `address` is a `feature` 0x Settler on `chainId` — 2 taker, 3 MetaTxn (Deployer.sol's
119
+ * `ownerOf(tokenId)`). Settlers deploy as a CREATE2 shim whose CREATE child is the contract: `salt
120
+ * = (feature << 128) | (chainId << 64) | nonce`, `shim = CREATE2(deployer, salt, initHash)`,
121
+ * `settler = CREATE(shim, 1)`. Settler is redeployed roughly monthly, so nonces 1..256 leave
122
+ * decades of headroom; the loop runs 512 keccaks and is only reached for an AllowanceHolder `exec`
123
+ * or a Permit2 `slippageAndActions` witness. Feature 5 (bridge) is deliberately not matched.
126
124
  */
127
- export declare const isZeroExSettler: (chainId: number, address: string) => boolean;
125
+ export declare const isZeroExSettler: (chainId: number, address: string, feature?: bigint) => boolean;
128
126
  /**
129
127
  * The `DisplayIntent` for a call to AllowanceHolder `exec` on a chain this decoder covers: a swap
130
128
  * when the operator calls the taker Settler's own `execute` (operator == target, an on-chain
@@ -173,15 +171,141 @@ export declare const decodeAcross: (chainId: number, call: {
173
171
  data: string;
174
172
  value: bigint;
175
173
  }, table?: EvmTokenTable) => AcrossBridge | undefined;
174
+ /**
175
+ * CCTP TokenMessengerV2 `depositForBurnWithHook` deposits USDC into Hyperliquid via Circle's
176
+ * CctpForwarder on HyperEVM (destination domain 19). Only the Hyperliquid route is described — a
177
+ * call to the messenger on these chains that does not match it exactly is blind
178
+ * (`cctp-destination`): an unrecognised hook could send the burn anywhere.
179
+ *
180
+ * Verified on chain 2026-11-21 (code present).
181
+ */
182
+ export declare const CCTP_MESSENGERS: Readonly<Record<number, string>>;
183
+ export declare const CCTP_USDC: Readonly<Record<number, string>>;
184
+ /** Circle's CctpForwarder on HyperEVM (999 mainnet, 998 testnet) — the mint recipient on domain 19. */
185
+ export declare const CCTP_FORWARDERS: Readonly<Record<number, string>>;
186
+ export declare const HYPERLIQUID_DOMAIN = 19;
176
187
  /** The Lido contracts the kernel recognises by address — Ethereum mainnet only. */
177
188
  export declare const LIDO_CHAIN = 1;
178
189
  export declare const LIDO_STETH = "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84";
179
190
  export declare const LIDO_WSTETH = "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0";
180
191
  export declare const LIDO_QUEUE = "0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1";
192
+ type HyperliquidNetwork = "Mainnet" | "Testnet";
193
+ type HyperliquidL1Order = {
194
+ readonly a: number;
195
+ readonly b: boolean;
196
+ readonly p: string;
197
+ readonly s: string;
198
+ readonly r: boolean;
199
+ readonly t: {
200
+ readonly limit: {
201
+ readonly tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket";
202
+ };
203
+ } | {
204
+ readonly trigger: {
205
+ readonly isMarket: boolean;
206
+ readonly triggerPx: string;
207
+ readonly tpsl: "tp" | "sl";
208
+ };
209
+ };
210
+ readonly c?: string;
211
+ };
212
+ /** The nine allow-listed L1 actions (research H2-T), in the table's order. */
213
+ type HyperliquidL1Action = {
214
+ readonly type: "order";
215
+ readonly orders: ReadonlyArray<HyperliquidL1Order>;
216
+ readonly grouping: "na" | "normalTpsl" | "positionTpsl";
217
+ readonly builder?: {
218
+ readonly b: string;
219
+ readonly f: number;
220
+ };
221
+ } | {
222
+ readonly type: "cancel";
223
+ readonly cancels: ReadonlyArray<{
224
+ readonly a: number;
225
+ readonly o: number;
226
+ }>;
227
+ readonly f?: true;
228
+ } | {
229
+ readonly type: "cancelByCloid";
230
+ readonly cancels: ReadonlyArray<{
231
+ readonly asset: number;
232
+ readonly cloid: string;
233
+ }>;
234
+ readonly f?: true;
235
+ } | {
236
+ readonly type: "modify";
237
+ readonly oid: number | string;
238
+ readonly order: HyperliquidL1Order;
239
+ readonly a?: true;
240
+ } | {
241
+ readonly type: "batchModify";
242
+ readonly modifies: ReadonlyArray<{
243
+ readonly oid: number | string;
244
+ readonly order: HyperliquidL1Order;
245
+ }>;
246
+ readonly a?: true;
247
+ } | {
248
+ readonly type: "updateLeverage";
249
+ readonly asset: number;
250
+ readonly isCross: boolean;
251
+ readonly leverage: number;
252
+ } | {
253
+ readonly type: "updateIsolatedMargin";
254
+ readonly asset: number;
255
+ readonly isBuy: boolean;
256
+ readonly ntli: number;
257
+ } | {
258
+ readonly type: "twapCancel";
259
+ readonly a: number;
260
+ readonly t: number;
261
+ };
262
+ type HyperliquidL1Params = {
263
+ readonly action: HyperliquidL1Action;
264
+ readonly nonce: number;
265
+ readonly vaultAddress?: string;
266
+ /** Wall-clock ms after which Hyperliquid rejects the action — at most 60 s after signing. */
267
+ readonly expiresAfter: number;
268
+ };
269
+ /** The phantom-agent typed-data JSON an L1 `params` signs, shared by kernel and host. */
270
+ export declare function hyperliquidL1Document(params: HyperliquidL1Params, network: HyperliquidNetwork): string;
271
+ /**
272
+ * The Fiat24 contracts (SR Saphirstein AG) the decoder recognises by address — Arbitrum One only.
273
+ * The pinned proxies come from the issuer's own list
274
+ * (https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts.md) re-read on chain
275
+ * at block 526439604: EIP-1967 implementation slots, symbol()/decimals() — Sourcify full matches,
276
+ * solc 0.8.18.
277
+ */
278
+ export declare const FIAT24_CHAIN = 42161;
279
+ /** The exact personal-message text a `evm.fiat24-session` request signs. */
280
+ export declare const fiat24SessionMessage: (chainId: number, tokenId: string, deadline: number) => string;
281
+ /**
282
+ * The unsigned signing preimage of `tx`: the EIP-155 / EIP-2718 serialization whose keccak256 is
283
+ * `evmEnvelope(tx).payload`. An `eip7702` transaction has no unsigned preimage — its payload is the
284
+ * authorization's, produced by `evmAuthorization(tx)`.
285
+ */
286
+ export declare const evmSigningPreimage: (tx: EvmTransaction) => Uint8Array;
287
+ /**
288
+ * `authorization` is the 65-byte `r‖s‖v` of the stage-1 signature; it is present only on the
289
+ * second-stage plan `assembleEvm` returns for an `eip7702` transaction.
290
+ */
291
+ type EvmSignPlan = {
292
+ readonly kind: "evm.transaction";
293
+ readonly tx: EvmTransaction;
294
+ readonly authorization?: Uint8Array;
295
+ readonly tasks: readonly [EcdsaTask];
296
+ } | {
297
+ readonly kind: "evm.personal-message" | "evm.fiat24-session" | "evm.typed-data";
298
+ readonly tasks: readonly [EcdsaTask];
299
+ };
300
+ /** The plan of a normalized request; the task keeps the request kind so the kernel can wrap it. */
301
+ export declare const planEvm: (request: Extract<SignRequest, {
302
+ kind: "evm.transaction" | "evm.personal-message" | "evm.fiat24-session" | "evm.typed-data";
303
+ }>, key: TaskKey) => EvmSignPlan;
304
+ export declare const assembleEvm: (plan: EvmSignPlan, signatures: ReadonlyArray<Uint8Array>) => Assembled<Uint8Array, EvmSignPlan>;
181
305
  /**
182
306
  * Normalizes a SignRequest for the EVM family: exact key sets, chainId vs the CAIP-2 `network`,
183
307
  * canonical quantities and EIP-55 addresses. Idempotent.
184
308
  */
185
309
  export declare const normalizeEvm: (request: unknown) => SignRequest;
186
- export type { EvmToken, EvmTokenTable };
310
+ export { type EvmSignPlan, type EvmToken, type EvmTokenTable, type HyperliquidL1Action, type HyperliquidL1Order, type HyperliquidL1Params, type HyperliquidNetwork, TYPED_FIELD_BUDGET, TYPED_FIELD_CODE_POINTS, type TypedDataInput, parseTypedData, typedDataFields, typedDataHashes };
187
311
  //# sourceMappingURL=evm.d.mts.map