@cardanowall/sdk-ts 0.4.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]);
@@ -9578,16 +9578,22 @@ var RecordsNamespace = class {
9578
9578
  * between.
9579
9579
  *
9580
9580
  * Auth required (Bearer with `poe:read` scope, or NextAuth session
9581
- * cookie). Optional `verify_uris` toggles URI hash-equivalence checks;
9582
- * `decryption[]` drives trial-decrypt of sealed envelopes per item.
9581
+ * cookie). This is the hosted PUBLIC verifier: it accepts no decryption
9582
+ * credentials, and sealed items report as unverifiable without decryption.
9583
+ * To verify as a recipient (decrypt + plaintext-hash recheck), run the
9584
+ * `verifier` module locally with its `decryption` input — keys never leave
9585
+ * the process. Optional `fetch_content: false` skips content re-fetching;
9586
+ * affected claims report `not_checked`.
9583
9587
  */
9584
9588
  async verify(txHash, input) {
9589
+ const body = {};
9590
+ if (input?.fetch_content !== void 0) body.fetch_content = input.fetch_content;
9585
9591
  const response = await this.config.fetch(
9586
9592
  `${this.config.baseUrl}/api/v1/records/${encodeURIComponent(txHash)}/verify`,
9587
9593
  {
9588
9594
  method: "POST",
9589
9595
  headers: buildHeaders2(this.config.apiKey),
9590
- body: JSON.stringify(input ?? {})
9596
+ body: JSON.stringify(body)
9591
9597
  }
9592
9598
  );
9593
9599
  await throwIfNotOk(response);