@orbinum/sdk 0.7.0 → 0.7.1

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/README.md CHANGED
@@ -28,6 +28,7 @@ const client = await OrbinumClient.connect({
28
28
  const info = await client.substrate.getChainInfo();
29
29
  const root = await client.rpcV2.privacy.getMerkleRoot();
30
30
  const block = await client.substrate.getBlock('best');
31
+ const isValidator = await client.rpcV2.chain.isValidator('5GrwvaEF...');
31
32
  ```
32
33
 
33
34
  `OrbinumClient` exposes the following modules:
@@ -36,7 +37,8 @@ const block = await client.substrate.getBlock('best');
36
37
  |---|---|
37
38
  | `client.substrate` | Substrate RPC — blocks, events, transactions |
38
39
  | `client.evm` | EVM JSON-RPC client (`null` if `evmRpc` not set) |
39
- | `client.rpcV2` | Orbinum `rpc-v2` namespaces (`privacy_*`, etc.) |
40
+ | `client.rpcV2` | Orbinum `rpc-v2` namespaces (`chain_*`, `privacy_*`) |
41
+ | `client.rpcV2.chain` | Chain-level queries (`chain_isValidator`, etc.) |
40
42
  | `client.shieldedPool` | Shielded pool extrinsics |
41
43
  | `client.accountMapping` | Alias, chain-link, and identity operations |
42
44
  | `client.precompiles` | EVM precompile wrappers (`null` if `evmRpc` not set) |
package/dist/index.d.mts CHANGED
@@ -711,7 +711,6 @@ declare class IndexerClient {
711
711
  constructor(config: IndexerClientConfig);
712
712
  private _fetchResponse;
713
713
  private get;
714
- private post;
715
714
  private getOrNull;
716
715
  private buildQuery;
717
716
  /** Returns the total count of shielded commitments. */
@@ -744,11 +743,15 @@ declare class IndexerClient {
744
743
  /** Returns the spent/unspent status of a nullifier. */
745
744
  getNullifierStatus(hex: string): Promise<NullifierStatusResult>;
746
745
  /**
747
- * Batch-checks which of the given nullifiers are spent.
748
- * Returns only the nullifiers that exist in the spent set.
749
- * Accepts up to 100 nullifiers (0x-prefixed hex).
746
+ * Downloads the full spent nullifier set and returns it as a Set of lowercase hex strings.
747
+ *
748
+ * The server sees an identical GET request regardless of which notes the wallet holds —
749
+ * the intersection is computed locally (PIR-A privacy model).
750
+ *
751
+ * Suitable for wallets with up to ~1M spent nullifiers (~70 MB raw, <20 MB gzip).
752
+ * For the current Orbinum testnet/mainnet scale this is the recommended approach.
750
753
  */
751
- getNullifiersBatch(nullifiers: string[]): Promise<SpentNullifier[]>;
754
+ getAllSpentNullifiers(): Promise<Set<string>>;
752
755
  /**
753
756
  * Returns temporal metadata for private transfers that spent any of the given nullifiers.
754
757
  * Only blockNumber, extrinsicIndex, timestampMs, and hash are returned — no cross-link
package/dist/index.d.ts CHANGED
@@ -711,7 +711,6 @@ declare class IndexerClient {
711
711
  constructor(config: IndexerClientConfig);
712
712
  private _fetchResponse;
713
713
  private get;
714
- private post;
715
714
  private getOrNull;
716
715
  private buildQuery;
717
716
  /** Returns the total count of shielded commitments. */
@@ -744,11 +743,15 @@ declare class IndexerClient {
744
743
  /** Returns the spent/unspent status of a nullifier. */
745
744
  getNullifierStatus(hex: string): Promise<NullifierStatusResult>;
746
745
  /**
747
- * Batch-checks which of the given nullifiers are spent.
748
- * Returns only the nullifiers that exist in the spent set.
749
- * Accepts up to 100 nullifiers (0x-prefixed hex).
746
+ * Downloads the full spent nullifier set and returns it as a Set of lowercase hex strings.
747
+ *
748
+ * The server sees an identical GET request regardless of which notes the wallet holds —
749
+ * the intersection is computed locally (PIR-A privacy model).
750
+ *
751
+ * Suitable for wallets with up to ~1M spent nullifiers (~70 MB raw, <20 MB gzip).
752
+ * For the current Orbinum testnet/mainnet scale this is the recommended approach.
750
753
  */
751
- getNullifiersBatch(nullifiers: string[]): Promise<SpentNullifier[]>;
754
+ getAllSpentNullifiers(): Promise<Set<string>>;
752
755
  /**
753
756
  * Returns temporal metadata for private transfers that spent any of the given nullifiers.
754
757
  * Only blockNumber, extrinsicIndex, timestampMs, and hash are returned — no cross-link
package/dist/index.js CHANGED
@@ -1113,24 +1113,6 @@ var IndexerClient = class {
1113
1113
  }
1114
1114
  return res.json();
1115
1115
  }
1116
- async post(path, body) {
1117
- const controller = new AbortController();
1118
- const timer = setTimeout(() => controller.abort(), this.timeoutMs);
1119
- try {
1120
- const res = await fetch(`${this.baseUrl}${path}`, {
1121
- method: "POST",
1122
- headers: { "Content-Type": "application/json" },
1123
- body: JSON.stringify(body),
1124
- signal: controller.signal
1125
- });
1126
- if (!res.ok) {
1127
- throw new Error(`IndexerClient: HTTP ${res.status} for POST ${path}`);
1128
- }
1129
- return res.json();
1130
- } finally {
1131
- clearTimeout(timer);
1132
- }
1133
- }
1134
1116
  async getOrNull(path) {
1135
1117
  const res = await this._fetchResponse(path);
1136
1118
  if (res.status === 404) return null;
@@ -1194,16 +1176,17 @@ var IndexerClient = class {
1194
1176
  );
1195
1177
  }
1196
1178
  /**
1197
- * Batch-checks which of the given nullifiers are spent.
1198
- * Returns only the nullifiers that exist in the spent set.
1199
- * Accepts up to 100 nullifiers (0x-prefixed hex).
1179
+ * Downloads the full spent nullifier set and returns it as a Set of lowercase hex strings.
1180
+ *
1181
+ * The server sees an identical GET request regardless of which notes the wallet holds —
1182
+ * the intersection is computed locally (PIR-A privacy model).
1183
+ *
1184
+ * Suitable for wallets with up to ~1M spent nullifiers (~70 MB raw, <20 MB gzip).
1185
+ * For the current Orbinum testnet/mainnet scale this is the recommended approach.
1200
1186
  */
1201
- async getNullifiersBatch(nullifiers) {
1202
- if (nullifiers.length === 0) return [];
1203
- const res = await this.post("/shielded/nullifiers/batch", {
1204
- nullifiers: nullifiers.map((n) => n.toLowerCase())
1205
- });
1206
- return res.data;
1187
+ async getAllSpentNullifiers() {
1188
+ const res = await this.get("/shielded/nullifiers/all");
1189
+ return new Set(res.data.map((h) => h.toLowerCase()));
1207
1190
  }
1208
1191
  // ─── Private transfers ─────────────────────────────────────────────────────
1209
1192
  /**
package/dist/index.mjs CHANGED
@@ -986,24 +986,6 @@ var IndexerClient = class {
986
986
  }
987
987
  return res.json();
988
988
  }
989
- async post(path, body) {
990
- const controller = new AbortController();
991
- const timer = setTimeout(() => controller.abort(), this.timeoutMs);
992
- try {
993
- const res = await fetch(`${this.baseUrl}${path}`, {
994
- method: "POST",
995
- headers: { "Content-Type": "application/json" },
996
- body: JSON.stringify(body),
997
- signal: controller.signal
998
- });
999
- if (!res.ok) {
1000
- throw new Error(`IndexerClient: HTTP ${res.status} for POST ${path}`);
1001
- }
1002
- return res.json();
1003
- } finally {
1004
- clearTimeout(timer);
1005
- }
1006
- }
1007
989
  async getOrNull(path) {
1008
990
  const res = await this._fetchResponse(path);
1009
991
  if (res.status === 404) return null;
@@ -1067,16 +1049,17 @@ var IndexerClient = class {
1067
1049
  );
1068
1050
  }
1069
1051
  /**
1070
- * Batch-checks which of the given nullifiers are spent.
1071
- * Returns only the nullifiers that exist in the spent set.
1072
- * Accepts up to 100 nullifiers (0x-prefixed hex).
1052
+ * Downloads the full spent nullifier set and returns it as a Set of lowercase hex strings.
1053
+ *
1054
+ * The server sees an identical GET request regardless of which notes the wallet holds —
1055
+ * the intersection is computed locally (PIR-A privacy model).
1056
+ *
1057
+ * Suitable for wallets with up to ~1M spent nullifiers (~70 MB raw, <20 MB gzip).
1058
+ * For the current Orbinum testnet/mainnet scale this is the recommended approach.
1073
1059
  */
1074
- async getNullifiersBatch(nullifiers) {
1075
- if (nullifiers.length === 0) return [];
1076
- const res = await this.post("/shielded/nullifiers/batch", {
1077
- nullifiers: nullifiers.map((n) => n.toLowerCase())
1078
- });
1079
- return res.data;
1060
+ async getAllSpentNullifiers() {
1061
+ const res = await this.get("/shielded/nullifiers/all");
1062
+ return new Set(res.data.map((h) => h.toLowerCase()));
1080
1063
  }
1081
1064
  // ─── Private transfers ─────────────────────────────────────────────────────
1082
1065
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbinum/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Official TypeScript SDK for Orbinum.",
5
5
  "author": "Orbinum",
6
6
  "license": "MIT",