@orbinum/sdk 0.11.0 → 0.12.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';
@@ -520,18 +520,10 @@ interface ShieldedCommitment {
520
520
  blockNumber: number;
521
521
  extrinsicIndex: number | null;
522
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
523
  assetId: string;
531
- /** Origin of the commitment: direct shield, output of private transfer, or change from unshield. */
532
524
  source: 'shield' | 'transfer' | 'unshield';
533
- /** 0x-prefixed encrypted memo hex, null if not present. */
534
525
  encryptedMemo: string | null;
526
+ circuitVersion: number | null;
535
527
  timestampMs: number | null;
536
528
  }
537
529
  /** A spent nullifier stored by the indexer. */
@@ -816,7 +808,8 @@ interface StealthScanHint {
816
808
  assetId: string;
817
809
  /** Ephemeral public key (last 32 bytes of encrypted_memo), 0x-prefixed. null if memo absent. */
818
810
  ephPkHex: string | null;
819
- /** Full 168-byte encrypted memo (0x-prefixed hex). null if not present. */
811
+ /** Full 180-byte encrypted memo (0x-prefixed hex). null if not present. The note's
812
+ * circuit version travels inside this memo — recovered by NoteDecryptor on scan. */
820
813
  encryptedMemo: string | null;
821
814
  }
822
815
 
