@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.cjs CHANGED
@@ -5346,13 +5346,13 @@ function readVarint(bytes, start) {
5346
5346
  function decodeMultibase(prefix, body) {
5347
5347
  switch (prefix) {
5348
5348
  case "b":
5349
- return decodeBase32(body.toLowerCase(), "rfc4648-lower");
5349
+ return decodeBase32(body, "rfc4648-lower");
5350
5350
  case "B":
5351
- return decodeBase32(body.toUpperCase(), "rfc4648-upper");
5351
+ return decodeBase32(body, "rfc4648-upper");
5352
5352
  case "f":
5353
- return decodeBase16(body.toLowerCase());
5353
+ return decodeBase16(body, "lower");
5354
5354
  case "F":
5355
- return decodeBase16(body.toUpperCase());
5355
+ return decodeBase16(body, "upper");
5356
5356
  case "z":
5357
5357
  return decodeBase58btc(body);
5358
5358
  default:
@@ -5361,10 +5361,10 @@ function decodeMultibase(prefix, body) {
5361
5361
  }
5362
5362
  var BASE16_LOWER = "0123456789abcdef";
5363
5363
  var BASE16_UPPER = "0123456789ABCDEF";
5364
- function decodeBase16(s) {
5364
+ function decodeBase16(s, variant) {
5365
5365
  if (s.length % 2 !== 0) throw new Error("base16: odd-length");
5366
+ const alphabet = variant === "lower" ? BASE16_LOWER : BASE16_UPPER;
5366
5367
  const out = new Uint8Array(s.length / 2);
5367
- const alphabet = s === s.toLowerCase() ? BASE16_LOWER : BASE16_UPPER;
5368
5368
  for (let i = 0; i < out.length; i++) {
5369
5369
  const hi = alphabet.indexOf(s[i * 2]);
5370
5370
  const lo = alphabet.indexOf(s[i * 2 + 1]);
@@ -9586,12 +9586,14 @@ var RecordsNamespace = class {
9586
9586
  * affected claims report `not_checked`.
9587
9587
  */
9588
9588
  async verify(txHash, input) {
9589
+ const body = {};
9590
+ if (input?.fetch_content !== void 0) body.fetch_content = input.fetch_content;
9589
9591
  const response = await this.config.fetch(
9590
9592
  `${this.config.baseUrl}/api/v1/records/${encodeURIComponent(txHash)}/verify`,
9591
9593
  {
9592
9594
  method: "POST",
9593
9595
  headers: buildHeaders2(this.config.apiKey),
9594
- body: JSON.stringify(input ?? {})
9596
+ body: JSON.stringify(body)
9595
9597
  }
9596
9598
  );
9597
9599
  await throwIfNotOk(response);