@fangorn-network/sdk 2026.10.20-dev → 2026.10.22-dev

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 (48) hide show
  1. package/README.md +23 -20
  2. package/lib/cli/cli.d.ts +0 -0
  3. package/lib/cli/cli.js +19 -55
  4. package/lib/cli/index.d.ts +2 -2
  5. package/lib/cli/index.js +3 -3
  6. package/lib/config.d.ts +420 -83
  7. package/lib/config.js +13 -5
  8. package/lib/contracts/membership-registry/index.d.ts +1 -1
  9. package/lib/contracts/membership-registry/index.js +1 -1
  10. package/lib/engine/index.d.ts +2 -16
  11. package/lib/engine/index.js +2 -18
  12. package/lib/erc8004.d.ts +56 -0
  13. package/lib/erc8004.js +143 -0
  14. package/lib/fangorn.d.ts +22 -7
  15. package/lib/fangorn.js +69 -8
  16. package/lib/index.d.ts +2 -2
  17. package/lib/index.js +2 -2
  18. package/lib/node_modules/{@jridgewell → .pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell}/sourcemap-codec/dist/sourcemap-codec.js +1 -1
  19. package/lib/node_modules/{@vitest → .pnpm/@vitest_expect@4.0.18/node_modules/@vitest}/expect/dist/index.js +8 -8
  20. package/lib/node_modules/{@vitest → .pnpm/@vitest_pretty-format@4.0.18/node_modules/@vitest}/pretty-format/dist/index.js +2 -2
  21. package/lib/node_modules/{@vitest → .pnpm/@vitest_runner@4.0.18/node_modules/@vitest}/runner/dist/chunk-tasks.js +2 -2
  22. package/lib/node_modules/{@vitest → .pnpm/@vitest_runner@4.0.18/node_modules/@vitest}/runner/dist/index.js +4 -4
  23. package/lib/node_modules/{@vitest → .pnpm/@vitest_snapshot@4.0.18/node_modules/@vitest}/snapshot/dist/index.js +4 -4
  24. package/lib/node_modules/{@vitest → .pnpm/@vitest_spy@4.0.18/node_modules/@vitest}/spy/dist/index.js +1 -1
  25. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/chunk-_commonjsHelpers.js +1 -1
  26. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/chunk-pathe.M-eThtNZ.js +1 -1
  27. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/diff.js +3 -3
  28. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/display.js +2 -2
  29. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/error.js +2 -2
  30. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/helpers.js +1 -1
  31. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/serialize.js +1 -1
  32. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/source-map.js +1 -1
  33. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/timers.js +1 -1
  34. package/lib/node_modules/{chai → .pnpm/chai@6.2.2/node_modules/chai}/index.js +1 -1
  35. package/lib/node_modules/{magic-string → .pnpm/magic-string@0.30.21/node_modules/magic-string}/dist/magic-string.es.js +2 -2
  36. package/lib/node_modules/{pathe → .pnpm/pathe@2.0.3/node_modules/pathe}/dist/shared/pathe.M-eThtNZ.js +1 -1
  37. package/lib/node_modules/{tinyrainbow → .pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow}/dist/index.js +1 -1
  38. package/lib/node_modules/{vitest → .pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest}/dist/chunks/_commonjsHelpers.D26ty3Ew.js +1 -1
  39. package/lib/node_modules/{vitest → .pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest}/dist/chunks/date.Bq6ZW5rf.js +1 -1
  40. package/lib/node_modules/{vitest → .pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest}/dist/chunks/utils.DvEY5TfP.js +2 -2
  41. package/lib/node_modules/{vitest → .pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest}/dist/chunks/vi.2VT5v0um.js +11 -11
  42. package/lib/providers/storage/signed-url.d.ts +4 -4
  43. package/lib/providers/storage/signed-url.js +5 -4
  44. package/lib/test/sdk-suite.js +2 -2
  45. package/lib/test/testbed.d.ts +6107 -5730
  46. package/lib/test/testbed.js +5 -1
  47. package/package.json +75 -89
  48. /package/lib/node_modules/{@vitest → .pnpm/@vitest_runner@4.0.18/node_modules/@vitest}/runner/dist/utils.js +0 -0
