@orbinum/sdk 0.2.0 → 0.4.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
@@ -1,9 +1,82 @@
1
1
  import * as polkadot_api from 'polkadot-api';
2
2
  import { PolkadotClient, TxFinalizedPayload, PolkadotSigner } from 'polkadot-api';
3
- export { PolkadotSigner } from 'polkadot-api';
3
+ export { PolkadotSigner, getSs58AddressInfo } from 'polkadot-api';
4
+ import { getDynamicBuilder } from '@polkadot-api/metadata-builders';
5
+ import { getExtrinsicDecoder } from '@polkadot-api/tx-utils';
6
+ export { AccountId, Blake2256, Keccak256, Storage, u128, u64 } from '@polkadot-api/substrate-bindings';
7
+ export { base58 } from '@scure/base';
4
8
  export { getPolkadotSigner } from 'polkadot-api/signer';
5
9
  export { getPolkadotSignerFromPjs } from 'polkadot-api/pjs-signer';
6
10
 
11
+ type ChainInfo = {
12
+ name: string;
13
+ version: string;
14
+ ss58Prefix: number;
15
+ symbol: string;
16
+ decimals: number;
17
+ };
18
+ type SystemHealth = {
19
+ peers: number;
20
+ isSyncing: boolean;
21
+ shouldHavePeers: boolean;
22
+ };
23
+ interface EventPhase {
24
+ isApplyExtrinsic: boolean;
25
+ asApplyExtrinsic: {
26
+ eq(n: number): boolean;
27
+ toString(): string;
28
+ toNumber(): number;
29
+ };
30
+ }
31
+ interface EventData extends ArrayLike<{
32
+ toString(): string;
33
+ toJSON(): unknown;
34
+ toHuman(): unknown;
35
+ }> {
36
+ toJSON(): unknown;
37
+ toHuman(): unknown;
38
+ }
39
+ interface EventRecord {
40
+ phase: EventPhase;
41
+ event: {
42
+ section: string;
43
+ method: string;
44
+ data: EventData;
45
+ };
46
+ }
47
+ /** Raw block header as returned by the chain_getBlock JSON-RPC call. */
48
+ interface RawBlockHeader {
49
+ parentHash: string;
50
+ /** Hex-encoded block number, e.g. "0x1a2b". */
51
+ number: string;
52
+ stateRoot: string;
53
+ extrinsicsRoot: string;
54
+ digest: {
55
+ logs: string[];
56
+ };
57
+ }
58
+ /** Raw block body returned by chain_getBlock. */
59
+ interface RawBlock {
60
+ header: RawBlockHeader;
61
+ /** SCALE-encoded extrinsics as 0x-hex strings. */
62
+ extrinsics: string[];
63
+ }
64
+ /**
65
+ * Enriched block info returned by `SubstrateClient.getBlock()`.
66
+ * Timestamp is extracted from `Timestamp.Now` storage (with a fallback via `timestamp.set` arg).
67
+ * Author is decoded from PreRuntime digest logs using the chain's SS58 prefix.
68
+ */
69
+ interface BlockInfo {
70
+ header: RawBlockHeader;
71
+ extrinsics: string[];
72
+ /** Unix timestamp in milliseconds, or null if not determinable. */
73
+ timestampMs: number | null;
74
+ /** SS58-encoded block author, or null if not present in digest logs. */
75
+ author: string | null;
76
+ }
77
+
78
+ type DynamicBuilder = ReturnType<typeof getDynamicBuilder>;
79
+ type ExtrinsicDecoder = ReturnType<typeof getExtrinsicDecoder>;
7
80
  /**
8
81
  * Thin wrapper over polkadot-api (PAPI) that provides:
9
82
  * - Raw JSON-RPC calls (custom Orbinum RPCs)
@@ -13,6 +86,8 @@ export { getPolkadotSignerFromPjs } from 'polkadot-api/pjs-signer';
13
86
  declare class SubstrateClient {
14
87
  private readonly _papi;
15
88
  private constructor();
89
+ private _dynamicBuilder;
90
+ private _extDecoder;
16
91
  /**
17
92
  * Connects to the Orbinum node via WebSocket.
18
93
  * Throws if the node does not respond within `timeoutMs`.
@@ -23,11 +98,55 @@ declare class SubstrateClient {
23
98
  * (shieldedPool_*, accountMapping_*, privacy_*, etc.).
24
99
  */
25
100
  request<T>(method: string, params?: unknown[]): Promise<T>;
101
+ /**
102
+ * Returns basic chain information from the node.
103
+ * Combines `system_name`, `system_chain`, `system_properties`, and `state_getRuntimeVersion`.
104
+ */
105
+ getChainInfo(): Promise<ChainInfo>;
106
+ /**
107
+ * Returns the node's peer count and sync status.
108
+ */
109
+ getHealth(): Promise<SystemHealth>;
110
+ /**
111
+ * Returns the node's software version string.
112
+ */
113
+ getNodeVersion(): Promise<string>;
114
+ /**
115
+ * Returns the genesis hash hex.
116
+ */
117
+ getGenesisHash(): Promise<string>;
118
+ /**
119
+ * Returns the block hash for a given block number.
120
+ * Returns null when the block does not exist or has been pruned.
121
+ */
122
+ getBlockHash(blockNumber: number): Promise<string | null>;
123
+ /**
124
+ * Fetches a block by hash or number, enriched with timestamp and block author.
125
+ *
126
+ * Uses `chain_getBlock` (works for all non-pruned blocks, unlike PAPI chainHead
127
+ * which only pins recent blocks). Timestamp is read from `Timestamp.Now` storage
128
+ * with a fallback via the `timestamp.set` extrinsic argument. Author is decoded
129
+ * from PreRuntime digest logs using the chain's SS58 prefix.
130
+ *
131
+ * @param hashOrNumber - A `0x`-prefixed block hash or a block number (number or decimal string).
132
+ * @returns `BlockInfo` or `null` if the block is not found.
133
+ */
134
+ getBlock(hashOrNumber: string | number): Promise<BlockInfo | null>;
26
135
  /**
27
136
  * Returns the underlying PolkadotClient instance.
28
- * Use for block subscriptions (`blocks$`), raw metadata access, and advanced SCALE operations.
137
+ * Use for raw metadata access and advanced SCALE operations.
29
138
  */
30
139
  get polkadotClient(): PolkadotClient;
140
+ /**
141
+ * Observable that emits a new entry each time a best-block is reported by the node.
142
+ * Delegates to PAPI's `blocks$`.
143
+ */
144
+ get blocks$(): PolkadotClient['blocks$'];
145
+ /**
146
+ * Returns the block header for a given tag or block hash.
147
+ * Delegates to PAPI's `getBlockHeader`.
148
+ */
149
+ getBlockHeader(...args: Parameters<PolkadotClient['getBlockHeader']>): ReturnType<PolkadotClient['getBlockHeader']>;
31
150
  /**
32
151
  * Returns the PAPI UnsafeApi for dynamic, metadata-driven transaction building.
33
152
  * The first access triggers a metadata fetch from the node.
@@ -66,6 +185,26 @@ declare class SubstrateClient {
66
185
  signAndSubmit(callData: Uint8Array, signer: PolkadotSigner): Promise<TxFinalizedPayload>;
67
186
  /** Closes the WebSocket connection. */
68
187
  destroy(): void;
188
+ /**
189
+ * Fetches and decodes all events for a given block hash.
190
+ * Queries `System.Events` storage via SCALE codec built from on-chain metadata.
191
+ *
192
+ * @param blockHash - The `0x`-prefixed block hash string.
193
+ * @returns Array of `EventRecord` or `null` if unavailable.
194
+ */
195
+ queryBlockEvents(blockHash: string): Promise<EventRecord[] | null>;
196
+ getDynamicBuilder(): Promise<ReturnType<typeof getDynamicBuilder>>;
197
+ getExtrinsicDecoder(): Promise<ExtrinsicDecoder>;
198
+ private static _buildDataProxy;
199
+ /**
200
+ * Extracts the block author (validator/collator) from raw digest log hex strings.
201
+ * Looks for a PreRuntime log (tag byte = 6) and decodes the first 32 bytes of the
202
+ * SCALE-compact payload as an SS58 address using the given prefix.
203
+ *
204
+ * Can be used standalone with raw logs from `chain_getBlock` responses.
205
+ */
206
+ static extractAuthorFromLogs(logs: string[], ss58Prefix: number): string | null;
207
+ private static _toEventRecords;
69
208
  }
70
209
 
71
210
  /**
@@ -119,11 +258,371 @@ declare class EvmClient {
119
258
  getTransactionReceipt(txHash: string): Promise<Record<string, unknown> | null>;
120
259
  }
121
260
 
261
+ /** Enriched EVM transaction model for explorer UIs. */
262
+ interface EvmTransaction {
263
+ hash: string;
264
+ blockNumber: number;
265
+ blockHash?: string;
266
+ from: string;
267
+ to: string | null;
268
+ value: string;
269
+ gasUsed: string;
270
+ gasPrice: string;
271
+ nonce: number;
272
+ input: string;
273
+ status: number;
274
+ contractAddress: string | null;
275
+ timestamp: number | null;
276
+ }
277
+ interface EvmLog {
278
+ address: string;
279
+ topics: string[];
280
+ data: string;
281
+ blockNumber: number;
282
+ transactionHash: string;
283
+ logIndex: number;
284
+ }
285
+ interface EvmAddressInfo {
286
+ address: string;
287
+ isContract: boolean;
288
+ balance: string;
289
+ nonce: number;
290
+ codeSize: number;
291
+ code: string;
292
+ recentLogs: EvmLog[];
293
+ }
294
+ interface EvmBlock {
295
+ hash: string;
296
+ number: number;
297
+ timestamp: number;
298
+ transactions: string[];
299
+ gasUsed: string;
300
+ gasLimit: string;
301
+ miner: string;
302
+ parentHash: string;
303
+ }
304
+ interface EvmTxSummary {
305
+ hash: string;
306
+ blockNumber: number;
307
+ timestamp: number | null;
308
+ from: string;
309
+ to: string | null;
310
+ value: string;
311
+ input: string;
312
+ gasUsed: number;
313
+ gasPrice: string;
314
+ status: boolean;
315
+ isContractCreation: boolean;
316
+ contractAddress: string | null;
317
+ }
318
+ interface TokenInfo {
319
+ address: string;
320
+ name: string;
321
+ symbol: string;
322
+ decimals: number;
323
+ totalSupply: string;
324
+ isErc20: boolean;
325
+ }
326
+ interface TokenTransfer {
327
+ transactionHash: string;
328
+ blockNumber: number;
329
+ from: string;
330
+ to: string;
331
+ value: string;
332
+ logIndex: number;
333
+ }
334
+
335
+ /**
336
+ * High-level EVM read-model explorer built on top of EvmClient.
337
+ * Provides typed block/tx/address/token methods for explorer applications.
338
+ */
339
+ declare class EvmExplorer {
340
+ private readonly evm;
341
+ constructor(evm: EvmClient);
342
+ getLatestBlocks(count?: number): Promise<EvmBlock[]>;
343
+ getBlock(hashOrNumber: string | number): Promise<EvmBlock | null>;
344
+ getBlockTransactions(hashOrNumber: string | number): Promise<EvmTransaction[]>;
345
+ getTransaction(hash: string): Promise<EvmTransaction | null>;
346
+ getTransactionsByAddress(address: string, maxBlocks?: number): Promise<EvmTxSummary[]>;
347
+ getAddressInfo(address: string): Promise<EvmAddressInfo>;
348
+ getBalance(address: string): Promise<string>;
349
+ getNonce(address: string): Promise<number>;
350
+ getIsContract(address: string): Promise<boolean>;
351
+ getTokenInfo(address: string): Promise<TokenInfo | null>;
352
+ getTokenTransfers(address: string, holderAddress?: string): Promise<TokenTransfer[]>;
353
+ getTokenBalance(tokenAddress: string, holderAddress: string): Promise<string>;
354
+ private parseBlock;
355
+ private parseTx;
356
+ private fetchBlock;
357
+ private ethCall;
358
+ private static decodeAbiString;
359
+ private static decodeAbiUint;
360
+ private static hexToDecimalStr;
361
+ }
362
+
363
+ /** Configuration for IndexerClient. */
364
+ interface IndexerClientConfig {
365
+ /** Base URL of the indexer REST API (no trailing slash). */
366
+ baseUrl: string;
367
+ /** Request timeout in ms. Default: 10_000. */
368
+ timeoutMs?: number;
369
+ }
370
+ /** Generic paginated result returned by list endpoints. */
371
+ interface PaginatedResult<T> {
372
+ data: T[];
373
+ pagination: {
374
+ page: number;
375
+ limit: number;
376
+ total: number;
377
+ };
378
+ }
379
+ /** A shielded commitment (shield event) stored by the indexer. */
380
+ interface ShieldedCommitment {
381
+ commitmentHex: string;
382
+ blockNumber: number;
383
+ extrinsicIndex: number | null;
384
+ leafIndex: number;
385
+ /** Asset ID as decimal string (e.g. "0"). */
386
+ assetId: string;
387
+ /** SS58 or 0x-prefixed depositor address, null if not tracked. */
388
+ sender: string | null;
389
+ /** 0x-prefixed encrypted memo hex, null if not present. */
390
+ encryptedMemo: string | null;
391
+ timestampMs: number | null;
392
+ }
393
+ /** A spent nullifier stored by the indexer. */
394
+ interface SpentNullifier {
395
+ nullifierHex: string;
396
+ blockNumber: number;
397
+ extrinsicIndex: number | null;
398
+ txType: 'unshield' | 'private_transfer';
399
+ timestampMs: number | null;
400
+ }
401
+ /** A private transfer event stored by the indexer. */
402
+ interface PrivateTransfer {
403
+ /** "{blockNumber}-{extrinsicIndex}" */
404
+ id: string;
405
+ blockNumber: number;
406
+ extrinsicIndex: number | null;
407
+ /** JSON-encoded array of nullifier hex strings. */
408
+ inputNullifiersJson: string;
409
+ /** JSON-encoded array of commitment hex strings. */
410
+ outputCommitmentsJson: string;
411
+ /** JSON-encoded array of leaf index numbers. */
412
+ leafIndicesJson: string;
413
+ timestampMs: number | null;
414
+ }
415
+ /** An unshield event stored by the indexer. */
416
+ interface Unshield {
417
+ /** "{blockNumber}-{extrinsicIndex}" */
418
+ id: string;
419
+ blockNumber: number;
420
+ extrinsicIndex: number | null;
421
+ nullifierHex: string;
422
+ /** Asset ID as decimal string. */
423
+ assetId: string;
424
+ /** Amount as decimal string (bigint-safe). */
425
+ amount: string;
426
+ recipient: string;
427
+ timestampMs: number | null;
428
+ }
429
+ /** A Merkle root checkpoint stored by the indexer. */
430
+ interface MerkleRoot {
431
+ id: number;
432
+ rootHex: string;
433
+ blockNumber: number;
434
+ oldRootHex: string | null;
435
+ treeSize: number;
436
+ timestampMs: number | null;
437
+ }
438
+ /** Response from the nullifier status endpoint. */
439
+ interface NullifierStatusResult {
440
+ nullifier: string;
441
+ spent: boolean;
442
+ txType?: 'unshield' | 'private_transfer';
443
+ blockNumber?: number;
444
+ }
445
+ /** A substrate extrinsic row returned by the address indexer endpoint. */
446
+ interface IndexedExtrinsic {
447
+ id: string;
448
+ blockNumber: number;
449
+ index: number;
450
+ hash: string | null;
451
+ section: string;
452
+ method: string;
453
+ signer: string | null;
454
+ success: boolean;
455
+ feePaid: string | null;
456
+ eventsJson: string;
457
+ argsJson: string;
458
+ timestampMs: number | null;
459
+ }
460
+ /** An indexed EVM transaction returned by explorer endpoints. */
461
+ interface IndexedEvmTx {
462
+ hash: string;
463
+ blockNumber: number;
464
+ fromAddress: string | null;
465
+ toAddress: string | null;
466
+ value: string;
467
+ gasUsed: number | null;
468
+ gasPrice: string | null;
469
+ status: number | null;
470
+ inputData: string | null;
471
+ nonce: number | null;
472
+ transactionIndex: number | null;
473
+ timestampMs: number | null;
474
+ evmBlockHash: string | null;
475
+ }
476
+ /** An indexed block returned by the blocks endpoint. */
477
+ interface IndexedBlock {
478
+ number: number;
479
+ hash: string;
480
+ parentHash: string;
481
+ timestampMs: number | null;
482
+ author: string | null;
483
+ extrinsicCount: number;
484
+ evmTxCount: number;
485
+ evmHash: string | null;
486
+ evmParentHash?: string | null;
487
+ evmMiner?: string | null;
488
+ evmGasUsed?: string | null;
489
+ evmGasLimit?: string | null;
490
+ evmBaseFeePerGas?: string | null;
491
+ }
492
+ /** Aggregated statistics returned by the /stats endpoint. */
493
+ interface IndexerStats {
494
+ blocks: {
495
+ indexed: number;
496
+ latest: number | null;
497
+ latestHash: string | null;
498
+ latestTimestampMs: number | null;
499
+ };
500
+ extrinsics: {
501
+ total: number;
502
+ };
503
+ evm: {
504
+ transactions: number;
505
+ };
506
+ shielded: {
507
+ commitments: number;
508
+ spentNullifiers: number;
509
+ merkleRoot: string | null;
510
+ treeSize: number | null;
511
+ };
512
+ zkVerifier: {
513
+ total: number;
514
+ successful: number;
515
+ };
516
+ }
517
+ /**
518
+ * A single shielded activity event tied to an address.
519
+ * The `kind` discriminant identifies whether it is a shield (commitment),
520
+ * unshield, or private transfer event.
521
+ */
522
+ type ShieldedAddressEvent = ({
523
+ kind: 'commitment';
524
+ } & ShieldedCommitment) | ({
525
+ kind: 'unshield';
526
+ } & Unshield) | ({
527
+ kind: 'transfer';
528
+ } & PrivateTransfer);
529
+
530
+ /**
531
+ * HTTP client for the Orbinum indexer REST API.
532
+ *
533
+ * All methods throw on network errors.
534
+ * Methods returning a single entity return `null` when the server responds 404.
535
+ */
536
+ declare class IndexerClient {
537
+ private readonly baseUrl;
538
+ private readonly timeoutMs;
539
+ constructor(config: IndexerClientConfig);
540
+ private _fetchResponse;
541
+ private get;
542
+ private getOrNull;
543
+ private buildQuery;
544
+ /** Returns the total count of shielded commitments. */
545
+ getCommitmentsCount(): Promise<number>;
546
+ /** Returns a paginated list of shielded commitments. */
547
+ getCommitments(params?: {
548
+ page?: number;
549
+ limit?: number;
550
+ sinceLeafIndex?: number;
551
+ }): Promise<PaginatedResult<ShieldedCommitment>>;
552
+ /** Returns a single commitment by its hex string, or null if not found. */
553
+ getCommitmentByHex(hex: string): Promise<ShieldedCommitment | null>;
554
+ /** Returns a paginated list of spent nullifiers. */
555
+ getNullifiers(params?: {
556
+ page?: number;
557
+ limit?: number;
558
+ }): Promise<PaginatedResult<SpentNullifier>>;
559
+ /** Returns the spent/unspent status of a nullifier. */
560
+ getNullifierStatus(hex: string): Promise<NullifierStatusResult>;
561
+ /** Returns a paginated list of private transfer events. */
562
+ getTransfers(params?: {
563
+ page?: number;
564
+ limit?: number;
565
+ }): Promise<PaginatedResult<PrivateTransfer>>;
566
+ /** Returns a paginated list of unshield events. */
567
+ getUnshields(params?: {
568
+ page?: number;
569
+ limit?: number;
570
+ }): Promise<PaginatedResult<Unshield>>;
571
+ /** Returns a paginated list of Merkle root checkpoints. */
572
+ getMerkleRoots(params?: {
573
+ page?: number;
574
+ limit?: number;
575
+ }): Promise<PaginatedResult<MerkleRoot>>;
576
+ /** Returns the latest Merkle root, or null if none exists. */
577
+ getLatestMerkleRoot(): Promise<MerkleRoot | null>;
578
+ /** Returns a paginated list of extrinsics signed by the given address. */
579
+ getAddressExtrinsics(address: string, params?: {
580
+ page?: number;
581
+ limit?: number;
582
+ }): Promise<PaginatedResult<IndexedExtrinsic>>;
583
+ /** Returns a paginated list of EVM transactions filtered by address and/or block number. */
584
+ getEvmTransactions(params?: {
585
+ page?: number;
586
+ limit?: number;
587
+ address?: string;
588
+ blockNumber?: number;
589
+ }): Promise<PaginatedResult<IndexedEvmTx>>;
590
+ /** Returns a single EVM transaction by hash, or null if not found. */
591
+ getEvmTransactionByHash(hash: string): Promise<IndexedEvmTx | null>;
592
+ /** Returns a paginated list of indexed blocks. */
593
+ getBlocks(params?: {
594
+ page?: number;
595
+ limit?: number;
596
+ }): Promise<PaginatedResult<IndexedBlock>>;
597
+ /** Returns a single block by number or hash, or null if not found. */
598
+ getBlock(numberOrHash: string | number): Promise<IndexedBlock | null>;
599
+ /** Returns a paginated list of shielded commitments initiated by an address. */
600
+ getAddressCommitments(address: string, params?: {
601
+ page?: number;
602
+ limit?: number;
603
+ }): Promise<PaginatedResult<ShieldedCommitment>>;
604
+ /**
605
+ * Returns a paginated list of all shielded activity (commitments, unshields,
606
+ * private transfers) associated with the given address.
607
+ * Each item is tagged with a `kind` discriminant.
608
+ */
609
+ getAddressShieldedActivity(address: string, params?: {
610
+ page?: number;
611
+ limit?: number;
612
+ }): Promise<PaginatedResult<ShieldedAddressEvent>>;
613
+ /** Returns aggregated indexer statistics. */
614
+ getStats(): Promise<IndexerStats>;
615
+ /** Returns true if the indexer health endpoint responds OK. */
616
+ isHealthy(): Promise<boolean>;
617
+ }
618
+
122
619
  type OrbinumClientConfig = {
123
620
  /** WebSocket URL of the Orbinum node (e.g. "ws://localhost:9944") */
124
621
  substrateWs: string;
125
622
  /** HTTP URL of the EVM JSON-RPC endpoint (e.g. "http://localhost:9933") */
126
623
  evmRpc?: string;
624
+ /** Base URL of the Orbinum indexer REST API (e.g. "https://indexer.orbinum.io") */
625
+ indexerUrl?: string;
127
626
  /** Connection timeout in ms. Default: 15_000 */
128
627
  connectTimeoutMs?: number;
129
628
  };
