@omnisat/lasereyes 0.0.153-next.0 → 0.0.153-next.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 (3) hide show
  1. package/dist/index.js +44 -24
  2. package/dist/ui.js +44 -24
  3. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -49938,8 +49938,12 @@ class wMe {
49938
49938
  "Content-Type": "application/json",
49939
49939
  "api-key": this.apiKey
49940
49940
  }
49941
- };
49942
- return (t === "get" ? await ti.get(i, o) : await ti.post(i, n, o)).data;
49941
+ }, a = t === "get" ? await ti.get(i, o) : await ti.post(i, n, o);
49942
+ if (!a || !a.data)
49943
+ throw new Error(
49944
+ `Invalid response from Maestro API: ${JSON.stringify(a)}`
49945
+ );
49946
+ return a.data;
49943
49947
  } catch (o) {
49944
49948
  throw console.error("MaestroDataSource.call error:", o), o;
49945
49949
  }
@@ -49956,17 +49960,23 @@ class wMe {
49956
49960
  `/addresses/${t}/brc20`
49957
49961
  );
49958
49962
  }
49959
- async getAddressInscriptions(t, r, n) {
49960
- const i = new URLSearchParams();
49961
- r !== void 0 && i.append("offset", r.toString()), n !== void 0 && i.append("limit", n.toString());
49962
- const o = `/addresses/${t}/inscriptions${i.toString() ? `?${i.toString()}` : ""}`, a = await this.call(
49963
- "get",
49964
- o
49965
- );
49963
+ async getAddressInscriptions(t, r = 0, n = 10) {
49964
+ let i, o = r, a = 100, s = null;
49965
+ for (; o > 0; ) {
49966
+ const f = Math.min(a, o), h = new URLSearchParams();
49967
+ h.append("count", f.toString()), i && h.append("cursor", i);
49968
+ const g = `/addresses/${t}/inscriptions?${h.toString()}`;
49969
+ if (s = await this.call("get", g), !s.next_cursor && o > f)
49970
+ return { ...s, data: [] };
49971
+ i = s.next_cursor, o -= f;
49972
+ }
49973
+ const c = new URLSearchParams();
49974
+ c.append("count", n.toString()), i && c.append("cursor", i);
49975
+ const l = `/addresses/${t}/inscriptions?${c.toString()}`, u = await this.call("get", l);
49966
49976
  return {
49967
- ...a,
49968
- data: a.data.map((s) => ({
49969
- ...s,
49977
+ ...u,
49978
+ data: u.data.map((f) => ({
49979
+ ...f,
49970
49980
  address: t
49971
49981
  }))
49972
49982
  };
@@ -135237,8 +135247,12 @@ class Lot {
135237
135247
  "Content-Type": "application/json",
135238
135248
  "api-key": this.apiKey
135239
135249
  }
135240
- };
135241
- return (t === "get" ? await ri.get(i, o) : await ri.post(i, n, o)).data;
135250
+ }, a = t === "get" ? await ri.get(i, o) : await ri.post(i, n, o);
135251
+ if (!a || !a.data)
135252
+ throw new Error(
135253
+ `Invalid response from Maestro API: ${JSON.stringify(a)}`
135254
+ );
135255
+ return a.data;
135242
135256
  } catch (o) {
135243
135257
  throw console.error("MaestroDataSource.call error:", o), o;
135244
135258
  }
@@ -135255,17 +135269,23 @@ class Lot {
135255
135269
  `/addresses/${t}/brc20`
135256
135270
  );
135257
135271
  }
135258
- async getAddressInscriptions(t, r, n) {
135259
- const i = new URLSearchParams();
135260
- r !== void 0 && i.append("offset", r.toString()), n !== void 0 && i.append("limit", n.toString());
135261
- const o = `/addresses/${t}/inscriptions${i.toString() ? `?${i.toString()}` : ""}`, a = await this.call(
135262
- "get",
135263
- o
135264
- );
135272
+ async getAddressInscriptions(t, r = 0, n = 10) {
135273
+ let i, o = r, a = 100, s = null;
135274
+ for (; o > 0; ) {
135275
+ const f = Math.min(a, o), h = new URLSearchParams();
135276
+ h.append("count", f.toString()), i && h.append("cursor", i);
135277
+ const g = `/addresses/${t}/inscriptions?${h.toString()}`;
135278
+ if (s = await this.call("get", g), !s.next_cursor && o > f)
135279
+ return { ...s, data: [] };
135280
+ i = s.next_cursor, o -= f;
135281
+ }
135282
+ const c = new URLSearchParams();
135283
+ c.append("count", n.toString()), i && c.append("cursor", i);
135284
+ const l = `/addresses/${t}/inscriptions?${c.toString()}`, u = await this.call("get", l);
135265
135285
  return {
135266
- ...a,
135267
- data: a.data.map((s) => ({
135268
- ...s,
135286
+ ...u,
135287
+ data: u.data.map((f) => ({
135288
+ ...f,
135269
135289
  address: t
135270
135290
  }))
135271
135291
  };
package/dist/ui.js CHANGED
@@ -52496,8 +52496,12 @@ class SPe {
52496
52496
  "Content-Type": "application/json",
52497
52497
  "api-key": this.apiKey
52498
52498
  }
52499
- };
52500
- return (t === "get" ? await Zn.get(i, o) : await Zn.post(i, n, o)).data;
52499
+ }, a = t === "get" ? await Zn.get(i, o) : await Zn.post(i, n, o);
52500
+ if (!a || !a.data)
52501
+ throw new Error(
52502
+ `Invalid response from Maestro API: ${JSON.stringify(a)}`
52503
+ );
52504
+ return a.data;
52501
52505
  } catch (o) {
52502
52506
  throw console.error("MaestroDataSource.call error:", o), o;
52503
52507
  }
@@ -52514,17 +52518,23 @@ class SPe {
52514
52518
  `/addresses/${t}/brc20`
52515
52519
  );
52516
52520
  }
52517
- async getAddressInscriptions(t, r, n) {
52518
- const i = new URLSearchParams();
52519
- r !== void 0 && i.append("offset", r.toString()), n !== void 0 && i.append("limit", n.toString());
52520
- const o = `/addresses/${t}/inscriptions${i.toString() ? `?${i.toString()}` : ""}`, a = await this.call(
52521
- "get",
52522
- o
52523
- );
52521
+ async getAddressInscriptions(t, r = 0, n = 10) {
52522
+ let i, o = r, a = 100, s = null;
52523
+ for (; o > 0; ) {
52524
+ const h = Math.min(a, o), f = new URLSearchParams();
52525
+ f.append("count", h.toString()), i && f.append("cursor", i);
52526
+ const g = `/addresses/${t}/inscriptions?${f.toString()}`;
52527
+ if (s = await this.call("get", g), !s.next_cursor && o > h)
52528
+ return { ...s, data: [] };
52529
+ i = s.next_cursor, o -= h;
52530
+ }
52531
+ const c = new URLSearchParams();
52532
+ c.append("count", n.toString()), i && c.append("cursor", i);
52533
+ const l = `/addresses/${t}/inscriptions?${c.toString()}`, u = await this.call("get", l);
52524
52534
  return {
52525
- ...a,
52526
- data: a.data.map((s) => ({
52527
- ...s,
52535
+ ...u,
52536
+ data: u.data.map((h) => ({
52537
+ ...h,
52528
52538
  address: t
52529
52539
  }))
52530
52540
  };
@@ -138250,8 +138260,12 @@ class Ett {
138250
138260
  "Content-Type": "application/json",
138251
138261
  "api-key": this.apiKey
138252
138262
  }
138253
- };
138254
- return (t === "get" ? await ji.get(i, o) : await ji.post(i, n, o)).data;
138263
+ }, a = t === "get" ? await ji.get(i, o) : await ji.post(i, n, o);
138264
+ if (!a || !a.data)
138265
+ throw new Error(
138266
+ `Invalid response from Maestro API: ${JSON.stringify(a)}`
138267
+ );
138268
+ return a.data;
138255
138269
  } catch (o) {
138256
138270
  throw console.error("MaestroDataSource.call error:", o), o;
138257
138271
  }
@@ -138268,17 +138282,23 @@ class Ett {
138268
138282
  `/addresses/${t}/brc20`
138269
138283
  );
138270
138284
  }
138271
- async getAddressInscriptions(t, r, n) {
138272
- const i = new URLSearchParams();
138273
- r !== void 0 && i.append("offset", r.toString()), n !== void 0 && i.append("limit", n.toString());
138274
- const o = `/addresses/${t}/inscriptions${i.toString() ? `?${i.toString()}` : ""}`, a = await this.call(
138275
- "get",
138276
- o
138277
- );
138285
+ async getAddressInscriptions(t, r = 0, n = 10) {
138286
+ let i, o = r, a = 100, s = null;
138287
+ for (; o > 0; ) {
138288
+ const h = Math.min(a, o), f = new URLSearchParams();
138289
+ f.append("count", h.toString()), i && f.append("cursor", i);
138290
+ const g = `/addresses/${t}/inscriptions?${f.toString()}`;
138291
+ if (s = await this.call("get", g), !s.next_cursor && o > h)
138292
+ return { ...s, data: [] };
138293
+ i = s.next_cursor, o -= h;
138294
+ }
138295
+ const c = new URLSearchParams();
138296
+ c.append("count", n.toString()), i && c.append("cursor", i);
138297
+ const l = `/addresses/${t}/inscriptions?${c.toString()}`, u = await this.call("get", l);
138278
138298
  return {
138279
- ...a,
138280
- data: a.data.map((s) => ({
138281
- ...s,
138299
+ ...u,
138300
+ data: u.data.map((h) => ({
138301
+ ...h,
138282
138302
  address: t
138283
138303
  }))
138284
138304
  };
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "url": "https://github.com/omnisat/lasereyes-mono.git"
21
21
  },
22
22
  "private": false,
23
- "version": "0.0.153-next.0",
23
+ "version": "0.0.153-next.2",
24
24
  "type": "module",
25
25
  "module": "./dist/index.js",
26
26
  "files": [
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "bip39": "^3.1.0",
43
- "@omnisat/lasereyes-react": "0.0.70-next.0",
44
- "@omnisat/lasereyes-core": "0.0.75-next.0",
45
- "@omnisat/lasereyes-ui": "0.0.12-next.0"
43
+ "@omnisat/lasereyes-core": "0.0.75-next.2",
44
+ "@omnisat/lasereyes-react": "0.0.70-next.2",
45
+ "@omnisat/lasereyes-ui": "0.0.12-next.2"
46
46
  },
47
47
  "license": "MIT",
48
48
  "publishConfig": {