@fleet-sdk/blockchain-providers 0.8.2 → 0.8.3

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.mjs CHANGED
@@ -3,7 +3,7 @@ import { ErgoAddress } from '@fleet-sdk/core';
3
3
 
4
4
  // src/ergo-graphql/ergoGraphQLProvider.ts
5
5
 
6
- // ../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/_assert.js
6
+ // ../../node_modules/.pnpm/@noble+hashes@1.7.2/node_modules/@noble/hashes/esm/_assert.js
7
7
  function isBytes(a) {
8
8
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
9
9
  }
@@ -27,13 +27,17 @@ function aoutput(out, instance) {
27
27
  }
28
28
  }
29
29
 
30
- // ../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/utils.js
30
+ // ../../node_modules/.pnpm/@noble+hashes@1.7.2/node_modules/@noble/hashes/esm/utils.js
31
31
  function createView(arr) {
32
32
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
33
33
  }
34
34
  function rotr(word, shift) {
35
35
  return word << 32 - shift | word >>> shift;
36
36
  }
37
+ (
38
+ // @ts-ignore
39
+ typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
40
+ );
37
41
  function utf8ToBytes(str) {
38
42
  if (typeof str !== "string")
39
43
  throw new Error("utf8ToBytes expected string, got " + typeof str);
@@ -60,7 +64,7 @@ function wrapConstructor(hashCons) {
60
64
  return hashC;
61
65
  }
62
66
 
63
- // ../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/_md.js
67
+ // ../../node_modules/.pnpm/@noble+hashes@1.7.2/node_modules/@noble/hashes/esm/_md.js
64
68
  function setBigUint64(view, byteOffset, value, isLE) {
65
69
  if (typeof view.setBigUint64 === "function")
66
70
  return view.setBigUint64(byteOffset, value, isLE);
@@ -82,14 +86,14 @@ function Maj(a, b, c) {
82
86
  var HashMD = class extends Hash {
83
87
  constructor(blockLen, outputLen, padOffset, isLE) {
84
88
  super();
85
- this.blockLen = blockLen;
86
- this.outputLen = outputLen;
87
- this.padOffset = padOffset;
88
- this.isLE = isLE;
89
89
  this.finished = false;
90
90
  this.length = 0;
91
91
  this.pos = 0;
92
92
  this.destroyed = false;
93
+ this.blockLen = blockLen;
94
+ this.outputLen = outputLen;
95
+ this.padOffset = padOffset;
96
+ this.isLE = isLE;
93
97
  this.buffer = new Uint8Array(blockLen);
94
98
  this.view = createView(this.buffer);
95
99
  }
@@ -166,7 +170,7 @@ var HashMD = class extends Hash {
166
170
  }
167
171
  };
168
172
 
169
- // ../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/sha256.js
173
+ // ../../node_modules/.pnpm/@noble+hashes@1.7.2/node_modules/@noble/hashes/esm/sha256.js
170
174
  var SHA256_K = /* @__PURE__ */ new Uint32Array([
171
175
  1116352408,
172
176
  1899447441,
@@ -245,8 +249,8 @@ var SHA256_IV = /* @__PURE__ */ new Uint32Array([
245
249
  ]);
246
250
  var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
247
251
  var SHA256 = class extends HashMD {
248
- constructor() {
249
- super(64, 32, 8, false);
252
+ constructor(outputLen = 32) {
253
+ super(64, outputLen, 8, false);
250
254
  this.A = SHA256_IV[0] | 0;
251
255
  this.B = SHA256_IV[1] | 0;
252
256
  this.C = SHA256_IV[2] | 0;
@@ -385,7 +389,7 @@ function alphabet(letters) {
385
389
  return input.map((letter) => {
386
390
  astr("alphabet.decode", letter);
387
391
  const i = indexes.get(letter);
388
- if (i === undefined)
392
+ if (i === void 0)
389
393
  throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`);
390
394
  return i;
391
395
  });
@@ -629,7 +633,7 @@ function createGqlOperation(query, options) {
629
633
  body: (options?.parser ?? JSON).stringify({
630
634
  operationName: getOpName(query),
631
635
  query,
632
- variables: variables ? clearUndefined(variables) : undefined
636
+ variables: variables ? clearUndefined(variables) : void 0
633
637
  })
634
638
  }
635
639
  });
@@ -850,7 +854,7 @@ function buildGqlBoxQueries(query) {
850
854
  );
851
855
  const baseQuery = {
852
856
  spent: false,
853
- boxIds: query.where.boxId ? [query.where.boxId] : undefined,
857
+ boxIds: query.where.boxId ? [query.where.boxId] : void 0,
854
858
  ergoTreeTemplateHash: query.where.templateHash,
855
859
  tokenId: query.where.tokenId,
856
860
  skip: query.skip ?? 0,
@@ -870,7 +874,7 @@ function buildGqlUnconfirmedTxQueries(query) {
870
874
  ].flat()
871
875
  );
872
876
  const baseQuery = {
873
- transactionIds: query.where.transactionId ? [query.where.transactionId] : undefined,
877
+ transactionIds: query.where.transactionId ? [query.where.transactionId] : void 0,
874
878
  skip: query.skip ?? 0,
875
879
  take: query.take ?? PAGE_SIZE
876
880
  };
@@ -962,7 +966,7 @@ function mapConfirmedTransaction(tx, mapper) {
962
966
  };
963
967
  }
964
968
  function isRequestParam(obj) {
965
- return typeof obj === "object" && obj.url !== undefined;
969
+ return typeof obj === "object" && obj.url !== void 0;
966
970
  }
967
971
  /*! Bundled license information:
968
972