@orbinum/sdk 0.11.0 → 0.13.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.mts CHANGED
@@ -3,7 +3,7 @@ import { PolkadotClient, TxFinalizedPayload, PolkadotSigner, TxOptions } from 'p
3
3
  export { PolkadotSigner, getSs58AddressInfo } from 'polkadot-api';
4
4
  import { getDynamicBuilder } from '@polkadot-api/metadata-builders';
5
5
  import { getExtrinsicDecoder } from '@polkadot-api/tx-utils';
6
- import { ArtifactProvider, ProofResult } from '@orbinum/proof-generator';
6
+ import { CircuitType, ArtifactProvider, ProofResult } from '@orbinum/proof-generator';
7
7
  export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider } from '@orbinum/proof-generator';
8
8
  export { AccountId, Blake2256, Keccak256, Storage, u128, u64 } from '@polkadot-api/substrate-bindings';
9
9
  export { base58 } from '@scure/base';
@@ -498,544 +498,20 @@ declare class EvmExplorer {
498
498
  private static hexToDecimalStr;
499
499
  }
500
500
 
501
- /** Configuration for IndexerClient. */
502
- interface IndexerClientConfig {
503
- /** Base URL of the indexer REST API (no trailing slash). */
504
- baseUrl: string;
505
- /** Request timeout in ms. Default: 10_000. */
506
- timeoutMs?: number;
507
- }
508
- /** Generic paginated result returned by list endpoints. */
509
- interface PaginatedResult<T> {
510
- data: T[];
511
- pagination: {
512
- page: number;
513
- limit: number;
514
- total: number;
515
- };
516
- }
517
- /** A shielded commitment (shield event) stored by the indexer. */
518
- interface ShieldedCommitment {
519
- commitmentHex: string;
520
- blockNumber: number;
521
- extrinsicIndex: number | null;
522
- leafIndex: number;
523
- /**
524
- * Asset ID as decimal string.
525
- * For `source: 'shield'` and `source: 'unshield'` this reflects the real asset.
526
- * For `source: 'transfer'` it is always `"0"` — the chain intentionally omits the asset ID
527
- * from `CommitmentsInserted` events to prevent graph correlation across assets.
528
- * The true asset is recoverable only by decrypting `encryptedMemo`.
529
- */
530
- assetId: string;
531
- /** Origin of the commitment: direct shield, output of private transfer, or change from unshield. */
532
- source: 'shield' | 'transfer' | 'unshield';
533
- /** 0x-prefixed encrypted memo hex, null if not present. */
534
- encryptedMemo: string | null;
535
- timestampMs: number | null;
536
- }
537
- /** A spent nullifier stored by the indexer. */
538
- interface SpentNullifier {
539
- nullifierHex: string;
540
- blockNumber: number;
541
- extrinsicIndex: number | null;
542
- txType: 'unshield' | 'private_transfer';
543
- timestampMs: number | null;
544
- }
545
- /** One sealed, immutable chunk of the spent-nullifier set (manifest entry). */
546
- interface NullifierChunkInfo {
547
- idx: number;
548
- /** Exact number of nullifiers in the chunk. */
549
- count: number;
550
- /** sha256 (hex) of the chunk's nullifier hexes sorted ascending — goes in the chunk URL. */
551
- digest: string;
552
- }
553
- /**
554
- * Universal index of the sealed nullifier chunks — identical for every caller.
555
- * No client-supplied position parameter exists anywhere in the chunk flow, so
556
- * the PIR-A property of `/nullifiers/all` is preserved while transfers become
557
- * incremental (clients persist chunks locally and only fetch new ones).
558
- */
559
- interface NullifierManifest {
560
- /** Bumped by the operator on semantic corrections; a change means: resync from zero. */
561
- generation: string;
562
- /** Target chunk size (informational; each chunk's exact size is its `count`). */
563
- chunkSize: number;
564
- chunks: NullifierChunkInfo[];
565
- /** Σ sealed counts + current tail size. */
566
- total: number;
567
- }
568
- /** The mutable remainder of the nullifier set after the last sealed chunk. */
569
- interface NullifierTail {
570
- /** Number of sealed chunks the tail starts after (detects a chunk sealed mid-sync). */
571
- afterChunks: number;
572
- data: string[];
573
- }
574
- /** Temporal metadata for a private transfer. No graph data (inputs ↔ outputs) exposed. */
575
- interface PrivateTransferTimestamp {
576
- blockNumber: number;
577
- extrinsicIndex: number | null;
578
- /** Blake2-256 hash of the raw extrinsic, 0x-prefixed. Null if the extrinsic was not decoded. */
579
- hash: string | null;
580
- timestampMs: number | null;
581
- /**
582
- * Subset of the queried nullifiers that were spent in this specific extrinsic.
583
- * Returned by `getTransfersByNullifiers`. Use to identify which input vault notes
584
- * belong to this transfer for local reconstruction.
585
- */
586
- matchedNullifiers?: string[];
587
- /**
588
- * Subset of the queried commitments that were inserted in this specific extrinsic.
589
- * Returned by `getTransfersByCommitments`. Use to identify which output vault notes
590
- * (change notes or received notes) belong to this transfer.
591
- */
592
- matchedCommitments?: string[];
593
- }
594
- /** An unshield event stored by the indexer. */
595
- interface Unshield {
596
- /** "{blockNumber}-{extrinsicIndex}" */
597
- id: string;
598
- blockNumber: number;
599
- extrinsicIndex: number | null;
600
- /** Blake2-256 hash of the raw extrinsic, 0x-prefixed. Null if the extrinsic was not decoded. */
601
- hash: string | null;
602
- nullifierHex: string;
603
- /** Asset ID as decimal string. */
604
- assetId: string;
605
- /** Amount as decimal string (bigint-safe). */
606
- amount: string;
607
- recipient: string;
608
- timestampMs: number | null;
609
- }
610
- /** A Merkle root checkpoint stored by the indexer. */
611
- interface MerkleRoot {
612
- id: number;
613
- rootHex: string;
614
- blockNumber: number;
615
- oldRootHex: string | null;
616
- treeSize: number;
617
- timestampMs: number | null;
618
- }
619
- /** Response from the nullifier status endpoint. */
620
- interface NullifierStatusResult {
621
- nullifier: string;
622
- spent: boolean;
623
- txType?: 'unshield' | 'private_transfer';
624
- blockNumber?: number;
625
- }
626
- /** A substrate extrinsic row returned by the address indexer endpoint. */
627
- interface IndexedExtrinsic {
628
- id: string;
629
- blockNumber: number;
630
- index: number;
631
- hash: string | null;
632
- section: string;
633
- method: string;
634
- signer: string | null;
635
- success: boolean;
636
- feePaid: string | null;
637
- eventsJson: string;
638
- argsJson: string;
639
- timestampMs: number | null;
640
- }
641
- /** An indexed EVM transaction returned by explorer endpoints. */
642
- interface IndexedEvmTx {
643
- hash: string;
644
- blockNumber: number;
645
- fromAddress: string | null;
646
- toAddress: string | null;
647
- value: string;
648
- gasUsed: number | null;
649
- gasPrice: string | null;
650
- status: number | null;
651
- inputData: string | null;
652
- nonce: number | null;
653
- transactionIndex: number | null;
654
- timestampMs: number | null;
655
- evmBlockHash: string | null;
656
- }
657
- /** An indexed block returned by the blocks endpoint. */
658
- interface IndexedBlock {
659
- number: number;
660
- hash: string;
661
- parentHash: string;
662
- timestampMs: number | null;
663
- author: string | null;
664
- extrinsicCount: number;
665
- evmTxCount: number;
666
- evmHash: string | null;
667
- evmParentHash?: string | null;
668
- evmMiner?: string | null;
669
- evmGasUsed?: string | null;
670
- evmGasLimit?: string | null;
671
- evmBaseFeePerGas?: string | null;
672
- }
673
- /** Aggregated statistics returned by the /stats endpoint. */
674
- interface IndexerStats {
675
- blocks: {
676
- indexed: number;
677
- latest: number | null;
678
- latestHash: string | null;
679
- latestTimestampMs: number | null;
680
- };
681
- extrinsics: {
682
- total: number;
683
- signed: number;
684
- };
685
- evm: {
686
- transactions: number;
687
- };
688
- shielded: {
689
- commitments: number;
690
- spentNullifiers: number;
691
- merkleRoot: string | null;
692
- treeSize: number | null;
693
- };
694
- relayers: {
695
- active: number;
696
- };
697
- zkVerifier: {
698
- total: number;
699
- successful: number;
700
- };
701
- }
702
- /** One hour-bucket of transaction activity from `/stats/activity`. */
703
- interface ActivityBucket {
704
- hourStartMs: number;
705
- transactions: number;
706
- signedExtrinsics: number;
707
- evmTransactions: number;
708
- }
709
- /** Transaction activity bucketed per hour over the last N hours of chain time. */
710
- interface IndexerActivity {
711
- hours: number;
712
- anchorMs: number | null;
713
- buckets: ActivityBucket[];
714
- }
715
- /** A registered relayer stored by the indexer. */
716
- interface Relayer {
717
- evmAddress: string;
718
- account: string;
719
- active: boolean;
720
- registeredAtBlock: number;
721
- unregisteredAtBlock: number | null;
722
- timestampMs: number | null;
723
- }
724
- /** A relay fee accumulation or consumption event stored by the indexer. */
725
- interface RelayFeeEvent {
726
- id: number;
727
- relayer: string;
728
- assetId: string;
729
- /** Amount as decimal string (bigint-safe). */
730
- amount: string;
731
- eventType: 'accumulated' | 'consumed';
732
- blockNumber: number;
733
- timestampMs: number | null;
734
- }
735
- /** Aggregated relay fee balance per asset for a given relayer. */
736
- interface RelayFeeSummaryEntry {
737
- assetId: string;
738
- /** Total accumulated (bigint string). */
739
- accumulated: string;
740
- /** Total consumed (bigint string). */
741
- consumed: string;
742
- /** pending = accumulated − consumed (bigint string). */
743
- pending: string;
744
- }
745
- /** A registered asset stored by the indexer. */
746
- interface RegisteredAsset {
747
- assetId: string;
748
- name: string | null;
749
- symbol: string | null;
750
- decimals: number | null;
751
- contractAddress: string | null;
752
- /** Whether the asset is verified by the protocol. */
753
- verified: boolean;
754
- registeredAtBlock: number;
755
- timestampMs: number | null;
756
- }
757
- /**
758
- * One shielded-pool BOUNDARY event for an address, as served by
759
- * `GET /shielded/address/:addr`. Only boundary facts are exposed — block,
760
- * asset, amount (unshield), time, tx hash. Note internals (commitment hex,
761
- * leaf index, nullifier, memo, sender/recipient) are never returned
762
- * per-address: a public sender→leaf mapping would shrink the shielded pool's
763
- * anonymity set. Private transfers carry no address and are never included.
764
- */
765
- interface ShieldedAddressEvent {
766
- /** 'shield' = deposit into the pool by this address; 'unshield' = withdrawal received by it. */
767
- kind: 'shield' | 'unshield';
768
- blockNumber: number;
769
- extrinsicIndex: number | null;
770
- /** Asset ID as decimal string. */
771
- assetId: string;
772
- /**
773
- * Amount as decimal string (bigint-safe) for unshields.
774
- * Always null for shields — the shield amount lives in the extrinsic, not the index.
775
- */
776
- amount: string | null;
777
- timestampMs: number | null;
778
- /** Blake2-256 hash of the enclosing extrinsic, 0x-prefixed. Null if not decoded. */
779
- hash: string | null;
780
- }
781
- /** A validator node indexed from pallet-validator-set events. */
782
- interface IndexedValidator {
783
- account: string;
784
- /** Current lifecycle status of the validator. */
785
- status: 'pending' | 'approved' | 'rejected' | 'removed';
786
- /** Reserved bond amount as decimal string (bigint-safe). Null if no bond was reserved. */
787
- bondAmount: string | null;
788
- requestedAtBlock: number | null;
789
- approvedAtBlock: number | null;
790
- removedAtBlock: number | null;
791
- timestampMs: number | null;
792
- }
793
- /** A session rotation event indexed from pallet-session NewSession events. */
794
- interface IndexedSession {
795
- sessionIndex: number;
796
- blockNumber: number;
797
- timestampMs: number | null;
798
- }
799
- /**
800
- * Lightweight hint returned by the stealth scan endpoint.
801
- * Contains only the fields required for a wallet to:
802
- * 1. Compute ECDH shared secret: ephPkHex × ivsk
803
- * 2. Attempt ChaCha20-Poly1305 decryption of encryptedMemo
804
- * Ordered ascending by leafIndex for incremental cursor compatibility.
805
- */
806
- interface StealthScanHint {
807
- leafIndex: number;
808
- commitmentHex: string;
809
- /**
810
- * Asset ID as decimal string.
811
- * For shield-origin commitments this is the real asset ID.
812
- * For transfer-origin commitments this is always `"0"` — the chain does not emit the asset ID
813
- * in `CommitmentsInserted` events by design (privacy: prevents cross-asset graph correlation).
814
- * Recover the true asset by decrypting `encryptedMemo`.
815
- */
816
- assetId: string;
817
- /** Ephemeral public key (last 32 bytes of encrypted_memo), 0x-prefixed. null if memo absent. */
818
- ephPkHex: string | null;
819
- /** Full 168-byte encrypted memo (0x-prefixed hex). null if not present. */
820
- encryptedMemo: string | null;
821
- }
822
-
823
- /**
824
- * HTTP client for the Orbinum indexer REST API.
825
- *
826
- * All methods throw on network errors.
827
- * Methods returning a single entity return `null` when the server responds 404.
828
- */
829
- declare class IndexerClient {
830
- private readonly baseUrl;
831
- private readonly timeoutMs;
832
- constructor(config: IndexerClientConfig);
833
- private _fetchResponse;
834
- private get;
835
- private getOrNull;
836
- private buildQuery;
837
- /** Returns the total count of shielded commitments. */
838
- getCommitmentsCount(): Promise<number>;
839
- /** Returns a paginated list of shielded commitments. */
840
- getCommitments(params?: {
841
- page?: number;
842
- limit?: number;
843
- sinceLeafIndex?: number;
844
- }): Promise<PaginatedResult<ShieldedCommitment>>;
845
- /** Returns a single commitment by its hex string, or null if not found. */
846
- getCommitmentByHex(hex: string): Promise<ShieldedCommitment | null>;
847
- /**
848
- * Returns a paginated list of stealth scan hints ordered ascending by leafIndex.
849
- * Each hint contains only the fields required for ECDH triage and decryption:
850
- * leafIndex, commitmentHex, assetId, ephPkHex, encryptedMemo.
851
- *
852
- * Use `sinceLeafIndex` for incremental scans (cursor = last seen leafIndex + 1).
853
- */
854
- getScanHints(params?: {
855
- page?: number;
856
- limit?: number;
857
- sinceLeafIndex?: number;
858
- }): Promise<PaginatedResult<StealthScanHint>>;
859
- /** Returns a paginated list of spent nullifiers. */
860
- getNullifiers(params?: {
861
- page?: number;
862
- limit?: number;
863
- }): Promise<PaginatedResult<SpentNullifier>>;
864
- /** Returns the spent/unspent status of a nullifier. */
865
- getNullifierStatus(hex: string): Promise<NullifierStatusResult>;
866
- /**
867
- * Downloads the full spent nullifier set and returns it as a Set of lowercase hex strings.
868
- *
869
- * The server sees an identical GET request regardless of which notes the wallet holds —
870
- * the intersection is computed locally (PIR-A privacy model).
871
- *
872
- * Kept as the FALLBACK for readers that don't serve sealed chunks yet (and for
873
- * small sets). New integrations should prefer the incremental chunk flow:
874
- * `getNullifierManifest` → `getNullifierChunk` for missing chunks →
875
- * `getNullifierTail`, persisting the set locally between rescans.
876
- */
877
- getAllSpentNullifiers(): Promise<Set<string>>;
878
- /**
879
- * Universal index of the sealed nullifier chunks — identical request and
880
- * response for every caller (no client-supplied position: PIR-A preserved).
881
- *
882
- * Returns `null` when the reader does not serve chunks yet (404) — the
883
- * caller should fall back to `getAllSpentNullifiers`.
884
- */
885
- getNullifierManifest(): Promise<NullifierManifest | null>;
886
- /**
887
- * One sealed, immutable chunk of the spent-nullifier set (ascending hex,
888
- * lowercased). The digest comes from the manifest and lives in the URL, so
889
- * a corrected chunk is a different URL — safe to cache forever client-side.
890
- */
891
- getNullifierChunk(idx: number, digest: string): Promise<string[]>;
892
- /**
893
- * The mutable remainder of the nullifier set after the last sealed chunk.
894
- * Identical request for every caller (no input). `afterChunks` lets the
895
- * client detect a chunk sealed between its manifest fetch and this one.
896
- */
897
- getNullifierTail(): Promise<NullifierTail>;
898
- /** Server-enforced max items per by-nullifiers / by-commitments request. */
899
- private static readonly TRANSFER_LOOKUP_CHUNK;
900
- /**
901
- * Chunked fetch for the transfer timestamp lookups. The reader silently
902
- * truncates each request to 50 items, so larger inputs MUST be split or
903
- * results are silently lost. Responses are merged per extrinsic
904
- * (`blockNumber:extrinsicIndex`), concatenating the matched arrays, and
905
- * sorted by block descending.
906
- *
907
- * Privacy note: these lookups send the wallet's own note identifiers to
908
- * the indexer — a bounded, documented linkage tradeoff for timestamp
909
- * recovery. They are NEVER used for spent-STATUS checks (PIR-A: status
910
- * comes from the anonymous full-set `/shielded/nullifiers/all` download).
911
- */
912
- private fetchTransfersChunked;
913
- /**
914
- * Returns temporal metadata for private transfers that spent any of the given nullifiers.
915
- * Only blockNumber, extrinsicIndex, timestampMs, and hash are returned — no cross-link
916
- * between inputs and outputs to prevent graph reconstruction.
917
- * Inputs of any size are transparently chunked into requests of 50 (the server cap)
918
- * and merged per extrinsic.
919
- */
920
- getTransfersByNullifiers(nullifiers: string[]): Promise<PrivateTransferTimestamp[]>;
921
- /**
922
- * Returns temporal metadata for private transfers that produced any of the given commitments.
923
- * Only blockNumber, extrinsicIndex, timestampMs, and hash are returned — no cross-link
924
- * between outputs and inputs to prevent graph reconstruction.
925
- * Inputs of any size are transparently chunked into requests of 50 (the server cap)
926
- * and merged per extrinsic.
927
- */
928
- getTransfersByCommitments(commitments: string[]): Promise<PrivateTransferTimestamp[]>;
929
- /** Returns a paginated list of unshield events. */
930
- getUnshields(params?: {
931
- page?: number;
932
- limit?: number;
933
- }): Promise<PaginatedResult<Unshield>>;
934
- /** Returns a paginated list of Merkle root checkpoints. */
935
- getMerkleRoots(params?: {
936
- page?: number;
937
- limit?: number;
938
- }): Promise<PaginatedResult<MerkleRoot>>;
939
- /** Returns the latest Merkle root, or null if none exists. */
940
- getLatestMerkleRoot(): Promise<MerkleRoot | null>;
941
- /** Returns a paginated list of extrinsics signed by the given address. */
942
- getAddressExtrinsics(address: string, params?: {
943
- page?: number;
944
- limit?: number;
945
- }): Promise<PaginatedResult<IndexedExtrinsic>>;
946
- /** Returns a paginated list of EVM transactions filtered by address and/or block number. */
947
- getEvmTransactions(params?: {
948
- page?: number;
949
- limit?: number;
950
- address?: string;
951
- blockNumber?: number;
952
- }): Promise<PaginatedResult<IndexedEvmTx>>;
953
- /** Returns a single EVM transaction by hash, or null if not found. */
954
- getEvmTransactionByHash(hash: string): Promise<IndexedEvmTx | null>;
955
- /** Returns a paginated list of indexed blocks. */
956
- getBlocks(params?: {
957
- page?: number;
958
- limit?: number;
959
- }): Promise<PaginatedResult<IndexedBlock>>;
960
- /** Returns a single block by number or hash, or null if not found. */
961
- getBlock(numberOrHash: string | number): Promise<IndexedBlock | null>;
962
- /**
963
- * Returns a paginated list of unshield events where the given address is the recipient.
964
- * Accepts a 0x-prefixed EVM address or an SS58 Substrate address.
965
- */
966
- getAddressUnshields(address: string, params?: {
967
- page?: number;
968
- limit?: number;
969
- }): Promise<PaginatedResult<Unshield>>;
970
- /**
971
- * Returns the shielded-pool BOUNDARY activity for an address: shields it
972
- * deposited and unshields it received, tagged `kind: 'shield' | 'unshield'`.
973
- * Only boundary fields are returned (block, asset, amount for unshields,
974
- * timestamp, tx hash) — note internals are never served per-address, and
975
- * private transfers carry no address at all (PIR-A).
976
- */
977
- getAddressShieldedActivity(address: string, params?: {
978
- page?: number;
979
- limit?: number;
980
- }): Promise<PaginatedResult<ShieldedAddressEvent>>;
981
- /** Returns a paginated list of relayers. Filter by active status with `active`. */
982
- getRelayers(params?: {
983
- page?: number;
984
- limit?: number;
985
- active?: boolean;
986
- }): Promise<PaginatedResult<Relayer>>;
987
- /** Returns a single relayer by EVM address, or null if not found. */
988
- getRelayer(evmAddress: string): Promise<Relayer | null>;
989
- /** Returns a paginated list of relay fee events. */
990
- getRelayFees(params?: {
991
- page?: number;
992
- limit?: number;
993
- relayer?: string;
994
- type?: 'accumulated' | 'consumed';
995
- }): Promise<PaginatedResult<RelayFeeEvent>>;
996
- /** Returns aggregated relay fee balances per asset for a given relayer account. */
997
- getRelayFeesSummary(relayer: string): Promise<RelayFeeSummaryEntry[]>;
998
- /** Returns a paginated list of assets registered via register_asset. */
999
- getRegisteredAssets(params?: {
1000
- page?: number;
1001
- limit?: number;
1002
- }): Promise<PaginatedResult<RegisteredAsset>>;
1003
- /** Returns a single registered asset by its ID, or null if not found. */
1004
- getRegisteredAsset(assetId: string): Promise<RegisteredAsset | null>;
1005
- /** Returns a paginated list of validators. Filter by lifecycle status with `status`. */
1006
- getValidators(params?: {
1007
- page?: number;
1008
- limit?: number;
1009
- status?: 'pending' | 'approved' | 'rejected' | 'removed';
1010
- }): Promise<PaginatedResult<IndexedValidator>>;
1011
- /** Returns a single validator by account address, or null if not found. */
1012
- getValidator(account: string): Promise<IndexedValidator | null>;
1013
- /** Returns a paginated list of session rotations, ordered by most recent first. */
1014
- getSessions(params?: {
1015
- page?: number;
1016
- limit?: number;
1017
- }): Promise<PaginatedResult<IndexedSession>>;
1018
- /** Returns aggregated indexer statistics. */
1019
- getStats(): Promise<IndexerStats>;
1020
- /**
1021
- * Returns transaction activity bucketed per hour over the last `hours` hours
1022
- * of chain time (default 24, max 168). For sparklines / activity charts.
1023
- */
1024
- getActivity(hours?: number): Promise<IndexerActivity>;
1025
- /** Returns true if the indexer health endpoint responds OK. */
1026
- isHealthy(): Promise<boolean>;
1027
- }
1028
-
1029
501
  /** Configuration passed to `OrbinumClient.connect()`. */
