@candledottv/cli 0.8.1 → 0.8.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.
Files changed (2) hide show
  1. package/dist/index.js +27 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20258,7 +20258,7 @@ async function resolveApiKey(deps, profile) {
20258
20258
  }
20259
20259
 
20260
20260
  // src/version.ts
20261
- var CLI_VERSION = "0.8.1";
20261
+ var CLI_VERSION = "0.8.2";
20262
20262
 
20263
20263
  // src/commands/auth.ts
20264
20264
  var DEVICE_CODE_PATH = "/api/v1/agent/device/code";
@@ -25279,22 +25279,32 @@ async function walletsImport(args, ctx) {
25279
25279
  }
25280
25280
  async function verifyImportLanded(args) {
25281
25281
  const { deps } = args.ctx;
25282
- const listed = await apiRequest("/api/v1/agent/wallets", {
25283
- method: "GET",
25284
- auth: "key",
25285
- credentials: { apiKey: args.apiKey },
25286
- apiUrl: args.apiUrl,
25287
- fetch: deps.fetch,
25288
- env: deps.env
25289
- });
25290
- if (!listed.ok)
25291
- return { status: "unchecked" };
25292
- const page = listed.body.page;
25293
- if (!Array.isArray(page))
25294
- return { status: "unchecked" };
25295
- const account = page.find((row) => typeof row.userAddress === "string")?.userAddress;
25296
- const found = page.some((row) => row._id === args.id);
25297
- return { status: found ? "verified" : "missing", ...account !== undefined ? { account } : {} };
25282
+ let cursor = null;
25283
+ let account;
25284
+ for (let pageCount = 0;pageCount < 25; pageCount++) {
25285
+ const query = cursor === null ? "?limit=100" : `?limit=100&cursor=${encodeURIComponent(cursor)}`;
25286
+ const listed = await apiRequest(`/api/v1/agent/wallets${query}`, {
25287
+ method: "GET",
25288
+ auth: "key",
25289
+ credentials: { apiKey: args.apiKey },
25290
+ apiUrl: args.apiUrl,
25291
+ fetch: deps.fetch,
25292
+ env: deps.env
25293
+ });
25294
+ if (!listed.ok)
25295
+ return { status: "unchecked", ...account !== undefined ? { account } : {} };
25296
+ const body = listed.body;
25297
+ if (!Array.isArray(body.page))
25298
+ return { status: "unchecked", ...account !== undefined ? { account } : {} };
25299
+ account ??= body.page.find((row) => typeof row.userAddress === "string")?.userAddress;
25300
+ if (body.page.some((row) => row._id === args.id)) {
25301
+ return { status: "verified", ...account !== undefined ? { account } : {} };
25302
+ }
25303
+ if (body.isDone !== false || typeof body.continueCursor !== "string")
25304
+ break;
25305
+ cursor = body.continueCursor;
25306
+ }
25307
+ return { status: "missing", ...account !== undefined ? { account } : {} };
25298
25308
  }
25299
25309
  async function walletsRevoke(args, ctx) {
25300
25310
  const { deps, apiUrl, json } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candledottv/cli",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "The Candle CLI: authorize a device from your browser, then manage API keys, wallets, and setup health from the terminal",
5
5
  "type": "module",
6
6
  "bin": {