@cardanowall/sdk-ts 0.5.0 → 0.6.0

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.js CHANGED
@@ -5324,13 +5324,13 @@ function readVarint(bytes, start) {
5324
5324
  function decodeMultibase(prefix, body) {
5325
5325
  switch (prefix) {
5326
5326
  case "b":
5327
- return decodeBase32(body.toLowerCase(), "rfc4648-lower");
5327
+ return decodeBase32(body, "rfc4648-lower");
5328
5328
  case "B":
5329
- return decodeBase32(body.toUpperCase(), "rfc4648-upper");
5329
+ return decodeBase32(body, "rfc4648-upper");
5330
5330
  case "f":
5331
- return decodeBase16(body.toLowerCase());
5331
+ return decodeBase16(body, "lower");
5332
5332
  case "F":
5333
- return decodeBase16(body.toUpperCase());
5333
+ return decodeBase16(body, "upper");
5334
5334
  case "z":
5335
5335
  return decodeBase58btc(body);
5336
5336
  default:
@@ -5339,10 +5339,10 @@ function decodeMultibase(prefix, body) {
5339
5339
  }
5340
5340
  var BASE16_LOWER = "0123456789abcdef";
5341
5341
  var BASE16_UPPER = "0123456789ABCDEF";
5342
- function decodeBase16(s) {
5342
+ function decodeBase16(s, variant) {
5343
5343
  if (s.length % 2 !== 0) throw new Error("base16: odd-length");
5344
+ const alphabet = variant === "lower" ? BASE16_LOWER : BASE16_UPPER;
5344
5345
  const out = new Uint8Array(s.length / 2);
5345
- const alphabet = s === s.toLowerCase() ? BASE16_LOWER : BASE16_UPPER;
5346
5346
  for (let i = 0; i < out.length; i++) {
5347
5347
  const hi = alphabet.indexOf(s[i * 2]);
5348
5348
  const lo = alphabet.indexOf(s[i * 2 + 1]);
@@ -9564,12 +9564,14 @@ var RecordsNamespace = class {
9564
9564
  * affected claims report `not_checked`.
9565
9565
  */
9566
9566
  async verify(txHash, input) {
9567
+ const body = {};
9568
+ if (input?.fetch_content !== void 0) body.fetch_content = input.fetch_content;
9567
9569
  const response = await this.config.fetch(
9568
9570
  `${this.config.baseUrl}/api/v1/records/${encodeURIComponent(txHash)}/verify`,
9569
9571
  {
9570
9572
  method: "POST",
9571
9573
  headers: buildHeaders2(this.config.apiKey),
9572
- body: JSON.stringify(input ?? {})
9574
+ body: JSON.stringify(body)
9573
9575
  }
9574
9576
  );
9575
9577
  await throwIfNotOk(response);