1030
502
  type OrbinumClientConfig = {
1031
503
  /** WebSocket URL of the Orbinum Substrate node (e.g. `"ws://localhost:9944"`). */
1032
504
  substrateWs: string;
1033
505
  /** HTTP URL of the EVM JSON-RPC endpoint (e.g. `"http://localhost:9933"`). Omit to disable EVM support. */
1034
506
  evmRpc?: string;
1035
- /** Base URL of the Orbinum indexer REST API (e.g. `"https://indexer.orbinum.io"`). Omit to disable indexer support. */
1036
- indexerUrl?: string;
1037
507
  /** Timeout for the initial WebSocket handshake in milliseconds. Default: `15_000`. */
1038
508
  connectTimeoutMs?: number;
509
+ /**
510
+ * Base URL of a circuits-artifact mirror (serving `manifest.json` + artifacts).
511
+ * Passed to the `CircuitVersionResolver`'s provider. Omit to use the default
512
+ * npm CDN (unpkg). Use to point at a self-hosted/multi-version manifest.
513
+ */
514
+ circuitsBaseUrl?: string;
1039
515
  };
1040
516
  /** Result returned by extrinsic-submitting methods (shield, unshield, transfer, …). */
1041
517
  type TxResult = {
@@ -1055,32 +531,51 @@ type TxResult = {
1055
531
  type UnsafeTxOptions = TxOptions<void, Record<string, unknown>>;
1056
532
  declare function toTxResult(payload: TxFinalizedPayload): TxResult;
1057
533
 
534
+ /** On-chain Merkle tree state for the shielded pool. */
1058
535
  type MerkleTreeInfo = {
536
+ /** 0x-prefixed current Merkle root hex. */
1059
537
  root: string;
538
+ /** Number of leaves (commitments) inserted so far. */
1060
539
  treeSize: number;
540
+ /** Tree depth (levels from leaf to root). */
1061
541
  depth: number;
1062
542
  };
543
+ /** A commitment surfaced by the indexer scan feed, for trial-decryption. */
1063
544
  type ScanCommitment = {
545
+ /** 0x-prefixed 32-byte commitment hex. */
1064
546
  commitmentHex: string;
547
+ /** Leaf position of the commitment in the Merkle tree. */
1065
548
  leafIndex: number;
549
+ /** 0x-prefixed encrypted memo hex, or null if none was published. */
1066
550
  encryptedMemo: string | null;
1067
551
  };
552
+ /** Plaintext fields recovered from a note's encrypted memo. */
1068
553
  type DecryptedMemo = {
554
+ /** Note amount in planck. */
1069
555
  value: bigint;
556
+ /** Owner's BabyJubJub Ax coordinate. */
1070
557
  ownerPk: bigint;
558
+ /** Blinding scalar used in the commitment. */
1071
559
  blinding: bigint;
560
+ /** Asset ID of the note. */
1072
561
  assetId: bigint;
1073
562
  /** Counterparty BabyJubJub Ax coordinate. Zero for shield/unshield notes. */
1074
563
  counterpartyPk: bigint;
564
+ /** ZK circuit version the note is spent under, recovered from the memo plaintext. */
565
+ circuitVersion: number;
1075
566
  };
567
+ /** Parameters for shieldedPool.shield — deposits one note into the pool. */
1076
568
  type ShieldParams = {
569
+ /** Asset ID being deposited. */
1077
570
  assetId: number;
571
+ /** Amount to deposit in planck. */
1078
572
  amount: bigint;
1079
573
  /** 0x-prefixed 32-byte commitment hex */
1080
574
  commitment: string;
1081
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
575
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1082
576
  encryptedMemo: Uint8Array;
1083
577
  };
578
+ /** Parameters for shieldedPool.unshield — withdraws from the pool to a clear address. */
1084
579
  type UnshieldParams = {
1085
580
  /** ZK proof bytes */
1086
581
  proof: Uint8Array;
@@ -1088,6 +583,7 @@ type UnshieldParams = {
1088
583
  merkleRoot: string;
1089
584
  /** 0x-prefixed nullifier hex */
1090
585
  nullifier: string;
586
+ /** Asset ID being withdrawn. */
1091
587
  assetId: number;
1092
588
  /** Net amount recipient receives (planck) */
1093
589
  amount: bigint;
@@ -1102,11 +598,13 @@ type UnshieldParams = {
1102
598
  */
1103
599
  changeCommitment?: string;
1104
600
  /**
1105
- * Encrypted memo for the change note (176 bytes).
601
+ * Encrypted memo for the change note (180 bytes).
1106
602
  * Required for partial unshield so the change note can be recovered via blockchain scan.
1107
603
  * Omit for total unshield.
1108
604
  */
1109
605
  changeEncryptedMemo?: Uint8Array;
606
+ /** Circuit version the spent note was created under. Verified against that version's VK. */
607
+ circuitVersion: number;
1110
608
  };
1111
609
  type PrivateTransferInput = {
1112
610
  /** 0x-prefixed nullifier hex */
@@ -1117,11 +615,13 @@ type PrivateTransferInput = {
1117
615
  type PrivateTransferOutput = {
1118
616
  /** 0x-prefixed commitment hex */
1119
617
  commitment: string;
1120
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
618
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1121
619
  encryptedMemo: Uint8Array;
1122
620
  };
1123
621
  type PrivateTransferParams = {
622
+ /** Input notes being spent (nullifier + commitment each). */
1124
623
  inputs: PrivateTransferInput[];
624
+ /** Output notes being created (commitment + encrypted memo each). */
1125
625
  outputs: PrivateTransferOutput[];
1126
626
  /** ZK proof bytes */
1127
627
  proof: Uint8Array;
@@ -1132,6 +632,8 @@ type PrivateTransferParams = {
1132
632
  /** Gasless fee in planck (default 0n; input_sum == output_sum + fee in circuit).
1133
633
  * The fee is paid to the block author (validator) by the pallet runtime. */
1134
634
  fee?: bigint;
635
+ /** Circuit version the input notes were created under. Verified against that version's VK. */
636
+ circuitVersion: number;
1135
637
  };
1136
638
  /** Input params for NoteBuilder.build(). All fields except value have defaults. */
1137
639
  type NoteInput = {
@@ -1147,7 +649,7 @@ type NoteInput = {
1147
649
  spendingKey?: bigint;
1148
650
  /**
1149
651
  * 32-byte LE-encoded packed BJJ viewing public key of the recipient (from their privacy address).
1150
- * When provided, NoteBuilder.build() will auto-generate the 168-byte ECDH-encrypted memo.
652
+ * When provided, NoteBuilder.build() will auto-generate the 180-byte ECDH-encrypted memo.
1151
653
  * Omit to skip memo generation (use buildMemo() separately if needed).
1152
654
  */
1153
655
  viewingPublicKey?: Uint8Array;
@@ -1160,7 +662,16 @@ type NoteInput = {
1160
662
  recipientOwnerPk?: bigint;
1161
663
  /** Counterparty BabyJubJub Ax coordinate. Zero for shield/unshield notes. Default 0n. */
1162
664
  counterpartyPk?: bigint;
665
+ /** Circuit version to stamp on the note. Defaults to `CURRENT_CIRCUIT_VERSION`. */
666
+ circuitVersion?: number;
1163
667
  };
668
+ /**
669
+ * Circuit version notes are created under today. A note carries its version
670
+ * (`ZkNote.circuitVersion`) so that, after a VK rotation, it is always proven
671
+ * and verified against the circuit that created it. Only one version exists
672
+ * today; callers may pass the chain's active version explicitly.
673
+ */
674
+ declare const CURRENT_CIRCUIT_VERSION = 1;
1164
675
  /**
1165
676
  * Computed ZK note (commitment + nullifier). Built entirely off-chain.
1166
677
  *
@@ -1168,11 +679,18 @@ type NoteInput = {
1168
679
  * nullifier = Poseidon(commitment, spendingKey)
1169
680
  */
1170
681
  type ZkNote = {
682
+ /** Note amount in planck. */
1171
683
  value: bigint;
684
+ /** Asset ID of the note. */
1172
685
  assetId: bigint;
686
+ /** Owner's BabyJubJub Ax coordinate (or stealth owner Pk for stealth notes). */
1173
687
  ownerPk: bigint;
688
+ /** Blinding scalar mixed into the commitment. */
1174
689
  blinding: bigint;
690
+ /** Secret spending key used to derive the nullifier. */
1175
691
  spendingKey: bigint;
692
+ /** Circuit version this note was created under (see `CURRENT_CIRCUIT_VERSION`). Required. */
693
+ circuitVersion: number;
1176
694
  /** Whether the note has been spent/nullified on-chain. */
1177
695
  spent: boolean;
1178
696
  /** Local timestamp when this note was marked spent, or null if still active/unknown. */
@@ -1186,7 +704,7 @@ type ZkNote = {
1186
704
  /** 0x-prefixed 32-byte little-endian hex nullifier. */
1187
705
  nullifierHex: string;
1188
706
  /**
1189
- * 168-byte encrypted memo (ChaCha20-Poly1305 ECDH) as number[] for SCALE encoding.
707
+ * 180-byte encrypted memo (ChaCha20-Poly1305 ECDH) as number[] for SCALE encoding.
1190
708
  * Always populated: uses a dummy memo when no viewingPublicKey is provided.
1191
709
  */
1192
710
  memo: number[];
@@ -1195,15 +713,18 @@ type ZkNote = {
1195
713
  };
1196
714
  /** Parameters for a single item in a shield_batch extrinsic. */
1197
715
  type ShieldBatchItem = {
716
+ /** Asset ID being deposited. */
1198
717
  assetId: number;
718
+ /** Amount to deposit in planck. */
1199
719
  amount: bigint;
1200
720
  /** 0x-prefixed 32-byte commitment hex */
1201
721
  commitment: string;
1202
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
722
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1203
723
  encryptedMemo: Uint8Array;
1204
724
  };
1205
725
  /** Parameters for shieldedPool.shieldBatch — deposits up to 20 notes in one extrinsic. */
1206
726
  type ShieldBatchParams = {
727
+ /** The notes to deposit (up to 20). */
1207
728
  items: ShieldBatchItem[];
1208
729
  };
1209
730
  /**
@@ -1224,8 +745,10 @@ type ClaimShieldedFeesParams = {
1224
745
  proof: Uint8Array;
1225
746
  /** 76-byte public signals buffer (commitment || amount_u64_le || assetId_u32_le || owner_hash) */
1226
747
  publicSignals: Uint8Array;
1227
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
748
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1228
749
  encryptedMemo: Uint8Array;
750
+ /** Circuit version of the fee-claim note. Verified against that version's VK. */
751
+ circuitVersion: number;
1229
752
  };
1230
753
 
1231
754
  /**
@@ -1252,14 +775,14 @@ declare class ShieldedPoolModule {
1252
775
  * Withdraws tokens from the shielded pool to a public address.
1253
776
  * Submits as an UNSIGNED (gasless) transaction — fee is embedded in the ZK proof.
1254
777
  * Pass a `signer` to fall back to signed submission (e.g. for testing).
1255
- * Extrinsic: shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient, fee)
778
+ * Extrinsic: shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient, fee, changeCommitment, changeEncryptedMemo, relayer, circuitVersion)
1256
779
  */
1257
780
  unshield(params: UnshieldParams, signer?: PolkadotSigner, txOptions?: UnsafeTxOptions): Promise<TxResult>;
1258
781
  /**
1259
782
  * Performs a private (shielded) transfer between two notes.
1260
783
  * Submits as an UNSIGNED (gasless) transaction — fee is embedded in the ZK proof.
1261
784
  * Pass a `signer` to fall back to signed submission (e.g. for testing).
1262
- * Extrinsic: shieldedPool.privateTransfer(proof, merkleRoot, nullifiers, commitments, memos, assetId, fee)
785
+ * Extrinsic: shieldedPool.privateTransfer(proof, merkleRoot, nullifiers, commitments, memos, assetId, fee, relayer, circuitVersion)
1263
786
  */
1264
787
  privateTransfer(params: PrivateTransferParams, signer?: PolkadotSigner, txOptions?: UnsafeTxOptions): Promise<TxResult>;
1265
788
  /**
@@ -1272,7 +795,7 @@ declare class ShieldedPoolModule {
1272
795
  * This is a SIGNED transaction — the relayer must sign it with their wallet.
1273
796
  * Before calling this, generate a ZK value proof with generateFeeClaimProof() (not yet implemented).
1274
797
  *
1275
- * Extrinsic: shieldedPool.claim_shielded_fees(commitment, amount, asset_id, memo, proof, public_signals)
798
+ * Extrinsic: shieldedPool.claim_shielded_fees(commitment, amount, asset_id, memo, proof, public_signals, circuit_version)
1276
799
  */
1277
800
  claimShieldedFees(params: ClaimShieldedFeesParams, signer: PolkadotSigner, txOptions?: UnsafeTxOptions): Promise<TxResult>;
1278
801
  }
@@ -1635,6 +1158,61 @@ declare class ZkVerifierModule {
1635
1158
  getCircuitVersionInfo(circuitId: number): Promise<ZkVerifierCircuitVersionInfo | null>;
1636
1159
  }
1637
1160
 
1161
+ /** The resolved version + VK hash the prover reports for a circuit. */
1162
+ type ResolvedProverVersion = {
1163
+ version: number;
1164
+ vkHash: string;
1165
+ };
1166
+ /**
1167
+ * A provider that can both serve artifacts and report the version it resolved
1168
+ * for a circuit (`WebArtifactProvider` implements both). The resolver needs the
1169
+ * version-reporting half; it is a separate type so tests can inject a fake.
1170
+ */
1171
+ type VersionedArtifactProvider = ArtifactProvider & {
1172
+ getResolvedVersion(circuit: CircuitType): Promise<ResolvedProverVersion>;
1173
+ };
1174
+ /**
1175
+ * Builds a provider pinned to `noteVersion` for `circuit`. The default uses the
1176
+ * npm CDN (or `baseUrl` mirror); tests inject a fake.
1177
+ */
1178
+ type ProviderFactory = (circuit: CircuitType, noteVersion: number) => VersionedArtifactProvider;
1179
+ /**
1180
+ * The single fail-closed choke point for spending a note under a specific
1181
+ * circuit version.
1182
+ *
1183
+ * A note carries the circuit version it was created under (`ZkNote.circuitVersion`).
1184
+ * When that note is spent, the proof MUST be generated against that version's
1185
+ * artifacts and verified on-chain against that version's VK — never the current
1186
+ * `active_version`, or a VK rotation would make old notes unspendable.
1187
+ *
1188
+ * `resolve()` pins the prover to the note's version, cross-checks that the
1189
+ * prover's VK hash matches what the chain declares for that version, and confirms
1190
+ * the chain still supports it. On any mismatch it throws BEFORE any proof is
1191
+ * generated — there is no fallback to the active version. The returned
1192
+ * `{ provider, version }` is fed to the proof generator and the extrinsic.
1193
+ */
1194
+ type ResolvedSpendVersion = {
1195
+ /** Artifact provider pinned to the note's circuit version. Pass to `generate*Proof`. */
1196
+ provider: ArtifactProvider;
1197
+ /** The circuit version to send in the extrinsic (`circuit_version` arg). */
1198
+ version: number;
1199
+ };
1200
+ declare class CircuitVersionResolver {
1201
+ private readonly zkVerifier;
1202
+ private readonly makeProvider;
1203
+ constructor(zkVerifier: ZkVerifierModule,
1204
+ /** Optional base URL for a self-hosted artifact mirror (else the npm CDN). */
1205
+ baseUrl?: string,
1206
+ /** Override how the pinned provider is built (tests inject a fake). */
1207
+ providerFactory?: ProviderFactory);
1208
+ /**
1209
+ * Resolves the prover + on-chain version for spending a note of `circuit`
1210
+ * created under `noteVersion`. Fail-closed: throws on unsupported version or
1211
+ * VK-hash mismatch (CDN vs chain), before generating any proof.
1212
+ */
1213
+ resolve(circuit: CircuitType, noteVersion: number): Promise<ResolvedSpendVersion>;
1214
+ }
1215
+
1638
1216
  /**
1639
1217
  * Status info for a registered relayer account.
1640
1218
  */
@@ -1735,7 +1313,8 @@ declare class ShieldedPoolPrecompile {
1735
1313
  shield(params: ShieldParams, signer: EvmSigner): Promise<string>;
1736
1314
  /**
1737
1315
  * Returns the ABI-encoded calldata for
1738
- * `privateTransfer(bytes, bytes32, bytes32[], bytes32[], bytes[], uint32, uint256)`.
1316
+ * `privateTransfer(bytes, bytes32, bytes32[], bytes32[], bytes[], uint32, uint256, uint32)`.
1317
+ * The trailing `uint32` is the circuit version the input notes were created under.
1739
1318
  */
1740
1319
  buildPrivateTransferCalldata(params: PrivateTransferParams): string;
1741
1320
  /**
@@ -1778,7 +1357,7 @@ declare class ShieldedPoolPrecompile {
1778
1357
  estimateUnshieldGas(params: UnshieldParams, from: string): Promise<bigint>;
1779
1358
  /**
1780
1359
  * Returns the ABI-encoded calldata for
1781
- * `claimShieldedFees(bytes32,uint256,uint32,bytes,bytes,bytes)`.
1360
+ * `claimShieldedFees(bytes32,uint256,uint32,bytes,bytes,bytes,uint32)`.
1782
1361
  *
1783
1362
  * ABI layout (params after selector):
1784
1363
  * - `commitment` — bytes32 (fixed)
@@ -1787,6 +1366,7 @@ declare class ShieldedPoolPrecompile {
1787
1366
  * - `memo` — bytes (dynamic)
1788
1367
  * - `proof` — bytes (dynamic, 128 bytes Groth16)
1789
1368
  * - `publicSignals` — bytes (dynamic, 76 bytes)
1369
+ * - `circuitVersion` — uint32 (fixed, right-aligned)
1790
1370
  *
1791
1371
  * The validator identity is derived from `msg.sender` in the precompile —
1792
1372
  * do NOT include it in the calldata.
@@ -2076,12 +1656,6 @@ declare class OrbinumClient {
2076
1656
  * `null` when `evmRpc` is not configured.
2077
1657
  */
2078
1658
  readonly evmExplorer: EvmExplorer | null;
2079
- /**
2080
- * HTTP client for the Orbinum indexer REST API.
2081
- * Provides paginated access to indexed blocks, extrinsics, shielded events, and nullifiers.
2082
- * `null` when `indexerUrl` is not configured.
2083
- */
2084
- readonly indexer: IndexerClient | null;
2085
1659
  /** Shielded-pool extrinsics and Merkle tree queries (`shield`, `unshield`, `privateTransfer`, …). */
2086
1660
  readonly shieldedPool: ShieldedPoolModule;
2087
1661
  /** Account-mapping extrinsics: aliases, chain links, metadata, marketplace, and identity. */
@@ -2092,6 +1666,11 @@ declare class OrbinumClient {
2092
1666
  readonly chain: ChainModule;
2093
1667
  /** Typed access to `zkVerifier_*` custom RPC endpoints. */
2094
1668
  readonly zkVerifier: ZkVerifierModule;
1669
+ /**
1670
+ * Resolves a note's circuit version to a pinned prover + on-chain version
1671
+ * before spending it (fail-closed: throws on unsupported version / VK mismatch).
1672
+ */
1673
+ readonly circuitVersionResolver: CircuitVersionResolver;
2095
1674
  /** Typed access to `relayer_*` RPC endpoints (registry lookup and pending fee queries). */
2096
1675
  readonly relayerStatus: RelayerStatusModule;
2097
1676
  /**
@@ -2136,8 +1715,8 @@ interface ClientProviderConfig {
2136
1715
  substrateWs: string;
2137
1716
  /** HTTP URL of the EVM JSON-RPC endpoint (e.g. `"http://localhost:9933"`). Omit to disable EVM support. */
2138
1717
  evmRpc?: string;
2139
- /** Base URL of the Orbinum indexer REST API (e.g. `"https://indexer.orbinum.io"`). Omit to disable indexer support. */
2140
- indexerUrl?: string;
1718
+ /** Base URL of a circuits-artifact mirror (manifest.json + artifacts). Omit to use the default npm CDN. */
1719
+ circuitsBaseUrl?: string;
2141
1720
  /** Timeout for the initial WebSocket handshake in milliseconds. Default: `8_000`. */
2142
1721
  connectTimeoutMs?: number;
2143
1722
  /** Interval between heartbeat probes in milliseconds. Default: `5_000`. */
@@ -2299,7 +1878,7 @@ declare class OrbinumClientProvider {
2299
1878
  *
2300
1879
  * Memo scheme (EncryptedMemo — native TypeScript, no WASM):
2301
1880
  * ChaCha20-Poly1305 with ECDH ephemeral key — SHA256(sharedSecret || commitment || domain)
2302
- * Result: nonce(12) || ciphertext(108 + 16 MAC) || ephPk(32) = 168 bytes
1881
+ * Result: nonce(12) || ciphertext(120 + 16 MAC) || ephPk(32) = 180 bytes
2303
1882
  *
2304
1883
  * Stealth scheme (when viewingPublicKey + recipientOwnerPk are both provided):
2305
1884
  * ephSk is generated once and shared between the ECDH memo and the stealth Pk derivation.
@@ -2324,7 +1903,7 @@ declare class NoteBuilder {
2324
1903
  */
2325
1904
  static build(input: NoteInput): Promise<ZkNote>;
2326
1905
  /**
2327
- * Build the 168-byte ECDH-encrypted memo for a note.
1906
+ * Build the 180-byte ECDH-encrypted memo for a note.
2328
1907
  *
2329
1908
  * Pure TypeScript implementation — no WASM dependency.
2330
1909
  * Uses ChaCha20-Poly1305 with ECDH key agreement (BabyJubJub ephemeral keypair).
@@ -2343,11 +1922,11 @@ declare class NoteBuilder {
2343
1922
  *
2344
1923
  * Mirrors primitives/encrypted-memo in the node repository; no WASM required.
2345
1924
  *
2346
- * Layout (176 bytes, ECDH):
2347
- * nonce(12) || ciphertext+MAC(132) || ephPk_packed(32) = 176
1925
+ * Layout (180 bytes, ECDH):
1926
+ * nonce(12) || ciphertext+MAC(136) || ephPk_packed(32) = 180
2348
1927
  *
2349
- * Plaintext layout (116 bytes):
2350
- * value_lo(8 LE) || value_hi(8 LE) || owner_pk(32) || blinding(32) || asset_id(4 LE) || counterparty_pk(32)
1928
+ * Plaintext layout (120 bytes):
1929
+ * value_lo(8 LE) || value_hi(8 LE) || owner_pk(32) || blinding(32) || asset_id(4 LE) || counterparty_pk(32) || circuit_version(4 LE)
2351
1930
  *
2352
1931
  * value is stored as a 128-bit LE unsigned integer (two uint64 words), supporting
2353
1932
  * amounts up to ~3.4 × 10^38 planck — well above any realistic token supply.
@@ -2362,11 +1941,11 @@ declare class NoteBuilder {
2362
1941
  * Cipher: ChaCha20-Poly1305 (IETF, 96-bit nonce)
2363
1942
  */
2364
1943
 
2365
- /** Memo size: nonce(12) + ciphertext+MAC(132) + ephPk(32) = 176 */
1944
+ /** Memo size: nonce(12) + ciphertext+MAC(136) + ephPk(32) = 180 */
2366
1945
  declare const ENCRYPTED_MEMO_SIZE: number;
2367
1946
  declare const EncryptedMemo: {
2368
1947
  /**
2369
- * Build and encrypt a memo for a note using ECDH (v2, 168 bytes).
1948
+ * Build and encrypt a memo for a note using ECDH (v2, 180 bytes).
2370
1949
  *
2371
1950
  * @param value Note value in planck.
2372
1951
  * @param ownerPk 32-byte owner public key (LE).
@@ -2378,22 +1957,24 @@ declare const EncryptedMemo: {
2378
1957
  * decoded from a privacy address).
2379
1958
  * Pass `new Uint8Array(32)` (all zeros) for a publicly-readable memo.
2380
1959
  * @param counterpartyPk 32-byte counterparty BJJ Ax. Default: all zeros.
2381
- * @returns 168-byte encrypted memo: nonce(12) || ciphertext+MAC(124) || ephPk(32).
1960
+ * @param circuitVersion ZK circuit version the note is spent under. Default: 0.
1961
+ * @param ephSkOverride 32-byte ephemeral secret key (stealth coordination). Optional.
1962
+ * @returns 180-byte encrypted memo: nonce(12) || ciphertext+MAC(136) || ephPk(32).
2382
1963
  */
2383
- encrypt(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, recipientIvkPacked: Uint8Array, counterpartyPk?: Uint8Array, ephSkOverride?: Uint8Array): Uint8Array;
1964
+ encrypt(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, recipientIvkPacked: Uint8Array, counterpartyPk?: Uint8Array, circuitVersion?: number, ephSkOverride?: Uint8Array): Uint8Array;
2384
1965
  /**
2385
- * Returns a 168-byte public memo encrypted with a zero viewing key.
1966
+ * Returns a 180-byte public memo encrypted with a zero viewing key.
2386
1967
  * Decryptable by anyone with `decrypt(memo, commitment, new Uint8Array(32))`.
2387
1968
  * Convenience alias for `encrypt(..., new Uint8Array(32))`.
2388
1969
  */
2389
- encryptPublic(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array): Uint8Array;
1970
+ encryptPublic(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, circuitVersion?: number): Uint8Array;
2390
1971
  /**
2391
- * Returns a 168-byte zeroed dummy memo (no information, always valid on-chain).
1972
+ * Returns a 180-byte zeroed dummy memo (no information, always valid on-chain).
2392
1973
  */
2393
1974
  dummy(): Uint8Array;
2394
1975
  /**
2395
1976
  * Validates that `bytes` is a properly-sized encrypted memo.
2396
- * Throws an Error if the length is not ENCRYPTED_MEMO_SIZE (168 bytes).
1977
+ * Throws an Error if the length is not ENCRYPTED_MEMO_SIZE (180 bytes).
2397
1978
  *
2398
1979
  * Call this at system boundaries (extrinsic builders, precompile encoders)
2399
1980
  * to catch malformed memos before they reach the chain and fail on-chain.
@@ -2407,7 +1988,7 @@ declare const EncryptedMemo: {
2407
1988
  * Returns null if decryption fails — wrong key, bad MAC, or malformed memo.
2408
1989
  * Never throws; safe for scan loops.
2409
1990
  *
2410
- * @param memoBytes 168-byte encrypted memo.
1991
+ * @param memoBytes 180-byte encrypted memo.
2411
1992
  * @param commitment 32-byte note commitment (LE).
2412
1993
  * @param viewingSecretKey 32-byte HKDF viewing secret key from deriveViewingSecretKey().
2413
1994
  */
@@ -2416,13 +1997,13 @@ declare const EncryptedMemo: {
2416
1997
  * Extract the ECDH shared secret from an encrypted memo using the recipient's viewing secret key.
2417
1998
  *
2418
1999
  * Used by NoteDecryptor to obtain the shared secret needed for stealth address derivation
2419
- * without re-running the full decrypt path. Safe to call on any 168-byte memo.
2000
+ * without re-running the full decrypt path. Safe to call on any 180-byte memo.
2420
2001
  *
2421
2002
  * Returns `new Uint8Array(32)` (all zeros) for public/dummy memos (zero ephPk).
2422
2003
  * Returns `null` if the memo is malformed or the ephPk is not a valid BJJ point.
2423
2004
  * Never throws; safe for scan loops.
2424
2005
  *
2425
- * @param memoBytes 168-byte encrypted memo.
2006
+ * @param memoBytes 180-byte encrypted memo.
2426
2007
  * @param viewingSecretKey 32-byte HKDF viewing secret key from deriveViewingSecretKey().
2427
2008
  */
2428
2009
  extractSharedSecret(memoBytes: Uint8Array, viewingSecretKey: Uint8Array): Uint8Array | null;
@@ -2592,6 +2173,11 @@ declare function generateTransferProof(params: PrivateTransferProofInputs, optio
2592
2173
  * 2. The smallest pair whose sum >= needed → [noteA, noteB]
2593
2174
  * 3. No combination covers needed → null (consolidation via merge required)
2594
2175
  *
2176
+ * Both inputs of a transfer are proven together against ONE circuit VK, so a
2177
+ * pair MUST share a circuitVersion — mixing v1 and v2 would produce an invalid
2178
+ * proof. Priority 2 only pairs notes of the same version; a single note (P1) is
2179
+ * always one version so it needs no check.
2180
+ *
2595
2181
  * Only unspent notes with value > 0 are considered.
2596
2182
  */
2597
2183
  declare function selectNotes(notes: ZkNote[], needed: bigint): [ZkNote, ZkNote | null] | null;
@@ -3303,18 +2889,22 @@ type CircuitId = (typeof CircuitId)[keyof typeof CircuitId];
3303
2889
  /**
3304
2890
  * Named constants for all supported ZK circuits.
3305
2891
  *
2892
+ * Values MUST match the node's `CircuitId` constants
2893
+ * (`node/frame/zk-verifier/src/types.rs`). Note: ValueProof is 6, not 4 or
2894
+ * sequential.
2895
+ *
3306
2896
  * | Name | Value | Circuit |
3307
2897
  * |--------------|-------|---------------------------------|
3308
2898
  * | Transfer | 1 | 2-in-2-out private transfer |
3309
2899
  * | Unshield | 2 | Withdrawal from the pool |
3310
- * | ValueProof | 4 | Note value binding (fee-claim) |
3311
2900
  * | PrivateLink | 5 | Private chain-link proof |
2901
+ * | ValueProof | 6 | Note value binding (fee-claim) |
3312
2902
  */
3313
2903
  declare const CircuitId: {
3314
2904
  readonly Transfer: 1;
3315
2905
  readonly Unshield: 2;
3316
- readonly ValueProof: 4;
3317
2906
  readonly PrivateLink: 5;
2907
+ readonly ValueProof: 6;
3318
2908
  };
3319
2909
  /**
3320
2910
  * A single verification key registration entry used in batch operations.
@@ -3955,10 +3545,11 @@ type AccountMappingEvent = {
3955
3545
  */
3956
3546
  type Bytes32 = number[];
3957
3547
  /**
3958
- * 176-byte encrypted memo (ChaCha20-Poly1305 ECDH).
3959
- * Layout: nonce(12) || ciphertext(132) || tag(16) || ephPk(32) = 176 bytes.
3548
+ * 180-byte encrypted memo (ChaCha20-Poly1305 ECDH).
3549
+ * Layout: nonce(12) || ciphertext(136) || ephPk(32) = 180 bytes
3550
+ * (ciphertext = plaintext 120 + MAC 16).
3960
3551
  */
3961
- type Bytes176 = number[];
3552
+ type Bytes180 = number[];
3962
3553
  /**
3963
3554
  * A single shield operation for use in `shield_batch`.
3964
3555
  */
@@ -3967,7 +3558,7 @@ type ShieldOperation = {
3967
3558
  amount: bigint;
3968
3559
  /** 32-byte Poseidon commitment (LE). */
3969
3560
  commitment: Bytes32;
3970
- /** Encrypted memo bytes — exactly 104 bytes. */
3561
+ /** Encrypted memo bytes — exactly 180 bytes. */
3971
3562
  encryptedMemo: number[];
3972
3563
  };
3973
3564
  /**
@@ -3979,7 +3570,7 @@ type ShieldArgs = {
3979
3570
  amount: bigint;
3980
3571
  /** 32-byte Poseidon commitment (LE). */
3981
3572
  commitment: Bytes32;
3982
- /** Encrypted memo — exactly 104 bytes. */
3573
+ /** Encrypted memo — exactly 180 bytes. */
3983
3574
  encryptedMemo: number[];
3984
3575
  };
3985
3576
  /**
@@ -4000,7 +3591,7 @@ type RawTransferInput = {
4000
3591
  type RawTransferOutput = {
4001
3592
  /** 32-byte Poseidon commitment (LE). */
4002
3593
  commitment: Bytes32;
4003
- /** Encrypted memo — exactly 104 bytes. */
3594
+ /** Encrypted memo — exactly 180 bytes. */
4004
3595
  memo: number[];
4005
3596
  };
4006
3597
  /**
@@ -4021,6 +3612,8 @@ type PrivateTransferArgs = {
4021
3612
  assetId: number;
4022
3613
  /** Gasless fee in planck. Paid to the block author (validator). */
4023
3614
  fee: bigint;
3615
+ /** Circuit version the input notes were created under (verified against that version's VK). */
3616
+ circuitVersion: number;
4024
3617
  };
4025
3618
  /**
4026
3619
  * Call index 2 — `unshield` (Unsigned/gasless origin)
@@ -4048,10 +3641,12 @@ type UnshieldArgs = {
4048
3641
  */
4049
3642
  changeCommitment: Bytes32;
4050
3643
  /**
4051
- * Encrypted memo for the change note (176 bytes, empty for total unshield).
3644
+ * Encrypted memo for the change note (180 bytes, empty for total unshield).
4052
3645
  * Enables note recovery via blockchain scan for partial unshield.
4053
3646
  */
4054
- changeEncryptedMemo?: Bytes176;
3647
+ changeEncryptedMemo?: Bytes180;
3648
+ /** Circuit version the spent note was created under (verified against that version's VK). */
3649
+ circuitVersion: number;
4055
3650
  };
4056
3651
  /**
4057
3652
  * Call index 9 — `register_asset` (Root origin)
@@ -4577,4 +4172,4 @@ interface ExtrinsicFailedData {
4577
4172
  dispatch_info: DispatchInfo;
4578
4173
  }
4579
4174
 
4580
- export { type AccountListing, type AccountMappedData, type AccountMappedEvent, type AccountMappingCall, type AccountMappingEvent, AccountMappingModule, AccountMappingPrecompile, type AccountMetadata, type AccountUnmappedEvent, type ActiveVersionSetEvent, type ActivityBucket, type AddChainLinkArgs, type AddChainLinkParams, type AddSupportedChainArgs, type AliasFullIdentity, type AliasInfo, type AliasListedForSaleEvent, type AliasOnSaleData, type AliasRegisteredData, type AliasRegisteredEvent, type AliasReleasedEvent, type AliasSaleCancelledEvent, type AliasSoldData, type AliasSoldEvent, type AliasTransferredData, type AliasTransferredEvent, type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BatchRegisterVerificationKeysArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type BuyAliasArgs, type Bytes32, type ChainInfo, type ChainLink, type ChainLinkAddedEvent, type ChainLinkRemovedEvent, CircuitId, CircuitId as CircuitIdType, type ClaimShieldedFeesParams, type ClientProviderConfig, type CommitmentsInsertedEvent, type CommitmentsInsertedEventData, type ConnectionStatus, CryptoPrecompiles, type DecodedAddChainLinkArgs, type DecodedBatchArgs, type DecodedDispatchAsPrivateLinkArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedPutAliasForSaleArgs, type DecodedRegisterAliasArgs, type DecodedRemarkArgs, type DecodedRevealPrivateLinkArgs, type DecodedSetAccountMetadataArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DispatchAsLinkedAccountArgs, type DispatchAsLinkedParams, type DispatchAsPrivateLinkArgs, type DispatchError, type DispatchInfo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, type EncryptedNoteRecord, type EndowedEventData, type EthereumExecutedData, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, type EvmExecutedData, type EvmExitReason, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFailedData, type ExtrinsicSuccessData, type FeeClaimProofInputs, type FormatOptions, type IndexedBlock, type IndexedEvmTx, type IndexedExtrinsic, type IndexedSession, type IndexedValidator, type IndexerActivity, IndexerClient, type IndexerClientConfig, type IndexerStats, KNOWN_PRECOMPILES, type KnownPrecompileInfo, type ListingInfo, type MerkleRoot, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, type MetadataUpdatedEvent, NoteBuilder, type NoteDisclosure, type NoteInput, type NoteStatusUpdate, type NullifierChunkInfo, type NullifierManifest, type NullifierStatusResult, type NullifierTail, type NullifiersSpentEvent, type NullifiersSpentEventData, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, type PaginatedResult, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateChainLinkAddedEvent, type PrivateChainLinkRemovedEvent, type PrivateChainLinkRevealedEvent, type PrivateLink, type PrivateLinkDispatchExecutedEvent, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type PrivateTransferTimestamp, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type ProxyCallExecutedEvent, type PutAliasOnSaleArgs, type PutOnSaleParams, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAliasArgs, type RegisterAssetArgs, type RegisterPrivateLinkArgs, type RegisterVerificationKeyArgs, type RegisteredAsset, type RelayFeeEvent, type RelayFeeSummaryEntry, type Relayer, type RelayerInfo, RelayerStatusModule, type RemoveChainLinkArgs, type RemovePrivateLinkArgs, type RemoveSupportedChainArgs, type RemoveVerificationKeyArgs, type ReservedEventData, type ResolvedAlias, type RevealPrivateLinkArgs, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SLIP0044_NAMESPACE, type ScanCommitment, type SetAccountMetadataArgs, type SetActiveVersionArgs, type SetMetadataParams, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedAddressEvent, type ShieldedCommitment, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, SignatureScheme, type SpentNullifier, type StatusChangeEvent, type StatusListener, type StealthScanHint, SubstrateClient, type SupportedChain, type SupportedChainAddedEvent, type SupportedChainRemovedEvent, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferAliasArgs, type TransferEventData, type TransferInputNote, type TransferOutputNote, type TxResult, type UnsafeTxOptions, type Unshield, type UnshieldArgs, type UnshieldParams, type UnshieldProofInputs, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, VaultLockedError, type VerificationKeyRegisteredEvent, type VerificationKeyRemovedEvent, type VerifyAssetArgs, type VerifyProofArgs, type VkEntry, type ZkNote, type ZkVerifierCall, type ZkVerifierCircuitVersionInfo, type ZkVerifierEvent, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, applyNoteStatus, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildDummyTransferInput, bytesToBigintLE, computeNullifier, computePathIndices, createNoteDisclosureKey, decodeNoteDisclosureKey, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessage, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewingPublicKey, deriveViewingSecretKey, encryptJson, encryptNote, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, noteBlindTag, randomBlinding, recoverOwnerPkPoint, selectNotes, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, vaultReplacer, vaultReviver };
4175
+ export { type AccountListing, type AccountMappedData, type AccountMappedEvent, type AccountMappingCall, type AccountMappingEvent, AccountMappingModule, AccountMappingPrecompile, type AccountMetadata, type AccountUnmappedEvent, type ActiveVersionSetEvent, type AddChainLinkArgs, type AddChainLinkParams, type AddSupportedChainArgs, type AliasFullIdentity, type AliasInfo, type AliasListedForSaleEvent, type AliasOnSaleData, type AliasRegisteredData, type AliasRegisteredEvent, type AliasReleasedEvent, type AliasSaleCancelledEvent, type AliasSoldData, type AliasSoldEvent, type AliasTransferredData, type AliasTransferredEvent, type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BatchRegisterVerificationKeysArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type BuyAliasArgs, type Bytes32, CURRENT_CIRCUIT_VERSION, type ChainInfo, type ChainLink, type ChainLinkAddedEvent, type ChainLinkRemovedEvent, CircuitId, CircuitId as CircuitIdType, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CommitmentsInsertedEvent, type CommitmentsInsertedEventData, type ConnectionStatus, CryptoPrecompiles, type DecodedAddChainLinkArgs, type DecodedBatchArgs, type DecodedDispatchAsPrivateLinkArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedPutAliasForSaleArgs, type DecodedRegisterAliasArgs, type DecodedRemarkArgs, type DecodedRevealPrivateLinkArgs, type DecodedSetAccountMetadataArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DispatchAsLinkedAccountArgs, type DispatchAsLinkedParams, type DispatchAsPrivateLinkArgs, type DispatchError, type DispatchInfo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, type EncryptedNoteRecord, type EndowedEventData, type EthereumExecutedData, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, type EvmExecutedData, type EvmExitReason, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFailedData, type ExtrinsicSuccessData, type FeeClaimProofInputs, type FormatOptions, KNOWN_PRECOMPILES, type KnownPrecompileInfo, type ListingInfo, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, type MetadataUpdatedEvent, NoteBuilder, type NoteDisclosure, type NoteInput, type NoteStatusUpdate, type NullifiersSpentEvent, type NullifiersSpentEventData, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateChainLinkAddedEvent, type PrivateChainLinkRemovedEvent, type PrivateChainLinkRevealedEvent, type PrivateLink, type PrivateLinkDispatchExecutedEvent, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type ProxyCallExecutedEvent, type PutAliasOnSaleArgs, type PutOnSaleParams, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAliasArgs, type RegisterAssetArgs, type RegisterPrivateLinkArgs, type RegisterVerificationKeyArgs, type RelayerInfo, RelayerStatusModule, type RemoveChainLinkArgs, type RemovePrivateLinkArgs, type RemoveSupportedChainArgs, type RemoveVerificationKeyArgs, type ReservedEventData, type ResolvedAlias, type ResolvedSpendVersion, type RevealPrivateLinkArgs, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SLIP0044_NAMESPACE, type ScanCommitment, type SetAccountMetadataArgs, type SetActiveVersionArgs, type SetMetadataParams, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, SignatureScheme, type StatusChangeEvent, type StatusListener, SubstrateClient, type SupportedChain, type SupportedChainAddedEvent, type SupportedChainRemovedEvent, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferAliasArgs, type TransferEventData, type TransferInputNote, type TransferOutputNote, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldParams, type UnshieldProofInputs, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, VaultLockedError, type VerificationKeyRegisteredEvent, type VerificationKeyRemovedEvent, type VerifyAssetArgs, type VerifyProofArgs, type VkEntry, type ZkNote, type ZkVerifierCall, type ZkVerifierCircuitVersionInfo, type ZkVerifierEvent, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, applyNoteStatus, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildDummyTransferInput, bytesToBigintLE, computeNullifier, computePathIndices, createNoteDisclosureKey, decodeNoteDisclosureKey, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessage, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewingPublicKey, deriveViewingSecretKey, encryptJson, encryptNote, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, noteBlindTag, randomBlinding, recoverOwnerPkPoint, selectNotes, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, vaultReplacer, vaultReviver };