@orbinum/sdk 1.3.1 → 2.0.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Z as ZkNote, D as DecryptedMemo, N as NoteInput, S as ScanCommitment, O as OutgoingNoteRecord, a as DecryptPool, b as ScanKeys } from './index-V5Z9igEN.js';
2
- export { C as CURRENT_CIRCUIT_VERSION, c as DECRYPT_YIELD_EVERY, d as DecryptBatchResult, e as DecryptRequest, E as EMPTY_BATCH_RESULT, K as KnownEphEntry, f as KnownEphWindow, M as MAX_WORKERS, g as MatchSource, h as MerkleTreeInfo, P as PAIRWISE_EPH_WINDOW, i as SELF_EPH_WINDOW, W as WORKER_CRASHED, j as WorkerFactory, k as WorkerLike, l as WorkerMessage, m as clearKnownEphWindow, n as createDecryptPool, o as createMainThreadPool, p as createWorkerPool, q as decryptHintBatch, r as getKnownEphWindow } from './index-V5Z9igEN.js';
1
+ import { Z as ZkNote, D as DecryptedMemo, N as NoteInput, S as ScanCommitment, a as NoteFacts, O as OutgoingNoteRecord, b as DecryptPool, c as ScanKeys } from './index-CLpM1984.js';
2
+ export { C as CURRENT_CIRCUIT_VERSION, d as DECRYPT_YIELD_EVERY, e as DecryptBatchResult, f as DecryptRequest, E as EMPTY_BATCH_RESULT, K as KnownEphEntry, g as KnownEphWindow, M as MAX_WORKERS, h as MatchSource, i as MerkleTreeInfo, P as PAIRWISE_EPH_WINDOW, j as SELF_EPH_WINDOW, W as WORKER_CRASHED, k as WorkerFactory, l as WorkerLike, m as WorkerMessage, n as clearKnownEphWindow, o as createDecryptPool, p as createMainThreadPool, q as createWorkerPool, r as decryptHintBatch, s as getKnownEphWindow } from './index-CLpM1984.js';
3
3
  import { ArtifactProvider, ProofResult, CircuitType } from '@orbinum/proof-generator';
4
4
  export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider, shouldProveSingleThreaded } from '@orbinum/proof-generator';
5
5
  import * as polkadot_api from 'polkadot-api';
