@neus/sdk 1.1.1 → 1.1.2

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
@@ -1,206 +1,184 @@
1
- # @neus/sdk
2
-
3
- Create, check, and reuse NEUS trust receipts from apps and backends. The same package ships the **`neus`** CLI for hosted MCP setup and portable agent import.
4
-
5
- NEUS makes trust portable across apps, agents, and ecosystems before access, payment, or action.
6
-
7
- Roadmap: [docs.neus.network/platform/status](https://docs.neus.network/platform/status)
8
-
9
- ## Install (library)
10
-
11
- ```bash
12
- npm install @neus/sdk
13
- ```
14
-
15
- ## Bring Your Own Agent (BYOA)
16
-
17
- Already have an agent setup? Use the CLI to package supported local agent context, including instructions, rules, skills, and MCP server references from **OpenClaw, Cursor, Claude Code, and Claude Desktop**:
18
-
19
- ```bash
20
- npx -y -p @neus/sdk neus import
21
- ```
22
-
23
- This prepares a local portable-agent manifest. In MCP, call `neus_agent_link` first; if setup is missing, use `neus_agent_create`, complete the hosted or signing steps, then call `neus_agent_link` again until `linked: true`.
24
-
25
- *To check what will be imported without writing changes:*
26
- ```bash
27
- npx -y -p @neus/sdk neus import --dry-run
28
- ```
29
-
30
- ## Connect editors and assistants
31
-
32
- | Topic | Link |
33
- | --------------------------------- | ----------------------------------------------------------------------------- |
34
- | Setup, JSON snippets, and headers | [MCP setup](https://docs.neus.network/mcp/setup) |
35
- | Tools and session order | [MCP overview](https://docs.neus.network/mcp/overview) |
36
- | Discovery URLs | [Discovery and endpoints](https://docs.neus.network/mcp/endpoints) |
37
- | NEUS for AI assistants | [NEUS for AI assistants](https://docs.neus.network/mcp/ide-plugin) |
38
-
39
- Prefer `neus setup` over hand-editing config files so every host stays on **`https://mcp.neus.network/mcp`**.
40
-
41
- ## What you can ship
42
-
43
- - Hosted verification flows that return a reusable receipt
44
- - Server checks before access, rewards, payments, or actions
45
- - React gates with `VerifyGate`
46
- - Agent identity and scoped delegation
47
- - MCP setup for assistants and agent tools
48
-
49
- ## Fastest path: Hosted Verify
50
-
51
- Use Hosted Verify when you want NEUS to handle the signing/verification flow outside your app UI.
52
-
53
- ```js
54
- import { getHostedCheckoutUrl } from '@neus/sdk';
55
-
56
- const url = getHostedCheckoutUrl({
57
- verifiers: ['ownership-basic'],
58
- returnUrl: 'https://yourapp.com/auth/callback'
59
- });
60
-
61
- window.location.assign(url);
62
- ```
63
-
64
- After completion, NEUS redirects back with a `qHash`. Store it with your user or record.
65
-
66
- ## Advanced: in-app signing
67
-
68
- Use this only when your app intentionally handles signing. This example is EVM. For non-EVM accounts, pass the provider explicitly and include `chain` as a CAIP-2 value.
69
-
70
- ```js
71
- import { NeusClient } from '@neus/sdk';
72
-
73
- const client = new NeusClient({
74
- appId: 'your-app-id'
75
- });
76
-
77
- const proof = await client.verify({
78
- verifier: 'ownership-basic',
79
- data: {
80
- owner: '0x...',
81
- contentType: 'application/json',
82
- content: JSON.stringify({
83
- title: 'Verified claim',
84
- type: 'project-update',
85
- summary: 'Public summary of what is being proven.'
86
- }),
87
- reference: {
88
- type: 'url',
89
- id: 'https://example.com/source',
90
- title: 'Source record'
91
- }
92
- },
93
- wallet: window.ethereum // EVM provider
94
- });
95
-
96
- console.log(proof.qHash);
97
- console.log(proof.proofUrl);
98
- ```
99
-
100
- ## React widget
101
-
102
- Use `VerifyGate` when you want a drop-in verification flow in React.
103
-
104
- ```jsx
105
- import { VerifyGate } from '@neus/sdk/widgets';
106
-
107
- export function Page() {
108
- return (
109
- <VerifyGate
110
- appId="your-app-id"
111
- requiredVerifiers={['ownership-basic']}
112
- verifierData={{
113
- 'ownership-basic': {
114
- owner: '0x...',
115
- contentType: 'application/json',
116
- content: JSON.stringify({
117
- title: 'Verified claim',
118
- summary: 'Public summary of what is being proven.'
119
- }),
120
- reference: {
121
- type: 'url',
122
- id: 'https://example.com/source'
123
- }
124
- }
125
- }}
126
- onVerified={result => {
127
- console.log(result.qHash || result.qHashes);
128
- }}
129
- />
130
- );
131
- }
132
- ```
133
-
134
- ## Check receipts
135
-
136
- Use `gateCheck` from trusted server code when you need allow/deny or eligibility checks.
137
-
138
- ```js
139
- import { NeusClient } from '@neus/sdk';
140
-
141
- const client = new NeusClient({
142
- appId: 'your-app-id'
143
- });
144
-
145
- const result = await client.gateCheck({
146
- address: '0x...',
147
- verifierIds: ['ownership-basic']
148
- });
149
-
150
- if (!result.data?.eligible) {
151
- throw new Error('Access denied');
152
- }
153
- ```
154
-
155
- Never ship access keys in browser code.
156
-
157
- ## Core methods
158
-
159
- | Method | Use it for |
160
- | ------------------------------- | ------------------------------------------- |
161
- | `getHostedCheckoutUrl()` | Send a user to Hosted Verify |
162
- | `client.verify()` | Create a proof |
163
- | `client.getProof()` | Fetch a receipt by `qHash` |
164
- | `client.pollProofStatus()` | Wait for async completion |
165
- | `client.gateCheck()` | Server-side eligibility checks |
166
- | `client.checkGate()` | Local preview against already-loaded proofs |
167
- | `client.createWalletLinkData()` | Wallet-link payloads |
168
-
169
- ## Configuration
170
-
171
- ```js
172
- const client = new NeusClient({
173
- apiUrl: 'https://api.neus.network',
174
- appId: 'your-app-id',
175
- timeout: 30000
176
- });
177
- ```
178
-
179
- `appId` is public attribution for your app.
180
- `apiKey` / `npk_*` is optional and server-side only.
181
-
182
- ## MCP step-by-step
183
-
184
- ```bash
185
- npx -y -p @neus/sdk neus setup
186
- npx -y -p @neus/sdk neus auth
187
- npx -y -p @neus/sdk neus doctor --live
188
- ```
189
-
190
- Re-sign in or rotate credentials:
191
-
192
- ```bash
193
- npx -y -p @neus/sdk neus auth
194
- npx -y -p @neus/sdk neus auth --access-key <npk_...> # servers and CI only
195
- ```
196
-
197
- Editors with plugin marketplaces can install **`neus-trust@neus`** for the bundled session workflow. OpenClaw, Hermes, and other runtimes: see [NEUS for AI assistants](https://docs.neus.network/mcp/ide-plugin) for exact paths.
198
-
199
- ## Docs
200
-
201
- - Quickstart: https://docs.neus.network/quickstart
202
- - JavaScript SDK: https://docs.neus.network/sdks/javascript
203
- - Ownership Basic: https://docs.neus.network/verification/ownership-basic
204
- - Widgets: https://docs.neus.network/widgets/overview
205
- - MCP: https://docs.neus.network/mcp/overview
206
- - API: https://docs.neus.network/api/overview
1
+ # @neus/sdk
2
+
3
+ Create, check, and reuse NEUS trust receipts from apps and backends. The same package ships the **`neus`** CLI for hosted MCP setup.
4
+
5
+ NEUS makes trust portable across apps, agents, and ecosystems before access, payment, or action.
6
+
7
+ Roadmap: [docs.neus.network/platform/status](https://docs.neus.network/platform/status)
8
+
9
+ ## Install (library)
10
+
11
+ ```bash
12
+ npm install @neus/sdk
13
+ ```
14
+
15
+ ## Connect editors and assistants
16
+
17
+ One command detects your environment and configures hosted MCP for Claude Code, Codex, Cursor, or VS Code.
18
+
19
+ ```bash
20
+ npx -y -p @neus/sdk neus setup
21
+ npx -y -p @neus/sdk neus doctor --live
22
+ ```
23
+
24
+ Call `neus_context` in your MCP client. For agent workflows, call `neus_agent_link` before assuming identity or delegation is ready.
25
+
26
+ ## MCP docs
27
+
28
+ | Topic | Link |
29
+ | --------------------------------- | ----------------------------------------------------------------------------- |
30
+ | Setup, JSON snippets, and headers | [MCP setup](https://docs.neus.network/mcp/setup) |
31
+ | Tools and session order | [MCP overview](https://docs.neus.network/mcp/overview) |
32
+ | Discovery URLs | [Discovery and endpoints](https://docs.neus.network/mcp/endpoints) |
33
+ | NEUS for AI assistants | [NEUS for AI assistants](https://docs.neus.network/mcp/ide-plugin) |
34
+
35
+ Prefer `neus setup` over hand-editing config files so every host stays on **`https://mcp.neus.network/mcp`**.
36
+
37
+ ## What you can ship
38
+
39
+ - Hosted verification flows that return a reusable receipt
40
+ - Server checks before access, rewards, payments, or actions
41
+ - React gates with `VerifyGate`
42
+ - Agent identity and scoped delegation
43
+ - MCP setup for assistants and agent tools
44
+
45
+ ## Hosted Verify
46
+
47
+ Use Hosted Verify when you want NEUS to handle the signing/verification flow outside your app UI. Prefer a **published gate**:
48
+
49
+ ```js
50
+ import { getHostedCheckoutUrl } from '@neus/sdk';
51
+
52
+ const url = getHostedCheckoutUrl({
53
+ gateId: 'gate_abc123',
54
+ returnUrl: 'https://yourapp.com/auth/callback'
55
+ });
56
+
57
+ window.location.assign(url);
58
+ ```
59
+
60
+ After completion, NEUS redirects back with a `qHash`. Store it with your user or record.
61
+
62
+ ## Advanced: in-app signing
63
+
64
+ Use this only when your app intentionally handles signing. This example is EVM. For non-EVM accounts, pass the provider explicitly and include `chain` as a CAIP-2 value.
65
+
66
+ ```js
67
+ import { NeusClient } from '@neus/sdk';
68
+
69
+ const client = new NeusClient({
70
+ apiUrl: 'https://api.neus.network'
71
+ });
72
+
73
+ const proof = await client.verify({
74
+ verifier: 'ownership-basic',
75
+ data: {
76
+ owner: '0x...',
77
+ contentType: 'application/json',
78
+ content: JSON.stringify({
79
+ title: 'Verified claim',
80
+ type: 'project-update',
81
+ summary: 'Public summary of what is being proven.'
82
+ }),
83
+ reference: {
84
+ type: 'url',
85
+ id: 'https://example.com/source',
86
+ title: 'Source record'
87
+ }
88
+ },
89
+ wallet: window.ethereum // EVM provider
90
+ });
91
+
92
+ console.log(proof.qHash);
93
+ console.log(proof.proofUrl);
94
+ ```
95
+
96
+ ## React widget
97
+
98
+ Use `VerifyGate` with your published `gateId`:
99
+
100
+ ```jsx
101
+ import { VerifyGate } from '@neus/sdk/widgets';
102
+
103
+ export function Page() {
104
+ return (
105
+ <VerifyGate
106
+ gateId="gate_abc123"
107
+ onVerified={result => {
108
+ console.log(result.qHash || result.qHashes);
109
+ }}
110
+ >
111
+ <section>Unlocked content</section>
112
+ </VerifyGate>
113
+ );
114
+ }
115
+ ```
116
+
117
+ ## Check receipts
118
+
119
+ Use `gateCheck` from trusted server code when you need allow/deny before access:
120
+
121
+ ```js
122
+ import { NeusClient } from '@neus/sdk';
123
+
124
+ const client = new NeusClient();
125
+
126
+ const result = await client.gateCheck({
127
+ gateId: 'gate_abc123',
128
+ address: '0x...'
129
+ });
130
+
131
+ if (!result.data?.eligible) {
132
+ throw new Error('Access denied');
133
+ }
134
+ ```
135
+
136
+ Never ship access keys in browser code.
137
+
138
+ ## Core methods
139
+
140
+ | Method | Use it for |
141
+ | ------------------------------- | ------------------------------------------- |
142
+ | `getHostedCheckoutUrl()` | Send a user to Hosted Verify |
143
+ | `client.verify()` | Create a proof |
144
+ | `client.getProof()` | Fetch a receipt by `qHash` |
145
+ | `client.pollProofStatus()` | Wait for async completion |
146
+ | `client.gateCheck()` | Server-side eligibility checks |
147
+ | `client.checkGate()` | Local preview against already-loaded proofs |
148
+ | `client.createWalletLinkData()` | Wallet-link payloads |
149
+
150
+ ## Configuration
151
+
152
+ ```js
153
+ const client = new NeusClient({
154
+ apiUrl: 'https://api.neus.network',
155
+ timeout: 30000
156
+ });
157
+ ```
158
+
159
+ `appId` is optional public attribution for advanced server/app flows. Published gate checkout and `gateCheck({ gateId })` do not require it.
160
+ `apiKey` / `npk_*` is optional and server-side only.
161
+
162
+ ## MCP step-by-step
163
+
164
+ ```bash
165
+ npx -y -p @neus/sdk neus setup
166
+ npx -y -p @neus/sdk neus doctor --live
167
+ ```
168
+
169
+ `neus setup` configures MCP and signs you in: `NEUS_ACCESS_KEY` from the environment when set, otherwise the selected host starts OAuth. Cursor, VS Code, and Claude Code use browser sign-in on NEUS. Pass `--access-key <npk_...>` only to override.
170
+
171
+ Codex owns its local MCP OAuth session. Use `npx -y -p @neus/sdk neus setup --client codex`, then `npx -y -p @neus/sdk neus auth --client codex`.
172
+
173
+ Integrators embedding install UX in apps should import **`@neus/sdk/mcp-hosts`** (setup commands, deeplinks, host labels) instead of duplicating strings.
174
+
175
+ Editors with plugin marketplaces can install **`neus-trust@neus`** for the bundled session workflow. In Claude Code, run `/plugin marketplace add https://github.com/neus/network` and `/plugin install neus-trust@neus` inside chat. Other hosts: [NEUS for AI assistants](https://docs.neus.network/mcp/ide-plugin).
176
+
177
+ ## Docs
178
+
179
+ - Quickstart: https://docs.neus.network/quickstart
180
+ - JavaScript SDK: https://docs.neus.network/sdks/javascript
181
+ - Ownership Basic: https://docs.neus.network/verification/ownership-basic
182
+ - Widgets: https://docs.neus.network/widgets/overview
183
+ - MCP: https://docs.neus.network/mcp/overview
184
+ - API: https://docs.neus.network/api/overview
package/cjs/client.cjs CHANGED
@@ -1396,21 +1396,20 @@ var NeusClient = class {
1396
1396
  return hex;
1397
1397
  }
1398
1398
  };
1399
- const isFarcasterWallet = (() => {
1399
+ const isBaseMiniAppWallet = (() => {
1400
1400
  if (typeof window === "undefined") return false;
1401
1401
  try {
1402
1402
  const w = window;
1403
- const fc = w.farcaster;
1404
- if (!fc || !fc.context) return false;
1405
- const fcProvider = fc.provider || fc.walletProvider || fc.context && fc.context.walletProvider;
1406
- if (fcProvider === provider) return true;
1407
- if (w.mini && w.mini.wallet === provider && fc && fc.context) return true;
1408
- if (w.ethereum === provider && fc && fc.context) return true;
1403
+ const mini = w.mini;
1404
+ if (!mini) return false;
1405
+ const miniProvider = mini.wallet || mini.provider;
1406
+ if (miniProvider === provider) return true;
1407
+ if (w.ethereum === provider && mini) return true;
1409
1408
  } catch {
1410
1409
  }
1411
1410
  return false;
1412
1411
  })();
1413
- if (isFarcasterWallet) {
1412
+ if (isBaseMiniAppWallet) {
1414
1413
  try {
1415
1414
  const hexMsg = toHexUtf82(message);
1416
1415
  signature2 = await provider.request({ method: "personal_sign", params: [hexMsg, walletAddress2] });
@@ -1759,7 +1758,9 @@ ${bytes.length}`;
1759
1758
  const pathId = /^0x[a-fA-F0-9]{40}$/i.test(id) ? id.toLowerCase() : id;
1760
1759
  const qs = [];
1761
1760
  if (options.limit) qs.push(`limit=${encodeURIComponent(String(options.limit))}`);
1762
- if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
1761
+ const cursorRaw = options.cursor !== null && options.cursor !== void 0 ? String(options.cursor).trim() : "";
1762
+ if (cursorRaw) qs.push(`cursor=${encodeURIComponent(cursorRaw)}`);
1763
+ else if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
1763
1764
  if (options.qHash) qs.push(`qHash=${encodeURIComponent(options.qHash.toLowerCase())}`);
1764
1765
  const query = qs.length ? `?${qs.join("&")}` : "";
1765
1766
  const response = await this._makeRequest(
@@ -1775,7 +1776,8 @@ ${bytes.length}`;
1775
1776
  proofs: Array.isArray(proofs) ? proofs : [],
1776
1777
  totalCount: response.data?.totalCount ?? proofs.length,
1777
1778
  hasMore: Boolean(response.data?.hasMore),
1778
- nextOffset: response.data?.nextOffset ?? null
1779
+ nextOffset: response.data?.nextOffset ?? null,
1780
+ nextCursor: typeof response.data?.nextCursor === "string" && response.data.nextCursor.trim() ? response.data.nextCursor.trim() : null
1779
1781
  };
1780
1782
  }
1781
1783
  async getPrivateProofsByWallet(walletAddress, options = {}, wallet = null) {
@@ -1827,7 +1829,9 @@ ${bytes.length}`;
1827
1829
  }
1828
1830
  const qs = [];
1829
1831
  if (options.limit) qs.push(`limit=${encodeURIComponent(String(options.limit))}`);
1830
- if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
1832
+ const cursorRaw = options.cursor !== null && options.cursor !== void 0 ? String(options.cursor).trim() : "";
1833
+ if (cursorRaw) qs.push(`cursor=${encodeURIComponent(cursorRaw)}`);
1834
+ else if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
1831
1835
  if (options.qHash) qs.push(`qHash=${encodeURIComponent(options.qHash.toLowerCase())}`);
1832
1836
  const query = qs.length ? `?${qs.join("&")}` : "";
1833
1837
  const response = await this._makeRequest("GET", `/api/v1/proofs/by-wallet/${encodeURIComponent(pathId)}${query}`, null, {
@@ -1845,7 +1849,8 @@ ${bytes.length}`;
1845
1849
  proofs: Array.isArray(proofs) ? proofs : [],
1846
1850
  totalCount: response.data?.totalCount ?? proofs.length,
1847
1851
  hasMore: Boolean(response.data?.hasMore),
1848
- nextOffset: response.data?.nextOffset ?? null
1852
+ nextOffset: response.data?.nextOffset ?? null,
1853
+ nextCursor: typeof response.data?.nextCursor === "string" && response.data.nextCursor.trim() ? response.data.nextCursor.trim() : null
1849
1854
  };
1850
1855
  }
1851
1856
  async gateCheck(params = {}) {
@@ -1853,6 +1858,8 @@ ${bytes.length}`;
1853
1858
  if (!validateUniversalAddress(address, params.chain)) {
1854
1859
  throw new ValidationError("Valid address is required");
1855
1860
  }
1861
+ const gateIdParam = typeof params.gateId === "string" ? params.gateId.trim() : "";
1862
+ const verifierIds = gateIdParam ? void 0 : params.verifierIds;
1856
1863
  const qs = new URLSearchParams();
1857
1864
  qs.set("address", address);
1858
1865
  const setIfPresent = (key, value) => {
@@ -1874,7 +1881,8 @@ ${bytes.length}`;
1874
1881
  }
1875
1882
  setIfPresent(key, value);
1876
1883
  };
1877
- setCsvIfPresent("verifierIds", params.verifierIds);
1884
+ setIfPresent("gateId", gateIdParam);
1885
+ setCsvIfPresent("verifierIds", verifierIds);
1878
1886
  setBoolIfPresent("requireAll", params.requireAll);
1879
1887
  setIfPresent("minCount", params.minCount);
1880
1888
  setIfPresent("sinceDays", params.sinceDays);
@@ -1938,10 +1946,10 @@ ${bytes.length}`;
1938
1946
  }
1939
1947
  }
1940
1948
  let mergedHeaders = headersOverride;
1941
- if (!mergedHeaders) {
1949
+ if (!mergedHeaders && !gateIdParam) {
1942
1950
  try {
1943
1951
  const sponsorHeaders = await this._resolveSponsorGrantHeaders(
1944
- Array.isArray(params.verifierIds) ? params.verifierIds : params.verifierIds ? [params.verifierIds] : []
1952
+ Array.isArray(verifierIds) ? verifierIds : verifierIds ? [verifierIds] : []
1945
1953
  );
1946
1954
  if (sponsorHeaders && Object.keys(sponsorHeaders).length > 0) {
1947
1955
  mergedHeaders = sponsorHeaders;
package/cjs/index.cjs CHANGED
@@ -2089,21 +2089,20 @@ var init_client = __esm({
2089
2089
  return hex;
2090
2090
  }
2091
2091
  };
2092
- const isFarcasterWallet = (() => {
2092
+ const isBaseMiniAppWallet = (() => {
2093
2093
  if (typeof window === "undefined") return false;
2094
2094
  try {
2095
2095
  const w = window;
2096
- const fc = w.farcaster;
2097
- if (!fc || !fc.context) return false;
2098
- const fcProvider = fc.provider || fc.walletProvider || fc.context && fc.context.walletProvider;
2099
- if (fcProvider === provider) return true;
2100
- if (w.mini && w.mini.wallet === provider && fc && fc.context) return true;
2101
- if (w.ethereum === provider && fc && fc.context) return true;
2096
+ const mini = w.mini;
2097
+ if (!mini) return false;
2098
+ const miniProvider = mini.wallet || mini.provider;
2099
+ if (miniProvider === provider) return true;
2100
+ if (w.ethereum === provider && mini) return true;
2102
2101
  } catch {
2103
2102
  }
2104
2103
  return false;
2105
2104
  })();
2106
- if (isFarcasterWallet) {
2105
+ if (isBaseMiniAppWallet) {
2107
2106
  try {
2108
2107
  const hexMsg = toHexUtf82(message);
2109
2108
  signature2 = await provider.request({ method: "personal_sign", params: [hexMsg, walletAddress2] });
@@ -2452,7 +2451,9 @@ ${bytes.length}`;
2452
2451
  const pathId = /^0x[a-fA-F0-9]{40}$/i.test(id) ? id.toLowerCase() : id;
2453
2452
  const qs = [];
2454
2453
  if (options.limit) qs.push(`limit=${encodeURIComponent(String(options.limit))}`);
2455
- if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
2454
+ const cursorRaw = options.cursor !== null && options.cursor !== void 0 ? String(options.cursor).trim() : "";
2455
+ if (cursorRaw) qs.push(`cursor=${encodeURIComponent(cursorRaw)}`);
2456
+ else if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
2456
2457
  if (options.qHash) qs.push(`qHash=${encodeURIComponent(options.qHash.toLowerCase())}`);
2457
2458
  const query = qs.length ? `?${qs.join("&")}` : "";
2458
2459
  const response = await this._makeRequest(
@@ -2468,7 +2469,8 @@ ${bytes.length}`;
2468
2469
  proofs: Array.isArray(proofs) ? proofs : [],
2469
2470
  totalCount: response.data?.totalCount ?? proofs.length,
2470
2471
  hasMore: Boolean(response.data?.hasMore),
2471
- nextOffset: response.data?.nextOffset ?? null
2472
+ nextOffset: response.data?.nextOffset ?? null,
2473
+ nextCursor: typeof response.data?.nextCursor === "string" && response.data.nextCursor.trim() ? response.data.nextCursor.trim() : null
2472
2474
  };
2473
2475
  }
2474
2476
  async getPrivateProofsByWallet(walletAddress, options = {}, wallet = null) {
@@ -2520,7 +2522,9 @@ ${bytes.length}`;
2520
2522
  }
2521
2523
  const qs = [];
2522
2524
  if (options.limit) qs.push(`limit=${encodeURIComponent(String(options.limit))}`);
2523
- if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
2525
+ const cursorRaw = options.cursor !== null && options.cursor !== void 0 ? String(options.cursor).trim() : "";
2526
+ if (cursorRaw) qs.push(`cursor=${encodeURIComponent(cursorRaw)}`);
2527
+ else if (options.offset) qs.push(`offset=${encodeURIComponent(String(options.offset))}`);
2524
2528
  if (options.qHash) qs.push(`qHash=${encodeURIComponent(options.qHash.toLowerCase())}`);
2525
2529
  const query = qs.length ? `?${qs.join("&")}` : "";
2526
2530
  const response = await this._makeRequest("GET", `/api/v1/proofs/by-wallet/${encodeURIComponent(pathId)}${query}`, null, {
@@ -2538,7 +2542,8 @@ ${bytes.length}`;
2538
2542
  proofs: Array.isArray(proofs) ? proofs : [],
2539
2543
  totalCount: response.data?.totalCount ?? proofs.length,
2540
2544
  hasMore: Boolean(response.data?.hasMore),
2541
- nextOffset: response.data?.nextOffset ?? null
2545
+ nextOffset: response.data?.nextOffset ?? null,
2546
+ nextCursor: typeof response.data?.nextCursor === "string" && response.data.nextCursor.trim() ? response.data.nextCursor.trim() : null
2542
2547
  };
2543
2548
  }
2544
2549
  async gateCheck(params = {}) {
@@ -2546,6 +2551,8 @@ ${bytes.length}`;
2546
2551
  if (!validateUniversalAddress(address, params.chain)) {
2547
2552
  throw new ValidationError("Valid address is required");
2548
2553
  }
2554
+ const gateIdParam = typeof params.gateId === "string" ? params.gateId.trim() : "";
2555
+ const verifierIds = gateIdParam ? void 0 : params.verifierIds;
2549
2556
  const qs = new URLSearchParams();
2550
2557
  qs.set("address", address);
2551
2558
  const setIfPresent = (key, value) => {
@@ -2567,7 +2574,8 @@ ${bytes.length}`;
2567
2574
  }
2568
2575
  setIfPresent(key, value);
2569
2576
  };
2570
- setCsvIfPresent("verifierIds", params.verifierIds);
2577
+ setIfPresent("gateId", gateIdParam);
2578
+ setCsvIfPresent("verifierIds", verifierIds);
2571
2579
  setBoolIfPresent("requireAll", params.requireAll);
2572
2580
  setIfPresent("minCount", params.minCount);
2573
2581
  setIfPresent("sinceDays", params.sinceDays);
@@ -2631,10 +2639,10 @@ ${bytes.length}`;
2631
2639
  }
2632
2640
  }
2633
2641
  let mergedHeaders = headersOverride;
2634
- if (!mergedHeaders) {
2642
+ if (!mergedHeaders && !gateIdParam) {
2635
2643
  try {
2636
2644
  const sponsorHeaders = await this._resolveSponsorGrantHeaders(
2637
- Array.isArray(params.verifierIds) ? params.verifierIds : params.verifierIds ? [params.verifierIds] : []
2645
+ Array.isArray(verifierIds) ? verifierIds : verifierIds ? [verifierIds] : []
2638
2646
  );
2639
2647
  if (sponsorHeaders && Object.keys(sponsorHeaders).length > 0) {
2640
2648
  mergedHeaders = sponsorHeaders;