@@ -1,7 +1,7 @@
1
- import { format, plugins } from "../../pretty-format/dist/index.js";
2
- import { resolve } from "../../../pathe/dist/shared/pathe.M-eThtNZ.js";
1
+ import { format, plugins } from "../../../../../@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.js";
2
+ import { resolve } from "../../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js";
3
3
 
4
- //#region node_modules/@vitest/snapshot/dist/index.js
4
+ //#region node_modules/.pnpm/@vitest+snapshot@4.0.18/node_modules/@vitest/snapshot/dist/index.js
5
5
  var comma = ",".charCodeAt(0);
6
6
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
7
7
  var intToChar = new Uint8Array(64);
@@ -420,7 +420,7 @@ function offsetToLineNumber(source, offset) {
420
420
  return line + 1;
421
421
  }
422
422
  async function saveInlineSnapshots(environment, snapshots) {
423
- const MagicString = (await import("../../../magic-string/dist/magic-string.es.js")).default;
423
+ const MagicString = (await import("../../../../../magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js")).default;
424
424
  const files = new Set(snapshots.map((i) => i.file));
425
425
  await Promise.all(Array.from(files).map(async (file) => {
426
426
  const snaps = snapshots.filter((i) => i.file === file);
@@ -1,4 +1,4 @@
1
- //#region node_modules/@vitest/spy/dist/index.js
1
+ //#region node_modules/.pnpm/@vitest+spy@4.0.18/node_modules/@vitest/spy/dist/index.js
2
2
  function isMockFunction(fn$1) {
3
3
  return typeof fn$1 === "function" && "_isMockFunction" in fn$1 && fn$1._isMockFunction === true;
4
4
  }
@@ -1,4 +1,4 @@
1
- //#region node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
1
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
2
2
  function getDefaultExportFromCjs(x) {
3
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
4
  }
@@ -1,4 +1,4 @@
1
- //#region node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
1
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
2
2
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
3
  function normalizeWindowsPath(input = "") {
4
4
  if (!input) return input;
@@ -1,10 +1,10 @@
1
- import { C } from "../../../tinyrainbow/dist/index.js";
2
- import { format, plugins } from "../../pretty-format/dist/index.js";
1
+ import { C } from "../../../../../tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js";
2
+ import { format, plugins } from "../../../../../@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.js";
3
3
  import { stringify } from "./display.js";
4
4
  import { deepClone, getOwnProperties, getType } from "./helpers.js";
5
5
  import { getDefaultExportFromCjs } from "./chunk-_commonjsHelpers.js";
6
6
 
7
- //#region node_modules/@vitest/utils/dist/diff.js
7
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/diff.js
8
8
  /**
9
9
  * Diff Match and Patch
10
10
  * Copyright 2018 The diff-match-patch Authors.
@@ -1,6 +1,6 @@
1
- import { format, plugins } from "../../pretty-format/dist/index.js";
1
+ import { format, plugins } from "../../../../../@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.js";
2
2
 
3
- //#region node_modules/@vitest/utils/dist/display.js
3
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/display.js
4
4
  const ansiColors = {
5
5
  bold: ["1", "22"],
6
6
  dim: ["2", "22"],
@@ -1,9 +1,9 @@
1
- import "../../../tinyrainbow/dist/index.js";
1
+ import "../../../../../tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js";
2
2
  import { stringify } from "./display.js";
3
3
  import { printDiffOrStringify } from "./diff.js";
4
4
  import { serializeValue } from "./serialize.js";
5
5
 
6
- //#region node_modules/@vitest/utils/dist/error.js
6
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/error.js
7
7
  function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
8
8
  if (!_err || typeof _err !== "object") return { message: String(_err) };
9
9
  const err = _err;
@@ -1,4 +1,4 @@
1
- //#region node_modules/@vitest/utils/dist/helpers.js
1
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/helpers.js
2
2
  /**
3
3
  * Get original stacktrace without source map support the most performant way.
4
4
  * - Create only 1 stack frame.
@@ -1,4 +1,4 @@
1
- //#region node_modules/@vitest/utils/dist/serialize.js
1
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/serialize.js
2
2
  const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
3
3
  const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
4
4
  function isImmutable(v) {
@@ -1,6 +1,6 @@
1
1
  import { resolve } from "./chunk-pathe.M-eThtNZ.js";
2
2
 
3
- //#region node_modules/@vitest/utils/dist/source-map.js
3
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/source-map.js
4
4
  var comma = ",".charCodeAt(0);
5
5
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
6
  var intToChar = new Uint8Array(64);
@@ -1,4 +1,4 @@
1
- //#region node_modules/@vitest/utils/dist/timers.js
1
+ //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/timers.js
2
2
  const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
3
3
  function getSafeTimers() {
4
4
  const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
@@ -1,4 +1,4 @@
1
- //#region node_modules/chai/index.js
1
+ //#region node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.js
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
4
4
  enumerable: true,
@@ -1,6 +1,6 @@
1
- import { encode } from "../../@jridgewell/sourcemap-codec/dist/sourcemap-codec.js";
1
+ import { encode } from "../../../../@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js";
2
2
 
3
- //#region node_modules/magic-string/dist/magic-string.es.mjs
3
+ //#region node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
4
4
  var BitSet = class BitSet {
5
5
  constructor(arg) {
6
6
  this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
@@ -1,4 +1,4 @@
1
- //#region node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
1
+ //#region node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
2
2
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
3
  function normalizeWindowsPath(input = "") {
4
4
  if (!input) return input;
@@ -1,4 +1,4 @@
1
- //#region node_modules/tinyrainbow/dist/index.js
1
+ //#region node_modules/.pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js
2
2
  var d = {
3
3
  reset: [0, 0],
4
4
  bold: [
@@ -1,4 +1,4 @@
1
- //#region node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js
1
+ //#region node_modules/.pnpm/vitest@4.0.18_@types+node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js
2
2
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3
3
 
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- //#region node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
1
+ //#region node_modules/.pnpm/vitest@4.0.18_@types+node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
2
2
  const RealDate = Date;
3
3
  let now = null;
4
4
  var MockDate = class MockDate extends RealDate {
@@ -1,6 +1,6 @@
1
- import { getSafeTimers } from "../../../@vitest/utils/dist/timers.js";
1
+ import { getSafeTimers } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/timers.js";
2
2
 
3
- //#region node_modules/vitest/dist/chunks/utils.DvEY5TfP.js
3
+ //#region node_modules/.pnpm/vitest@4.0.18_@types+node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/chunks/utils.DvEY5TfP.js
4
4
  const NAME_WORKER_STATE = "__vitest_worker__";
5
5
  function getWorkerState() {
6
6
  const workerState = globalThis[NAME_WORKER_STATE];
@@ -1,18 +1,18 @@
1
- import { assertTypes, createSimpleStackTrace } from "../../../@vitest/utils/dist/helpers.js";
2
- import { clearAllMocks, fn, isMockFunction, resetAllMocks, restoreAllMocks, spyOn } from "../../../@vitest/spy/dist/index.js";
3
- import { Assertion, assert as assert$1, expect, should as should$1, use, utils_exports } from "../../../chai/index.js";
4
- import { ASYMMETRIC_MATCHERS_OBJECT, GLOBAL_EXPECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, addCustomEqualityTesters, customMatchers, equals, getState, iterableEquality, setState, subsetEquality } from "../../../@vitest/expect/dist/index.js";
5
- import { delay, getSafeTimers } from "../../../@vitest/utils/dist/timers.js";
6
- import { parseSingleStack } from "../../../@vitest/utils/dist/source-map.js";
7
- import { getNames } from "../../../@vitest/runner/dist/chunk-tasks.js";
8
- import { getCurrentTest } from "../../../@vitest/runner/dist/index.js";
1
+ import { assertTypes, createSimpleStackTrace } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/helpers.js";
2
+ import { clearAllMocks, fn, isMockFunction, resetAllMocks, restoreAllMocks, spyOn } from "../../../../../@vitest_spy@4.0.18/node_modules/@vitest/spy/dist/index.js";
3
+ import { Assertion, assert as assert$1, expect, should as should$1, use, utils_exports } from "../../../../../chai@6.2.2/node_modules/chai/index.js";
4
+ import { ASYMMETRIC_MATCHERS_OBJECT, GLOBAL_EXPECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, addCustomEqualityTesters, customMatchers, equals, getState, iterableEquality, setState, subsetEquality } from "../../../../../@vitest_expect@4.0.18/node_modules/@vitest/expect/dist/index.js";
5
+ import { delay, getSafeTimers } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/timers.js";
6
+ import { parseSingleStack } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/source-map.js";
7
+ import { getNames } from "../../../../../@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/chunk-tasks.js";
8
+ import { getCurrentTest } from "../../../../../@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/index.js";
9
9
  import { getWorkerState, isChildProcess, resetModules, waitForImportsToResolve } from "./utils.DvEY5TfP.js";
10
- import "../../../@vitest/runner/dist/utils.js";
11
- import { SnapshotClient, addSerializer, stripSnapshotIndentation } from "../../../@vitest/snapshot/dist/index.js";
10
+ import "../../../../../@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/utils.js";
11
+ import { SnapshotClient, addSerializer, stripSnapshotIndentation } from "../../../../../@vitest_snapshot@4.0.18/node_modules/@vitest/snapshot/dist/index.js";
12
12
  import { commonjsGlobal } from "./_commonjsHelpers.D26ty3Ew.js";
13
13
  import { RealDate, mockDate, resetDate } from "./date.Bq6ZW5rf.js";
14
14
 
15
- //#region node_modules/vitest/dist/chunks/vi.2VT5v0um.js
15
+ //#region node_modules/.pnpm/vitest@4.0.18_@types+node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.2VT5v0um.js
16
16
  const unsupported = [
17
17
  "matchSnapshot",
18
18
  "toMatchSnapshot",
@@ -4,11 +4,11 @@ import { Hex } from "viem";
4
4
  //#region src/providers/storage/signed-url.d.ts
5
5
 
6
6
  /**
7
- * The hosted pinata-url-provider worker. Used when no worker URL is supplied, so
8
- * callers can upload via signed URLs with zero configuration. Point at your own
9
- * deployment by passing a workerUrl.
7
+ * The hosted worker for the default network (Base Sepolia). Used when neither
8
+ * a worker URL nor the network's config names one. `Fangorn.create` passes the
9
+ * config's `signedUrlWorker`, so a Base client reaches Base's worker.
10
10
  */
11
- declare const DEFAULT_SIGNED_URL_WORKER = "https://pinata-url-provider.fangorn-0be.workers.dev";
11
+ declare const DEFAULT_SIGNED_URL_WORKER: string;
12
12
  /** Just enough of a wallet to run the worker's ownership handshake. */
13
13
  interface SignedUrlSigner {
14
14
  address: Hex;
@@ -1,12 +1,13 @@
1
+ import { FangornConfig } from "../../config.js";
1
2
  import { fetchRawByCid, serialize, withUploadRetry } from "./utils.js";
2
3
 
3
4
  //#region src/providers/storage/signed-url.ts
4
5
  /**
5
- * The hosted pinata-url-provider worker. Used when no worker URL is supplied, so
6
- * callers can upload via signed URLs with zero configuration. Point at your own
7
- * deployment by passing a workerUrl.
6
+ * The hosted worker for the default network (Base Sepolia). Used when neither
7
+ * a worker URL nor the network's config names one. `Fangorn.create` passes the
8
+ * config's `signedUrlWorker`, so a Base client reaches Base's worker.
8
9
  */
9
- const DEFAULT_SIGNED_URL_WORKER = "https://pinata-url-provider.fangorn-0be.workers.dev";
10
+ const DEFAULT_SIGNED_URL_WORKER = FangornConfig.signedUrlWorker;
10
11
  /** A human-readable reason from a worker error response, detail included. */
11
12
  function workerError(r) {
12
13
  const base = r.error ?? "unknown error";
@@ -1,7 +1,7 @@
1
1
  import { ZERO_HEAD } from "../registry.js";
2
2
  import { GADGET_SELF_HKDF_V1, sealSelf, unsealSelf } from "../crypto/encryption.js";
3
- import { afterAll, beforeAll, describe, it } from "../node_modules/@vitest/runner/dist/index.js";
4
- import { globalExpect } from "../node_modules/vitest/dist/chunks/vi.2VT5v0um.js";
3
+ import { afterAll, beforeAll, describe, it } from "../node_modules/.pnpm/@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/index.js";
4
+ import { globalExpect } from "../node_modules/.pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.2VT5v0um.js";
5
5
  import { TEST_APP } from "./testbed.js";
6
6
  import { bytesToHex, hexToBytes, keccak256, stringToBytes } from "viem";
7
7
  import { generatePrivateKey } from "viem/accounts";