@@ -188,8 +188,22 @@ declare class MemoryVaultStorage implements VaultStorage {
188
188
  * carry every ephemeral counter forward. See `buildConfig`.
189
189
  */
190
190
 
191
- /** The schema version this build writes and expects to read back. */
192
- declare const VAULT_SCHEMA_VERSION = 4;
191
+ /**
192
+ * The schema version this build writes and expects to read back.
193
+ *
194
+ * v5: `counterpartyPk` became `sourcePk` on the persisted note. A v4 record
195
+ * carries the old key, and reading it back does NOT throw — `sourcePk` is in
196
+ * `ABSENT_MEANS_ZERO`, so its absence reads as a legitimate zero. The note
197
+ * loads fine, spends fine, and silently loses the other party's key: the only
198
+ * copy of the payee a sender can still open. The bump exists because that
199
+ * failure is quiet, not because the note becomes unusable.
200
+ *
201
+ * No data migration — wipe-and-rescan IS this repo's migration mechanism, and
202
+ * nothing is lost by it: notes live on chain and come back from a scan, while
203
+ * the ephemeral counters (the one piece that cannot be rebuilt) are carried
204
+ * forward by `mergeCounters` rather than wiped.
205
+ */
206
+ declare const VAULT_SCHEMA_VERSION = 5;
193
207
  /**
194
208
  * Lowercases a chain fingerprint, or returns undefined when there is none —
195
209
  * so callers can chain `??` without distinguishing empty from absent.
@@ -240,8 +254,27 @@ declare function reserveSelfEphIndex(storage: NoteStorage): Promise<number>;
240
254
  * viewing public key. Registering the counterparty is a side effect worth
241
255
  * having: it makes the REVERSE direction cheap too, since their future payments
242
256
  * to this wallet become hash lookups instead of one trial ECDH per note.
257
+ *
258
+ * Returns `null` when this vault holds no history for that counterparty, and
259
+ * the caller must then use a random ephemeral. The reason is that "no history"
260
+ * has two causes this function cannot tell apart:
261
+ *
262
+ * - a genuine first payment, where index 0 is correct;
263
+ * - a counter that was LOST — a restored seed, a cleared IndexedDB, a wipe
264
+ * and rescan — where index 0 was already published and re-deriving it
265
+ * republishes that ephPk, linking the two notes in public.
266
+ *
267
+ * Unlike `selfEphCounter`, this one cannot be recovered: the index was
268
+ * published on a note encrypted toward someone else, so it never appears in
269
+ * this wallet's own scan, and asking a server whether a given ephPk exists
270
+ * would reveal which notes are ours. So the ambiguity is resolved the safe way
271
+ * — the caller degrades to random, costing the recipient one trial scan, and
272
+ * every later payment to the same counterparty takes the fast path again.
273
+ *
274
+ * The entry is still created: the NEXT payment has a counter, and registering
275
+ * the counterparty is what makes the reverse direction cheap.
243
276
  */
244
- declare function reservePairwiseIndex(storage: NoteStorage, ivkHex: string): Promise<number>;
277
+ declare function reservePairwiseIndex(storage: NoteStorage, ivkHex: string): Promise<number | null>;
245
278
 
246
279
  /**
247
280
  * Turning a note into a stored record and back.
@@ -314,7 +347,7 @@ type NoteWithMeta = ZkNote & {
314
347
  txKind?: TxKind;
315
348
  };
316
349
  /** Shield deposit vs PrivateTransfer output (received or change) — the memo's
317
- * counterpartyPk is zero only for shield/unshield-built notes. */
350
+ * sourcePk is zero only for shield/unshield-built notes. */
318
351
  declare function noteOrigin(note: ZkNote): 'shield' | 'private-transfer';
319
352
  declare function noteCreatedAt(note: ZkNote): number | null;
320
353
  declare function stampCreatedAt(note: ZkNote, createdAt: number | null): ZkNote;
@@ -412,7 +445,7 @@ declare function removeByCommitment(notes: ZkNote[], commitmentHexes: Set<string
412
445
  * already exists.
413
446
  *
414
447
  * The field list belongs here because it is a fact about `ZkNote`, and a host
415
- * enumerating it independently would miss `counterpartyPk` — the one that is
448
+ * enumerating it independently would miss `sourcePk` — the one that is
416
449
  * optional on the way in and easy to overlook.
417
450
  */
418
451
 
@@ -423,7 +456,7 @@ declare function removeByCommitment(notes: ZkNote[], commitmentHexes: Set<string
423
456
  * without listing it here is a type error rather than a note that silently
424
457
  * normalises incompletely.
425
458
  */
426
- declare const NOTE_BIGINT_FIELDS: readonly ["value", "assetId", "ownerPk", "blinding", "spendingKey", "commitment", "nullifier", "counterpartyPk"];
459
+ declare const NOTE_BIGINT_FIELDS: readonly ["value", "assetId", "ownerPk", "blinding", "spendingKey", "commitment", "nullifier", "sourcePk"];
427
460
  /**
428
461
  * Coerces a note's scalars to `bigint`, or throws naming the field that cannot
429
462
  * be repaired.
@@ -603,6 +636,20 @@ declare class VaultStore {
603
636
  */
604
637
  declare function detectCommitmentMismatch(notes: ZkNote[], validateCommitment?: (commitmentHex: string) => Promise<boolean>): Promise<boolean>;
605
638
 
639
+ /**
640
+ * Is `value` a 0x-prefixed hex string of exactly `byteLen` bytes?
641
+ *
642
+ * A total predicate on `unknown`, for validating values that crossed a trust
643
+ * boundary — a decoded payment slip, an indexer response, a pasted string.
644
+ * Those arrive as `unknown` or as a `string` the type system already believes,
645
+ * and a bare `typeof === 'string'` check admits script tags, URLs and megabyte
646
+ * payloads into fields the wallet later stores and renders.
647
+ *
648
+ * Returns a boolean rather than throwing: callers at a boundary usually want to
649
+ * drop the value or reject the message, not unwind. Use `fromHex` when a throw
650
+ * is the right answer.
651
+ */
652
+ declare function isHexOfLength(value: unknown, byteLen: number): value is string;
606
653
  /**
607
654
  * Converts a Uint8Array or number[] to a 0x-prefixed lowercase hex string.
608
655
  */
@@ -639,6 +686,8 @@ declare function scalarToHex(value: bigint): string;
639
686
 
640
687
  /**
641
688
  * Serialises a bigint as a 32-byte little-endian Uint8Array.
689
+ *
690
+ * Throws on a negative value or one ≥ 2^256 — see `assert32ByteRange`.
642
691
  */
643
692
  declare function bigintTo32Le(n: bigint): Uint8Array;
644
693
  /**
@@ -647,11 +696,17 @@ declare function bigintTo32Le(n: bigint): Uint8Array;
647
696
  declare function bytesToBigintLE(bytes: Uint8Array): bigint;
648
697
  /**
649
698
  * Serialises a bigint as a 32-byte big-endian Uint8Array.
699
+ *
700
+ * Throws on a negative value or one ≥ 2^256 — see `assert32ByteRange`.
650
701
  */
651
702
  declare function bigintTo32Be(n: bigint): Uint8Array;
652
703
  /**
653
704
  * Serialises a bigint as a 32-element little-endian number[].
654
705
  * Useful when building SCALE-encoded arguments via polkadot-api.
706
+ *
707
+ * Throws on a negative value or one ≥ 2^256 — see `assert32ByteRange`. This is
708
+ * the encoder that feeds commitments straight into extrinsic arguments, so a
709
+ * silently-wrong value here lands on chain.
655
710
  */
656
711
  declare function bigintTo32LeArr(n: bigint): number[];
657
712
  /**
@@ -986,7 +1041,7 @@ declare function addressToFieldElement(address: string): bigint;
986
1041
  * tagActivationLeaf.
987
1042
  *
988
1043
  * Plaintext layout (120 bytes):
989
- * value_lo(8 LE) || value_hi(8 LE) || owner_pk(32) || blinding(32) || asset_id(4 LE) || counterparty_pk(32) || circuit_version(4 LE)
1044
+ * value_lo(8 LE) || value_hi(8 LE) || owner_pk(32) || blinding(32) || asset_id(4 LE) || source_pk(32) || circuit_version(4 LE)
990
1045
  *
991
1046
  * value is stored as a 128-bit LE unsigned integer (two uint64 words), supporting
992
1047
  * amounts up to ~3.4 × 10^38 planck — well above any realistic token supply.
@@ -1019,12 +1074,12 @@ declare const EncryptedMemo: {
1019
1074
  * (from PrivacyKeyManager.getViewingPublicKeyPacked() or
1020
1075
  * decoded from a privacy address).
1021
1076
  * Pass `new Uint8Array(32)` (all zeros) for a publicly-readable memo.
1022
- * @param counterpartyPk 32-byte counterparty BJJ Ax. Default: all zeros.
1077
+ * @param sourcePk 32-byte counterparty BJJ Ax. Default: all zeros.
1023
1078
  * @param circuitVersion ZK circuit version the note is spent under. Default: 0.
1024
1079
  * @param ephSkOverride 32-byte ephemeral secret key (stealth coordination). Optional.
1025
1080
  * @returns 180-byte encrypted memo: nonce(12) || ciphertext+MAC(136) || ephPk(32).
1026
1081
  */
1027
- encrypt(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, recipientIvkPacked: Uint8Array, counterpartyPk?: Uint8Array, circuitVersion?: number, ephSkOverride?: Uint8Array): Uint8Array;
1082
+ encrypt(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, recipientIvkPacked: Uint8Array, sourcePk?: Uint8Array, circuitVersion?: number, ephSkOverride?: Uint8Array): Uint8Array;
1028
1083
  /**
1029
1084
  * Returns a 180-byte public memo encrypted with a zero viewing key.
1030
1085
  * Decryptable by anyone with `decrypt(memo, commitment, new Uint8Array(32))`.
@@ -1089,7 +1144,16 @@ declare const EncryptedMemo: {
1089
1144
  _decrypt(memoBytes: Uint8Array, commitment: Uint8Array, viewingSecretKey: Uint8Array): DecryptedMemo | null;
1090
1145
  };
1091
1146
 
1092
- declare function serializeMemo(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, counterpartyPk: Uint8Array, circuitVersion: number): Uint8Array;
1147
+ /**
1148
+ * Serialises the 120-byte memo plaintext.
1149
+ *
1150
+ * The BYTE OFFSETS are the frozen contract, not the parameter names — a golden
1151
+ * vector pins them, and any other implementation has to agree with those
1152
+ * offsets to interoperate. `sourcePk` occupies [84,116); older material calls
1153
+ * that field `counterparty_pk`, which is the same 32 bytes under a name that
1154
+ * wrongly suggested it identifies the sender.
1155
+ */
1156
+ declare function serializeMemo(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, sourcePk: Uint8Array, circuitVersion: number): Uint8Array;
1093
1157
  /**
1094
1158
  * Derive the 1-byte view tag (Monero-style fast-scan filter) from the ECDH
1095
1159
  * shared secret:
@@ -1202,8 +1266,16 @@ interface PaymentSlipFields {
1202
1266
  */
1203
1267
  declare function sealPaymentSlip(recipientIvkPacked: Uint8Array, fields: PaymentSlipFields): Uint8Array;
1204
1268
  /**
1205
- * Open a payment slip with the recipient's viewing secret key. Returns the fields
1206
- * or null (not ours / corrupt). Never throws — safe in import loops.
1269
+ * Open a payment slip with the recipient's viewing secret key.
1270
+ *
1271
+ * Returns the fields, or null when the slip is not ours, is corrupt, or carries
1272
+ * a field that cannot be what it claims. Never throws: the input is a string a
1273
+ * user pasted, and an exception here takes down the paste handler rather than
1274
+ * one import.
1275
+ *
1276
+ * The result is REBUILT field by field rather than returned from `JSON.parse` —
1277
+ * see the note on the MAC at the top of this file for why a decrypted slip is
1278
+ * still untrusted input.
1207
1279
  */
1208
1280
  declare function openPaymentSlip(recipientIvsk: Uint8Array, envelope: Uint8Array): PaymentSlipFields | null;
1209
1281
  /** URI scheme prefix. The version is in the name, so a v2 reader can refuse a v1. */
@@ -1325,10 +1397,10 @@ declare class NoteBuilder {
1325
1397
  * @param note The ZkNote whose fields populate the plaintext.
1326
1398
  * @param recipientIvkPacked 32-byte LE packed BJJ viewing public key of the recipient.
1327
1399
  * Pass `new Uint8Array(32)` (default) for a public/dummy memo.
1328
- * @param counterpartyPk 32-byte counterparty BabyJubJub Ax.
1400
+ * @param sourcePk 32-byte counterparty BabyJubJub Ax.
1329
1401
  * Pass `new Uint8Array(32)` (default) for no counterparty.
1330
1402
  */
1331
- static buildMemo(note: ZkNote, recipientIvkPacked?: Uint8Array, counterpartyPk?: Uint8Array): Uint8Array;
1403
+ static buildMemo(note: ZkNote, recipientIvkPacked?: Uint8Array, sourcePk?: Uint8Array): Uint8Array;
1332
1404
  }
1333
1405
 
1334
1406
  /**
@@ -1452,6 +1524,24 @@ type OutgoingHint = ScanCommitment & {
1452
1524
  declare function tryRecoverOutgoing(hint: OutgoingHint, ovk: Uint8Array, opts?: {
1453
1525
  viewTagActivationLeaf?: number;
1454
1526
  }): OutgoingNoteRecord | null;
1527
+ /**
1528
+ * Collect what a sender can still say about a note they sent.
1529
+ *
1530
+ * There is no decryption on this path and no key involved. The memo travels
1531
+ * verbatim, exactly as published — the point is to FORWARD it to the recipient
1532
+ * inside a fresh payment slip, not to read it. The recipient opens it with
1533
+ * their own viewing key as they always would.
1534
+ *
1535
+ * That is what makes a slip recoverable after a lost device: re-issuing one
1536
+ * needs the commitment, the memo, and the leaf index, all of them public.
1537
+ *
1538
+ * What is NOT recoverable this way is the amount and the recipient, which live
1539
+ * inside the sealed memo. A sender restoring from a seed alone gets working
1540
+ * slips, not their outgoing history.
1541
+ *
1542
+ * Never throws (runs in recovery loops).
1543
+ */
1544
+ declare function collectOutgoingFacts(hint: ScanCommitment): NoteFacts | null;
1455
1545
 
1456
1546
  /**
1457
1547
  * Proving what ONE note holds, without granting any power to spend it.
@@ -2582,8 +2672,13 @@ declare class CircuitVersionResolver {
2582
2672
  */
2583
2673
  declare class EvmClient {
2584
2674
  private readonly rpcUrl;
2585
- /** @param rpcUrl - HTTP URL of the EVM JSON-RPC endpoint (e.g. `"http://localhost:9933"`). */
2586
- constructor(rpcUrl: string);
2675
+ private readonly peerRpcUrl?;
2676
+ /**
2677
+ * @param rpcUrl - HTTP URL of the EVM JSON-RPC endpoint (e.g. `"http://localhost:9933"`).
2678
+ * @param peerRpcUrl - Optional second endpoint, used only to tell a genuinely
2679
+ * pending transaction from one stranded on `rpcUrl` alone. See `waitForReceipt`.
2680
+ */
2681
+ constructor(rpcUrl: string, peerRpcUrl?: string | undefined);
2587
2682
  /**
2588
2683
  * Performs a single JSON-RPC call and returns the typed result.
2589
2684
  * Throws on HTTP errors, RPC-level errors, or a `null` result.
@@ -2605,8 +2700,16 @@ declare class EvmClient {
2605
2700
  getChainId(): Promise<number>;
2606
2701
  /** Returns the transaction count (nonce) for an EVM address. */
2607
2702
  getTransactionCount(address: string): Promise<number>;
2608
- /** Returns the current gas price in wei. */
2609
- getGasPrice(): Promise<bigint>;
2703
+ /**
2704
+ * Returns the current gas price in wei, padded by `bumpPercent`.
2705
+ *
2706
+ * `eth_gasPrice` reports the base fee exactly, and the base fee moves
2707
+ * between signing and the pool's next revalidation. A transaction priced at
2708
+ * the bare minimum is evicted as `GasPriceTooLow` the moment it rises, which
2709
+ * leaves every later nonce from that account stranded in the future queue.
2710
+ * The default 25% pad absorbs the usual movement.
2711
+ */
2712
+ getGasPrice(bumpPercent?: number): Promise<bigint>;
2610
2713
  /** Submits a signed raw transaction. Returns the transaction hash. */
2611
2714
  sendRawTransaction(signedHex: string): Promise<string>;
2612
2715
  /** Executes a read-only call without creating a transaction. Returns the raw ABI-encoded response. */
@@ -2641,6 +2744,13 @@ declare class EvmClient {
2641
2744
  * @throws If the transaction dropped, is still pending after the grace window, or reverted (`status == 0x0`).
2642
2745
  */
2643
2746
  waitForReceipt(txHash: string, intervalMs?: number, timeoutMs?: number): Promise<Record<string, unknown>>;
2747
+ /**
2748
+ * True when `rpcUrl` knows the transaction but the configured peer does not.
2749
+ *
2750
+ * Returns false without a peer configured, and on any peer error — an
2751
+ * unreachable peer is not evidence that a live transaction is stranded.
2752
+ */
2753
+ private isStrandedOnThisNode;
2644
2754
  }
2645
2755
 
2646
2756
  /** Enriched EVM transaction model for explorer UIs. */
@@ -2852,6 +2962,12 @@ declare class EvmExplorer {
2852
2962
  type OrbinumClientCommon = {
2853
2963
  /** HTTP URL of the EVM JSON-RPC endpoint (e.g. `"http://localhost:9933"`). Omit to disable EVM support. */
2854
2964
  evmRpc?: string;
2965
+ /**
2966
+ * HTTP URL of a second, independent EVM endpoint. Never used for submission —
2967
+ * only to tell a genuinely pending transaction from one stranded on `evmRpc`
2968
+ * alone, which reports as pending forever but can never mine.
2969
+ */
2970
+ evmRpcPeer?: string;
2855
2971
  /**
2856
2972
  * Base URL of a circuits-artifact mirror serving `manifest.json` and the
2857
2973
  * artifacts beside it. Omit for the default npm CDN (unpkg).
@@ -3220,6 +3336,12 @@ type EvmTxRequest = {
3220
3336
  to: string;
3221
3337
  data: string;
3222
3338
  value?: bigint;
3339
+ /**
3340
+ * Explicit gas price in wei. Omit to let the wallet pick, which prices the
3341
+ * transaction at the bare base fee — enough to be evicted as `GasPriceTooLow`
3342
+ * the moment the base fee rises, stranding every later nonce from the account.
3343
+ */
3344
+ gasPrice?: bigint;
3223
3345
  };
3224
3346
  /** Callback that signs and submits an EVM transaction, returning the tx hash. */
3225
3347
  type EvmSigner = (tx: EvmTxRequest) => Promise<string>;
@@ -3236,121 +3358,73 @@ interface KnownPrecompileInfo {
3236
3358
  *
3237
3359
  * This precompile wraps `pallet-shielded-pool` extrinsics and dispatches them
3238
3360
  * on behalf of the EVM caller (resolved to an AccountId32 via
3239
- * `EeSuffixAddressMapping`). No Substrate signer is required — an EVM wallet
3240
- * is sufficient.
3361
+ * `EeSuffixAddressMapping`). No Substrate signer is required — an EVM wallet is
3362
+ * sufficient, so EVM-only users can shield, transfer and unshield without ever
3363
+ * installing a Polkadot extension.
3241
3364
  *
3242
- * ### Key benefit for apps
3243
- * EVM-only users (MetaMask, Phantom bridge via chain links, etc.) can shield,
3244
- * transfer, and unshield without ever needing a Polkadot extension.
3245
- *
3246
- * All write methods accept an `EvmSigner` callback so the module stays
3247
- * transport-agnostic. See `buildShieldCalldata` etc. if you only need the
3248
- * raw calldata for custom signing flows.
3365
+ * This class is TRANSPORT only: the precompile address, the signer callback and
3366
+ * gas estimation. The calldata itself is built by `shieldedPoolCalldata`, which
3367
+ * needs no chain connection import those functions directly for custom
3368
+ * signing flows rather than constructing a client you never call.
3249
3369
  */
3370
+
3250
3371
  declare class ShieldedPoolPrecompile {
3251
3372
  private readonly evm;
3252
3373
  private readonly addr;
3253
3374
  constructor(evm: EvmClient);
3254
- /**
3255
- * Returns the ABI-encoded calldata for `shield(uint32, bytes32, bytes)`.
3256
- * The token amount must be sent as `msg.value` (the `value` field of the EVM
3257
- * transaction) — this is what MetaMask and other wallets display to the user.
3258
- */
3259
3375
  buildShieldCalldata(params: ShieldParams): string;
3376
+ buildPrivateTransferCalldata(params: PrivateTransferParams): string;
3377
+ buildUnshieldCalldata(params: UnshieldParams): string;
3378
+ buildClaimShieldedFeesCalldata(params: ClaimShieldedFeesParams): string;
3260
3379
  /**
3261
3380
  * Deposits tokens into the shielded pool from a payable EVM transaction.
3262
3381
  *
3263
- * The token amount is sent as `msg.value` so EVM wallets (MetaMask, etc.) display
3264
- * the correct amount on the confirmation screen. The precompile dispatches
3265
- * `shieldedPool.shield` with its own address as origin, so the funds flow:
3266
- * caller precompile (via msg.value, handled by EVM)
3267
- * precompile → pool (via pallet transfer)
3268
- * This avoids double-deduction while keeping the displayed amount accurate.
3382
+ * The amount rides as `msg.value` so EVM wallets show the correct figure on
3383
+ * the confirmation screen. The precompile then dispatches with its OWN
3384
+ * address as origin, so funds flow caller → precompile → pool. That avoids
3385
+ * a double deduction while keeping the displayed amount accurate.
3269
3386
  *
3270
3387
  * Extrinsic: `shieldedPool.shield(assetId, amount, commitment, encryptedMemo)`
3271
3388
  */
3272
3389
  shield(params: ShieldParams, signer: EvmSigner): Promise<string>;
3273
3390
  /**
3274
- * Returns the ABI-encoded calldata for
3275
- * `privateTransfer(bytes, bytes32, bytes32[], bytes32[], bytes[], uint32, uint256, uint32)`.
3276
- * The trailing `uint32` is the circuit version the input notes were created under.
3277
- */
3278
- buildPrivateTransferCalldata(params: PrivateTransferParams): string;
3279
- /**
3280
- * Submits a private transfer within the shielded pool from an EVM transaction.
3391
+ * Submits a private transfer within the shielded pool.
3281
3392
  *
3282
- * The EVM caller identity is **irrelevant to the ZK proof** — the sender is
3283
- * hidden by design. Any EVM address (including a relayer) can submit a valid proof.
3393
+ * The EVM caller identity is IRRELEVANT to the ZK proof — the sender is
3394
+ * hidden by design, so any address (a relayer included) can submit a valid
3395
+ * proof.
3284
3396
  *
3285
3397
  * Extrinsic: `shieldedPool.privateTransfer(proof, merkleRoot, nullifiers, commitments, memos)`
3286
3398
  */
3287
3399
  privateTransfer(params: PrivateTransferParams, signer: EvmSigner): Promise<string>;
3288
- /**
3289
- * Params for an `unshield` call via the EVM precompile.
3290
- * The `recipient` is a full 32-byte AccountId32 (Substrate account or
3291
- * EeSuffix-derived: `H160 ++ [0x00; 12]`).
3292
- */
3293
- buildUnshieldCalldata(params: UnshieldParams): string;
3294
3400
  /**
3295
3401
  * Withdraws tokens from the shielded pool to a recipient account.
3296
3402
  *
3297
- * `params.recipientAddress` must be a 0x-prefixed 64-hex-char AccountId32.
3298
- * To send to an EVM address, use `evmToImplicitSubstrate(evmAddr)` from
3299
- * `@orbinum/sdk` to derive the AccountId32 first.
3403
+ * `params.recipientAddress` must be a 0x-prefixed AccountId32. To send to an
3404
+ * EVM address, derive it first with `evmToImplicitSubstrate(evmAddr)`.
3300
3405
  *
3301
3406
  * Extrinsic: `shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient)`
3302
3407
  */
3303
3408
  unshield(params: UnshieldParams, signer: EvmSigner): Promise<string>;
3304
3409
  /**
3305
- * Estimates the EVM gas for a `shield` call without submitting.
3306
- * Requires `from` to be set to the actual sender address.
3307
- */
3308
- estimateShieldGas(params: ShieldParams, from: string): Promise<bigint>;
3309
- /**
3310
- * Estimates the EVM gas for a `privateTransfer` call.
3311
- */
3312
- estimatePrivateTransferGas(params: PrivateTransferParams, from: string): Promise<bigint>;
3313
- /**
3314
- * Estimates the EVM gas for an `unshield` call.
3315
- */
3316
- estimateUnshieldGas(params: UnshieldParams, from: string): Promise<bigint>;
3317
- /**
3318
- * Returns the ABI-encoded calldata for
3319
- * `claimShieldedFees(bytes32,uint256,uint32,bytes,bytes,bytes,uint32)`.
3410
+ * Claims accrued relay fees as a private shielded note.
3320
3411
  *
3321
- * ABI layout (params after selector):
3322
- * - `commitment` — bytes32 (fixed)
3323
- * - `amount` uint256 (fixed)
3324
- * - `asset_id` — uint32 (fixed, right-aligned)
3325
- * - `memo` — bytes (dynamic)
3326
- * - `proof` — bytes (dynamic, 128 bytes Groth16)
3327
- * - `publicSignals` — bytes (dynamic, 76 bytes)
3328
- * - `circuitVersion` — uint32 (fixed, right-aligned)
3412
+ * For validators/relayers holding fees in `pallet-relayer` who want them
3413
+ * paid privately into the shielded pool rather than as a public balance
3414
+ * credit. The ZK `value_proof` binds `commitment` to
3415
+ * `(amount, assetId, ownerPk, blinding)`, so the runtime can verify the note
3416
+ * encodes exactly the claimed amount and a malicious relayer cannot inflate
3417
+ * the withdrawal.
3329
3418
  *
3330
- * The validator identity is derived from `msg.sender` in the precompile
3331
- * do NOT include it in the calldata.
3332
- */
3333
- buildClaimShieldedFeesCalldata(params: ClaimShieldedFeesParams): string;
3334
- /**
3335
- * Claims accumulated relay fees as a private shielded note.
3336
- *
3337
- * This extrinsic is for **validators/relayers** who have accrued fees in
3338
- * `pallet-relayer` and want to receive them privately inside the shielded pool
3339
- * instead of as a public balance credit.
3340
- *
3341
- * The ZK `value_proof` binds `commitment` to `(amount, assetId, ownerPk, blinding)`
3342
- * so the runtime can verify the note encodes exactly the claimed fee amount,
3343
- * preventing a malicious relayer from inflating the withdrawal.
3344
- *
3345
- * The `msg.sender` EVM address is used as the validator identity; it must match
3346
- * the address that has pending relay fees in `pallet-relayer`.
3419
+ * The `msg.sender` address is the validator identity, and must match the
3420
+ * one with pending fees.
3347
3421
  *
3348
3422
  * Extrinsic: `shieldedPool.claim_shielded_fees(commitment, amount, assetId, memo, proof, publicSignals)`
3349
3423
  */
3350
3424
  claimShieldedFees(params: ClaimShieldedFeesParams, signer: EvmSigner): Promise<string>;
3351
- /**
3352
- * Estimates the EVM gas for a `claimShieldedFees` call.
3353
- */
3425
+ estimateShieldGas(params: ShieldParams, from: string): Promise<bigint>;
3426
+ estimatePrivateTransferGas(params: PrivateTransferParams, from: string): Promise<bigint>;
3427
+ estimateUnshieldGas(params: UnshieldParams, from: string): Promise<bigint>;
3354
3428
  estimateClaimShieldedFeesGas(params: ClaimShieldedFeesParams, from: string): Promise<bigint>;
3355
3429
  }
3356
3430
 
@@ -3543,6 +3617,8 @@ interface ClientProviderConfig {
3543
3617
  substrateWs: string;
3544
3618
  /** HTTP URL of the EVM JSON-RPC endpoint (e.g. `"http://localhost:9933"`). Omit to disable EVM support. */
3545
3619
  evmRpc?: string;
3620
+ /** HTTP URL of a second EVM endpoint, used only to detect transactions stranded on `evmRpc`. */
3621
+ evmRpcPeer?: string;
3546
3622
  /** Base URL of a circuits-artifact mirror (manifest.json + artifacts). Omit to use the default npm CDN. */
3547
3623
  circuitsBaseUrl?: string;
3548
3624
  /** Timeout for the initial WebSocket handshake in milliseconds. Default: `8_000`. */
@@ -4495,7 +4571,13 @@ declare function resolveSelfEphCeiling(params: {
4495
4571
  /**
4496
4572
  * Discovery window size for the next scan, given the persisted counter: at least
4497
4573
  * the default, rounded up so every index the wallet may already have used (plus
4498
- * the gap margin) falls inside the fast path.
4574
+ * the gap margin) falls inside the fast path, and never past `MAX_EPH_WINDOW`.
4575
+ *
4576
+ * The counter is read from a config that survives restores and hand-editing, so
4577
+ * a non-finite value is treated as "no history" rather than propagated: `NaN`
4578
+ * would make the builder's `i < from + count` false immediately and return an
4579
+ * EMPTY window, silently disabling the fast path, while `Infinity` would make
4580
+ * that same loop never terminate.
4499
4581
  */
4500
4582
  declare function windowSizeForCounter(counter: number): number;
4501
4583
 
@@ -4854,7 +4936,7 @@ interface BuildNoteParams {
4854
4936
  /** Packed viewing public key of the RECIPIENT, from their privacy address. */
4855
4937
  viewingPublicKey?: Uint8Array | undefined;
4856
4938
  /** Counterparty ownerPk. Zero for shield/unshield notes. */
4857
- counterpartyPk?: bigint | undefined;
4939
+ sourcePk?: bigint | undefined;
4858
4940
  /** Recipient's global ownerPk. With `viewingPublicKey`, enables stealth. */
4859
4941
  recipientOwnerPk?: bigint | undefined;
4860
4942
  /**
@@ -5172,7 +5254,7 @@ interface TransferDeps {
5172
5254
  assetId: bigint;
5173
5255
  ownerPk: bigint;
5174
5256
  spendingKey?: bigint;
5175
- counterpartyPk: bigint;
5257
+ sourcePk: bigint;
5176
5258
  viewingPublicKey?: Uint8Array;
5177
5259
  recipientOwnerPk?: bigint;
5178
5260
  }) => Promise<ZkNote>;
@@ -5529,6 +5611,218 @@ declare function getInjectedExtensions(): string[];
5529
5611
  */
5530
5612
  declare function connectInjectedExtension(name: string, origin?: string): Promise<InjectedExtension>;
5531
5613
 
5614
+ /**
5615
+ * NoteProvenance — the single vocabulary for "where did this note come from,
5616
+ * and where did it go".
5617
+ *
5618
+ * Several mechanisms answer that question, and before this module they had
5619
+ * separate vocabularies and no contract between them:
5620
+ *
5621
+ * - the memo's `sourcePk` field, readable by whoever can decrypt the note
5622
+ * (the recipient always; the sender only for the change note they kept);
5623
+ * - a lookup by commitment, which returns only what is already public — no
5624
+ * amount, no recipient, but enough to re-issue a payment slip.
5625
+ *
5626
+ * They are not competing designs. They are providers of the same fact, and
5627
+ * `ProvenanceSource` records which one spoke. Nothing here derives a key: this
5628
+ * layer only holds data already recovered.
5629
+ *
5630
+ * A sender cannot reopen a memo sealed toward someone else, so the amount and
5631
+ * recipient of an outgoing transfer are NOT recoverable from a seed alone. What
5632
+ * survives is the ability to hand the recipient a working slip again.
5633
+ */
5634
+
5635
+ /**
5636
+ * Which operation produced a note.
5637
+ *
5638
+ * Replaces reading intent out of `sourcePk === 0n`, which had come to mean
5639
+ * three unrelated things at once: "shield or unshield", "an older record that
5640
+ * omitted the field", and "recipient not yet known". A note whose origin is
5641
+ * genuinely unknown says so.
5642
+ */
5643
+ type NoteOrigin = 'shield' | 'transfer-in' | 'transfer-change' | 'unshield-change' | 'fee-claim' | 'unknown';
5644
+ /**
5645
+ * Who wrote this record, and therefore how much to trust it.
5646
+ *
5647
+ * `witnessed` is the wallet's own account of a transfer it submitted — the
5648
+ * strongest, since nothing was recovered or guessed. `memo` is a decrypted
5649
+ * fact. `chain` is a lookup by commitment: trustworthy but thin, carrying only
5650
+ * public fields. `inferred` is arithmetic over the notes an extrinsic touched,
5651
+ * and is the only one that can be wrong about the amount.
5652
+ */
5653
+ type ProvenanceSource = 'witnessed' | 'memo' | 'chain' | 'inferred';
5654
+ /**
5655
+ * What kind of public key `peer.pk` is.
5656
+ *
5657
+ * Orbinum stamps ONE-TIME stealth keys in memos on purpose — a stable
5658
+ * identifier in the recipient's note would link every payment from the same
5659
+ * sender forever. The UI needs to know which it holds: a global pk is an
5660
+ * address a user can act on, a stealth pk is a per-transfer artifact that
5661
+ * happens to look identical in hex.
5662
+ */
5663
+ type PkScope = 'global' | 'stealth' | 'none';
5664
+ /** The other party to a transfer, with the nature of the key made explicit. */
5665
+ type ProvenancePeer = {
5666
+ /** BabyJubJub Ax coordinate. */
5667
+ pk: bigint;
5668
+ scope: PkScope;
5669
+ };
5670
+ /**
5671
+ * The amount moved, and whether that figure is exact.
5672
+ *
5673
+ * `exact` is a property of the FIGURE, not of the source: an `inferred` record
5674
+ * whose fee resolved is exact too. Keeping them separate is what lets the UI
5675
+ * mark an approximation without pretending to know where it came from.
5676
+ */
5677
+ type ProvenanceAmount = {
5678
+ /** Amount in planck. */
5679
+ value: bigint;
5680
+ /** False when the figure was derived and something in the derivation was unknown. */
5681
+ exact: boolean;
5682
+ };
5683
+ /**
5684
+ * One entry in the wallet's private history. Subsumes what used to be three
5685
+ * separate shapes: the app's `LocalTxRecord`, the scanner's
5686
+ * `ReconstructedTxRecord`, and the per-note facts a lookup returns.
5687
+ */
5688
+ type NoteProvenanceRecord = {
5689
+ /** Primary key — the tx hash, or `{block}-{index}` when it was not decoded. */
5690
+ id: string;
5691
+ /** 0x-prefixed extrinsic hash. Empty when the extrinsic could not be resolved. */
5692
+ hash: string;
5693
+ blockNumber: number;
5694
+ /** Unix ms. On-chain block time where known, local wall-clock otherwise. */
5695
+ timestampMs: number;
5696
+ /** Explicit direction — replaces `isIncoming`, `outgoing/incoming` and the rest. */
5697
+ direction: 'in' | 'out';
5698
+ kind: 'private_transfer' | 'unshield' | 'shield' | 'fee_claim';
5699
+ origin: NoteOrigin;
5700
+ source: ProvenanceSource;
5701
+ /** The other party, or null when this operation has none (shield, fee claim)
5702
+ * or when no one-time key was available to record. */
5703
+ peer: ProvenancePeer | null;
5704
+ amount: ProvenanceAmount;
5705
+ assetId: bigint;
5706
+ status: 'success' | 'failed';
5707
+ /** Relay fee actually paid, when it could be read from the extrinsic. */
5708
+ feePlanck?: bigint;
5709
+ /** SS58 address that received the funds — unshield only. */
5710
+ publicRecipient?: string;
5711
+ /** The `orbslip1:` payment slip, when one was sealed or regenerated. */
5712
+ slip?: {
5713
+ encoded: string;
5714
+ };
5715
+ /** The recovered note itself, when a decryption path produced one. */
5716
+ note?: NoteFacts;
5717
+ };
5718
+
5719
+ /**
5720
+ * Which of an extrinsic's notes describes the transfer.
5721
+ *
5722
+ * One extrinsic can insert more than one note we own — a self-transfer produces
5723
+ * both the recipient note and the change. Taking whichever comes first would
5724
+ * report the change amount as the transfer amount, and an arbitrary one at
5725
+ * that, since vault order is insertion order.
5726
+ *
5727
+ * The rule: a note carrying a stamped `sourcePk` names the other party, so that
5728
+ * is the one that describes the transfer. In a self-transfer either note
5729
+ * qualifies, since both identify us.
5730
+ *
5731
+ * This was implemented twice — `findChangeNote` in the scanner and
5732
+ * `resolveIncomingTransferMeta` in the app, whose comment already admitted it
5733
+ * was copying the SDK. One rule, one place.
5734
+ */
5735
+
5736
+ /**
5737
+ * True when the note carries a `sourcePk` — i.e. it is not a shield/unshield
5738
+ * output, and not a transfer whose spent note had no one-time key to stamp.
5739
+ *
5740
+ * The type is checked, not just the value. Notes come back from encrypted
5741
+ * storage, and `normalizeNote` is what turns their scalars into bigints — but
5742
+ * this is public API and takes any object with the field, so a record that
5743
+ * skipped normalisation arrives with a string. `'0' != null && '0' !== 0n` is
5744
+ * true, so an unnormalised zero would read as a stamped key and pick the wrong
5745
+ * note: the CHANGE reported as the transfer amount, silently.
5746
+ */
5747
+ declare function hasSourcePk(note: Pick<ZkNote, 'sourcePk'>): boolean;
5748
+ /**
5749
+ * Pick the note that describes the transfer, from the notes of ONE extrinsic
5750
+ * that this wallet owns. Returns undefined when it owns none of them.
5751
+ */
5752
+ declare function selectDescribingNote<T extends Pick<ZkNote, 'sourcePk'>>(candidates: T[]): T | undefined;
5753
+ /**
5754
+ * Same rule, resolving commitment hexes against a lookup first — the shape the
5755
+ * scanner has on hand. Commitments we do not own are skipped.
5756
+ */
5757
+ declare function selectDescribingNoteByCommitment<T extends Pick<ZkNote, 'sourcePk'>>(commitments: string[], noteByCommitment: Map<string, T>): T | undefined;
5758
+
5759
+ /**
5760
+ * Merging what a rescan learned into what the wallet already knew.
5761
+ *
5762
+ * The hazard this exists to remove: reconstruction runs after every scan, over
5763
+ * records the wallet may have written itself at submit time. Those local
5764
+ * records hold what a recovery path cannot: the amount and the recipient, which
5765
+ * live inside a memo sealed toward someone else. Overwriting one loses them.
5766
+ *
5767
+ * The payment slip itself is not at risk — it can be re-issued from public
5768
+ * fields — but a thin `chain` record must never replace a rich local one.
5769
+ *
5770
+ * Before this, the protection was a single spread expression in the
5771
+ * reconstruction loop. The rule is now explicit and testable on its own.
5772
+ */
5773
+
5774
+ declare function outranks(a: ProvenanceSource, b: ProvenanceSource): boolean;
5775
+ /**
5776
+ * Merge an incoming record into an existing one.
5777
+ *
5778
+ * Two rules, in order:
5779
+ *
5780
+ * 1. **A weaker source never overwrites a stronger one's facts.** An
5781
+ * `inferred` backfill cannot replace the amount a `witnessed` record
5782
+ * recorded at submit time.
5783
+ * 2. **Absence never overwrites presence.** Whatever the incoming record does
5784
+ * not carry — a slip, a fee, a public recipient — is kept from the
5785
+ * existing one regardless of rank, because "not recovered" is not "not
5786
+ * there".
5787
+ *
5788
+ * Absence is not only `undefined`. Several fields spell "not known yet" with a
5789
+ * value: block and timestamp use `0`, `hash` and a slip's `encoded` use the
5790
+ * empty string, and a peer uses `scope: 'none'`. Those are gaps too, and
5791
+ * treating them as data let a placeholder win by rank — which is how a record
5792
+ * written before the chain confirmed could erase a block number already
5793
+ * resolved.
5794
+ *
5795
+ * Two fields sit outside the ranking entirely, because rank is the wrong
5796
+ * question for them: `status` is the chain's own outcome, and `amount.exact`
5797
+ * describes the figure rather than its source.
5798
+ */
5799
+ declare function mergeProvenance(existing: NoteProvenanceRecord, incoming: NoteProvenanceRecord): NoteProvenanceRecord;
5800
+
5801
+ /**
5802
+ * Seal a fresh `orbslip1:` slip for a transfer recovered from history.
5803
+ *
5804
+ * ## Why the facts are checked here
5805
+ *
5806
+ * They were looked up by commitment, so they crossed a trust boundary, and
5807
+ * sealing them produces an AUTHENTICATED envelope. A valid MAC proves the
5808
+ * sender knew the recipient's viewing key — not that they are honest, and not
5809
+ * that whatever server answered the lookup was. The recipient's wallet then
5810
+ * renders those fields with the authority of a decrypted slip, on a device
5811
+ * where nothing explains which server supplied them.
5812
+ *
5813
+ * So the check belongs on THIS side of the wire: a value that slipped through
5814
+ * would fail on the recipient's device, or worse, not fail at all.
5815
+ *
5816
+ * Throws on a malformed commitment, memo or leaf index — those are the note's
5817
+ * identity, and a slip carrying a wrong one is not a degraded slip but a broken
5818
+ * one. `txHash` is informational, so it is DROPPED rather than fatal.
5819
+ *
5820
+ * @param facts public facts of the sent note, looked up by commitment
5821
+ * @param recipientIvkPacked 32-byte packed viewing key from the recipient's privacy address
5822
+ * @param txHash the transfer's hash, when known — informational, shown as proof of payment
5823
+ */
5824
+ declare function regeneratePaymentSlip(facts: NoteFacts, recipientIvkPacked: Uint8Array, txHash?: string): string;
5825
+
5532
5826
  /**
5533
5827
  * `OrbinumWallet` — the assembled wallet: keys, vault, scanner, note building.
5534
5828
  *
@@ -5695,4 +5989,4 @@ declare class OrbinumWallet {
5695
5989
  private requireKey;
5696
5990
  }
5697
5991
 
5698
- export { type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BackupImportKeys, type BlockInfo, type BuildNoteDeps, type BuildNoteParams, type Bytes32, CachedNullifier, type ChainInfo, ChainModule, type ChunkInfo, CircuitId, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CoinSelection, type CollectScanEntriesParams, type CommitmentsInsertedEvent, type ConnectionStatus, type CryptoKey$1 as CryptoKey, CryptoPrecompiles, type DecodedPrecompile, DecryptPool, DecryptedMemo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, EncryptedNoteRecord, EncryptedTxRecord, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFacts, type ExtrinsicRecord, type FeeClaimDeps, type FeeClaimParams, type FeeClaimProofInputs, type FeeClaimProofOutput, type FeeClaimStep, type FormatOptions, KNOWN_PALLET_ERRORS, KNOWN_PRECOMPILES, type KnownPrecompileInfo, LEAVES_PER_TREE, MIN_GASLESS_FEE, MIN_SIGNATURE_BYTES, MemoryVaultStorage, type MerkleRootUpdatedEvent, type MutableWalletSession, NATIVE_ASSET_ID, NOTE_BACKUP_VERSION, NOTE_BIGINT_FIELDS, NOTE_TRANSFER_URI_SCHEME, type NoteBackup, type NoteBackupEntry, type NoteBuildKeys, NoteBuilder, type NoteDisclosure, NoteInput, NoteStatusUpdate, NoteStorage, type NoteTransferEntry, type NoteTransferPayload, type NoteWithMeta, type NotesCache, NullifierCache, type NullifierChunkBody, type NullifierManifest, type NullifierSource, NullifierSyncMeta, type NullifierTail, type NullifiersSpentEvent, OVK_BLOB_SIZE, type ObservableNotesCache, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, OrbinumWallet, type OrbinumWalletConfig, type OutgoingHint, OutgoingNoteRecord, PAGE_SIZE, PAYMENT_SLIP_SCHEME, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, type PalletErrorKind, type PaymentSlipFields, type PersistParams, type PrecompileMethod, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofOptions, type ProviderFactory, QR_PAGE_MAX_CHARS, RECOVERED_TX_RESULT, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type ReconstructDeps, type ReconstructedTxRecord, type RegisterAssetArgs, type RelayerInfo, RelayerStatusModule, type ResolveSpentSetParams, type ResolvedProverVersion, type ResolvedSpendVersion, type RpcV2MerkleProof, RpcV2Module, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, type RunScanParams, SPENDING_KEY_CANONICAL_ORIGIN, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanChunkManifest, ScanCommitment, type ScanHint, type ScanHintPage, type ScanHintSource, ScanKeys, type ScanOptions, type ScanOutcome, type ScanProgress, type ScanResult, SecretStore, type SelfEphWindowEntry, type SelfStealthKeys, type SessionCacheDeps, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SlipImportKeys, SpendDetails, type SpendPlanProblem, type SpendPrivacyReads, type SpendVault, type SpendableInputsCheck, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, TRANSFER_INPUTS, TRANSFER_OUTPUTS, type TokenInfo, type TokenTransfer, type TransferDeps, type TransferFactsRow, type TransferFactsSource, type TransferInputNote, type TransferOutputNote, type TransferParams, type TransferPlan, type TransferResult, type TransferStep, type TransferSubmitRequest, type TxFactsSource, TxHistoryStore, type TxKind, type TxLandingPollOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldDeps, type UnshieldNoteParams, type UnshieldParams, type UnshieldPlan, type UnshieldProofInputs, type UnshieldProofResult, type UnshieldStep, type UnshieldSubmitRequest, type UnshieldedEvent, type UnverifyAssetArgs, VAULT_SCHEMA_VERSION, VaultConfigRecord, VaultLockedError, VaultStorage, VaultStore, type VaultStoreDeps, type VaultUnlockOptions, type VerifyAssetArgs, type VersionedArtifactProvider, type WalletScanKeys, type WalletSession, ZkNote, type ZkVerifierCircuitVersionInfo, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, addressToFieldElement, applyBatch, applyNoteStatus, assembleNoteTransfer, base64UrlDecode, base64UrlEncode, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildConfig, buildDummyTransferInput, buildShieldBatchOperations, buildShieldParams, buildZkNote, bytesToBigintLE, bytesToBjjScalar, cacheSession, canPairWith, canonicalAccountId, chainActiveCircuitVersion, checkSpendableInputs, claimFees, classifyChainError, clearSession, collectNullifiersToQuery, collectScanEntries, commitmentHexOf, computeNoteCommitment, computeNullifier, computePathIndices, connectInjectedExtension, createNoteDisclosureKey, createNotesCache, createWalletSession, decodeNoteBackup, decodeNoteDisclosureKey, decodeNoteTransferPage, decodePaymentSlip, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOutgoingCipherKey, deriveOutgoingViewingKey, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromMaster, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, detectCommitmentMismatch, encodeNoteBackup, encodeNoteTransferPages, encodePaymentSlip, encryptJson, encryptNote, ensureCreatedAt, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, extractPalletError, failed, fastMulBase, fastMulPoint, fetchExtrinsicFacts, formatAmountPlain, formatBalance, formatORB, fromBase64, fromHex, gapMargin, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getInjectedExtensions, getPrecompileLabel, hasCachedSession, hasInjectedExtensions, hexToBigint, hexToNumber, implicitSubstrateToEvm, importNotesFromBackup, importPaymentSlip, isAbortError, isAlreadySpentError, isConnectionLossError, isEvmAddress, isGhostNoteError, isImplicitEvmAccount, isNativeAsset, isNoteSelfConsistent, isSpendable, isSs58, isSubstrateAddress, isUnifiedAddress, isValidLeafIndex, leHexToBigint, mapExtrinsicArgs, mapZkEventData, markInputsSpent, normalizeChainFingerprint, normalizeEvmAddress, normalizeNote, normalizeNotes, noteBlindTag, noteCreatedAt, noteCreatedTxHash, noteMatchesCommitment, noteOrigin, noteSpentTxHash, noteToTransferEntry, noteTxKind, openOutgoingBlob, openPaymentSlip, pairwiseEphWindow, palletErrorKind, parseAmount, parseEvmAddress, persistCursor, persistScanResults, planTransfer, planUnshield, randomBlinding, randomOutgoingBlob, reconstructOutgoingTxRecords, recoverOwnerPkPoint, recoverSelfStealthNote, refuseIfAlreadySpent, removeByCommitment, requireSessionKeys, reservePairwiseIndex, reserveSelfEphIndex, resolveSelfEphCeiling, resolveSpentSet, resolveSpentStatus, restoreSession, runScan, scalarToHex, scanAbortError, sealOutgoingBlob, sealPaymentSlip, selectGhosts, selectNotes, selfEphWindow, serializeMemo, sessionCacheKey, shortHash, signAndSubmitTx, spendableBalance, stampCreatedAt, stampCreatedTxHash, stampSpentTxHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, transferNotes, treeIdOf, treeOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, tryRecoverOutgoing, txLandedAfterError, unshieldNote, upsertNote, vaultReplacer, vaultReviver, vaultStorageName, windowSizeForCounter };
5992
+ export { type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BackupImportKeys, type BlockInfo, type BuildNoteDeps, type BuildNoteParams, type Bytes32, CachedNullifier, type ChainInfo, ChainModule, type ChunkInfo, CircuitId, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CoinSelection, type CollectScanEntriesParams, type CommitmentsInsertedEvent, type ConnectionStatus, type CryptoKey$1 as CryptoKey, CryptoPrecompiles, type DecodedPrecompile, DecryptPool, DecryptedMemo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, EncryptedNoteRecord, EncryptedTxRecord, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFacts, type ExtrinsicRecord, type FeeClaimDeps, type FeeClaimParams, type FeeClaimProofInputs, type FeeClaimProofOutput, type FeeClaimStep, type FormatOptions, KNOWN_PALLET_ERRORS, KNOWN_PRECOMPILES, type KnownPrecompileInfo, LEAVES_PER_TREE, MIN_GASLESS_FEE, MIN_SIGNATURE_BYTES, MemoryVaultStorage, type MerkleRootUpdatedEvent, type MutableWalletSession, NATIVE_ASSET_ID, NOTE_BACKUP_VERSION, NOTE_BIGINT_FIELDS, NOTE_TRANSFER_URI_SCHEME, type NoteBackup, type NoteBackupEntry, type NoteBuildKeys, NoteBuilder, type NoteDisclosure, NoteFacts, NoteInput, type NoteOrigin, type NoteProvenanceRecord, NoteStatusUpdate, NoteStorage, type NoteTransferEntry, type NoteTransferPayload, type NoteWithMeta, type NotesCache, NullifierCache, type NullifierChunkBody, type NullifierManifest, type NullifierSource, NullifierSyncMeta, type NullifierTail, type NullifiersSpentEvent, OVK_BLOB_SIZE, type ObservableNotesCache, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, OrbinumWallet, type OrbinumWalletConfig, type OutgoingHint, OutgoingNoteRecord, PAGE_SIZE, PAYMENT_SLIP_SCHEME, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, type PalletErrorKind, type PaymentSlipFields, type PersistParams, type PkScope, type PrecompileMethod, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofOptions, type ProvenanceAmount, type ProvenancePeer, type ProvenanceSource, type ProviderFactory, QR_PAGE_MAX_CHARS, RECOVERED_TX_RESULT, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type ReconstructDeps, type ReconstructedTxRecord, type RegisterAssetArgs, type RelayerInfo, RelayerStatusModule, type ResolveSpentSetParams, type ResolvedProverVersion, type ResolvedSpendVersion, type RpcV2MerkleProof, RpcV2Module, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, type RunScanParams, SPENDING_KEY_CANONICAL_ORIGIN, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanChunkManifest, ScanCommitment, type ScanHint, type ScanHintPage, type ScanHintSource, ScanKeys, type ScanOptions, type ScanOutcome, type ScanProgress, type ScanResult, SecretStore, type SelfEphWindowEntry, type SelfStealthKeys, type SessionCacheDeps, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SlipImportKeys, SpendDetails, type SpendPlanProblem, type SpendPrivacyReads, type SpendVault, type SpendableInputsCheck, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, TRANSFER_INPUTS, TRANSFER_OUTPUTS, type TokenInfo, type TokenTransfer, type TransferDeps, type TransferFactsRow, type TransferFactsSource, type TransferInputNote, type TransferOutputNote, type TransferParams, type TransferPlan, type TransferResult, type TransferStep, type TransferSubmitRequest, type TxFactsSource, TxHistoryStore, type TxKind, type TxLandingPollOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldDeps, type UnshieldNoteParams, type UnshieldParams, type UnshieldPlan, type UnshieldProofInputs, type UnshieldProofResult, type UnshieldStep, type UnshieldSubmitRequest, type UnshieldedEvent, type UnverifyAssetArgs, VAULT_SCHEMA_VERSION, VaultConfigRecord, VaultLockedError, VaultStorage, VaultStore, type VaultStoreDeps, type VaultUnlockOptions, type VerifyAssetArgs, type VersionedArtifactProvider, type WalletScanKeys, type WalletSession, ZkNote, type ZkVerifierCircuitVersionInfo, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, addressToFieldElement, applyBatch, applyNoteStatus, assembleNoteTransfer, base64UrlDecode, base64UrlEncode, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildConfig, buildDummyTransferInput, buildShieldBatchOperations, buildShieldParams, buildZkNote, bytesToBigintLE, bytesToBjjScalar, cacheSession, canPairWith, canonicalAccountId, chainActiveCircuitVersion, checkSpendableInputs, claimFees, classifyChainError, clearSession, collectNullifiersToQuery, collectOutgoingFacts, collectScanEntries, commitmentHexOf, computeNoteCommitment, computeNullifier, computePathIndices, connectInjectedExtension, createNoteDisclosureKey, createNotesCache, createWalletSession, decodeNoteBackup, decodeNoteDisclosureKey, decodeNoteTransferPage, decodePaymentSlip, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOutgoingCipherKey, deriveOutgoingViewingKey, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromMaster, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, detectCommitmentMismatch, encodeNoteBackup, encodeNoteTransferPages, encodePaymentSlip, encryptJson, encryptNote, ensureCreatedAt, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, extractPalletError, failed, fastMulBase, fastMulPoint, fetchExtrinsicFacts, formatAmountPlain, formatBalance, formatORB, fromBase64, fromHex, gapMargin, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getInjectedExtensions, getPrecompileLabel, hasCachedSession, hasInjectedExtensions, hasSourcePk, hexToBigint, hexToNumber, implicitSubstrateToEvm, importNotesFromBackup, importPaymentSlip, isAbortError, isAlreadySpentError, isConnectionLossError, isEvmAddress, isGhostNoteError, isHexOfLength, isImplicitEvmAccount, isNativeAsset, isNoteSelfConsistent, isSpendable, isSs58, isSubstrateAddress, isUnifiedAddress, isValidLeafIndex, leHexToBigint, mapExtrinsicArgs, mapZkEventData, markInputsSpent, mergeProvenance, normalizeChainFingerprint, normalizeEvmAddress, normalizeNote, normalizeNotes, noteBlindTag, noteCreatedAt, noteCreatedTxHash, noteMatchesCommitment, noteOrigin, noteSpentTxHash, noteToTransferEntry, noteTxKind, openOutgoingBlob, openPaymentSlip, outranks, pairwiseEphWindow, palletErrorKind, parseAmount, parseEvmAddress, persistCursor, persistScanResults, planTransfer, planUnshield, randomBlinding, randomOutgoingBlob, reconstructOutgoingTxRecords, recoverOwnerPkPoint, recoverSelfStealthNote, refuseIfAlreadySpent, regeneratePaymentSlip, removeByCommitment, requireSessionKeys, reservePairwiseIndex, reserveSelfEphIndex, resolveSelfEphCeiling, resolveSpentSet, resolveSpentStatus, restoreSession, runScan, scalarToHex, scanAbortError, sealOutgoingBlob, sealPaymentSlip, selectDescribingNote, selectDescribingNoteByCommitment, selectGhosts, selectNotes, selfEphWindow, serializeMemo, sessionCacheKey, shortHash, signAndSubmitTx, spendableBalance, stampCreatedAt, stampCreatedTxHash, stampSpentTxHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, transferNotes, treeIdOf, treeOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, tryRecoverOutgoing, txLandedAfterError, unshieldNote, upsertNote, vaultReplacer, vaultReviver, vaultStorageName, windowSizeForCounter };