@@ -136,32 +635,22 @@ type TxResult = {
136
635
  /** Dispatch error type string when ok = false. */
137
636
  error?: string;
138
637
  };
638
+
139
639
  type MerkleTreeInfo = {
140
640
  root: string;
141
641
  treeSize: number;
142
642
  depth: number;
143
643
  };
144
- /** Aggregate shielded pool statistics (merkle tree + total locked balance). */
145
- type PoolStats = {
146
- merkleRoot: string;
147
- commitmentCount: number;
148
- /** Total native balance locked in the pool (u128 as decimal string). */
149
- totalBalance: string;
150
- treeDepth: number;
151
- };
152
- type MerkleProof = {
153
- root: string;
644
+ type ScanCommitment = {
645
+ commitmentHex: string;
154
646
  leafIndex: number;
155
- siblings: string[];
156
- };
157
- type CommitmentMerkleProof = MerkleProof;
158
- type NullifierStatus = {
159
- nullifier: string;
160
- isSpent: boolean;
161
- };
162
- type PoolBalance = {
163
- assetId: number;
164
- balance: bigint;
647
+ encryptedMemo: string | null;
648
+ };
649
+ type DecryptedMemo = {
650
+ value: bigint;
651
+ ownerPk: bigint;
652
+ blinding: bigint;
653
+ assetId: bigint;
165
654
  };
166
655
  type ShieldParams = {
167
656
  assetId: number;
@@ -183,20 +672,20 @@ type UnshieldParams = {
183
672
  /** SS58 or 0x-prefixed 32-byte address */
184
673
  recipientAddress: string;
185
674
  };
186
- type TransferInput = {
675
+ type PrivateTransferInput = {
187
676
  /** 0x-prefixed nullifier hex */
188
677
  nullifier: string;
189
678
  /** 0x-prefixed commitment hex */
190
679
  commitment: string;
191
680
  };
192
- type TransferOutput = {
681
+ type PrivateTransferOutput = {
193
682
  /** 0x-prefixed commitment hex */
194
683
  commitment: string;
195
684
  encryptedMemo?: Uint8Array;
196
685
  };
197
686
  type PrivateTransferParams = {
198
- inputs: TransferInput[];
199
- outputs: TransferOutput[];
687
+ inputs: PrivateTransferInput[];
688
+ outputs: PrivateTransferOutput[];
200
689
  /** ZK proof bytes */
201
690
  proof: Uint8Array;
202
691
  /** 0x-prefixed merkle root hex */
@@ -256,21 +745,82 @@ type ShieldResult = {
256
745
  txResult: TxResult;
257
746
  note: ZkNote;
258
747
  };
259
- type ChainInfo = {
260
- name: string;
261
- version: string;
262
- ss58Prefix: number;
748
+ /** Parameters for a single item in a shield_batch extrinsic. */
749
+ type ShieldBatchItem = {
750
+ assetId: number;
751
+ amount: bigint;
752
+ /** 0x-prefixed 32-byte commitment hex */
753
+ commitment: string;
754
+ /** Optional encrypted memo bytes. Auto-generates a dummy memo if absent. */
755
+ encryptedMemo?: Uint8Array;
263
756
  };
264
- type FullIdentityInfo = {
265
- substrateAddress: string | null;
266
- evmAddress: string | null;
267
- alias: string | null;
757
+ /** Parameters for shieldedPool.shieldBatch — deposits up to 20 notes in one extrinsic. */
758
+ type ShieldBatchParams = {
759
+ items: ShieldBatchItem[];
268
760
  };
761
+
762
+ /**
763
+ * High-level module for Orbinum shielded-pool operations.
764
+ *
765
+ * Transactions are built via polkadot-api's UnsafeApi (metadata-driven),
766
+ * which means the Orbinum node must be reachable on first use.
767
+ * Signing is delegated to a PolkadotSigner (see polkadot-api/signer).
768
+ *
769
+ * Parameter order matches the Orbinum runtime extrinsics exactly.
770
+ */
771
+ declare class ShieldedPoolModule {
772
+ private readonly substrate;
773
+ constructor(substrate: SubstrateClient);
774
+ /**
775
+ * Deposits tokens into the shielded pool.
776
+ * Extrinsic: shieldedPool.shield(assetId, amount, commitment, encryptedMemo)
777
+ */
778
+ shield(params: ShieldParams, signer: PolkadotSigner): Promise<TxResult>;
779
+ /**
780
+ * Build a ZkNote locally and submit shieldedPool.shield in one call.
781
+ *
782
+ * Returns both the on-chain result and the note — **save the note locally**,
783
+ * it cannot be recovered after the fact.
784
+ *
785
+ * @param params.value Amount in planck (required).
786
+ * @param params.assetId Asset ID — default 0 (native ORB-Privacy).
787
+ * @param params.ownerPk BabyJubJub Ax (default 0n).
788
+ * @param params.blinding Random blinding scalar (default BigInt(Date.now())).
789
+ * @param params.spendingKey Secret spending key (default 0n).
790
+ */
791
+ buildAndShield(params: {
792
+ value: bigint;
793
+ assetId?: number;
794
+ ownerPk?: bigint;
795
+ blinding?: bigint;
796
+ spendingKey?: bigint;
797
+ }, signer: PolkadotSigner): Promise<ShieldResult>;
798
+ /**
799
+ * Withdraws tokens from the shielded pool to a public address.
800
+ * Extrinsic: shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient)
801
+ */
802
+ unshield(params: UnshieldParams, signer: PolkadotSigner): Promise<TxResult>;
803
+ /**
804
+ * Performs a private (shielded) transfer between two notes.
805
+ * Extrinsic: shieldedPool.privateTransfer(inputs, outputs, proof, merkleRoot)
806
+ */
807
+ privateTransfer(params: PrivateTransferParams, signer: PolkadotSigner): Promise<TxResult>;
808
+ /**
809
+ * Deposits multiple notes into the shielded pool in a single extrinsic.
810
+ * Extrinsic: shieldedPool.shieldBatch(operations) — max 20 items.
811
+ */
812
+ shieldBatch(params: ShieldBatchParams, signer: PolkadotSigner): Promise<TxResult>;
813
+ }
814
+
269
815
  /**
270
816
  * Signature verification scheme for cross-chain links.
271
817
  * Mirrors `SignatureScheme` in pallet-account-mapping.
272
818
  */
273
- type SignatureScheme = 'Eip191' | 'Ed25519';
819
+ declare const SignatureScheme: {
820
+ readonly Eip191: "Eip191";
821
+ readonly Ed25519: "Ed25519";
822
+ };
823
+ type SignatureScheme = (typeof SignatureScheme)[keyof typeof SignatureScheme];
274
824
  /** A verified public link to an external chain wallet. */
275
825
  type ChainLink = {
276
826
  chainId: number;
@@ -322,157 +872,7 @@ type SupportedChain = {
322
872
  chainId: number;
323
873
  scheme: SignatureScheme;
324
874
  };
325
- /**
326
- * Bitmask to convert a SLIP-0044 coin type into an Orbinum ChainId.
327
- * Example: `SLIP0044_NAMESPACE | 501` = Solana.
328
- */
329
- declare const SLIP0044_NAMESPACE = 2147483648;
330
-
331
- /**
332
- * Queries the Orbinum shielded-pool Merkle tree via custom RPC methods.
333
- */
334
- declare class MerkleModule {
335
- private readonly substrate;
336
- constructor(substrate: SubstrateClient);
337
- /**
338
- * Returns the current Merkle tree state: root, number of leaves, and depth.
339
- */
340
- getTreeInfo(): Promise<MerkleTreeInfo>;
341
- /**
342
- * Returns the Merkle inclusion proof for a leaf at `leafIndex`.
343
- */
344
- getProof(leafIndex: number): Promise<MerkleProof>;
345
- /**
346
- * Returns the Merkle inclusion proof for a given commitment (0x-prefixed hex).
347
- * Searches the tree for the commitment and returns its proof.
348
- */
349
- getProofByCommitment(commitmentHex: string): Promise<MerkleProof>;
350
- /**
351
- * Returns the current Merkle root without fetching the full tree info.
352
- */
353
- getRoot(): Promise<string>;
354
- /**
355
- * Returns an array of commitment leaves from index `from` to `to` (inclusive).
356
- * Defaults to returning all leaves.
357
- */
358
- getLeaves(from?: number, to?: number): Promise<string[]>;
359
- }
360
-
361
- /**
362
- * High-level module for Orbinum shielded-pool operations.
363
- *
364
- * Transactions are built via polkadot-api's UnsafeApi (metadata-driven),
365
- * which means the Orbinum node must be reachable on first use.
366
- * Signing is delegated to a PolkadotSigner (see polkadot-api/signer).
367
- *
368
- * Parameter order matches the Orbinum runtime extrinsics exactly.
369
- */
370
- declare class ShieldedPoolModule {
371
- private readonly substrate;
372
- readonly merkle: MerkleModule;
373
- constructor(substrate: SubstrateClient, merkle: MerkleModule);
374
- /**
375
- * Deposits tokens into the shielded pool.
376
- * Extrinsic: shieldedPool.shield(assetId, amount, commitment, encryptedMemo)
377
- */
378
- shield(params: ShieldParams, signer: PolkadotSigner): Promise<TxResult>;
379
- /**
380
- * Build a ZkNote locally and submit shieldedPool.shield in one call.
381
- *
382
- * Returns both the on-chain result and the note — **save the note locally**,
383
- * it cannot be recovered after the fact.
384
- *
385
- * @param params.value Amount in planck (required).
386
- * @param params.assetId Asset ID — default 0 (native ORB-Privacy).
387
- * @param params.ownerPk BabyJubJub Ax (default 0n).
388
- * @param params.blinding Random blinding scalar (default BigInt(Date.now())).
389
- * @param params.spendingKey Secret spending key (default 0n).
390
- */
391
- buildAndShield(params: {
392
- value: bigint;
393
- assetId?: number;
394
- ownerPk?: bigint;
395
- blinding?: bigint;
396
- spendingKey?: bigint;
397
- }, signer: PolkadotSigner): Promise<ShieldResult>;
398
- /**
399
- * Withdraws tokens from the shielded pool to a public address.
400
- * Extrinsic: shieldedPool.unshield(proof, merkleRoot, nullifier, assetId, amount, recipient)
401
- */
402
- unshield(params: UnshieldParams, signer: PolkadotSigner): Promise<TxResult>;
403
- /**
404
- * Performs a private (shielded) transfer between two notes.
405
- * Extrinsic: shieldedPool.privateTransfer(inputs, outputs, proof, merkleRoot)
406
- */
407
- privateTransfer(params: PrivateTransferParams, signer: PolkadotSigner): Promise<TxResult>;
408
- /** Returns whether a nullifier has already been spent. */
409
- isNullifierSpent(nullifierHex: string): Promise<boolean>;
410
- /** Returns the full nullifier status object. */
411
- getNullifierStatus(nullifierHex: string): Promise<NullifierStatus>;
412
- /** Returns the total locked balance in the pool for a given asset. */
413
- getPoolBalance(assetId: number): Promise<PoolBalance>;
414
- /**
415
- * Returns Merkle tree info and pool balance for a given asset in a single call.
416
- * Convenience wrapper used by both `app` and `privacy-explorer`.
417
- */
418
- getPoolStats(assetId?: number): Promise<{
419
- merkle: MerkleTreeInfo;
420
- balance: PoolBalance;
421
- }>;
422
- }
423
-
424
- type RawSystemHealth = {
425
- peers: number;
426
- isSyncing: boolean;
427
- shouldHavePeers: boolean;
428
- };
429
- /**
430
- * Provides general chain queries: node info, account mapping, address resolution.
431
- */
432
- declare class ChainModule {
433
- private readonly substrate;
434
- private readonly evm;
435
- constructor(substrate: SubstrateClient, evm: EvmClient | null);
436
- /**
437
- * Returns basic chain information from the node.
438
- */
439
- getChainInfo(): Promise<ChainInfo>;
440
- /**
441
- * Returns the node's peer count and sync status.
442
- */
443
- getHealth(): Promise<RawSystemHealth>;
444
- /**
445
- * Returns the node's software version string.
446
- */
447
- getNodeVersion(): Promise<string>;
448
- /**
449
- * Returns the genesis hash hex.
450
- */
451
- getGenesisHash(): Promise<string>;
452
- /**
453
- * Resolves the full identity (Substrate + EVM addresses, alias) for an account.
454
- * Accepts an EVM address (0x...) or a Substrate account hex (0x...32bytes).
455
- */
456
- getFullIdentity(address: string): Promise<FullIdentityInfo | null>;
457
- /**
458
- * Returns the mapped Substrate account hex for a given EVM address, or null.
459
- */
460
- getMappedAccountByEvm(evmAddress: string): Promise<string | null>;
461
- /**
462
- * Returns the alias registered for a Substrate account, or null.
463
- */
464
- getAliasOf(accountHex: string): Promise<string | null>;
465
- /**
466
- * Returns estimated EVM chain ID from the EVM RPC endpoint. Requires evmRpc
467
- * to have been provided in `OrbinumClientConfig`.
468
- */
469
- getEvmChainId(): Promise<number>;
470
- /**
471
- * Returns the current EVM block number.
472
- */
473
- getEvmBlockNumber(): Promise<number>;
474
- }
475
-
875
+ /** Parameters for adding a verified public chain link. */
476
876
  type AddChainLinkParams = {
477
877
  /** External chain ID. Use SLIP0044_NAMESPACE | coinType for SLIP-0044 chains. */
478
878
  chainId: number;
@@ -481,16 +881,19 @@ type AddChainLinkParams = {
481
881
  /** Signature over the caller's AccountId32 (64 bytes for Ed25519, 65 for EIP-191). */
482
882
  signature: Uint8Array;
483
883
  };
884
+ /** Parameters for updating public profile metadata. */
484
885
  type SetMetadataParams = {
485
886
  displayName?: string | null;
486
887
  bio?: string | null;
487
888
  avatar?: string | null;
488
889
  };
890
+ /** Parameters for listing an alias on the marketplace. */
489
891
  type PutOnSaleParams = {
490
892
  price: bigint;
491
893
  /** If true the sale becomes OTC (whitelist required). */
492
894
  isPrivate: boolean;
493
895
  };
896
+ /** Parameters for dispatching a call authenticated by a linked external account. */
494
897
  type DispatchAsLinkedParams = {
495
898
  /** Owner AccountId32 hex (0x-prefixed 64 chars). */
496
899
  owner: string;
@@ -501,6 +904,12 @@ type DispatchAsLinkedParams = {
501
904
  /** Encoded call bytes (SCALE). */
502
905
  callData: Uint8Array;
503
906
  };
907
+ /**
908
+ * Bitmask to convert a SLIP-0044 coin type into an Orbinum ChainId.
909
+ * Example: `SLIP0044_NAMESPACE | 501` = Solana.
910
+ */
911
+ declare const SLIP0044_NAMESPACE = 2147483648;
912
+
504
913
  /**
505
914
  * Module for Orbinum pallet-account-mapping:
506
915
  * - Query on-chain identity data (aliases, chain links, metadata, marketplace)
@@ -650,18 +1059,100 @@ declare class AccountMappingModule {
650
1059
  dispatchAsLinkedAccount(params: DispatchAsLinkedParams, signer: PolkadotSigner): Promise<TxResult>;
651
1060
  }
652
1061
 
1062
+ type RpcV2MerkleProof = {
1063
+ path: string[];
1064
+ leafIndex: number;
1065
+ treeDepth: number;
1066
+ };
1067
+ /** Prueba Merkle enriquecida con el `root` actual del árbol. Devuelta por `getMerkleProofByCommitment`. */
1068
+ type PrivacyMerkleProof = RpcV2MerkleProof & {
1069
+ root: string;
1070
+ };
1071
+ type RpcV2NullifierStatus = {
1072
+ nullifier: string;
1073
+ isSpent: boolean;
1074
+ };
1075
+ type RpcV2PoolAssetBalance = {
1076
+ assetId: number;
1077
+ /** Balance serializado como string decimal para preservar `u128`. */
1078
+ balance: string;
1079
+ };
1080
+ type RpcV2PoolStats = {
1081
+ merkleRoot: string;
1082
+ commitmentCount: number;
1083
+ /** Total pool balance serializado como string decimal para preservar `u128`. */
1084
+ totalBalance: string;
1085
+ assetBalances: RpcV2PoolAssetBalance[];
1086
+ treeDepth: number;
1087
+ };
1088
+
653
1089
  /**
654
- * Converts a Uint8Array or number[] to a 0x-prefixed lowercase hex string.
1090
+ * Typed client for the Orbinum `rpc-v2` endpoints under the `privacy_*` namespace.
655
1091
  */
656
- declare function toHex(bytes: Uint8Array | number[]): string;
1092
+ declare class PrivacyModule {
1093
+ private readonly substrate;
1094
+ constructor(substrate: SubstrateClient);
1095
+ /** Returns the current Merkle tree root. */
1096
+ getMerkleRoot(): Promise<string>;
1097
+ /** Returns the Merkle proof for the given leaf index or commitment hex. */
1098
+ getMerkleProof(leafIndex: number | string): Promise<RpcV2MerkleProof>;
1099
+ /**
1100
+ * Returns the Merkle inclusion proof for a given commitment hex,
1101
+ * bundled with the current Merkle root.
1102
+ */
1103
+ getMerkleProofByCommitment(commitmentHex: string): Promise<PrivacyMerkleProof>;
1104
+ /** Returns the spend status of a nullifier. */
1105
+ getNullifierStatus(nullifier: string): Promise<RpcV2NullifierStatus>;
1106
+ /** Returns aggregated statistics for the shielded pool from `rpc-v2`. */
1107
+ getPoolStats(): Promise<RpcV2PoolStats>;
1108
+ }
1109
+
1110
+ /** Public (camelCase) types for `zkVerifier_*` RPC responses. */
1111
+ type ZkVerifierVkHash = {
1112
+ version: number;
1113
+ vkHash: string;
1114
+ /** On-chain verification statistics for this version (if available). */
1115
+ stats?: ZkVerifierVersionStats;
1116
+ };
1117
+ /** Proof verification counts for a specific circuit version. */
1118
+ type ZkVerifierVersionStats = {
1119
+ /** Total proof verification attempts. */
1120
+ total: number;
1121
+ /** Successful verifications. */
1122
+ successful: number;
1123
+ /** Failed verifications. */
1124
+ failed: number;
1125
+ };
657
1126
  /**
658
- * Decodes a hex string (with or without 0x prefix) to Uint8Array.
1127
+ * A version whose VK was removed from storage but whose stats record survived.
1128
+ * The key data is gone; only the usage record remains.
659
1129
  */
660
- declare function fromHex(hex: string): Uint8Array;
1130
+ type ZkVerifierHistoricalVersion = {
1131
+ version: number;
1132
+ stats: ZkVerifierVersionStats;
1133
+ };
1134
+ type ZkVerifierCircuitVersionInfo = {
1135
+ circuitId: number;
1136
+ activeVersion: number;
1137
+ /** Proof system (e.g. 'Groth16'). */
1138
+ proofSystem: string;
1139
+ supportedVersions: number[];
1140
+ vkHashes: ZkVerifierVkHash[];
1141
+ /** Versions removed from storage that still have stats records. */
1142
+ historicalVersions: ZkVerifierHistoricalVersion[];
1143
+ };
1144
+
661
1145
  /**
662
- * Ensures a hex string has the 0x prefix.
1146
+ * Typed client for `zkVerifier_*` JSON-RPC endpoints.
663
1147
  */
664
- declare function ensureHexPrefix(hex: string): string;
1148
+ declare class ZkVerifierModule {
1149
+ private readonly substrate;
1150
+ constructor(substrate: SubstrateClient);
1151
+ /** Returns basic version info for all registered circuits. */
1152
+ getAllCircuitVersions(): Promise<ZkVerifierCircuitVersionInfo[]>;
1153
+ /** Returns version info for a specific circuit, or null if not found. */
1154
+ getCircuitVersionInfo(circuitId: number): Promise<ZkVerifierCircuitVersionInfo | null>;
1155
+ }
665
1156
 
666
1157
  /** EVM transaction request passed to an `EvmSigner` callback. */
667
1158
  type EvmTxRequest = {
@@ -669,14 +1160,43 @@ type EvmTxRequest = {
669
1160
  data: string;
670
1161
  value?: bigint;
671
1162
  };
1163
+ /** Callback that signs and submits an EVM transaction, returning the tx hash. */
1164
+ type EvmSigner = (tx: EvmTxRequest) => Promise<string>;
1165
+ type ResolvedAlias = {
1166
+ /** AccountId32 hex of the alias owner (as 0x-prefixed 20-byte EVM address). */
1167
+ owner: string;
1168
+ /** EVM address of the owner, or null if unset. */
1169
+ evmAddress: string | null;
1170
+ };
1171
+ /** Metadata for a known precompile: display name and function selector map. */
1172
+ interface KnownPrecompileInfo {
1173
+ /** Human-readable name, e.g. "ShieldedPool". */
1174
+ name: string;
1175
+ /** Map from 4-byte hex selector (no 0x prefix) to function signature. */
1176
+ functions: Record<string, string>;
1177
+ }
1178
+
672
1179
  /**
673
- * Callback that signs and submits an EVM transaction, returning the tx hash.
674
- *
675
- * MetaMask: `(tx) => window.ethereum.request({ method: 'eth_sendTransaction', params: [{ ...tx, from: account }] })`
676
- * ethers: `(tx) => (await signer.sendTransaction({ to: tx.to, data: tx.data })).hash`
677
- * viem: `(tx) => walletClient.sendTransaction({ to: tx.to, data: tx.data })`
1180
+ * Converts a Uint8Array or number[] to a 0x-prefixed lowercase hex string.
678
1181
  */
679
- type EvmSigner = (tx: EvmTxRequest) => Promise<string>;
1182
+ declare function toHex(bytes: Uint8Array | number[]): string;
1183
+ /**
1184
+ * Decodes a hex string (with or without 0x prefix) to Uint8Array.
1185
+ */
1186
+ declare function fromHex(hex: string): Uint8Array;
1187
+ /**
1188
+ * Ensures a hex string has the 0x prefix.
1189
+ */
1190
+ declare function ensureHexPrefix(hex: string): string;
1191
+ /**
1192
+ * Converts a 0x-prefixed hex string (as returned by JSON-RPC) to a number.
1193
+ */
1194
+ declare function hexToNumber(hex: string): number;
1195
+ /**
1196
+ * Converts a 0x-prefixed hex string (as returned by JSON-RPC) to a bigint.
1197
+ */
1198
+ declare function hexToBigint(hex: string): bigint;
1199
+
680
1200
  /**
681
1201
  * Bindings for the `ShieldedPoolPrecompile` at address `0x...0801`.
682
1202
  *
@@ -756,12 +1276,6 @@ declare class ShieldedPoolPrecompile {
756
1276
  estimateUnshieldGas(params: UnshieldParams, from: string): Promise<bigint>;
757
1277
  }
758
1278
 
759
- type ResolvedAlias = {
760
- /** AccountId32 hex of the alias owner (as 0x-prefixed 20-byte EVM address). */
761
- owner: string;
762
- /** EVM address of the owner, or null if unset. */
763
- evmAddress: string | null;
764
- };
765
1279
  /**
766
1280
  * EVM bindings for `AccountMappingPrecompile` at address `0x...0800`.
767
1281
  *
@@ -890,10 +1404,25 @@ declare class AccountMappingPrecompile {
890
1404
  /**
891
1405
  * Updates the signer's public profile metadata.
892
1406
  * Pass `null` for any field to leave it unchanged.
893
- *
894
- * Extrinsic: `accountMapping.setAccountMetadata(displayName, bio, avatar)`
895
- */
896
- setAccountMetadata(displayName: string | null, bio: string | null, avatar: string | null, signer: EvmSigner): Promise<string>;
1407
+ }
1408
+ displayName: string | null,
1409
+ bio: string | null,
1410
+ avatar: string | null,
1411
+ signer: EvmSigner
1412
+ ): Promise<string> {
1413
+ const enc = (v: string | null): Uint8Array =>
1414
+ v != null ? new TextEncoder().encode(v) : new Uint8Array(0);
1415
+ const data = encodeHex(
1416
+ AM_SEL.SET_ACCOUNT_METADATA,
1417
+ { type: 'bytes', value: enc(displayName) },
1418
+ { type: 'bytes', value: enc(bio) },
1419
+ { type: 'bytes', value: enc(avatar) }
1420
+ );
1421
+ return signer({ to: this.addr, data });
1422
+ }
1423
+
1424
+ // ─── Calldata builders (for custom signing / batching) ─────────────────────
1425
+
897
1426
  /** Returns the raw ABI-encoded calldata for `registerAlias`. */
898
1427
  buildRegisterAliasCalldata(alias: string): string;
899
1428
  /** Returns the raw ABI-encoded calldata for `mapAccount`. */
@@ -983,9 +1512,9 @@ declare class CryptoPrecompiles {
983
1512
  * evmRpc: 'http://localhost:9933',
984
1513
  * });
985
1514
  *
986
- * // Query Merkle tree
987
- * const info = await client.shieldedPool.merkle.getTreeInfo();
988
- * console.log('root:', info.root, 'nodes:', info.treeSize);
1515
+ * // Query Merkle tree stats
1516
+ * const stats = await client.privacy.getPoolStats();
1517
+ * console.log('root:', stats.merkleRoot, 'leaves:', stats.commitmentCount);
989
1518
  *
990
1519
  * // Shield tokens (with a PolkadotSigner)
991
1520
  * const result = await client.shieldedPool.shield(
@@ -1002,12 +1531,24 @@ declare class OrbinumClient {
1002
1531
  readonly substrate: SubstrateClient;
1003
1532
  /** Raw access to the EVM HTTP JSON-RPC endpoint (if configured). */
1004
1533
  readonly evm: EvmClient | null;
1534
+ /**
1535
+ * High-level EVM block and transaction explorer (if `evmRpc` is configured).
1536
+ * Provides enriched queries for blocks, transactions, addresses, and token transfers.
1537
+ */
1538
+ readonly evmExplorer: EvmExplorer | null;
1539
+ /**
1540
+ * HTTP client for the Orbinum indexer REST API (if `indexerUrl` is configured).
1541
+ * Provides paginated access to indexed blocks, extrinsics, shielded events, and nullifiers.
1542
+ */
1543
+ readonly indexer: IndexerClient | null;
1005
1544
  /** Shielded-pool operations: shield, unshield, privateTransfer, and merkle queries. */
1006
1545
  readonly shieldedPool: ShieldedPoolModule;
1007
- /** General chain queries: node info, identity resolution. */
1008
- readonly chain: ChainModule;
1009
1546
  /** Account mapping: aliases, chain links, metadata, marketplace, and identity extrinsics. */
1010
1547
  readonly accountMapping: AccountMappingModule;
1548
+ /** Typed access to Orbinum `privacy_*` RPC endpoints. */
1549
+ readonly privacy: PrivacyModule;
1550
+ /** Typed access to zkVerifier_* RPC endpoints. */
1551
+ readonly zkVerifier: ZkVerifierModule;
1011
1552
  /**
1012
1553
  * EVM precompiles: shielded pool + account mapping callable from an EVM wallet.
1013
1554
  * Only available when `evmRpc` is configured. Methods throw if `evm` is null.
@@ -1026,14 +1567,84 @@ declare class OrbinumClient {
1026
1567
  * Throws if the Substrate node is unreachable within `connectTimeoutMs`.
1027
1568
  */
1028
1569
  static connect(config: OrbinumClientConfig): Promise<OrbinumClient>;
1029
- /**
1030
- * Convenience getter for the Merkle module (shortcut for `shieldedPool.merkle`).
1031
- */
1032
- get merkle(): MerkleModule;
1033
1570
  /** Closes the WebSocket connection to the Substrate node. */
1034
1571
  destroy(): void;
1035
1572
  }
1036
1573
 
1574
+ type ConnectionStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting';
1575
+ type StatusChangeEvent = {
1576
+ status: ConnectionStatus;
1577
+ error?: string;
1578
+ };
1579
+ type StatusListener = (event: StatusChangeEvent) => void;
1580
+ interface ClientProviderConfig {
1581
+ substrateWs: string;
1582
+ evmRpc?: string;
1583
+ /** Base URL of the Orbinum indexer REST API (e.g. "https://indexer.orbinum.io") */
1584
+ indexerUrl?: string;
1585
+ connectTimeoutMs?: number;
1586
+ heartbeatIntervalMs?: number;
1587
+ heartbeatTimeoutMs?: number;
1588
+ reconnectBaseMs?: number;
1589
+ reconnectMaxMs?: number;
1590
+ }
1591
+ /**
1592
+ * Manages the lifecycle of an `OrbinumClient` with heartbeat monitoring,
1593
+ * exponential-backoff reconnection, and status event emission.
1594
+ *
1595
+ * Instantiate one per application and use as a singleton.
1596
+ *
1597
+ * @example
1598
+ * ```ts
1599
+ * import { OrbinumClientProvider } from '@orbinum/sdk';
1600
+ *
1601
+ * const provider = new OrbinumClientProvider({
1602
+ * substrateWs: 'ws://localhost:9944',
1603
+ * evmRpc: 'http://localhost:9944',
1604
+ * });
1605
+ * provider.connect();
1606
+ *
1607
+ * const client = await provider.getOrbinumClient();
1608
+ * ```
1609
+ */
1610
+ declare class OrbinumClientProvider {
1611
+ private readonly config;
1612
+ private readonly connectTimeoutMs;
1613
+ private readonly heartbeatIntervalMs;
1614
+ private readonly heartbeatTimeoutMs;
1615
+ private readonly reconnectBaseMs;
1616
+ private readonly reconnectMaxMs;
1617
+ private _status;
1618
+ private _orbinumClient;
1619
+ private _connectingPromise;
1620
+ private _heartbeatTimer;
1621
+ private _reconnectTimer;
1622
+ private _reconnectAttempt;
1623
+ private _listeners;
1624
+ constructor(config: ClientProviderConfig);
1625
+ get status(): ConnectionStatus;
1626
+ private setStatus;
1627
+ onStatusChange(listener: StatusListener): () => void;
1628
+ connect(): void;
1629
+ reset(): void;
1630
+ private startConnectAttempt;
1631
+ private attemptConnect;
1632
+ private startHeartbeat;
1633
+ private stopHeartbeat;
1634
+ private probe;
1635
+ private scheduleReconnect;
1636
+ private cancelReconnect;
1637
+ private teardownClient;
1638
+ getOrbinumClient(): Promise<OrbinumClient>;
1639
+ tryGetOrbinumClient(): Promise<OrbinumClient | null>;
1640
+ rpcSend<T>(method: string, params?: unknown[]): Promise<T>;
1641
+ evmRpc<T>(method: string, params?: unknown[]): Promise<T>;
1642
+ evmRpcBatch<T extends unknown[]>(calls: Array<{
1643
+ method: string;
1644
+ params?: unknown[];
1645
+ }>): Promise<T>;
1646
+ }
1647
+
1037
1648
  /**
1038
1649
  * Builds ZK notes (commitment + nullifier) and encrypted memos locally.
1039
1650
  *
@@ -1087,13 +1698,7 @@ declare class NoteBuilder {
1087
1698
  *
1088
1699
  * Cipher: ChaCha20-Poly1305 (IETF, 96-bit nonce)
1089
1700
  */
1090
- /** Fields recovered from a successfully decrypted EncryptedMemo. */
1091
- type DecryptedMemo = {
1092
- value: bigint;
1093
- ownerPk: bigint;
1094
- blinding: bigint;
1095
- assetId: bigint;
1096
- };
1701
+
1097
1702
  declare const EncryptedMemo: {
1098
1703
  /**
1099
1704
  * Build and encrypt a memo for a note.
@@ -1145,12 +1750,6 @@ declare const EncryptedMemo: {
1145
1750
  * nullifier = Poseidon2(commitment, spendingKey)
1146
1751
  */
1147
1752
 
1148
- /** A single commitment record as returned by the indexer. */
1149
- interface ScanCommitment {
1150
- commitmentHex: string;
1151
- leafIndex: number;
1152
- encryptedMemo: string | null;
1153
- }
1154
1753
  /**
1155
1754
  * Attempt to decrypt an on-chain commitment using a viewing key.
1156
1755
  *
@@ -1219,16 +1818,20 @@ declare function deriveOwnerPk(spendingKey: bigint): bigint;
1219
1818
  * In-memory manager for the user's Orbinum shielded-pool identity.
1220
1819
  * Protocol-level module — no UI, no localStorage, no sessionStorage dependencies.
1221
1820
  *
1222
- * Call `PrivacyKeyManager.load(spendingKey)` after deriving the key from a wallet
1223
- * signature (see `deriveSpendingKeyFromSignature`). The caller (application layer)
1224
- * is responsible for key persistence and session caching.
1821
+ * Create one instance per user session:
1822
+ * const pkm = new PrivacyKeyManager();
1823
+ * await pkm.load(spendingKey);
1824
+ *
1825
+ * The caller (application layer) is responsible for key persistence and session
1826
+ * caching. Each instance holds independent state — safe for multi-wallet use.
1225
1827
  *
1226
1828
  * Derivation scheme:
1227
1829
  * spendingKey (bigint, BN254 scalar)
1228
1830
  * └── viewingKey = HKDF-SHA256(spendingKey_bytes, info="orbinum-ivk-v1") → 32 bytes
1229
1831
  * └── ownerPk = BabyJubJub Ax from (spendingKey * Base8) → bigint
1230
1832
  */
1231
- declare const PrivacyKeyManager: {
1833
+ declare class PrivacyKeyManager {
1834
+ private _state;
1232
1835
  /**
1233
1836
  * Load a spending key into the in-memory session.
1234
1837
  * Derives viewingKey and ownerPk immediately.
@@ -1254,7 +1857,7 @@ declare const PrivacyKeyManager: {
1254
1857
  * Validates the key is in the valid range [1, BN254_R).
1255
1858
  */
1256
1859
  importFromHex(hex: string): Promise<void>;
1257
- };
1860
+ }
1258
1861
 
1259
1862
  /**
1260
1863
  * VaultCrypto
@@ -1302,12 +1905,16 @@ declare function encryptJson(key: CryptoKey, payload: unknown): Promise<{
1302
1905
  */
1303
1906
  declare function decryptJson(key: CryptoKey, iv: string, ciphertext: string): Promise<unknown>;
1304
1907
 
1908
+ declare function toBase64(buf: ArrayBuffer | Uint8Array): string;
1909
+ declare function fromBase64(b64: string): Uint8Array;
1910
+
1305
1911
  /**
1306
1912
  * Contract addresses and function selectors for all Orbinum EVM precompiles.
1307
1913
  *
1308
1914
  * Selectors are verified against the Rust source in frame/evm/precompile and
1309
1915
  * computed as `bytes4(keccak256("<functionName>(<argTypes>)"))`.
1310
1916
  */
1917
+
1311
1918
  /** All precompile contract addresses. */
1312
1919
  declare const PRECOMPILE_ADDR: {
1313
1920
  readonly EC_RECOVER: "0x0000000000000000000000000000000000000001";
@@ -1322,13 +1929,6 @@ declare const PRECOMPILE_ADDR: {
1322
1929
  readonly ACCOUNT_MAPPING: "0x0000000000000000000000000000000000000800";
1323
1930
  readonly SHIELDED_POOL: "0x0000000000000000000000000000000000000801";
1324
1931
  };
1325
- /** Metadata for a known precompile: display name and function selector map. */
1326
- interface KnownPrecompileInfo {
1327
- /** Human-readable name, e.g. "ShieldedPool". */
1328
- name: string;
1329
- /** Map from 4-byte hex selector (no 0x prefix) to function signature. */
1330
- functions: Record<string, string>;
1331
- }
1332
1932
  /**
1333
1933
  * Registry of all known Orbinum EVM precompiles, keyed by lowercase address.
1334
1934
  * Covers Ethereum standard (EIP), Frontier non-standard, and Orbinum custom precompiles.
@@ -1341,351 +1941,1623 @@ declare const KNOWN_PRECOMPILES: Record<string, KnownPrecompileInfo>;
1341
1941
  declare function getPrecompileLabel(address: string | null | undefined): string | null;
1342
1942
 
1343
1943
  /**
1344
- * Serialises a bigint as a 32-byte little-endian Uint8Array.
1944
+ * Decodes calldata for known Orbinum EVM precompiles.
1945
+ *
1946
+ * Returns raw decoded values (bigint amounts, hex strings for bytes32).
1947
+ * Callers are responsible for display formatting.
1345
1948
  */
1346
- declare function bigintTo32Le(n: bigint): Uint8Array;
1949
+ type DecodedPrecompile = {
1950
+ fnSig: string;
1951
+ args: Record<string, unknown>;
1952
+ };
1347
1953
  /**
1348
- * Deserialises a Uint8Array as a little-endian unsigned bigint.
1954
+ * Decodes EVM calldata for a known Orbinum precompile.
1955
+ *
1956
+ * @param address - The precompile contract address (0x-prefixed).
1957
+ * @param input - The transaction input data (0x-prefixed hex).
1958
+ * @returns Decoded `{ fnSig, args }` with raw values, or `null` if unknown.
1349
1959
  */
1350
- declare function bytesToBigintLE(bytes: Uint8Array): bigint;
1960
+ declare function decodePrecompileCalldata(address: string, input: string): DecodedPrecompile | null;
1961
+
1351
1962
  /**
1352
- * Serialises a bigint as a 32-byte big-endian Uint8Array.
1963
+ * TypeScript types for events emitted by pallet-shielded-pool.
1964
+ *
1965
+ * Conventions:
1966
+ * - Byte arrays (Commitment, Nullifier, Hash) → `string` (0x-prefixed hex, LE)
1967
+ * - Balances (BalanceOf<T>) → `bigint`
1968
+ * - AccountId → `string` (SS58 or 0x-prefixed)
1969
+ * - BoundedVec<T, N> → `T[]` (max N documented per field)
1970
+ * - u32 / leaf indices → `number`
1971
+ * - Option<T> → `T | null`
1353
1972
  */
1354
- declare function bigintTo32Be(n: bigint): Uint8Array;
1355
1973
  /**
1356
- * Serialises a bigint as a 32-element little-endian number[].
1357
- * Useful when building SCALE-encoded arguments via polkadot-api.
1974
+ * Emitted by `shield()` when a note is deposited into the shielded pool.
1975
+ * Rust variant: `Shielded { depositor, amount, commitment, encrypted_memo, leaf_index }`
1358
1976
  */
1359
- declare function bigintTo32LeArr(n: bigint): number[];
1977
+ type ShieldedEvent = {
1978
+ /** SS58 AccountId of the depositor. */
1979
+ depositor: string;
1980
+ amount: bigint;
1981
+ /** 0x-prefixed 32-byte Poseidon commitment (LE). */
1982
+ commitment: string;
1983
+ /** 0x-prefixed encrypted memo bytes (104 bytes). */
1984
+ encryptedMemo: string;
1985
+ /** Leaf index assigned in the Merkle tree. */
1986
+ leafIndex: number;
1987
+ };
1360
1988
  /**
1361
- * Computes the Merkle path direction bits for a leaf at `leafIndex`
1362
- * in a binary Merkle tree of `depth` levels.
1363
- * bit 0 = bottom level (leaf), bit depth-1 = top level (root sibling).
1989
+ * Emitted by `private_transfer()`.
1990
+ * Rust variant: `PrivateTransfer { nullifiers, commitments, encrypted_memos, leaf_indices }`
1991
+ * Max 2 inputs / 2 outputs.
1364
1992
  */
1365
- declare function computePathIndices(leafIndex: number, depth: number): number[];
1993
+ type PrivateTransferEvent = {
1994
+ /** Input nullifiers — max 2. 0x-prefixed 32-byte hex each. */
1995
+ nullifiers: string[];
1996
+ /** Output commitments — max 2. 0x-prefixed 32-byte hex each. */
1997
+ commitments: string[];
1998
+ /** Encrypted memos for each output — max 2. */
1999
+ encryptedMemos: string[];
2000
+ /** Leaf indices assigned to output commitments — max 2. */
2001
+ leafIndices: number[];
2002
+ };
1366
2003
  /**
1367
- * Decodes a little-endian hex string (0x-prefixed or bare) to a bigint.
1368
- * Equivalent to `bytesToBigintLE(fromHex(hex))`.
2004
+ * Emitted by `unshield()` when a note is withdrawn to the public chain.
2005
+ * Rust variant: `Unshielded { nullifier, amount, recipient }`
1369
2006
  */
1370
- declare function leHexToBigint(hex: string): bigint;
1371
-
2007
+ type UnshieldedEvent = {
2008
+ /** 0x-prefixed 32-byte Poseidon nullifier (LE). */
2009
+ nullifier: string;
2010
+ amount: bigint;
2011
+ /** SS58 AccountId of the recipient. */
2012
+ recipient: string;
2013
+ };
1372
2014
  /**
1373
- * Normalises an EVM address to lowercase with 0x prefix.
2015
+ * Emitted after every Merkle tree update (shield / transfer / unshield).
2016
+ * Rust variant: `MerkleRootUpdated { old_root, new_root, tree_size }`
1374
2017
  */
1375
- declare function normalizeEvmAddress(addr: string): string;
2018
+ type MerkleRootUpdatedEvent = {
2019
+ /** 0x-prefixed previous Merkle root (32 bytes, LE). */
2020
+ oldRoot: string;
2021
+ /** 0x-prefixed new Merkle root (32 bytes, LE). */
2022
+ newRoot: string;
2023
+ /** Total number of leaves after the update. */
2024
+ treeSize: number;
2025
+ };
1376
2026
  /**
1377
- * Returns true if the string looks like an SS58 encoded address
1378
- * (not a 0x-prefixed hex).
2027
+ * Emitted by `set_audit_policy()` when an account sets or updates its audit policy.
2028
+ * Rust variant: `AuditPolicySet { account, version }`
1379
2029
  */
1380
- declare function isSs58(addr: string): boolean;
2030
+ type AuditPolicySetEvent = {
2031
+ /** SS58 AccountId of the policy owner. */
2032
+ account: string;
2033
+ /** Policy version number (monotonically increasing). */
2034
+ version: number;
2035
+ };
1381
2036
  /**
1382
- * Returns true if the string looks like a 20-byte EVM address.
2037
+ * Emitted by `disclose()` when a note is disclosed.
2038
+ * Rust variant: `Disclosed { who, commitment, auditor }`
1383
2039
  */
1384
- declare function isEvmAddress(addr: string): boolean;
2040
+ type DisclosedEvent = {
2041
+ /** SS58 AccountId of the discloser. */
2042
+ who: string;
2043
+ /** 0x-prefixed 32-byte commitment of the disclosed note. */
2044
+ commitment: string;
2045
+ /** SS58 AccountId of the auditor, or null for voluntary disclosure. */
2046
+ auditor: string | null;
2047
+ };
1385
2048
  /**
1386
- * Pads a 20-byte EVM address to a 32-byte account ID (H256)
1387
- * by prepending 12 zero bytes (Ethereum-compatible mapping).
2049
+ * Emitted by `request_disclosure()` when an auditor requests a note disclosure.
2050
+ * Rust variant: `DisclosureRequested { target, auditor, reason }`
1388
2051
  */
1389
- declare function evmAddressToAccountId(evmAddr: string): Uint8Array;
2052
+ type DisclosureRequestedEvent = {
2053
+ /** SS58 AccountId of the note owner (disclosure target). */
2054
+ target: string;
2055
+ /** SS58 AccountId of the requesting auditor. */
2056
+ auditor: string;
2057
+ /** Reason string (max 256 bytes, UTF-8). */
2058
+ reason: string;
2059
+ };
1390
2060
  /**
1391
- * Derives the implicit Substrate AccountId32 for an EVM address using the
1392
- * EeSuffixAddressMapping rule: AccountId32 = H160 ++ [0x00; 12].
1393
- *
1394
- * This is the same rule applied by pallet-account-mapping's fallback when
1395
- * there is no explicit `map_account` entry. Returns 0x-prefixed 64-char hex.
1396
- *
1397
- * @param evmAddr 0x-prefixed 20-byte EVM address.
2061
+ * Emitted by `reject_disclosure()` when a note owner rejects a disclosure request.
2062
+ * Rust variant: `DisclosureRejected { target, auditor, reason }`
1398
2063
  */
1399
- declare function evmToImplicitSubstrate(evmAddr: string): string;
2064
+ type DisclosureRejectedEvent = {
2065
+ /** SS58 AccountId of the note owner. */
2066
+ target: string;
2067
+ /** SS58 AccountId of the auditor whose request was rejected. */
2068
+ auditor: string;
2069
+ /** Rejection reason string (max 256 bytes, UTF-8). */
2070
+ reason: string;
2071
+ };
1400
2072
  /**
1401
- * Returns true if the given AccountId32 hex was derived from an EVM address
1402
- * via the EeSuffixAddressMapping (last 12 bytes are zero).
1403
- *
1404
- * @param accountHex 0x-prefixed 64-char AccountId32 hex.
2073
+ * Emitted when a pending disclosure request expires (on_finalize pruning).
2074
+ * Rust variant: `DisclosureRequestExpired { target, auditor }`
1405
2075
  */
1406
- declare function isImplicitEvmAccount(accountHex: string): boolean;
2076
+ type DisclosureRequestExpiredEvent = {
2077
+ /** SS58 AccountId of the note owner. */
2078
+ target: string;
2079
+ /** SS58 AccountId of the auditor. */
2080
+ auditor: string;
2081
+ };
1407
2082
  /**
1408
- * Extracts the EVM address (H160) from an implicit Substrate AccountId32
1409
- * created by EeSuffixAddressMapping. Throws if the account is not EVM-derived.
1410
- *
1411
- * @param accountHex 0x-prefixed 64-char AccountId32 hex.
2083
+ * Emitted by `revoke_disclosure_record()` when an account revokes a previous disclosure.
2084
+ * Rust variant: `DisclosureRecordRevoked { who, commitment }`
1412
2085
  */
1413
- declare function implicitSubstrateToEvm(accountHex: string): string;
2086
+ type DisclosureRecordRevokedEvent = {
2087
+ /** SS58 AccountId of the note owner. */
2088
+ who: string;
2089
+ /** 0x-prefixed 32-byte commitment of the revoked note. */
2090
+ commitment: string;
2091
+ };
1414
2092
  /**
1415
- * Returns true if `addr` is a valid SS58 substrate address (not EVM).
2093
+ * Emitted by `register_asset()` when a new asset is registered in the pool.
2094
+ * Rust variant: `AssetRegistered { asset_id }`
1416
2095
  */
1417
- declare function isSubstrateAddress(addr: string): boolean;
2096
+ type AssetRegisteredEvent = {
2097
+ assetId: number;
2098
+ };
1418
2099
  /**
1419
- * Returns true if `addr` is a Substrate SS58 address derived from an EVM H160
1420
- * via the EeSuffixAddressMapping rule (last 12 bytes of AccountId are zero).
2100
+ * Emitted by `verify_asset()` when an asset is verified (marked as trusted).
2101
+ * Rust variant: `AssetVerified { asset_id }`
1421
2102
  */
1422
- declare function isUnifiedAddress(addr: string): boolean;
2103
+ type AssetVerifiedEvent = {
2104
+ assetId: number;
2105
+ };
1423
2106
  /**
1424
- * Converts a unified (EVM-derived) Substrate SS58 address to its EVM H160.
1425
- * Returns null for native Substrate accounts or invalid input.
2107
+ * Emitted by `unverify_asset()` when an asset's verified status is removed.
2108
+ * Rust variant: `AssetUnverified { asset_id }`
1426
2109
  */
1427
- declare function substrateToEvm(addr: string): string | null;
2110
+ type AssetUnverifiedEvent = {
2111
+ assetId: number;
2112
+ };
2113
+ /** All events emitted by pallet-shielded-pool as a discriminated union. */
2114
+ type ShieldedPoolEvent = {
2115
+ type: 'Shielded';
2116
+ data: ShieldedEvent;
2117
+ } | {
2118
+ type: 'PrivateTransfer';
2119
+ data: PrivateTransferEvent;
2120
+ } | {
2121
+ type: 'Unshielded';
2122
+ data: UnshieldedEvent;
2123
+ } | {
2124
+ type: 'MerkleRootUpdated';
2125
+ data: MerkleRootUpdatedEvent;
2126
+ } | {
2127
+ type: 'AuditPolicySet';
2128
+ data: AuditPolicySetEvent;
2129
+ } | {
2130
+ type: 'Disclosed';
2131
+ data: DisclosedEvent;
2132
+ } | {
2133
+ type: 'DisclosureRequested';
2134
+ data: DisclosureRequestedEvent;
2135
+ } | {
2136
+ type: 'DisclosureRejected';
2137
+ data: DisclosureRejectedEvent;
2138
+ } | {
2139
+ type: 'DisclosureRequestExpired';
2140
+ data: DisclosureRequestExpiredEvent;
2141
+ } | {
2142
+ type: 'DisclosureRecordRevoked';
2143
+ data: DisclosureRecordRevokedEvent;
2144
+ } | {
2145
+ type: 'AssetRegistered';
2146
+ data: AssetRegisteredEvent;
2147
+ } | {
2148
+ type: 'AssetVerified';
2149
+ data: AssetVerifiedEvent;
2150
+ } | {
2151
+ type: 'AssetUnverified';
2152
+ data: AssetUnverifiedEvent;
2153
+ };
2154
+
1428
2155
  /**
1429
- * Converts an EVM H160 address to its Substrate SS58 equivalent
1430
- * using the EeSuffixAddressMapping rule: AccountId32 = H160 ++ [0x00; 12].
1431
- * Returns null on invalid input.
2156
+ * TypeScript types for pallet-zk-verifier extrinsics.
2157
+ *
2158
+ * Conventions:
2159
+ * - Byte arrays → `number[]` (SCALE-compatible)
2160
+ * - Versions → `number` (u32)
1432
2161
  */
1433
- declare function evmToSubstrate(addr: string): string | null;
1434
2162
  /**
1435
- * Converts a 32-byte AccountId hex (0x-prefixed or bare) to its SS58 string.
1436
- * Returns null on invalid input.
2163
+ * On-chain circuit identifier (u32 newtype on-chain).
2164
+ * Use the {@link CircuitId} constant object for named values.
1437
2165
  */
1438
- declare function accountIdHexToSs58(hex: string): string | null;
2166
+ type CircuitId = (typeof CircuitId)[keyof typeof CircuitId];
1439
2167
  /**
1440
- * Converts a Substrate SS58 address to its AccountId32 as a 0x-prefixed 64-char hex.
1441
- * Returns null on invalid input.
2168
+ * Named constants for all supported ZK circuits.
2169
+ *
2170
+ * | Name | Value | Circuit |
2171
+ * |--------------|-------|---------------------------------|
2172
+ * | Transfer | 1 | 2-in-2-out private transfer |
2173
+ * | Unshield | 2 | Withdrawal from the pool |
2174
+ * | Disclosure | 3 | Selective disclosure |
2175
+ * | PrivateLink | 4 | Private chain-link proof |
1442
2176
  */
1443
- declare function substrateSs58ToAccountIdHex(addr: string): string | null;
2177
+ declare const CircuitId: {
2178
+ readonly Transfer: 1;
2179
+ readonly Unshield: 2;
2180
+ readonly Disclosure: 3;
2181
+ readonly PrivateLink: 4;
2182
+ };
1444
2183
  /**
1445
- * Universal converter: given any raw address string (SS58, 0x-prefixed 64-char
1446
- * AccountId hex, or EVM H160), returns the AccountId32 hex (0x-prefixed).
1447
- * Returns null on unrecognised input.
2184
+ * A single verification key registration entry used in batch operations.
2185
+ * Maps to `VkEntry` in Rust.
1448
2186
  */
1449
- declare function addressToAccountIdHex(addr: string): string | null;
1450
-
2187
+ type VkEntry = {
2188
+ circuitId: CircuitId;
2189
+ /** Circuit version number (u32 on-chain). Versions are independent per circuit. */
2190
+ version: number;
2191
+ /** Serialised Groth16 verification key bytes — max 8 192 bytes. */
2192
+ verificationKey: number[];
2193
+ };
1451
2194
  /**
1452
- * Types for the arguments passed to pallet-shielded-pool extrinsics.
1453
- * Byte arrays are represented as `number[]` to match SCALE encoding.
2195
+ * Call index 0 `register_verification_key` (Root origin)
2196
+ * Registers a Groth16 verification key for a specific circuit and version.
1454
2197
  */
1455
- /** Arguments for the `shield` extrinsic. */
1456
- type ShieldArgs = {
1457
- assetId: number;
1458
- amount: bigint;
1459
- /** 32-byte Poseidon commitment (LE). */
1460
- commitment: number[];
1461
- /** 104-byte encrypted memo. */
1462
- encryptedMemo: number[];
1463
- };
1464
- /** Arguments for the `unshield` extrinsic. */
1465
- type UnshieldArgs = {
1466
- /** Groth16 proof bytes. */
1467
- proof: number[];
1468
- /** 32-byte Merkle root (LE). */
1469
- merkleRoot: number[];
1470
- /** 32-byte Poseidon nullifier (LE). */
1471
- nullifier: number[];
1472
- assetId: number;
1473
- amount: bigint;
1474
- /** 32-byte recipient AccountId. */
1475
- recipient: number[];
2198
+ type RegisterVerificationKeyArgs = {
2199
+ circuitId: CircuitId;
2200
+ /** Version to associate with this key. */
2201
+ version: number;
2202
+ /** Serialised Groth16 verification key bytes — max 8 192 bytes. */
2203
+ verificationKey: number[];
1476
2204
  };
1477
- /** Single input note for a private transfer. */
1478
- type PrivateTransferInput = {
1479
- /** 32-byte Poseidon nullifier (LE). */
1480
- nullifier: number[];
1481
- /** 32-byte Poseidon commitment (LE). */
1482
- commitment: number[];
2205
+ /**
2206
+ * Call index 1 — `set_active_version` (Root origin)
2207
+ * Designates a specific version as the active one used for proof verification.
2208
+ */
2209
+ type SetActiveVersionArgs = {
2210
+ circuitId: CircuitId;
2211
+ version: number;
1483
2212
  };
1484
- /** Single output note for a private transfer. */
1485
- type PrivateTransferOutput = {
1486
- /** 32-byte Poseidon commitment (LE). */
1487
- commitment: number[];
1488
- /** 104-byte encrypted memo. */
1489
- memo: number[];
2213
+ /**
2214
+ * Call index 2 — `remove_verification_key` (Root origin)
2215
+ * Removes a registered verification key.
2216
+ * The currently active version cannot be removed.
2217
+ */
2218
+ type RemoveVerificationKeyArgs = {
2219
+ circuitId: CircuitId;
2220
+ version: number;
1490
2221
  };
1491
- /** Arguments for the `private_transfer` extrinsic. */
1492
- type PrivateTransferArgs = {
1493
- inputs: PrivateTransferInput[];
1494
- outputs: PrivateTransferOutput[];
2222
+ /**
2223
+ * Call index 3 — `verify_proof` (Signed origin)
2224
+ * Verifies a single Groth16 proof on-chain for the specified circuit.
2225
+ * Uses the circuit's currently active verification key version.
2226
+ */
2227
+ type VerifyProofArgs = {
2228
+ circuitId: CircuitId;
1495
2229
  /** Groth16 proof bytes. */
1496
2230
  proof: number[];
1497
- /** 32-byte Merkle root (LE). */
1498
- merkleRoot: number[];
2231
+ /**
2232
+ * Public inputs as a list of 32-byte field elements (LE).
2233
+ * Number and meaning of inputs depends on the circuit:
2234
+ * - Transfer: [merkle_root, nullifier_0, nullifier_1, commitment_0, commitment_1]
2235
+ * - Unshield: [merkle_root, nullifier, amount_fe, recipient_hash, asset_id_fe]
2236
+ * - Disclosure: [commitment, revealed_value_fe, revealed_asset_id_fe, owner_hash]
2237
+ * - PrivateLink: [commitment, call_hash_fe]
2238
+ */
2239
+ publicInputs: number[][];
1499
2240
  };
1500
-
1501
2241
  /**
1502
- * Types for events emitted by pallet-shielded-pool.
1503
- * Hex strings are 0x-prefixed 32-byte LE Poseidon values.
2242
+ * Call index 4 `batch_register_verification_keys` (Root origin)
2243
+ * Registers up to 10 verification keys in one extrinsic.
2244
+ * Useful for initial chain setup or coordinated upgrades.
1504
2245
  */
1505
- /** Emitted by `shield()` when a note is deposited. */
1506
- type ShieldedEvent = {
1507
- /** SS58 or 0x-prefixed AccountId of the depositor. */
1508
- depositor: string;
1509
- amount: bigint;
1510
- /** 0x-prefixed 32-byte commitment hex (LE). */
1511
- commitment: string;
1512
- /** 0x-prefixed encrypted memo hex. */
1513
- encryptedMemo: string;
1514
- /** Leaf index assigned in the Merkle tree. */
1515
- leafIndex: number;
2246
+ type BatchRegisterVerificationKeysArgs = {
2247
+ /** Up to 10 VK entries. */
2248
+ entries: VkEntry[];
1516
2249
  };
1517
- /** Emitted by `private_transfer()`. */
1518
- type PrivateTransferEvent = {
1519
- /** Input nullifiers (0x-prefixed 32-byte hex each). */
1520
- nullifiers: string[];
1521
- /** Output commitments (0x-prefixed 32-byte hex each). */
1522
- commitments: string[];
1523
- /** Encrypted memos for each output. */
1524
- encryptedMemos: string[];
1525
- /** Leaf indices assigned to output commitments. */
1526
- leafIndices: number[];
2250
+ /** All pallet-zk-verifier calls as a discriminated union. */
2251
+ type ZkVerifierCall = {
2252
+ type: 'registerVerificationKey';
2253
+ args: RegisterVerificationKeyArgs;
2254
+ } | {
2255
+ type: 'setActiveVersion';
2256
+ args: SetActiveVersionArgs;
2257
+ } | {
2258
+ type: 'removeVerificationKey';
2259
+ args: RemoveVerificationKeyArgs;
2260
+ } | {
2261
+ type: 'verifyProof';
2262
+ args: VerifyProofArgs;
2263
+ } | {
2264
+ type: 'batchRegisterVerificationKeys';
2265
+ args: BatchRegisterVerificationKeysArgs;
1527
2266
  };
1528
- /** Emitted by `unshield()` when a note is withdrawn. */
1529
- type UnshieldedEvent = {
1530
- /** 0x-prefixed 32-byte nullifier hex (LE). */
1531
- nullifier: string;
1532
- amount: bigint;
1533
- /** SS58 or 0x-prefixed AccountId of the recipient. */
1534
- recipient: string;
2267
+
2268
+ /**
2269
+ * TypeScript types for events emitted by pallet-zk-verifier.
2270
+ *
2271
+ * Conventions:
2272
+ * - CircuitId → imported from pallet-extrinsics (u32 newtype)
2273
+ * - version `number` (u32)
2274
+ * - count → `number` (u32)
2275
+ */
2276
+
2277
+ /**
2278
+ * Emitted by `register_verification_key()` when a new VK is stored.
2279
+ * Rust variant: `VerificationKeyRegistered { circuit_id, version }`
2280
+ */
2281
+ type VerificationKeyRegisteredEvent = {
2282
+ circuitId: CircuitId;
2283
+ version: number;
1535
2284
  };
1536
- /** Emitted after every Merkle tree update. */
1537
- type MerkleRootUpdatedEvent = {
1538
- /** 0x-prefixed previous root hex. */
1539
- oldRoot: string;
1540
- /** 0x-prefixed new root hex. */
1541
- newRoot: string;
1542
- /** New total number of leaves. */
1543
- treeSize: number;
2285
+ /**
2286
+ * Emitted by `set_active_version()` when the active VK version changes.
2287
+ * Rust variant: `ActiveVersionSet { circuit_id, version }`
2288
+ */
2289
+ type ActiveVersionSetEvent = {
2290
+ circuitId: CircuitId;
2291
+ version: number;
1544
2292
  };
1545
- /** Discriminated union of all shielded-pool events. */
1546
- type ShieldedPoolEvent = {
1547
- type: 'Shielded';
1548
- data: ShieldedEvent;
2293
+ /**
2294
+ * Emitted by `remove_verification_key()` when a VK is deleted.
2295
+ * Rust variant: `VerificationKeyRemoved { circuit_id, version }`
2296
+ */
2297
+ type VerificationKeyRemovedEvent = {
2298
+ circuitId: CircuitId;
2299
+ version: number;
2300
+ };
2301
+ /**
2302
+ * Emitted by `verify_proof()` when a ZK proof is successfully verified.
2303
+ * Rust variant: `ProofVerified { circuit_id, version }`
2304
+ */
2305
+ type ProofVerifiedEvent = {
2306
+ circuitId: CircuitId;
2307
+ version: number;
2308
+ };
2309
+ /**
2310
+ * Emitted by `verify_proof()` when ZK proof verification fails.
2311
+ * Rust variant: `ProofVerificationFailed { circuit_id, version }`
2312
+ */
2313
+ type ProofVerificationFailedEvent = {
2314
+ circuitId: CircuitId;
2315
+ version: number;
2316
+ };
2317
+ /**
2318
+ * Emitted by `batch_register_verification_keys()` on success.
2319
+ * Rust variant: `BatchVerificationKeysRegistered { count }`
2320
+ */
2321
+ type BatchVerificationKeysRegisteredEvent = {
2322
+ /** Number of VK entries registered in the batch. */
2323
+ count: number;
2324
+ };
2325
+ /** All events emitted by pallet-zk-verifier as a discriminated union. */
2326
+ type ZkVerifierEvent = {
2327
+ type: 'VerificationKeyRegistered';
2328
+ data: VerificationKeyRegisteredEvent;
1549
2329
  } | {
1550
- type: 'PrivateTransfer';
1551
- data: PrivateTransferEvent;
2330
+ type: 'ActiveVersionSet';
2331
+ data: ActiveVersionSetEvent;
1552
2332
  } | {
1553
- type: 'Unshielded';
1554
- data: UnshieldedEvent;
2333
+ type: 'VerificationKeyRemoved';
2334
+ data: VerificationKeyRemovedEvent;
1555
2335
  } | {
1556
- type: 'MerkleRootUpdated';
1557
- data: MerkleRootUpdatedEvent;
2336
+ type: 'ProofVerified';
2337
+ data: ProofVerifiedEvent;
2338
+ } | {
2339
+ type: 'ProofVerificationFailed';
2340
+ data: ProofVerificationFailedEvent;
2341
+ } | {
2342
+ type: 'BatchVerificationKeysRegistered';
2343
+ data: BatchVerificationKeysRegisteredEvent;
2344
+ };
2345
+
2346
+ /**
2347
+ * TypeScript types for pallet-account-mapping extrinsics.
2348
+ *
2349
+ * Conventions:
2350
+ * - Byte arrays → `number[]` (SCALE-compatible)
2351
+ * - Balances → `bigint`
2352
+ * - AccountId → `string` (SS58 or 0x-prefixed 64-char hex)
2353
+ * - ChainId → `number` (u32, typically a SLIP-0044 coin type)
2354
+ * - Optional → `T | null`
2355
+ */
2356
+
2357
+ /**
2358
+ * Call index 2 — `register_alias` (Signed origin)
2359
+ * Registers a human-readable identity alias for the caller's Substrate account.
2360
+ * Valid characters: alphanumeric, underscore, hyphen.
2361
+ * Length bounded by `T::MaxAliasLength` on-chain (configurable; typically ≤ 32 bytes).
2362
+ */
2363
+ type RegisterAliasArgs = {
2364
+ alias: string;
2365
+ };
2366
+ /**
2367
+ * Call index 4 — `transfer_alias` (Signed origin)
2368
+ * Transfers the caller's alias to another account.
2369
+ * The current owner loses the alias; the new owner must not already hold one.
2370
+ */
2371
+ type TransferAliasArgs = {
2372
+ /** AccountId of the new owner. */
2373
+ newOwner: string;
2374
+ };
2375
+ /**
2376
+ * Call index 5 — `put_alias_on_sale` (Signed origin)
2377
+ * Lists the caller's alias for purchase at a given planck price.
2378
+ */
2379
+ type PutAliasOnSaleArgs = {
2380
+ /** Sale price in planck (native token smallest unit). Cannot be zero. */
2381
+ price: bigint;
2382
+ /**
2383
+ * Optional whitelist of AccountIds allowed to buy.
2384
+ * Null = unrestricted public sale.
2385
+ * Max {@link MAX_WHITELIST_SIZE} entries.
2386
+ */
2387
+ allowedBuyers: string[] | null;
2388
+ };
2389
+ /**
2390
+ * Call index 7 — `buy_alias` (Signed origin)
2391
+ * Purchases an alias currently listed for sale.
2392
+ * The buyer must not already hold an alias.
2393
+ */
2394
+ type BuyAliasArgs = {
2395
+ /** The alias to purchase. */
2396
+ alias: string;
2397
+ };
2398
+ /**
2399
+ * Call index 8 — `add_chain_link` (Signed origin)
2400
+ * Links an external-chain address to the caller's Orbinum identity.
2401
+ * The `signature` must be produced over a deterministic challenge message
2402
+ * using the private key corresponding to `address` on the given chain.
2403
+ */
2404
+ type AddChainLinkArgs = {
2405
+ /** u32 chain identifier (must be in the supported chains registry). */
2406
+ chainId: number;
2407
+ /** Raw external address bytes — 20 bytes for EVM, 32 bytes for Ed25519 chains. */
2408
+ address: number[];
2409
+ /** Ownership proof signature bytes. */
2410
+ signature: number[];
2411
+ };
2412
+ /**
2413
+ * Call index 9 — `remove_chain_link` (Signed origin)
2414
+ * Removes a previously verified external chain link from the caller's identity.
2415
+ */
2416
+ type RemoveChainLinkArgs = {
2417
+ /** u32 chain identifier of the link to remove. */
2418
+ chainId: number;
2419
+ };
2420
+ /**
2421
+ * Call index 10 — `set_account_metadata` (Signed origin)
2422
+ * Sets or updates the caller's public profile metadata.
2423
+ * Fields set to null are cleared from storage.
2424
+ */
2425
+ type SetAccountMetadataArgs = {
2426
+ /** Display name — max 64 bytes UTF-8. Null removes the field. */
2427
+ displayName: string | null;
2428
+ /** Short biography — max 512 bytes UTF-8. Null removes the field. */
2429
+ bio: string | null;
2430
+ /** Avatar URL or IPFS CID — max 256 bytes. Null removes the field. */
2431
+ avatar: string | null;
2432
+ };
2433
+ /**
2434
+ * Call index 11 — `add_supported_chain` (Root origin)
2435
+ * Registers a new external chain in the supported chains registry.
2436
+ */
2437
+ type AddSupportedChainArgs = {
2438
+ /** u32 chain identifier (e.g. SLIP-0044 coin type). */
2439
+ chainId: number;
2440
+ /** Signature scheme used for address-ownership proofs on this chain. */
2441
+ scheme: SignatureScheme;
2442
+ };
2443
+ /**
2444
+ * Call index 12 — `remove_supported_chain` (Root origin)
2445
+ * Removes a chain from the supported chains registry.
2446
+ * Existing links for that chain are unaffected.
2447
+ */
2448
+ type RemoveSupportedChainArgs = {
2449
+ /** u32 chain identifier to remove. */
2450
+ chainId: number;
2451
+ };
2452
+ /**
2453
+ * Call index 13 — `dispatch_as_linked_account` (Signed origin, relayer)
2454
+ * Dispatches a RuntimeCall on behalf of an account that owns a verified chain link.
2455
+ * The relayer pays fees; authorisation comes from the external chain signature.
2456
+ */
2457
+ type DispatchAsLinkedAccountArgs = {
2458
+ /** AccountId on whose behalf to dispatch. */
2459
+ owner: string;
2460
+ /** u32 chain identifier of the link used for authorisation. */
2461
+ chainId: number;
2462
+ /** Raw external address bytes of the authorising signer. */
2463
+ address: number[];
2464
+ /** Signature over the SCALE-encoded `call` payload. */
2465
+ signature: number[];
2466
+ /** SCALE-encoded RuntimeCall to dispatch. */
2467
+ call: number[];
2468
+ };
2469
+ /**
2470
+ * Call index 14 — `register_private_link` (Signed origin)
2471
+ * Registers a hidden chain link using a Poseidon commitment: H(address, blinding).
2472
+ * The actual external address is not revealed on-chain.
2473
+ */
2474
+ type RegisterPrivateLinkArgs = {
2475
+ /** u32 chain identifier. */
2476
+ chainId: number;
2477
+ /** 32-byte Poseidon commitment: H(address || blinding) (LE). */
2478
+ commitment: number[];
2479
+ };
2480
+ /**
2481
+ * Call index 15 — `remove_private_link` (Signed origin)
2482
+ * Removes a private chain link identified by its commitment.
2483
+ */
2484
+ type RemovePrivateLinkArgs = {
2485
+ /** 32-byte commitment identifying the link to remove (LE). */
2486
+ commitment: number[];
2487
+ };
2488
+ /**
2489
+ * Call index 16 — `reveal_private_link` (Signed origin)
2490
+ * Reveals a previously registered private link by providing the commitment preimage.
2491
+ * After this call the link becomes publicly readable in storage.
2492
+ */
2493
+ type RevealPrivateLinkArgs = {
2494
+ /** 32-byte commitment: H(address || blinding) (LE). */
2495
+ commitment: number[];
2496
+ /** The actual raw external address bytes being revealed. */
2497
+ address: number[];
2498
+ /** 32-byte blinding factor used when creating the commitment (LE). */
2499
+ blinding: number[];
2500
+ /** Ownership proof signature produced with the external-chain key. */
2501
+ signature: number[];
2502
+ };
2503
+ /**
2504
+ * Call index 17 — `dispatch_as_private_link` (Signed origin, relayer)
2505
+ * Dispatches a RuntimeCall on behalf of an account identified only by a private
2506
+ * link commitment. A Groth16 ZK proof (PRIVATE_LINK circuit) authorises the
2507
+ * dispatch without revealing the external address.
2508
+ */
2509
+ type DispatchAsPrivateLinkArgs = {
2510
+ /** AccountId on whose behalf to dispatch. */
2511
+ owner: string;
2512
+ /** 32-byte commitment identifying the private link (LE). */
2513
+ commitment: number[];
2514
+ /** Groth16 proof bytes (PRIVATE_LINK circuit). */
2515
+ zkProof: number[];
2516
+ /** SCALE-encoded RuntimeCall to dispatch. */
2517
+ call: number[];
2518
+ };
2519
+ /** All pallet-account-mapping calls as a discriminated union. */
2520
+ type AccountMappingCall = {
2521
+ type: 'mapAccount';
2522
+ } | {
2523
+ type: 'unmapAccount';
2524
+ } | {
2525
+ type: 'registerAlias';
2526
+ args: RegisterAliasArgs;
2527
+ } | {
2528
+ type: 'releaseAlias';
2529
+ } | {
2530
+ type: 'transferAlias';
2531
+ args: TransferAliasArgs;
2532
+ } | {
2533
+ type: 'putAliasOnSale';
2534
+ args: PutAliasOnSaleArgs;
2535
+ } | {
2536
+ type: 'cancelSale';
2537
+ } | {
2538
+ type: 'buyAlias';
2539
+ args: BuyAliasArgs;
2540
+ } | {
2541
+ type: 'addChainLink';
2542
+ args: AddChainLinkArgs;
2543
+ } | {
2544
+ type: 'removeChainLink';
2545
+ args: RemoveChainLinkArgs;
2546
+ } | {
2547
+ type: 'setAccountMetadata';
2548
+ args: SetAccountMetadataArgs;
2549
+ } | {
2550
+ type: 'addSupportedChain';
2551
+ args: AddSupportedChainArgs;
2552
+ } | {
2553
+ type: 'removeSupportedChain';
2554
+ args: RemoveSupportedChainArgs;
2555
+ } | {
2556
+ type: 'dispatchAsLinkedAccount';
2557
+ args: DispatchAsLinkedAccountArgs;
2558
+ } | {
2559
+ type: 'registerPrivateLink';
2560
+ args: RegisterPrivateLinkArgs;
2561
+ } | {
2562
+ type: 'removePrivateLink';
2563
+ args: RemovePrivateLinkArgs;
2564
+ } | {
2565
+ type: 'revealPrivateLink';
2566
+ args: RevealPrivateLinkArgs;
2567
+ } | {
2568
+ type: 'dispatchAsPrivateLink';
2569
+ args: DispatchAsPrivateLinkArgs;
1558
2570
  };
1559
2571
 
1560
- /** Configuration for IndexerClient. */
1561
- interface IndexerClientConfig {
1562
- /** Base URL of the indexer REST API (no trailing slash). */
1563
- baseUrl: string;
1564
- /** Request timeout in ms. Default: 10_000. */
1565
- timeoutMs?: number;
1566
- }
1567
- /** Generic paginated result returned by list endpoints. */
1568
- interface PaginatedResult<T> {
1569
- data: T[];
1570
- pagination: {
1571
- page: number;
1572
- limit: number;
1573
- total: number;
1574
- };
2572
+ /**
2573
+ * TypeScript types for events emitted by pallet-account-mapping.
2574
+ *
2575
+ * Conventions:
2576
+ * - AccountId → `string` (SS58)
2577
+ * - H160 → `string` (0x-prefixed 20-byte Ethereum address)
2578
+ * - AliasOf<T> → `string` (bounded string, max configurable)
2579
+ * - ChainId → `number` (SLIP-0044 coin-type u32)
2580
+ * - ExternalAddr → `string` (chain-specific address string)
2581
+ * - BalanceOf<T> → `bigint`
2582
+ * - [u8; 32] → `string` (0x-prefixed hex, for private commitments)
2583
+ * - SignatureScheme → imported from pallet-extrinsics
2584
+ */
2585
+
2586
+ /**
2587
+ * Emitted when a Substrate account is mapped to an Ethereum address.
2588
+ * Rust variant: `AccountMapped { account, address }`
2589
+ */
2590
+ type AccountMappedEvent = {
2591
+ account: string;
2592
+ /** 0x-prefixed 20-byte Ethereum address. */
2593
+ address: string;
2594
+ };
2595
+ /**
2596
+ * Emitted when an existing account mapping is removed.
2597
+ * Rust variant: `AccountUnmapped { account, address }`
2598
+ */
2599
+ type AccountUnmappedEvent = {
2600
+ account: string;
2601
+ /** 0x-prefixed 20-byte Ethereum address. */
2602
+ address: string;
2603
+ };
2604
+ /**
2605
+ * Emitted by `register_alias()` when a new alias is claimed.
2606
+ * Rust variant: `AliasRegistered { account, alias, evm_address }`
2607
+ */
2608
+ type AliasRegisteredEvent = {
2609
+ account: string;
2610
+ alias: string;
2611
+ /** Optional EVM address linked at registration time. */
2612
+ evmAddress: string | null;
2613
+ };
2614
+ /**
2615
+ * Emitted when an alias is released (burned / expired).
2616
+ * Rust variant: `AliasReleased { account, alias }`
2617
+ */
2618
+ type AliasReleasedEvent = {
2619
+ account: string;
2620
+ alias: string;
2621
+ };
2622
+ /**
2623
+ * Emitted by `transfer_alias()` when ownership changes hands.
2624
+ * Rust variant: `AliasTransferred { from, to, alias }`
2625
+ */
2626
+ type AliasTransferredEvent = {
2627
+ from: string;
2628
+ to: string;
2629
+ alias: string;
2630
+ };
2631
+ /**
2632
+ * Emitted by `put_alias_on_sale()` when an alias is listed on the marketplace.
2633
+ * Rust variant: `AliasListedForSale { seller, alias, price, private }`
2634
+ */
2635
+ type AliasListedForSaleEvent = {
2636
+ seller: string;
2637
+ alias: string;
2638
+ price: bigint;
2639
+ /** Whether the listing is private (whitelist-only). */
2640
+ private: boolean;
2641
+ };
2642
+ /**
2643
+ * Emitted when an alias listing is cancelled before a sale.
2644
+ * Rust variant: `AliasSaleCancelled { seller, alias }`
2645
+ */
2646
+ type AliasSaleCancelledEvent = {
2647
+ seller: string;
2648
+ alias: string;
2649
+ };
2650
+ /**
2651
+ * Emitted by `buy_alias()` when an alias is purchased.
2652
+ * Rust variant: `AliasSold { seller, buyer, alias, price }`
2653
+ */
2654
+ type AliasSoldEvent = {
2655
+ seller: string;
2656
+ buyer: string;
2657
+ alias: string;
2658
+ price: bigint;
2659
+ };
2660
+ /**
2661
+ * Emitted by `add_chain_link()` when an external address is linked.
2662
+ * Rust variant: `ChainLinkAdded { account, chain_id, address }`
2663
+ */
2664
+ type ChainLinkAddedEvent = {
2665
+ account: string;
2666
+ /** SLIP-0044 coin-type identifying the external chain. */
2667
+ chainId: number;
2668
+ /** Chain-specific address string. */
2669
+ address: string;
2670
+ };
2671
+ /**
2672
+ * Emitted by `remove_chain_link()` when an external address link is removed.
2673
+ * Rust variant: `ChainLinkRemoved { account, chain_id }`
2674
+ */
2675
+ type ChainLinkRemovedEvent = {
2676
+ account: string;
2677
+ chainId: number;
2678
+ };
2679
+ /**
2680
+ * Emitted by `set_account_metadata()` when an account's metadata is updated.
2681
+ * Rust variant: `MetadataUpdated { account }`
2682
+ */
2683
+ type MetadataUpdatedEvent = {
2684
+ account: string;
2685
+ };
2686
+ /**
2687
+ * Emitted by `add_supported_chain()` (governance) when a new chain type is whitelisted.
2688
+ * Rust variant: `SupportedChainAdded { chain_id, scheme }`
2689
+ */
2690
+ type SupportedChainAddedEvent = {
2691
+ chainId: number;
2692
+ scheme: SignatureScheme;
2693
+ };
2694
+ /**
2695
+ * Emitted by `remove_supported_chain()` (governance) when a chain type is removed.
2696
+ * Rust variant: `SupportedChainRemoved { chain_id }`
2697
+ */
2698
+ type SupportedChainRemovedEvent = {
2699
+ chainId: number;
2700
+ };
2701
+ /**
2702
+ * Emitted after a successful `dispatch_as_linked_account()` call.
2703
+ * Rust variant: `ProxyCallExecuted { owner, chain_id, address }`
2704
+ */
2705
+ type ProxyCallExecutedEvent = {
2706
+ owner: string;
2707
+ chainId: number;
2708
+ address: string;
2709
+ };
2710
+ /**
2711
+ * Emitted by `register_private_link()` when a private (commitment-based) chain link is added.
2712
+ * Rust variant: `PrivateChainLinkAdded { account, chain_id, commitment }`
2713
+ */
2714
+ type PrivateChainLinkAddedEvent = {
2715
+ account: string;
2716
+ chainId: number;
2717
+ /** 0x-prefixed 32-byte Poseidon commitment of the private link. */
2718
+ commitment: string;
2719
+ };
2720
+ /**
2721
+ * Emitted by `remove_private_link()` when a private chain link is removed.
2722
+ * Rust variant: `PrivateChainLinkRemoved { account, chain_id, commitment }`
2723
+ */
2724
+ type PrivateChainLinkRemovedEvent = {
2725
+ account: string;
2726
+ chainId: number;
2727
+ /** 0x-prefixed 32-byte commitment. */
2728
+ commitment: string;
2729
+ };
2730
+ /**
2731
+ * Emitted by `reveal_private_link()` when a private link is publicly revealed.
2732
+ * Rust variant: `PrivateChainLinkRevealed { account, chain_id, address }`
2733
+ */
2734
+ type PrivateChainLinkRevealedEvent = {
2735
+ account: string;
2736
+ chainId: number;
2737
+ /** The now-revealed external address. */
2738
+ address: string;
2739
+ };
2740
+ /**
2741
+ * Emitted after a successful `dispatch_as_private_link()` call.
2742
+ * Rust variant: `PrivateLinkDispatchExecuted { owner, commitment }`
2743
+ */
2744
+ type PrivateLinkDispatchExecutedEvent = {
2745
+ owner: string;
2746
+ /** 0x-prefixed 32-byte commitment of the private link used. */
2747
+ commitment: string;
2748
+ };
2749
+ /** All events emitted by pallet-account-mapping as a discriminated union. */
2750
+ type AccountMappingEvent = {
2751
+ type: 'AccountMapped';
2752
+ data: AccountMappedEvent;
2753
+ } | {
2754
+ type: 'AccountUnmapped';
2755
+ data: AccountUnmappedEvent;
2756
+ } | {
2757
+ type: 'AliasRegistered';
2758
+ data: AliasRegisteredEvent;
2759
+ } | {
2760
+ type: 'AliasReleased';
2761
+ data: AliasReleasedEvent;
2762
+ } | {
2763
+ type: 'AliasTransferred';
2764
+ data: AliasTransferredEvent;
2765
+ } | {
2766
+ type: 'AliasListedForSale';
2767
+ data: AliasListedForSaleEvent;
2768
+ } | {
2769
+ type: 'AliasSaleCancelled';
2770
+ data: AliasSaleCancelledEvent;
2771
+ } | {
2772
+ type: 'AliasSold';
2773
+ data: AliasSoldEvent;
2774
+ } | {
2775
+ type: 'ChainLinkAdded';
2776
+ data: ChainLinkAddedEvent;
2777
+ } | {
2778
+ type: 'ChainLinkRemoved';
2779
+ data: ChainLinkRemovedEvent;
2780
+ } | {
2781
+ type: 'MetadataUpdated';
2782
+ data: MetadataUpdatedEvent;
2783
+ } | {
2784
+ type: 'SupportedChainAdded';
2785
+ data: SupportedChainAddedEvent;
2786
+ } | {
2787
+ type: 'SupportedChainRemoved';
2788
+ data: SupportedChainRemovedEvent;
2789
+ } | {
2790
+ type: 'ProxyCallExecuted';
2791
+ data: ProxyCallExecutedEvent;
2792
+ } | {
2793
+ type: 'PrivateChainLinkAdded';
2794
+ data: PrivateChainLinkAddedEvent;
2795
+ } | {
2796
+ type: 'PrivateChainLinkRemoved';
2797
+ data: PrivateChainLinkRemovedEvent;
2798
+ } | {
2799
+ type: 'PrivateChainLinkRevealed';
2800
+ data: PrivateChainLinkRevealedEvent;
2801
+ } | {
2802
+ type: 'PrivateLinkDispatchExecuted';
2803
+ data: PrivateLinkDispatchExecutedEvent;
2804
+ };
2805
+
2806
+ /**
2807
+ * TypeScript types for pallet-shielded-pool extrinsics and supporting structures.
2808
+ *
2809
+ * Conventions:
2810
+ * - Fixed/bounded byte arrays → `number[]` (SCALE-compatible)
2811
+ * - Balances (u128) → `bigint`
2812
+ * - AccountId → `string` (SS58 or 0x-prefixed 64-char hex)
2813
+ * - Block numbers → `number`
2814
+ * - Optional fields → `T | null`
2815
+ */
2816
+ /**
2817
+ * 32-byte SCALE-encoded value (commitment, nullifier, Merkle root, etc.).
2818
+ * Stored as little-endian Poseidon field elements on-chain.
2819
+ */
2820
+ type Bytes32 = number[];
2821
+ /**
2822
+ * Structured disclosure public signals — exactly 76 bytes:
2823
+ * commitment[0..32] | revealed_value[32..40] | revealed_asset_id[40..44] | owner_hash[44..76]
2824
+ */
2825
+ type DisclosurePublicSignals = number[];
2826
+ /**
2827
+ * A single auditor entry in an audit policy.
2828
+ * Maps to `Auditor<AccountId>` in Rust.
2829
+ */
2830
+ type Auditor = {
2831
+ /** SS58 or 0x-prefixed AccountId of the authorized auditor. */
2832
+ account: string;
2833
+ };
2834
+ /**
2835
+ * A condition that must be satisfied before disclosure is permitted.
2836
+ * Maps to `DisclosureCondition` in Rust. Max 10 conditions per policy.
2837
+ */
2838
+ type DisclosureCondition = {
2839
+ type: 'MinValue';
2840
+ value: bigint;
2841
+ } | {
2842
+ type: 'MaxValue';
2843
+ value: bigint;
2844
+ } | {
2845
+ type: 'AssetId';
2846
+ assetId: number;
2847
+ } | {
2848
+ type: 'RecipientIs';
2849
+ recipient: string;
2850
+ } | {
2851
+ type: 'Custom';
2852
+ encoded: number[];
2853
+ };
2854
+ /**
2855
+ * A single entry in a batch disclosure proof submission.
2856
+ * Maps to `BatchDisclosureSubmission<AccountId>` in Rust.
2857
+ */
2858
+ type BatchDisclosureSubmission = {
2859
+ /** 32-byte commitment (LE). */
2860
+ commitment: Bytes32;
2861
+ /** Groth16 proof bytes — max 256 bytes. */
2862
+ proof: number[];
2863
+ /** 76-byte public signals: commitment(32) | value(8) | asset_id(4) | owner_hash(32). */
2864
+ publicSignals: DisclosurePublicSignals;
2865
+ /** Optional auditor AccountId. Null = voluntary disclosure. */
2866
+ auditor: string | null;
2867
+ };
2868
+ /**
2869
+ * A single shield operation for use in `shield_batch`.
2870
+ */
2871
+ type ShieldOperation = {
2872
+ assetId: number;
2873
+ amount: bigint;
2874
+ /** 32-byte Poseidon commitment (LE). */
2875
+ commitment: Bytes32;
2876
+ /** Encrypted memo bytes — exactly 104 bytes. */
2877
+ encryptedMemo: number[];
2878
+ };
2879
+ /**
2880
+ * Call index 0 — `shield` (Signed origin)
2881
+ * Deposits a public token amount into the shielded pool.
2882
+ */
2883
+ type ShieldArgs = {
2884
+ assetId: number;
2885
+ amount: bigint;
2886
+ /** 32-byte Poseidon commitment (LE). */
2887
+ commitment: Bytes32;
2888
+ /** Encrypted memo — exactly 104 bytes. */
2889
+ encryptedMemo: number[];
2890
+ };
2891
+ /**
2892
+ * Call index 12 — `shield_batch` (Signed origin)
2893
+ * Deposits multiple notes in a single extrinsic — max 20 operations.
2894
+ */
2895
+ type ShieldBatchArgs = {
2896
+ operations: ShieldOperation[];
2897
+ };
2898
+ /** Input note consumed by a private transfer (SCALE wire format). */
2899
+ type RawTransferInput = {
2900
+ /** 32-byte Poseidon nullifier (LE). */
2901
+ nullifier: Bytes32;
2902
+ /** 32-byte Poseidon commitment (LE). */
2903
+ commitment: Bytes32;
2904
+ };
2905
+ /** Output note created by a private transfer (SCALE wire format). */
2906
+ type RawTransferOutput = {
2907
+ /** 32-byte Poseidon commitment (LE). */
2908
+ commitment: Bytes32;
2909
+ /** Encrypted memo — exactly 104 bytes. */
2910
+ memo: number[];
2911
+ };
2912
+ /**
2913
+ * Call index 1 — `private_transfer` (Signed origin)
2914
+ * Transfers value between notes without revealing sender, recipient or amount.
2915
+ * Accepts 1–2 inputs and 1–2 outputs; total input value must equal total output value.
2916
+ */
2917
+ type PrivateTransferArgs = {
2918
+ /** Groth16 proof bytes — max 512 bytes. */
2919
+ proof: number[];
2920
+ /** 32-byte Merkle root (LE). */
2921
+ merkleRoot: Bytes32;
2922
+ nullifiers: RawTransferInput[];
2923
+ outputs: RawTransferOutput[];
2924
+ encryptedMemos: number[][];
2925
+ };
2926
+ /**
2927
+ * Call index 2 — `unshield` (Signed origin)
2928
+ * Withdraws a note from the pool to a public account.
2929
+ */
2930
+ type UnshieldArgs = {
2931
+ /** Groth16 proof bytes — max 512 bytes. */
2932
+ proof: number[];
2933
+ /** 32-byte Merkle root (LE). */
2934
+ merkleRoot: Bytes32;
2935
+ /** 32-byte nullifier of the spent note (LE). */
2936
+ nullifier: Bytes32;
2937
+ assetId: number;
2938
+ amount: bigint;
2939
+ /** SS58 or 0x-prefixed AccountId of the recipient. */
2940
+ recipient: string;
2941
+ };
2942
+ /**
2943
+ * Call index 4 — `set_audit_policy` (Signed origin)
2944
+ * Registers or replaces the caller's audit policy for selective disclosure.
2945
+ */
2946
+ type SetAuditPolicyArgs = {
2947
+ /** Up to 10 authorized auditors. */
2948
+ auditors: Auditor[];
2949
+ /** Up to 10 disclosure conditions. */
2950
+ conditions: DisclosureCondition[];
2951
+ /** Minimum blocks between disclosures to the same auditor. Null = no limit. */
2952
+ maxFrequency: number | null;
2953
+ /** Block after which the policy expires. Null = no expiry. */
2954
+ validUntil: number | null;
2955
+ };
2956
+ /**
2957
+ * Call index 5 — `request_disclosure` (Signed origin)
2958
+ * Auditor requests selective disclosure from a target account.
2959
+ */
2960
+ type RequestDisclosureArgs = {
2961
+ /** AccountId of the disclosure target. */
2962
+ target: string;
2963
+ /** Human-readable request reason — max 256 bytes UTF-8. */
2964
+ reason: string;
2965
+ };
2966
+ /**
2967
+ * Call index 6 — `disclose` (Signed origin)
2968
+ * Submit a Groth16 disclosure proof for a commitment.
2969
+ */
2970
+ type DiscloseArgs = {
2971
+ /** 32-byte note commitment to disclose (LE). */
2972
+ commitment: Bytes32;
2973
+ /** Groth16 proof bytes — max 256 bytes. */
2974
+ proofBytes: number[];
2975
+ /** 76-byte public signals: commitment(32) | value(8) | asset_id(4) | owner_hash(32). */
2976
+ publicSignals: DisclosurePublicSignals;
2977
+ /** Target auditor AccountId. Null = voluntary public disclosure. */
2978
+ auditor: string | null;
2979
+ };
2980
+ /**
2981
+ * Call index 7 — `reject_disclosure` (Signed origin)
2982
+ * Disclosure target rejects a pending request from an auditor.
2983
+ */
2984
+ type RejectDisclosureArgs = {
2985
+ /** AccountId of the auditor whose request is rejected. */
2986
+ auditor: string;
2987
+ /** Rejection reason — max 256 bytes UTF-8. */
2988
+ reason: string;
2989
+ };
2990
+ /**
2991
+ * Call index 13 — `batch_submit_disclosure_proofs` (Signed origin)
2992
+ * Submit up to 10 disclosure proofs in one extrinsic.
2993
+ */
2994
+ type BatchSubmitDisclosureProofsArgs = {
2995
+ submissions: BatchDisclosureSubmission[];
2996
+ };
2997
+ /**
2998
+ * Call index 9 — `register_asset` (Root origin)
2999
+ * Registers a new asset in the shielded pool registry.
3000
+ */
3001
+ type RegisterAssetArgs = {
3002
+ /** Asset name — max 64 bytes UTF-8. */
3003
+ name: string;
3004
+ /** Asset ticker symbol, e.g. "USDT" — max 16 bytes UTF-8. */
3005
+ symbol: string;
3006
+ /** Token decimal precision (e.g. 18 for ORB, 6 for USDT). */
3007
+ decimals: number;
3008
+ /** 20-byte EVM contract address for ERC-20 assets. Null = native asset. */
3009
+ contractAddress: number[] | null;
3010
+ };
3011
+ /**
3012
+ * Call index 10 — `verify_asset` (Root origin)
3013
+ * Marks a registered asset as verified, enabling shielding.
3014
+ */
3015
+ type VerifyAssetArgs = {
3016
+ assetId: number;
3017
+ };
3018
+ /**
3019
+ * Call index 11 — `unverify_asset` (Root origin)
3020
+ * Removes the verified status from an asset, disabling new shield operations.
3021
+ */
3022
+ type UnverifyAssetArgs = {
3023
+ assetId: number;
3024
+ };
3025
+ /**
3026
+ * Call index 14 — `prune_expired_request` (Signed origin)
3027
+ * Cleans up a disclosure request that has passed its expiration block.
3028
+ */
3029
+ type PruneExpiredRequestArgs = {
3030
+ /** AccountId of the disclosure target. */
3031
+ target: string;
3032
+ /** AccountId of the auditor. */
3033
+ auditor: string;
3034
+ };
3035
+ /**
3036
+ * Call index 15 — `revoke_disclosure_record` (Signed origin)
3037
+ * Allows the note owner to revoke a previously submitted disclosure record.
3038
+ */
3039
+ type RevokeDisclosureRecordArgs = {
3040
+ /** 32-byte commitment whose disclosure record should be revoked (LE). */
3041
+ commitment: Bytes32;
3042
+ };
3043
+ /** All pallet-shielded-pool calls as a discriminated union. */
3044
+ type ShieldedPoolCall = {
3045
+ type: 'shield';
3046
+ args: ShieldArgs;
3047
+ } | {
3048
+ type: 'shieldBatch';
3049
+ args: ShieldBatchArgs;
3050
+ } | {
3051
+ type: 'privateTransfer';
3052
+ args: PrivateTransferArgs;
3053
+ } | {
3054
+ type: 'unshield';
3055
+ args: UnshieldArgs;
3056
+ } | {
3057
+ type: 'setAuditPolicy';
3058
+ args: SetAuditPolicyArgs;
3059
+ } | {
3060
+ type: 'requestDisclosure';
3061
+ args: RequestDisclosureArgs;
3062
+ } | {
3063
+ type: 'disclose';
3064
+ args: DiscloseArgs;
3065
+ } | {
3066
+ type: 'rejectDisclosure';
3067
+ args: RejectDisclosureArgs;
3068
+ } | {
3069
+ type: 'batchSubmitDisclosureProofs';
3070
+ args: BatchSubmitDisclosureProofsArgs;
3071
+ } | {
3072
+ type: 'registerAsset';
3073
+ args: RegisterAssetArgs;
3074
+ } | {
3075
+ type: 'verifyAsset';
3076
+ args: VerifyAssetArgs;
3077
+ } | {
3078
+ type: 'unverifyAsset';
3079
+ args: UnverifyAssetArgs;
3080
+ } | {
3081
+ type: 'pruneExpiredRequest';
3082
+ args: PruneExpiredRequestArgs;
3083
+ } | {
3084
+ type: 'revokeDisclosureRecord';
3085
+ args: RevokeDisclosureRecordArgs;
3086
+ };
3087
+
3088
+ /**
3089
+ * Options for {@link formatBalance}.
3090
+ */
3091
+ interface FormatOptions {
3092
+ /** On-chain token decimals. Defaults to `18`. */
3093
+ decimals?: number;
3094
+ /** Token symbol appended to the output. Defaults to `'ORB'`. */
3095
+ symbol?: string;
3096
+ /** Whether to append the symbol. Defaults to `true`. */
3097
+ showSymbol?: boolean;
3098
+ /** Maximum number of decimal digits shown in output. Defaults to `6`. */
3099
+ precision?: number;
3100
+ }
3101
+ /**
3102
+ * Formats a raw on-chain token amount to a human-readable string.
3103
+ *
3104
+ * Handles the following input forms:
3105
+ * - `bigint` — raw planck/wei amount.
3106
+ * - `string` — canonical decimal integer, canonical hex (`0x`/`0X`-prefixed), or canonical decimal.
3107
+ * - `number` — converted via `String(number)` and accepted only if it matches one of the
3108
+ * supported canonical numeric formats.
3109
+ * - `null` / `undefined` — treated as zero.
3110
+ *
3111
+ * Rejected string formats return zero instead of being coerced. This includes grouped values
3112
+ * such as `1,000`, scientific notation such as `1e18`, underscored numbers, and explicit plus
3113
+ * signs such as `+1`.
3114
+ *
3115
+ * Does NOT depend on `ethers`. Uses pure BigInt arithmetic.
3116
+ *
3117
+ * @example
3118
+ * formatBalance('1000000000000000000') // '1 ORB'
3119
+ * formatBalance(500000000000000000n, { precision: 2 }) // '0.50 ORB'
3120
+ * formatBalance('0x0de0b6b3a7640000', { showSymbol: false }) // '1'
3121
+ * formatBalance(null) // '0 ORB'
3122
+ */
3123
+ declare function formatBalance(raw: string | bigint | number | null | undefined, options?: FormatOptions | number): string;
3124
+ /**
3125
+ * Convenience wrapper for formatting ORB amounts with 18 decimals.
3126
+ *
3127
+ * @param raw Raw planck amount (string, bigint, number, or null).
3128
+ * @param precision Max decimal digits shown. Defaults to `6`.
3129
+ *
3130
+ * @example
3131
+ * formatORB('1000000000000000000') // '1 ORB'
3132
+ * formatORB(500000000000000000n, 2) // '0.50 ORB'
3133
+ */
3134
+ declare function formatORB(raw: string | bigint | number | null | undefined, precision?: number): string;
3135
+
3136
+ /** Truncate a string in the middle with an ellipsis. */
3137
+ declare function truncateMiddle(str: string, start: number, end: number): string;
3138
+ /** Shorten a hash for compact inline display. */
3139
+ declare function shortHash(h: string, start?: number, end?: number): string;
3140
+
3141
+ declare function toTxResult(payload: TxFinalizedPayload): TxResult;
3142
+
3143
+ /**
3144
+ * Serialises a bigint as a 32-byte little-endian Uint8Array.
3145
+ */
3146
+ declare function bigintTo32Le(n: bigint): Uint8Array;
3147
+ /**
3148
+ * Deserialises a Uint8Array as a little-endian unsigned bigint.
3149
+ */
3150
+ declare function bytesToBigintLE(bytes: Uint8Array): bigint;
3151
+ /**
3152
+ * Serialises a bigint as a 32-byte big-endian Uint8Array.
3153
+ */
3154
+ declare function bigintTo32Be(n: bigint): Uint8Array;
3155
+ /**
3156
+ * Serialises a bigint as a 32-element little-endian number[].
3157
+ * Useful when building SCALE-encoded arguments via polkadot-api.
3158
+ */
3159
+ declare function bigintTo32LeArr(n: bigint): number[];
3160
+ /**
3161
+ * Computes the Merkle path direction bits for a leaf at `leafIndex`
3162
+ * in a binary Merkle tree of `depth` levels.
3163
+ * bit 0 = bottom level (leaf), bit depth-1 = top level (root sibling).
3164
+ */
3165
+ declare function computePathIndices(leafIndex: number, depth: number): number[];
3166
+ /**
3167
+ * Decodes a little-endian hex string (0x-prefixed or bare) to a bigint.
3168
+ * Equivalent to `bytesToBigintLE(fromHex(hex))`.
3169
+ */
3170
+ declare function leHexToBigint(hex: string): bigint;
3171
+
3172
+ /**
3173
+ * Normalises an EVM address to lowercase with 0x prefix.
3174
+ */
3175
+ declare function normalizeEvmAddress(addr: string): string;
3176
+ /**
3177
+ * Returns true if the string looks like an SS58 encoded address
3178
+ * (not a 0x-prefixed hex).
3179
+ */
3180
+ declare function isSs58(addr: string): boolean;
3181
+ /**
3182
+ * Returns true if the string looks like a 20-byte EVM address.
3183
+ */
3184
+ declare function isEvmAddress(addr: string): boolean;
3185
+ /**
3186
+ * Pads a 20-byte EVM address to a 32-byte account ID (H256)
3187
+ * by prepending 12 zero bytes (Ethereum-compatible mapping).
3188
+ */
3189
+ declare function evmAddressToAccountId(evmAddr: string): Uint8Array;
3190
+ /**
3191
+ * Derives the implicit Substrate AccountId32 for an EVM address using the
3192
+ * EeSuffixAddressMapping rule: AccountId32 = H160 ++ [0x00; 12].
3193
+ *
3194
+ * This is the same rule applied by pallet-account-mapping's fallback when
3195
+ * there is no explicit `map_account` entry. Returns 0x-prefixed 64-char hex.
3196
+ *
3197
+ * @param evmAddr 0x-prefixed 20-byte EVM address.
3198
+ */
3199
+ declare function evmToImplicitSubstrate(evmAddr: string): string;
3200
+ /**
3201
+ * Converts an EVM H160 address to the 32-byte AccountId32 hex used by
3202
+ * pallet-account-mapping (EeSuffixAddressMapping: H160 ++ [0x00; 12]).
3203
+ * Returns null for invalid or non-EVM input.
3204
+ *
3205
+ * @param address 0x-prefixed EVM H160 address (or bare 40-char hex).
3206
+ */
3207
+ declare function evmToMappedAccountHex(address: string): string | null;
3208
+ /**
3209
+ * Returns true if the given AccountId32 hex was derived from an EVM address
3210
+ * via the EeSuffixAddressMapping (last 12 bytes are zero).
3211
+ *
3212
+ * @param accountHex 0x-prefixed 64-char AccountId32 hex.
3213
+ */
3214
+ declare function isImplicitEvmAccount(accountHex: string): boolean;
3215
+ /**
3216
+ * Extracts the EVM address (H160) from an implicit Substrate AccountId32
3217
+ * created by EeSuffixAddressMapping. Throws if the account is not EVM-derived.
3218
+ *
3219
+ * @param accountHex 0x-prefixed 64-char AccountId32 hex.
3220
+ */
3221
+ declare function implicitSubstrateToEvm(accountHex: string): string;
3222
+ /**
3223
+ * Returns true if `addr` is a valid SS58 substrate address (not EVM).
3224
+ */
3225
+ declare function isSubstrateAddress(addr: string): boolean;
3226
+ /**
3227
+ * Returns true if `addr` is a Substrate SS58 address derived from an EVM H160
3228
+ * via the EeSuffixAddressMapping rule (last 12 bytes of AccountId are zero).
3229
+ */
3230
+ declare function isUnifiedAddress(addr: string): boolean;
3231
+ /**
3232
+ * Converts a unified (EVM-derived) Substrate SS58 address to its EVM H160.
3233
+ * Returns null for native Substrate accounts or invalid input.
3234
+ */
3235
+ declare function substrateToEvm(addr: string): string | null;
3236
+ /**
3237
+ * Converts an EVM H160 address to its Substrate SS58 equivalent
3238
+ * using the EeSuffixAddressMapping rule: AccountId32 = H160 ++ [0x00; 12].
3239
+ * Returns null on invalid input.
3240
+ */
3241
+ declare function evmToSubstrate(addr: string): string | null;
3242
+ /**
3243
+ * Converts a 32-byte AccountId hex (0x-prefixed or bare) to its SS58 string.
3244
+ * Returns null on invalid input.
3245
+ */
3246
+ declare function accountIdHexToSs58(hex: string): string | null;
3247
+ /**
3248
+ * Converts a Substrate SS58 address to its AccountId32 as a 0x-prefixed 64-char hex.
3249
+ * Returns null on invalid input.
3250
+ */
3251
+ declare function substrateSs58ToAccountIdHex(addr: string): string | null;
3252
+ /**
3253
+ * Universal converter: given any raw address string (SS58, 0x-prefixed 64-char
3254
+ * AccountId hex, or EVM H160), returns the AccountId32 hex (0x-prefixed).
3255
+ * Returns null on unrecognised input.
3256
+ */
3257
+ declare function addressToAccountIdHex(addr: string): string | null;
3258
+
3259
+ /**
3260
+ * Utilities for decoding on-chain extrinsic arguments and event data.
3261
+ *
3262
+ * Substrate/PAPI nodes return positional arg keys (`arg0`, `arg1`, …) when
3263
+ * metadata-based decoding is unavailable. These helpers map those positions
3264
+ * to human-readable semantic names for all Orbinum pallets.
3265
+ */
3266
+ /**
3267
+ * Maps raw extrinsic args (which may use positional keys like `arg0`, `arg1`)
3268
+ * to semantic field names for a given pallet section/method.
3269
+ *
3270
+ * @param section - Pallet name (e.g. `'shieldedPool'`).
3271
+ * @param method - Call name (e.g. `'shield'`).
3272
+ * @param args - Raw args object from the node.
3273
+ * @returns Remapped args with semantic keys, or the original object if unknown.
3274
+ */
3275
+ declare function mapExtrinsicArgs(section: string, method: string, args: Record<string, unknown>): Record<string, unknown>;
3276
+ /**
3277
+ * Maps raw event data fields (which may use positional keys) to semantic names
3278
+ * for shielded-pool, account-mapping, zk-verifier, evm, ethereum and system events.
3279
+ *
3280
+ * @param method - Event name (e.g. `'shielded'`, `'aliasRegistered'`).
3281
+ * @param data - Raw event data fields.
3282
+ * @returns Remapped data with semantic keys, or the original object if unknown.
3283
+ */
3284
+ declare function mapZkEventData(method: string, data: Record<string, unknown>): Record<string, unknown>;
3285
+
3286
+ /**
3287
+ * Decoded extrinsic arg shapes — "explorer/read path".
3288
+ *
3289
+ * These interfaces mirror on-chain arg shapes as they appear after JSON
3290
+ * decoding (snake_case keys, string amounts). They are intentionally
3291
+ * different from the call-builder types in shielded-pool/types/pallet-extrinsics.ts
3292
+ * which use camelCase and bigint/Bytes32 for SCALE construction.
3293
+ */
3294
+ interface DecodedShieldArgs {
3295
+ asset_id: number | string;
3296
+ amount: string;
3297
+ commitment: string;
3298
+ encrypted_memo: string;
1575
3299
  }
1576
- /** A shielded commitment (shield event) stored by the indexer. */
1577
- interface ShieldedCommitment {
1578
- commitmentHex: string;
1579
- blockNumber: number;
1580
- extrinsicIndex: number | null;
1581
- leafIndex: number;
1582
- /** Asset ID as decimal string (e.g. "0"). */
1583
- assetId: string;
1584
- /** SS58 or 0x-prefixed depositor address, null if not tracked. */
1585
- sender: string | null;
1586
- /** 0x-prefixed encrypted memo hex, null if not present. */
1587
- encryptedMemo: string | null;
1588
- timestampMs: number | null;
3300
+ interface DecodedShieldBatchOperation {
3301
+ asset_id: number | string;
3302
+ amount: string;
3303
+ commitment: string;
3304
+ encrypted_memo: string;
1589
3305
  }
1590
- /** A spent nullifier stored by the indexer. */
1591
- interface SpentNullifier {
1592
- nullifierHex: string;
1593
- blockNumber: number;
1594
- extrinsicIndex: number | null;
1595
- txType: 'unshield' | 'private_transfer';
1596
- timestampMs: number | null;
3306
+ interface DecodedShieldBatchArgs {
3307
+ operations: DecodedShieldBatchOperation[];
1597
3308
  }
1598
- /** A private transfer event stored by the indexer. */
1599
- interface PrivateTransfer {
1600
- /** "{blockNumber}-{extrinsicIndex}" */
1601
- id: string;
1602
- blockNumber: number;
1603
- extrinsicIndex: number | null;
1604
- /** JSON-encoded array of nullifier hex strings. */
1605
- inputNullifiersJson: string;
1606
- /** JSON-encoded array of commitment hex strings. */
1607
- outputCommitmentsJson: string;
1608
- /** JSON-encoded array of leaf index numbers. */
1609
- leafIndicesJson: string;
1610
- timestampMs: number | null;
3309
+ interface DecodedPrivateTransferArgs {
3310
+ proof: string;
3311
+ merkle_root: string;
3312
+ nullifiers: string[];
3313
+ commitments: string[];
3314
+ encrypted_memos: string[];
1611
3315
  }
1612
- /** An unshield event stored by the indexer. */
1613
- interface Unshield {
1614
- /** "{blockNumber}-{extrinsicIndex}" */
1615
- id: string;
1616
- blockNumber: number;
1617
- extrinsicIndex: number | null;
1618
- nullifierHex: string;
1619
- /** Asset ID as decimal string. */
1620
- assetId: string;
1621
- /** Amount as decimal string (bigint-safe). */
3316
+ interface DecodedUnshieldArgs {
3317
+ proof: string;
3318
+ merkle_root: string;
3319
+ nullifier: string;
3320
+ asset_id: number | string;
1622
3321
  amount: string;
1623
3322
  recipient: string;
1624
- timestampMs: number | null;
1625
3323
  }
1626
- /** A Merkle root checkpoint stored by the indexer. */
1627
- interface MerkleRoot {
1628
- id: number;
1629
- rootHex: string;
1630
- blockNumber: number;
1631
- oldRootHex: string | null;
1632
- treeSize: number;
1633
- timestampMs: number | null;
3324
+ interface DecodedSetAuditPolicyArgs {
3325
+ auditors: string[];
3326
+ conditions: unknown;
3327
+ max_frequency: number;
1634
3328
  }
1635
- /** Response from the nullifier status endpoint. */
1636
- interface NullifierStatusResult {
1637
- nullifier: string;
1638
- spent: boolean;
1639
- txType?: 'unshield' | 'private_transfer';
1640
- blockNumber?: number;
3329
+ interface DecodedRequestDisclosureArgs {
3330
+ target: string;
3331
+ reason: string;
3332
+ evidence?: string;
3333
+ }
3334
+ interface DecodedApproveDisclosureArgs {
3335
+ auditor: string;
3336
+ commitment: string;
3337
+ proof: string;
3338
+ public_signals: string[];
3339
+ extra_data: unknown;
3340
+ }
3341
+ interface DecodedRejectDisclosureArgs {
3342
+ auditor: string;
3343
+ reason: string;
3344
+ }
3345
+ interface DecodedSubmitDisclosureArgs {
3346
+ commitment: string;
3347
+ proof: string;
3348
+ public_signals: string[];
3349
+ partial_data: unknown;
3350
+ auditor: string;
3351
+ }
3352
+ interface DecodedBatchSubmitDisclosureArgs {
3353
+ count: number;
3354
+ submissions: DecodedSubmitDisclosureArgs[];
3355
+ }
3356
+ interface DecodedTransferArgs {
3357
+ dest: string;
3358
+ value: string;
3359
+ }
3360
+ type DecodedTransferKeepAliveArgs = DecodedTransferArgs;
3361
+ interface DecodedTransferAllArgs {
3362
+ dest: string;
3363
+ keep_alive: boolean;
3364
+ }
3365
+ interface DecodedBatchArgs {
3366
+ calls: unknown[];
3367
+ }
3368
+ interface DecodedSudoArgs {
3369
+ call: unknown;
3370
+ }
3371
+ interface DecodedRemarkArgs {
3372
+ remark: string;
3373
+ }
3374
+ interface DecodedRegisterAliasArgs {
3375
+ alias: string;
3376
+ }
3377
+ interface DecodedPutAliasForSaleArgs {
3378
+ asking_price: string;
3379
+ sale_type: string;
3380
+ whitelist_count?: number;
3381
+ }
3382
+ interface DecodedSetAccountMetadataArgs {
3383
+ display_name: string;
3384
+ bio: string;
3385
+ avatar: string;
3386
+ }
3387
+ interface DecodedAddChainLinkArgs {
3388
+ chain_id: number | string;
3389
+ target_address: string;
3390
+ signature: string;
3391
+ }
3392
+ interface DecodedRevealPrivateLinkArgs {
3393
+ commitment: string;
3394
+ address: string;
3395
+ blinding: string;
3396
+ signature: string;
3397
+ }
3398
+ interface DecodedDispatchAsPrivateLinkArgs {
3399
+ owner: string;
3400
+ commitment: string;
3401
+ zk_proof: string;
3402
+ inner_call: string;
1641
3403
  }
3404
+ interface DecodedEthereumTransactArgs {
3405
+ tx_type: string;
3406
+ chain_id?: number;
3407
+ nonce?: number;
3408
+ gas_limit?: number;
3409
+ to: string;
3410
+ value?: string;
3411
+ input: string;
3412
+ }
3413
+ interface DecodedEvmCallArgs {
3414
+ source: string;
3415
+ target: string;
3416
+ input: string;
3417
+ value: string;
3418
+ gas_limit: number;
3419
+ }
3420
+
1642
3421
  /**
1643
- * HTTP client for the Orbinum indexer REST API.
3422
+ * Decoded pallet event data shapes "explorer/read path".
1644
3423
  *
1645
- * All methods throw on network errors.
1646
- * Methods returning a single entity return `null` when the server responds 404.
3424
+ * These interfaces represent the JSON-decoded form of on-chain events as
3425
+ * they are received via RPC or indexer. They cover all pallets relevant
3426
+ * to the Orbinum explorer: shielded-pool, balances, system, ethereum, evm,
3427
+ * and account-mapping.
3428
+ *
3429
+ * Note: EventRecord itself is exported from @orbinum/sdk via substrate/types.
1647
3430
  */
1648
- declare class IndexerClient {
1649
- private readonly baseUrl;
1650
- private readonly timeoutMs;
1651
- constructor(config: IndexerClientConfig);
1652
- private get;
1653
- private getOrNull;
1654
- private buildQuery;
1655
- /** Returns the total count of shielded commitments. */
1656
- getCommitmentsCount(): Promise<number>;
1657
- /** Returns a paginated list of shielded commitments. */
1658
- getCommitments(params?: {
1659
- page?: number;
1660
- limit?: number;
1661
- sinceLeafIndex?: number;
1662
- }): Promise<PaginatedResult<ShieldedCommitment>>;
1663
- /** Returns a single commitment by its hex string, or null if not found. */
1664
- getCommitmentByHex(hex: string): Promise<ShieldedCommitment | null>;
1665
- /** Returns a paginated list of spent nullifiers. */
1666
- getNullifiers(params?: {
1667
- page?: number;
1668
- limit?: number;
1669
- }): Promise<PaginatedResult<SpentNullifier>>;
1670
- /** Returns the spent/unspent status of a nullifier. */
1671
- getNullifierStatus(hex: string): Promise<NullifierStatusResult>;
1672
- /** Returns a paginated list of private transfer events. */
1673
- getTransfers(params?: {
1674
- page?: number;
1675
- limit?: number;
1676
- }): Promise<PaginatedResult<PrivateTransfer>>;
1677
- /** Returns a paginated list of unshield events. */
1678
- getUnshields(params?: {
1679
- page?: number;
1680
- limit?: number;
1681
- }): Promise<PaginatedResult<Unshield>>;
1682
- /** Returns a paginated list of Merkle root checkpoints. */
1683
- getMerkleRoots(params?: {
1684
- page?: number;
1685
- limit?: number;
1686
- }): Promise<PaginatedResult<MerkleRoot>>;
1687
- /** Returns the latest Merkle root, or null if none exists. */
1688
- getLatestMerkleRoot(): Promise<MerkleRoot | null>;
3431
+ interface ShieldedEventData {
3432
+ sender: string;
3433
+ amount: string | null;
3434
+ commitment: string;
3435
+ memo: string;
3436
+ index: number;
3437
+ }
3438
+ interface PrivateTransferEventData {
3439
+ nullifiers: string[];
3440
+ commitments: string[];
3441
+ memos: string[];
3442
+ indices: number[];
3443
+ }
3444
+ interface UnshieldedEventData {
3445
+ nullifier: string;
3446
+ amount: string | null;
3447
+ recipient: string;
3448
+ }
3449
+ interface MerkleRootUpdatedData {
3450
+ old_root: string;
3451
+ new_root: string;
3452
+ size: number;
3453
+ }
3454
+ interface AuditPolicySetData {
3455
+ who: string;
3456
+ auditors: string[];
3457
+ version: number;
3458
+ }
3459
+ interface DisclosureRequestedData {
3460
+ requestor: string;
3461
+ target: string;
3462
+ commitment: string;
3463
+ reason?: string;
3464
+ }
3465
+ interface DisclosureApprovedData {
3466
+ who: string;
3467
+ commitment: string;
3468
+ auditor: string;
3469
+ }
3470
+ interface DisclosureRejectedData {
3471
+ who: string;
3472
+ auditor: string;
3473
+ reason: string;
3474
+ }
3475
+ interface DisclosureSubmittedData {
3476
+ who: string;
3477
+ commitment: string;
3478
+ proof_size: number;
3479
+ auditor: string;
3480
+ }
3481
+ interface DisclosureVerifiedData {
3482
+ who: string;
3483
+ commitment: string;
3484
+ verified: boolean;
3485
+ }
3486
+ interface AuditTrailRecordedData {
3487
+ account: string;
3488
+ auditor: string;
3489
+ commitment: string;
3490
+ trail_hash: string;
3491
+ trail_id: string;
3492
+ }
3493
+ interface TransferEventData {
3494
+ from: string;
3495
+ to: string;
3496
+ amount: string;
3497
+ }
3498
+ interface EndowedEventData {
3499
+ account: string;
3500
+ free_balance: string;
3501
+ }
3502
+ interface ReservedEventData {
3503
+ account: string;
3504
+ amount: string;
3505
+ }
3506
+ interface AliasRegisteredData {
3507
+ who: string;
3508
+ alias: string;
3509
+ }
3510
+ interface AliasTransferredData {
3511
+ from: string;
3512
+ to: string;
3513
+ alias: string;
3514
+ }
3515
+ interface AliasOnSaleData {
3516
+ alias: string;
3517
+ price: string;
3518
+ }
3519
+ interface AliasSoldData {
3520
+ from: string;
3521
+ to: string;
3522
+ alias: string;
3523
+ price: string;
3524
+ }
3525
+ interface AccountMappedData {
3526
+ account: string;
3527
+ address: string;
3528
+ }
3529
+ /** EVM exit reason — either a named variant or a plain string. */
3530
+ type EvmExitReason = string | Record<string, unknown>;
3531
+ interface EvmExecutedData {
3532
+ from: string;
3533
+ to: string;
3534
+ tx_hash: string;
3535
+ exit_reason: EvmExitReason;
3536
+ }
3537
+ interface EthereumExecutedData {
3538
+ from: string;
3539
+ to: string;
3540
+ tx_hash: string;
3541
+ exit_reason: EvmExitReason;
3542
+ }
3543
+ interface DispatchInfo {
3544
+ weight: Record<string, unknown>;
3545
+ class: string;
3546
+ pays_fee: string;
3547
+ }
3548
+ interface DispatchError {
3549
+ module?: {
3550
+ index: number;
3551
+ error: number;
3552
+ };
3553
+ [variant: string]: unknown;
3554
+ }
3555
+ interface ExtrinsicSuccessData {
3556
+ dispatch_info: DispatchInfo;
3557
+ }
3558
+ interface ExtrinsicFailedData {
3559
+ dispatch_error: DispatchError;
3560
+ dispatch_info: DispatchInfo;
1689
3561
  }
1690
3562
 
1691
- export { type AccountListing, AccountMappingModule, AccountMappingPrecompile, type AccountMetadata, type AddChainLinkParams, type AliasFullIdentity, type AliasInfo, type ChainInfo, type ChainLink, ChainModule, type CommitmentMerkleProof, CryptoPrecompiles, type DecryptedMemo, type DispatchAsLinkedParams, EncryptedMemo, EvmClient, type EvmSigner, type EvmTxRequest, type FullIdentityInfo, IndexerClient, type IndexerClientConfig, KNOWN_PRECOMPILES, type KnownPrecompileInfo, type ListingInfo, MerkleModule, type MerkleProof, type MerkleRoot, type MerkleRootUpdatedEvent, type MerkleTreeInfo, NoteBuilder, type NoteInput, type NullifierStatus, type NullifierStatusResult, OrbinumClient, type OrbinumClientConfig, PRECOMPILE_ADDR, type PaginatedResult, type PoolBalance, type PoolStats, PrivacyKeyManager, type PrivateLink, type PrivateTransfer, type PrivateTransferArgs, type PrivateTransferEvent, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PutOnSaleParams, type ResolvedAlias, SLIP0044_NAMESPACE, type ScanCommitment, type SetMetadataParams, type ShieldArgs, type ShieldParams, type ShieldResult, type ShieldedCommitment, type ShieldedEvent, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SignatureScheme, type SpentNullifier, SubstrateClient, type SupportedChain, type TransferInput, type TransferOutput, type TxResult, type Unshield, type UnshieldArgs, type UnshieldParams, type UnshieldedEvent, type ZkNote, accountIdHexToSs58, addressToAccountIdHex, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, bytesToBigintLE, computePathIndices, decryptJson, deriveOwnerPk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessage, deriveVaultKey, deriveViewingKey, encryptJson, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToSubstrate, fromHex, getPrecompileLabel, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, normalizeEvmAddress, substrateSs58ToAccountIdHex, substrateToEvm, toHex, tryDecryptNote, vaultReplacer, vaultReviver };
3563
+ 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, type AuditPolicySetData, type AuditPolicySetEvent, type AuditTrailRecordedData, type Auditor, type BatchDisclosureSubmission, type BatchRegisterVerificationKeysArgs, type BatchSubmitDisclosureProofsArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type BuyAliasArgs, type Bytes32, type ChainInfo, type ChainLink, type ChainLinkAddedEvent, type ChainLinkRemovedEvent, CircuitId, CircuitId as CircuitIdType, type ClientProviderConfig, type ConnectionStatus, CryptoPrecompiles, type DecodedAddChainLinkArgs, type DecodedApproveDisclosureArgs, type DecodedBatchArgs, type DecodedBatchSubmitDisclosureArgs, type DecodedDispatchAsPrivateLinkArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedPutAliasForSaleArgs, type DecodedRegisterAliasArgs, type DecodedRejectDisclosureArgs, type DecodedRemarkArgs, type DecodedRequestDisclosureArgs, type DecodedRevealPrivateLinkArgs, type DecodedSetAccountMetadataArgs, type DecodedSetAuditPolicyArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSubmitDisclosureArgs, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DiscloseArgs, type DisclosedEvent, type DisclosureApprovedData, type DisclosureCondition, type DisclosurePublicSignals, type DisclosureRecordRevokedEvent, type DisclosureRejectedData, type DisclosureRejectedEvent, type DisclosureRequestExpiredEvent, type DisclosureRequestedData, type DisclosureRequestedEvent, type DisclosureSubmittedData, type DisclosureVerifiedData, type DispatchAsLinkedAccountArgs, type DispatchAsLinkedParams, type DispatchAsPrivateLinkArgs, type DispatchError, type DispatchInfo, type DynamicBuilder, EncryptedMemo, 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 FormatOptions, type IndexedBlock, type IndexedEvmTx, type IndexedExtrinsic, IndexerClient, type IndexerClientConfig, type IndexerStats, KNOWN_PRECOMPILES, type KnownPrecompileInfo, type ListingInfo, type MerkleRoot, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, type MetadataUpdatedEvent, NoteBuilder, type NoteInput, type NullifierStatusResult, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, type PaginatedResult, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateChainLinkAddedEvent, type PrivateChainLinkRemovedEvent, type PrivateChainLinkRevealedEvent, type PrivateLink, type PrivateLinkDispatchExecutedEvent, type PrivateTransfer, type PrivateTransferArgs, type PrivateTransferEvent, type PrivateTransferEventData, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type ProxyCallExecutedEvent, type PruneExpiredRequestArgs, type PutAliasOnSaleArgs, type PutOnSaleParams, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAliasArgs, type RegisterAssetArgs, type RegisterPrivateLinkArgs, type RegisterVerificationKeyArgs, type RejectDisclosureArgs, type RemoveChainLinkArgs, type RemovePrivateLinkArgs, type RemoveSupportedChainArgs, type RemoveVerificationKeyArgs, type RequestDisclosureArgs, type ReservedEventData, type ResolvedAlias, type RevealPrivateLinkArgs, type RevokeDisclosureRecordArgs, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SLIP0044_NAMESPACE, type ScanCommitment, type SetAccountMetadataArgs, type SetActiveVersionArgs, type SetAuditPolicyArgs, type SetMetadataParams, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldResult, type ShieldedAddressEvent, type ShieldedCommitment, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, SignatureScheme, type SpentNullifier, type StatusChangeEvent, type StatusListener, SubstrateClient, type SupportedChain, type SupportedChainAddedEvent, type SupportedChainRemovedEvent, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferAliasArgs, type TransferEventData, type TxResult, type Unshield, type UnshieldArgs, type UnshieldParams, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, 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, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, bytesToBigintLE, computePathIndices, decodePrecompileCalldata, decryptJson, deriveOwnerPk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessage, deriveVaultKey, deriveViewingKey, encryptJson, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, truncateMiddle, tryDecryptNote, vaultReplacer, vaultReviver };