@@ -847,7 +840,7 @@ declare class IndexerClient {
847
840
  /**
848
841
  * Returns a paginated list of stealth scan hints ordered ascending by leafIndex.
849
842
  * Each hint contains only the fields required for ECDH triage and decryption:
850
- * leafIndex, commitmentHex, assetId, ephPkHex, encryptedMemo.
843
+ * leafIndex, commitmentHex, assetId, ephPkHex, encryptedMemo, circuitVersion.
851
844
  *
852
845
  * Use `sinceLeafIndex` for incremental scans (cursor = last seen leafIndex + 1).
853
846
  */
@@ -1036,6 +1029,12 @@ type OrbinumClientConfig = {
1036
1029
  indexerUrl?: string;
1037
1030
  /** Timeout for the initial WebSocket handshake in milliseconds. Default: `15_000`. */
1038
1031
  connectTimeoutMs?: number;
1032
+ /**
1033
+ * Base URL of a circuits-artifact mirror (serving `manifest.json` + artifacts).
1034
+ * Passed to the `CircuitVersionResolver`'s provider. Omit to use the default
1035
+ * npm CDN (unpkg). Use to point at a self-hosted/multi-version manifest.
1036
+ */
1037
+ circuitsBaseUrl?: string;
1039
1038
  };
1040
1039
  /** Result returned by extrinsic-submitting methods (shield, unshield, transfer, …). */
1041
1040
  type TxResult = {
@@ -1055,32 +1054,51 @@ type TxResult = {
1055
1054
  type UnsafeTxOptions = TxOptions<void, Record<string, unknown>>;
1056
1055
  declare function toTxResult(payload: TxFinalizedPayload): TxResult;
1057
1056
 
1057
+ /** On-chain Merkle tree state for the shielded pool. */
1058
1058
  type MerkleTreeInfo = {
1059
+ /** 0x-prefixed current Merkle root hex. */
1059
1060
  root: string;
1061
+ /** Number of leaves (commitments) inserted so far. */
1060
1062
  treeSize: number;
1063
+ /** Tree depth (levels from leaf to root). */
1061
1064
  depth: number;
1062
1065
  };
1066
+ /** A commitment surfaced by the indexer scan feed, for trial-decryption. */
1063
1067
  type ScanCommitment = {
1068
+ /** 0x-prefixed 32-byte commitment hex. */
1064
1069
  commitmentHex: string;
1070
+ /** Leaf position of the commitment in the Merkle tree. */
1065
1071
  leafIndex: number;
1072
+ /** 0x-prefixed encrypted memo hex, or null if none was published. */
1066
1073
  encryptedMemo: string | null;
1067
1074
  };
1075
+ /** Plaintext fields recovered from a note's encrypted memo. */
1068
1076
  type DecryptedMemo = {
1077
+ /** Note amount in planck. */
1069
1078
  value: bigint;
1079
+ /** Owner's BabyJubJub Ax coordinate. */
1070
1080
  ownerPk: bigint;
1081
+ /** Blinding scalar used in the commitment. */
1071
1082
  blinding: bigint;
1083
+ /** Asset ID of the note. */
1072
1084
  assetId: bigint;
1073
1085
  /** Counterparty BabyJubJub Ax coordinate. Zero for shield/unshield notes. */
1074
1086
  counterpartyPk: bigint;
1087
+ /** ZK circuit version the note is spent under, recovered from the memo plaintext. */
1088
+ circuitVersion: number;
1075
1089
  };
1090
+ /** Parameters for shieldedPool.shield — deposits one note into the pool. */
1076
1091
  type ShieldParams = {
1092
+ /** Asset ID being deposited. */
1077
1093
  assetId: number;
1094
+ /** Amount to deposit in planck. */
1078
1095
  amount: bigint;
1079
1096
  /** 0x-prefixed 32-byte commitment hex */
1080
1097
  commitment: string;
1081
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
1098
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1082
1099
  encryptedMemo: Uint8Array;
1083
1100
  };
1101
+ /** Parameters for shieldedPool.unshield — withdraws from the pool to a clear address. */
1084
1102
  type UnshieldParams = {
1085
1103
  /** ZK proof bytes */
1086
1104
  proof: Uint8Array;
@@ -1088,6 +1106,7 @@ type UnshieldParams = {
1088
1106
  merkleRoot: string;
1089
1107
  /** 0x-prefixed nullifier hex */
1090
1108
  nullifier: string;
1109
+ /** Asset ID being withdrawn. */
1091
1110
  assetId: number;
1092
1111
  /** Net amount recipient receives (planck) */
1093
1112
  amount: bigint;
@@ -1102,11 +1121,13 @@ type UnshieldParams = {
1102
1121
  */
1103
1122
  changeCommitment?: string;
1104
1123
  /**
1105
- * Encrypted memo for the change note (176 bytes).
1124
+ * Encrypted memo for the change note (180 bytes).
1106
1125
  * Required for partial unshield so the change note can be recovered via blockchain scan.
1107
1126
  * Omit for total unshield.
1108
1127
  */
1109
1128
  changeEncryptedMemo?: Uint8Array;
1129
+ /** Circuit version the spent note was created under. Verified against that version's VK. */
1130
+ circuitVersion: number;
1110
1131
  };
1111
1132
  type PrivateTransferInput = {
1112
1133
  /** 0x-prefixed nullifier hex */
@@ -1117,11 +1138,13 @@ type PrivateTransferInput = {
1117
1138
  type PrivateTransferOutput = {
1118
1139
  /** 0x-prefixed commitment hex */
1119
1140
  commitment: string;
1120
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
1141
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1121
1142
  encryptedMemo: Uint8Array;
1122
1143
  };
1123
1144
  type PrivateTransferParams = {
1145
+ /** Input notes being spent (nullifier + commitment each). */
1124
1146
  inputs: PrivateTransferInput[];
1147
+ /** Output notes being created (commitment + encrypted memo each). */
1125
1148
  outputs: PrivateTransferOutput[];
1126
1149
  /** ZK proof bytes */
1127
1150
  proof: Uint8Array;
@@ -1132,6 +1155,8 @@ type PrivateTransferParams = {
1132
1155
  /** Gasless fee in planck (default 0n; input_sum == output_sum + fee in circuit).
1133
1156
  * The fee is paid to the block author (validator) by the pallet runtime. */
1134
1157
  fee?: bigint;
1158
+ /** Circuit version the input notes were created under. Verified against that version's VK. */
1159
+ circuitVersion: number;
1135
1160
  };
1136
1161
  /** Input params for NoteBuilder.build(). All fields except value have defaults. */
1137
1162
  type NoteInput = {
@@ -1147,7 +1172,7 @@ type NoteInput = {
1147
1172
  spendingKey?: bigint;
1148
1173
  /**
1149
1174
  * 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.
1175
+ * When provided, NoteBuilder.build() will auto-generate the 180-byte ECDH-encrypted memo.
1151
1176
  * Omit to skip memo generation (use buildMemo() separately if needed).
1152
1177
  */
1153
1178
  viewingPublicKey?: Uint8Array;
@@ -1160,7 +1185,16 @@ type NoteInput = {
1160
1185
  recipientOwnerPk?: bigint;
1161
1186
  /** Counterparty BabyJubJub Ax coordinate. Zero for shield/unshield notes. Default 0n. */
1162
1187
  counterpartyPk?: bigint;
1188
+ /** Circuit version to stamp on the note. Defaults to `CURRENT_CIRCUIT_VERSION`. */
1189
+ circuitVersion?: number;
1163
1190
  };
1191
+ /**
1192
+ * Circuit version notes are created under today. A note carries its version
1193
+ * (`ZkNote.circuitVersion`) so that, after a VK rotation, it is always proven
1194
+ * and verified against the circuit that created it. Only one version exists
1195
+ * today; callers may pass the chain's active version explicitly.
1196
+ */
1197
+ declare const CURRENT_CIRCUIT_VERSION = 1;
1164
1198
  /**
1165
1199
  * Computed ZK note (commitment + nullifier). Built entirely off-chain.
1166
1200
  *
@@ -1168,11 +1202,18 @@ type NoteInput = {
1168
1202
  * nullifier = Poseidon(commitment, spendingKey)
1169
1203
  */
1170
1204
  type ZkNote = {
1205
+ /** Note amount in planck. */
1171
1206
  value: bigint;
1207
+ /** Asset ID of the note. */
1172
1208
  assetId: bigint;
1209
+ /** Owner's BabyJubJub Ax coordinate (or stealth owner Pk for stealth notes). */
1173
1210
  ownerPk: bigint;
1211
+ /** Blinding scalar mixed into the commitment. */
1174
1212
  blinding: bigint;
1213
+ /** Secret spending key used to derive the nullifier. */
1175
1214
  spendingKey: bigint;
1215
+ /** Circuit version this note was created under (see `CURRENT_CIRCUIT_VERSION`). Required. */
1216
+ circuitVersion: number;
1176
1217
  /** Whether the note has been spent/nullified on-chain. */
1177
1218
  spent: boolean;
1178
1219
  /** Local timestamp when this note was marked spent, or null if still active/unknown. */
@@ -1186,7 +1227,7 @@ type ZkNote = {
1186
1227
  /** 0x-prefixed 32-byte little-endian hex nullifier. */
1187
1228
  nullifierHex: string;
1188
1229
  /**
1189
- * 168-byte encrypted memo (ChaCha20-Poly1305 ECDH) as number[] for SCALE encoding.
1230
+ * 180-byte encrypted memo (ChaCha20-Poly1305 ECDH) as number[] for SCALE encoding.
1190
1231
  * Always populated: uses a dummy memo when no viewingPublicKey is provided.
1191
1232
  */
1192
1233
  memo: number[];
@@ -1195,15 +1236,18 @@ type ZkNote = {
1195
1236
  };
1196
1237
  /** Parameters for a single item in a shield_batch extrinsic. */
1197
1238
  type ShieldBatchItem = {
1239
+ /** Asset ID being deposited. */
1198
1240
  assetId: number;
1241
+ /** Amount to deposit in planck. */
1199
1242
  amount: bigint;
1200
1243
  /** 0x-prefixed 32-byte commitment hex */
1201
1244
  commitment: string;
1202
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
1245
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1203
1246
  encryptedMemo: Uint8Array;
1204
1247
  };
1205
1248
  /** Parameters for shieldedPool.shieldBatch — deposits up to 20 notes in one extrinsic. */
1206
1249
  type ShieldBatchParams = {
1250
+ /** The notes to deposit (up to 20). */
1207
1251
  items: ShieldBatchItem[];
1208
1252
  };
1209
1253
  /**
@@ -1224,8 +1268,10 @@ type ClaimShieldedFeesParams = {
1224
1268
  proof: Uint8Array;
1225
1269
  /** 76-byte public signals buffer (commitment || amount_u64_le || assetId_u32_le || owner_hash) */
1226
1270
  publicSignals: Uint8Array;
1227
- /** Encrypted memo bytes (168 bytes). Required — notes without valid memos are irrecoverable. */
1271
+ /** Encrypted memo bytes (180 bytes). Required — notes without valid memos are irrecoverable. */
1228
1272
  encryptedMemo: Uint8Array;
1273
+ /** Circuit version of the fee-claim note. Verified against that version's VK. */
1274
+ circuitVersion: number;
1229
1275
  };
1230
1276
 
1231
1277
  /**
@@ -1252,14 +1298,14 @@ declare class ShieldedPoolModule {
1252
1298
  * Withdraws tokens from the shielded pool to a public address.
1253
1299
  * Submits as an UNSIGNED (gasless) transaction — fee is embedded in the ZK proof.
1254
1300
  * Pass a `signer` to fall back to signed submission (e.g. for testing).
1255
- * Extrinsic: shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient, fee)
1301
+ * Extrinsic: shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient, fee, changeCommitment, changeEncryptedMemo, relayer, circuitVersion)
1256
1302
  */
1257
1303
  unshield(params: UnshieldParams, signer?: PolkadotSigner, txOptions?: UnsafeTxOptions): Promise<TxResult>;
1258
1304
  /**
1259
1305
  * Performs a private (shielded) transfer between two notes.
1260
1306
  * Submits as an UNSIGNED (gasless) transaction — fee is embedded in the ZK proof.
1261
1307
  * Pass a `signer` to fall back to signed submission (e.g. for testing).
1262
- * Extrinsic: shieldedPool.privateTransfer(proof, merkleRoot, nullifiers, commitments, memos, assetId, fee)
1308
+ * Extrinsic: shieldedPool.privateTransfer(proof, merkleRoot, nullifiers, commitments, memos, assetId, fee, relayer, circuitVersion)
1263
1309
  */
1264
1310
  privateTransfer(params: PrivateTransferParams, signer?: PolkadotSigner, txOptions?: UnsafeTxOptions): Promise<TxResult>;
1265
1311
  /**
@@ -1272,7 +1318,7 @@ declare class ShieldedPoolModule {
1272
1318
  * This is a SIGNED transaction — the relayer must sign it with their wallet.
1273
1319
  * Before calling this, generate a ZK value proof with generateFeeClaimProof() (not yet implemented).
1274
1320
  *
1275
- * Extrinsic: shieldedPool.claim_shielded_fees(commitment, amount, asset_id, memo, proof, public_signals)
1321
+ * Extrinsic: shieldedPool.claim_shielded_fees(commitment, amount, asset_id, memo, proof, public_signals, circuit_version)
1276
1322
  */
1277
1323
  claimShieldedFees(params: ClaimShieldedFeesParams, signer: PolkadotSigner, txOptions?: UnsafeTxOptions): Promise<TxResult>;
1278
1324
  }
@@ -1635,6 +1681,61 @@ declare class ZkVerifierModule {
1635
1681
  getCircuitVersionInfo(circuitId: number): Promise<ZkVerifierCircuitVersionInfo | null>;
1636
1682
  }
1637
1683
 
1684
+ /** The resolved version + VK hash the prover reports for a circuit. */
1685
+ type ResolvedProverVersion = {
1686
+ version: number;
1687
+ vkHash: string;
1688
+ };
1689
+ /**
1690
+ * A provider that can both serve artifacts and report the version it resolved
1691
+ * for a circuit (`WebArtifactProvider` implements both). The resolver needs the
1692
+ * version-reporting half; it is a separate type so tests can inject a fake.
1693
+ */
1694
+ type VersionedArtifactProvider = ArtifactProvider & {
1695
+ getResolvedVersion(circuit: CircuitType): Promise<ResolvedProverVersion>;
1696
+ };
1697
+ /**
1698
+ * Builds a provider pinned to `noteVersion` for `circuit`. The default uses the
1699
+ * npm CDN (or `baseUrl` mirror); tests inject a fake.
1700
+ */
1701
+ type ProviderFactory = (circuit: CircuitType, noteVersion: number) => VersionedArtifactProvider;
1702
+ /**
1703
+ * The single fail-closed choke point for spending a note under a specific
1704
+ * circuit version.
1705
+ *
1706
+ * A note carries the circuit version it was created under (`ZkNote.circuitVersion`).
1707
+ * When that note is spent, the proof MUST be generated against that version's
1708
+ * artifacts and verified on-chain against that version's VK — never the current
1709
+ * `active_version`, or a VK rotation would make old notes unspendable.
1710
+ *
1711
+ * `resolve()` pins the prover to the note's version, cross-checks that the
1712
+ * prover's VK hash matches what the chain declares for that version, and confirms
1713
+ * the chain still supports it. On any mismatch it throws BEFORE any proof is
1714
+ * generated — there is no fallback to the active version. The returned
1715
+ * `{ provider, version }` is fed to the proof generator and the extrinsic.
1716
+ */
1717
+ type ResolvedSpendVersion = {
1718
+ /** Artifact provider pinned to the note's circuit version. Pass to `generate*Proof`. */
1719
+ provider: ArtifactProvider;
1720
+ /** The circuit version to send in the extrinsic (`circuit_version` arg). */
1721
+ version: number;
1722
+ };
1723
+ declare class CircuitVersionResolver {
1724
+ private readonly zkVerifier;
1725
+ private readonly makeProvider;
1726
+ constructor(zkVerifier: ZkVerifierModule,
1727
+ /** Optional base URL for a self-hosted artifact mirror (else the npm CDN). */
1728
+ baseUrl?: string,
1729
+ /** Override how the pinned provider is built (tests inject a fake). */
1730
+ providerFactory?: ProviderFactory);
1731
+ /**
1732
+ * Resolves the prover + on-chain version for spending a note of `circuit`
1733
+ * created under `noteVersion`. Fail-closed: throws on unsupported version or
1734
+ * VK-hash mismatch (CDN vs chain), before generating any proof.
1735
+ */
1736
+ resolve(circuit: CircuitType, noteVersion: number): Promise<ResolvedSpendVersion>;
1737
+ }
1738
+
1638
1739
  /**
1639
1740
  * Status info for a registered relayer account.
1640
1741
  */
@@ -1735,7 +1836,8 @@ declare class ShieldedPoolPrecompile {
1735
1836
  shield(params: ShieldParams, signer: EvmSigner): Promise<string>;
1736
1837
  /**
1737
1838
  * Returns the ABI-encoded calldata for
1738
- * `privateTransfer(bytes, bytes32, bytes32[], bytes32[], bytes[], uint32, uint256)`.
1839
+ * `privateTransfer(bytes, bytes32, bytes32[], bytes32[], bytes[], uint32, uint256, uint32)`.
1840
+ * The trailing `uint32` is the circuit version the input notes were created under.
1739
1841
  */
1740
1842
  buildPrivateTransferCalldata(params: PrivateTransferParams): string;
1741
1843
  /**
@@ -1778,7 +1880,7 @@ declare class ShieldedPoolPrecompile {
1778
1880
  estimateUnshieldGas(params: UnshieldParams, from: string): Promise<bigint>;
1779
1881
  /**
1780
1882
  * Returns the ABI-encoded calldata for
1781
- * `claimShieldedFees(bytes32,uint256,uint32,bytes,bytes,bytes)`.
1883
+ * `claimShieldedFees(bytes32,uint256,uint32,bytes,bytes,bytes,uint32)`.
1782
1884
  *
1783
1885
  * ABI layout (params after selector):
1784
1886
  * - `commitment` — bytes32 (fixed)
@@ -1787,6 +1889,7 @@ declare class ShieldedPoolPrecompile {
1787
1889
  * - `memo` — bytes (dynamic)
1788
1890
  * - `proof` — bytes (dynamic, 128 bytes Groth16)
1789
1891
  * - `publicSignals` — bytes (dynamic, 76 bytes)
1892
+ * - `circuitVersion` — uint32 (fixed, right-aligned)
1790
1893
  *
1791
1894
  * The validator identity is derived from `msg.sender` in the precompile —
1792
1895
  * do NOT include it in the calldata.
@@ -2092,6 +2195,11 @@ declare class OrbinumClient {
2092
2195
  readonly chain: ChainModule;
2093
2196
  /** Typed access to `zkVerifier_*` custom RPC endpoints. */
2094
2197
  readonly zkVerifier: ZkVerifierModule;
2198
+ /**
2199
+ * Resolves a note's circuit version to a pinned prover + on-chain version
2200
+ * before spending it (fail-closed: throws on unsupported version / VK mismatch).
2201
+ */
2202
+ readonly circuitVersionResolver: CircuitVersionResolver;
2095
2203
  /** Typed access to `relayer_*` RPC endpoints (registry lookup and pending fee queries). */
2096
2204
  readonly relayerStatus: RelayerStatusModule;
2097
2205
  /**
@@ -2138,6 +2246,8 @@ interface ClientProviderConfig {
2138
2246
  evmRpc?: string;
2139
2247
  /** Base URL of the Orbinum indexer REST API (e.g. `"https://indexer.orbinum.io"`). Omit to disable indexer support. */
2140
2248
  indexerUrl?: string;
2249
+ /** Base URL of a circuits-artifact mirror (manifest.json + artifacts). Omit to use the default npm CDN. */
2250
+ circuitsBaseUrl?: string;
2141
2251
  /** Timeout for the initial WebSocket handshake in milliseconds. Default: `8_000`. */
2142
2252
  connectTimeoutMs?: number;
2143
2253
  /** Interval between heartbeat probes in milliseconds. Default: `5_000`. */
@@ -2299,7 +2409,7 @@ declare class OrbinumClientProvider {
2299
2409
  *
2300
2410
  * Memo scheme (EncryptedMemo — native TypeScript, no WASM):
2301
2411
  * ChaCha20-Poly1305 with ECDH ephemeral key — SHA256(sharedSecret || commitment || domain)
2302
- * Result: nonce(12) || ciphertext(108 + 16 MAC) || ephPk(32) = 168 bytes
2412
+ * Result: nonce(12) || ciphertext(120 + 16 MAC) || ephPk(32) = 180 bytes
2303
2413
  *
2304
2414
  * Stealth scheme (when viewingPublicKey + recipientOwnerPk are both provided):
2305
2415
  * ephSk is generated once and shared between the ECDH memo and the stealth Pk derivation.
@@ -2324,7 +2434,7 @@ declare class NoteBuilder {
2324
2434
  */
2325
2435
  static build(input: NoteInput): Promise<ZkNote>;
2326
2436
  /**
2327
- * Build the 168-byte ECDH-encrypted memo for a note.
2437
+ * Build the 180-byte ECDH-encrypted memo for a note.
2328
2438
  *
2329
2439
  * Pure TypeScript implementation — no WASM dependency.
2330
2440
  * Uses ChaCha20-Poly1305 with ECDH key agreement (BabyJubJub ephemeral keypair).
@@ -2343,11 +2453,11 @@ declare class NoteBuilder {
2343
2453
  *
2344
2454
  * Mirrors primitives/encrypted-memo in the node repository; no WASM required.
2345
2455
  *
2346
- * Layout (176 bytes, ECDH):
2347
- * nonce(12) || ciphertext+MAC(132) || ephPk_packed(32) = 176
2456
+ * Layout (180 bytes, ECDH):
2457
+ * nonce(12) || ciphertext+MAC(136) || ephPk_packed(32) = 180
2348
2458
  *
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)
2459
+ * Plaintext layout (120 bytes):
2460
+ * 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
2461
  *
2352
2462
  * value is stored as a 128-bit LE unsigned integer (two uint64 words), supporting
2353
2463
  * amounts up to ~3.4 × 10^38 planck — well above any realistic token supply.
@@ -2362,11 +2472,11 @@ declare class NoteBuilder {
2362
2472
  * Cipher: ChaCha20-Poly1305 (IETF, 96-bit nonce)
2363
2473
  */
2364
2474
 
2365
- /** Memo size: nonce(12) + ciphertext+MAC(132) + ephPk(32) = 176 */
2475
+ /** Memo size: nonce(12) + ciphertext+MAC(136) + ephPk(32) = 180 */
2366
2476
  declare const ENCRYPTED_MEMO_SIZE: number;
2367
2477
  declare const EncryptedMemo: {
2368
2478
  /**
2369
- * Build and encrypt a memo for a note using ECDH (v2, 168 bytes).
2479
+ * Build and encrypt a memo for a note using ECDH (v2, 180 bytes).
2370
2480
  *
2371
2481
  * @param value Note value in planck.
2372
2482
  * @param ownerPk 32-byte owner public key (LE).
@@ -2378,22 +2488,24 @@ declare const EncryptedMemo: {
2378
2488
  * decoded from a privacy address).
2379
2489
  * Pass `new Uint8Array(32)` (all zeros) for a publicly-readable memo.
2380
2490
  * @param counterpartyPk 32-byte counterparty BJJ Ax. Default: all zeros.
2381
- * @returns 168-byte encrypted memo: nonce(12) || ciphertext+MAC(124) || ephPk(32).
2491
+ * @param circuitVersion ZK circuit version the note is spent under. Default: 0.
2492
+ * @param ephSkOverride 32-byte ephemeral secret key (stealth coordination). Optional.
2493
+ * @returns 180-byte encrypted memo: nonce(12) || ciphertext+MAC(136) || ephPk(32).
2382
2494
  */
2383
- encrypt(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, recipientIvkPacked: Uint8Array, counterpartyPk?: Uint8Array, ephSkOverride?: Uint8Array): Uint8Array;
2495
+ encrypt(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, recipientIvkPacked: Uint8Array, counterpartyPk?: Uint8Array, circuitVersion?: number, ephSkOverride?: Uint8Array): Uint8Array;
2384
2496
  /**
2385
- * Returns a 168-byte public memo encrypted with a zero viewing key.
2497
+ * Returns a 180-byte public memo encrypted with a zero viewing key.
2386
2498
  * Decryptable by anyone with `decrypt(memo, commitment, new Uint8Array(32))`.
2387
2499
  * Convenience alias for `encrypt(..., new Uint8Array(32))`.
2388
2500
  */
2389
- encryptPublic(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array): Uint8Array;
2501
+ encryptPublic(value: bigint, ownerPk: Uint8Array, blinding: Uint8Array, assetId: number, commitment: Uint8Array, circuitVersion?: number): Uint8Array;
2390
2502
  /**
2391
- * Returns a 168-byte zeroed dummy memo (no information, always valid on-chain).
2503
+ * Returns a 180-byte zeroed dummy memo (no information, always valid on-chain).
2392
2504
  */
2393
2505
  dummy(): Uint8Array;
2394
2506
  /**
2395
2507
  * Validates that `bytes` is a properly-sized encrypted memo.
2396
- * Throws an Error if the length is not ENCRYPTED_MEMO_SIZE (168 bytes).
2508
+ * Throws an Error if the length is not ENCRYPTED_MEMO_SIZE (180 bytes).
2397
2509
  *
2398
2510
  * Call this at system boundaries (extrinsic builders, precompile encoders)
2399
2511
  * to catch malformed memos before they reach the chain and fail on-chain.
@@ -2407,7 +2519,7 @@ declare const EncryptedMemo: {
2407
2519
  * Returns null if decryption fails — wrong key, bad MAC, or malformed memo.
2408
2520
  * Never throws; safe for scan loops.
2409
2521
  *
2410
- * @param memoBytes 168-byte encrypted memo.
2522
+ * @param memoBytes 180-byte encrypted memo.
2411
2523
  * @param commitment 32-byte note commitment (LE).
2412
2524
  * @param viewingSecretKey 32-byte HKDF viewing secret key from deriveViewingSecretKey().
2413
2525
  */
@@ -2416,13 +2528,13 @@ declare const EncryptedMemo: {
2416
2528
  * Extract the ECDH shared secret from an encrypted memo using the recipient's viewing secret key.
2417
2529
  *
2418
2530
  * 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.
2531
+ * without re-running the full decrypt path. Safe to call on any 180-byte memo.
2420
2532
  *
2421
2533
  * Returns `new Uint8Array(32)` (all zeros) for public/dummy memos (zero ephPk).
2422
2534
  * Returns `null` if the memo is malformed or the ephPk is not a valid BJJ point.
2423
2535
  * Never throws; safe for scan loops.
2424
2536
  *
2425
- * @param memoBytes 168-byte encrypted memo.
2537
+ * @param memoBytes 180-byte encrypted memo.
2426
2538
  * @param viewingSecretKey 32-byte HKDF viewing secret key from deriveViewingSecretKey().
2427
2539
  */
2428
2540
  extractSharedSecret(memoBytes: Uint8Array, viewingSecretKey: Uint8Array): Uint8Array | null;
@@ -2592,6 +2704,11 @@ declare function generateTransferProof(params: PrivateTransferProofInputs, optio
2592
2704
  * 2. The smallest pair whose sum >= needed → [noteA, noteB]
2593
2705
  * 3. No combination covers needed → null (consolidation via merge required)
2594
2706
  *
2707
+ * Both inputs of a transfer are proven together against ONE circuit VK, so a
2708
+ * pair MUST share a circuitVersion — mixing v1 and v2 would produce an invalid
2709
+ * proof. Priority 2 only pairs notes of the same version; a single note (P1) is
2710
+ * always one version so it needs no check.
2711
+ *
2595
2712
  * Only unspent notes with value > 0 are considered.
2596
2713
  */
2597
2714
  declare function selectNotes(notes: ZkNote[], needed: bigint): [ZkNote, ZkNote | null] | null;
@@ -3303,18 +3420,22 @@ type CircuitId = (typeof CircuitId)[keyof typeof CircuitId];
3303
3420
  /**
3304
3421
  * Named constants for all supported ZK circuits.
3305
3422
  *
3423
+ * Values MUST match the node's `CircuitId` constants
3424
+ * (`node/frame/zk-verifier/src/types.rs`). Note: ValueProof is 6, not 4 or
3425
+ * sequential.
3426
+ *
3306
3427
  * | Name | Value | Circuit |
3307
3428
  * |--------------|-------|---------------------------------|
3308
3429
  * | Transfer | 1 | 2-in-2-out private transfer |
3309
3430
  * | Unshield | 2 | Withdrawal from the pool |
3310
- * | ValueProof | 4 | Note value binding (fee-claim) |
3311
3431
  * | PrivateLink | 5 | Private chain-link proof |
3432
+ * | ValueProof | 6 | Note value binding (fee-claim) |
3312
3433
  */
3313
3434
  declare const CircuitId: {
3314
3435
  readonly Transfer: 1;
3315
3436
  readonly Unshield: 2;
3316
- readonly ValueProof: 4;
3317
3437
  readonly PrivateLink: 5;
3438
+ readonly ValueProof: 6;
3318
3439
  };
3319
3440
  /**
3320
3441
  * A single verification key registration entry used in batch operations.
@@ -3955,10 +4076,11 @@ type AccountMappingEvent = {
3955
4076
  */
3956
4077
  type Bytes32 = number[];
3957
4078
  /**
3958
- * 176-byte encrypted memo (ChaCha20-Poly1305 ECDH).
3959
- * Layout: nonce(12) || ciphertext(132) || tag(16) || ephPk(32) = 176 bytes.
4079
+ * 180-byte encrypted memo (ChaCha20-Poly1305 ECDH).
4080
+ * Layout: nonce(12) || ciphertext(136) || ephPk(32) = 180 bytes
4081
+ * (ciphertext = plaintext 120 + MAC 16).
3960
4082
  */
3961
- type Bytes176 = number[];
4083
+ type Bytes180 = number[];
3962
4084
  /**
3963
4085
  * A single shield operation for use in `shield_batch`.
3964
4086
  */
@@ -3967,7 +4089,7 @@ type ShieldOperation = {
3967
4089
  amount: bigint;
3968
4090
  /** 32-byte Poseidon commitment (LE). */
3969
4091
  commitment: Bytes32;
3970
- /** Encrypted memo bytes — exactly 104 bytes. */
4092
+ /** Encrypted memo bytes — exactly 180 bytes. */
3971
4093
  encryptedMemo: number[];
3972
4094
  };
3973
4095
  /**
@@ -3979,7 +4101,7 @@ type ShieldArgs = {
3979
4101
  amount: bigint;
3980
4102
  /** 32-byte Poseidon commitment (LE). */
3981
4103
  commitment: Bytes32;
3982
- /** Encrypted memo — exactly 104 bytes. */
4104
+ /** Encrypted memo — exactly 180 bytes. */
3983
4105
  encryptedMemo: number[];
3984
4106
  };
3985
4107
  /**
@@ -4000,7 +4122,7 @@ type RawTransferInput = {
4000
4122
  type RawTransferOutput = {
4001
4123
  /** 32-byte Poseidon commitment (LE). */
4002
4124
  commitment: Bytes32;
4003
- /** Encrypted memo — exactly 104 bytes. */
4125
+ /** Encrypted memo — exactly 180 bytes. */
4004
4126
  memo: number[];
4005
4127
  };
4006
4128
  /**
@@ -4021,6 +4143,8 @@ type PrivateTransferArgs = {
4021
4143
  assetId: number;
4022
4144
  /** Gasless fee in planck. Paid to the block author (validator). */
4023
4145
  fee: bigint;
4146
+ /** Circuit version the input notes were created under (verified against that version's VK). */
4147
+ circuitVersion: number;
4024
4148
  };
4025
4149
  /**
4026
4150
  * Call index 2 — `unshield` (Unsigned/gasless origin)
@@ -4048,10 +4172,12 @@ type UnshieldArgs = {
4048
4172
  */
4049
4173
  changeCommitment: Bytes32;
4050
4174
  /**
4051
- * Encrypted memo for the change note (176 bytes, empty for total unshield).
4175
+ * Encrypted memo for the change note (180 bytes, empty for total unshield).
4052
4176
  * Enables note recovery via blockchain scan for partial unshield.
4053
4177
  */
4054
- changeEncryptedMemo?: Bytes176;
4178
+ changeEncryptedMemo?: Bytes180;
4179
+ /** Circuit version the spent note was created under (verified against that version's VK). */
4180
+ circuitVersion: number;
4055
4181
  };
4056
4182
  /**
4057
4183
  * Call index 9 — `register_asset` (Root origin)
@@ -4577,4 +4703,4 @@ interface ExtrinsicFailedData {
4577
4703
  dispatch_info: DispatchInfo;
4578
4704
  }
4579
4705
 
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 };
4706
+ 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, 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, 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 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 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 };