@fangorn-network/sdk 2026.9.22-dev → 2026.10.19-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.
- package/README.md +177 -192
- package/lib/cli/cli.d.ts +0 -0
- package/lib/cli/cli.js +165 -194
- package/lib/config.d.ts +32 -27
- package/lib/config.js +17 -7
- package/lib/contracts/app-registry/abi.d.ts +1033 -277
- package/lib/contracts/app-registry/abi.js +1214 -335
- package/lib/contracts/app-registry/index.d.ts +105 -65
- package/lib/contracts/app-registry/index.js +182 -175
- package/lib/contracts/data-registry/abi.d.ts +166 -187
- package/lib/contracts/data-registry/abi.js +207 -237
- package/lib/contracts/data-registry/index.d.ts +4 -151
- package/lib/contracts/data-registry/index.js +5 -279
- package/lib/contracts/index.d.ts +6 -7
- package/lib/contracts/index.js +6 -8
- package/lib/contracts/logs.d.ts +4 -1
- package/lib/contracts/logs.js +9 -2
- package/lib/contracts/membership-registry/abi.d.ts +1145 -0
- package/lib/contracts/membership-registry/abi.js +1333 -0
- package/lib/contracts/membership-registry/index.d.ts +79 -0
- package/lib/contracts/membership-registry/index.js +104 -0
- package/lib/contracts/types.d.ts +3 -1
- package/lib/contracts/types.js +3 -1
- package/lib/contracts/write.d.ts +34 -2
- package/lib/contracts/write.js +48 -1
- package/lib/crypto/encryption.js +4 -4
- package/lib/engine/car.d.ts +2 -2
- package/lib/engine/car.js +10 -5
- package/lib/engine/index.d.ts +99 -143
- package/lib/engine/index.js +156 -295
- package/lib/engine/records.d.ts +110 -0
- package/lib/engine/records.js +165 -0
- package/lib/engine/test-helpers.d.ts +7 -14
- package/lib/engine/test-helpers.js +7 -18
- package/lib/fangorn.d.ts +129 -156
- package/lib/fangorn.js +250 -250
- package/lib/feed.d.ts +7 -4
- package/lib/feed.js +4 -1
- package/lib/index.d.ts +9 -9
- package/lib/index.js +8 -9
- package/lib/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +77 -0
- package/lib/node_modules/@vitest/expect/dist/index.js +1414 -0
- package/lib/node_modules/@vitest/pretty-format/dist/index.js +858 -0
- package/lib/node_modules/@vitest/runner/dist/chunk-tasks.js +51 -0
- package/lib/node_modules/@vitest/runner/dist/index.js +1199 -0
- package/lib/node_modules/@vitest/runner/dist/utils.js +3 -0
- package/lib/node_modules/@vitest/snapshot/dist/index.js +1075 -0
- package/lib/node_modules/@vitest/spy/dist/index.js +353 -0
- package/lib/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +7 -0
- package/lib/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +81 -0
- package/lib/node_modules/@vitest/utils/dist/diff.js +1345 -0
- package/lib/node_modules/@vitest/utils/dist/display.js +534 -0
- package/lib/node_modules/@vitest/utils/dist/error.js +30 -0
- package/lib/node_modules/@vitest/utils/dist/helpers.js +118 -0
- package/lib/node_modules/@vitest/utils/dist/serialize.js +76 -0
- package/lib/node_modules/@vitest/utils/dist/source-map.js +93 -0
- package/lib/node_modules/@vitest/utils/dist/timers.js +36 -0
- package/lib/node_modules/chai/index.js +2874 -0
- package/lib/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/lib/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +81 -0
- package/lib/node_modules/tinyrainbow/dist/index.js +85 -0
- package/lib/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +5 -0
- package/lib/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +50 -0
- package/lib/node_modules/vitest/dist/chunks/utils.DvEY5TfP.js +44 -0
- package/lib/node_modules/vitest/dist/chunks/vi.2VT5v0um.js +2578 -0
- package/lib/providers/storage/signed-url.d.ts +16 -6
- package/lib/providers/storage/signed-url.js +20 -8
- package/lib/registry.d.ts +116 -0
- package/lib/registry.js +182 -0
- package/lib/test/mem-registry.d.ts +51 -0
- package/lib/test/mem-registry.js +107 -0
- package/lib/test/sdk-suite.d.ts +13 -0
- package/lib/test/sdk-suite.js +226 -0
- package/lib/test/testbed.d.ts +16411 -61
- package/lib/test/testbed.js +190 -84
- package/lib/types/index.d.ts +13 -11
- package/package.json +89 -73
- package/lib/contracts/data-registry/test.d.ts +0 -1
- package/lib/contracts/data-registry/test.js +0 -1
- package/lib/contracts/settlement-registry/abi.d.ts +0 -466
- package/lib/contracts/settlement-registry/abi.js +0 -535
- package/lib/contracts/settlement-registry/index.d.ts +0 -163
- package/lib/contracts/settlement-registry/index.js +0 -264
- package/lib/contracts/subscription-registry/abi.d.ts +0 -179
- package/lib/contracts/subscription-registry/abi.js +0 -195
- package/lib/contracts/subscription-registry/index.d.ts +0 -59
- package/lib/contracts/subscription-registry/index.js +0 -116
- package/lib/engine/graph.d.ts +0 -70
- package/lib/engine/graph.js +0 -73
package/lib/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as viem5596 from "viem";
|
|
2
2
|
import { Chain, Hex } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/config.d.ts
|
|
@@ -6,7 +6,12 @@ import { Chain, Hex } from "viem";
|
|
|
6
6
|
* Derive an app id from a human-readable name (keccak256(hex(name)).
|
|
7
7
|
*/
|
|
8
8
|
declare function appId(name: string): Hex;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Blank input means "not set", never an app called "". Returns the trimmed value,
|
|
11
|
+
* or undefined when it is missing or only whitespace, so it can sit on the left of
|
|
12
|
+
* a `??` fallback. `??` on the raw value would let "" through: it is not nullish.
|
|
13
|
+
*/
|
|
14
|
+
declare function nonBlank(value: string | undefined): string | undefined;
|
|
10
15
|
declare function toAppId(nameOrId: string): Hex;
|
|
11
16
|
/**
|
|
12
17
|
* The networks supported by Fangorn currently
|
|
@@ -47,17 +52,17 @@ declare const SupportedNetworks: {
|
|
|
47
52
|
testnet: true;
|
|
48
53
|
custom?: Record<string, unknown> | undefined;
|
|
49
54
|
extendSchema?: Record<string, unknown> | undefined;
|
|
50
|
-
fees?:
|
|
55
|
+
fees?: viem5596.ChainFees<undefined> | undefined;
|
|
51
56
|
formatters?: undefined;
|
|
52
|
-
prepareTransactionRequest?: ((args:
|
|
57
|
+
prepareTransactionRequest?: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
53
58
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
54
|
-
}) => Promise<
|
|
59
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | [fn: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
55
60
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
56
|
-
}) => Promise<
|
|
61
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
57
62
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
58
63
|
}] | undefined;
|
|
59
|
-
serializers?:
|
|
60
|
-
verifyHash?: ((client:
|
|
64
|
+
serializers?: viem5596.ChainSerializers<undefined, viem5596.TransactionSerializable> | undefined;
|
|
65
|
+
verifyHash?: ((client: viem5596.Client, parameters: viem5596.VerifyHashActionParameters) => Promise<viem5596.VerifyHashActionReturnType>) | undefined;
|
|
61
66
|
};
|
|
62
67
|
};
|
|
63
68
|
};
|
|
@@ -99,33 +104,33 @@ declare function getNetwork(name: string): {
|
|
|
99
104
|
testnet: true;
|
|
100
105
|
custom?: Record<string, unknown> | undefined;
|
|
101
106
|
extendSchema?: Record<string, unknown> | undefined;
|
|
102
|
-
fees?:
|
|
107
|
+
fees?: viem5596.ChainFees<undefined> | undefined;
|
|
103
108
|
formatters?: undefined;
|
|
104
|
-
prepareTransactionRequest?: ((args:
|
|
109
|
+
prepareTransactionRequest?: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
105
110
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
106
|
-
}) => Promise<
|
|
111
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | [fn: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
107
112
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
108
|
-
}) => Promise<
|
|
113
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
109
114
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
110
115
|
}] | undefined;
|
|
111
|
-
serializers?:
|
|
112
|
-
verifyHash?: ((client:
|
|
116
|
+
serializers?: viem5596.ChainSerializers<undefined, viem5596.TransactionSerializable> | undefined;
|
|
117
|
+
verifyHash?: ((client: viem5596.Client, parameters: viem5596.VerifyHashActionParameters) => Promise<viem5596.VerifyHashActionReturnType>) | undefined;
|
|
113
118
|
};
|
|
114
119
|
interface AppConfig {
|
|
115
120
|
dataRegistryContractAddress: Hex;
|
|
116
121
|
appRegistryContractAddress: Hex;
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
membershipRegistryContractAddress: Hex;
|
|
123
|
+
appRegistryFromBlock: bigint;
|
|
119
124
|
chain: Chain;
|
|
120
125
|
rpcUrl: string;
|
|
121
126
|
caip2: number;
|
|
122
127
|
ipfsGateway: string;
|
|
123
128
|
}
|
|
124
129
|
declare const FangornConfig: {
|
|
125
|
-
dataRegistryContractAddress: "
|
|
126
|
-
appRegistryContractAddress: "
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
dataRegistryContractAddress: "0x72B5f83526F3893aF9f1eE0f32A27218EA09f8aE";
|
|
131
|
+
appRegistryContractAddress: "0x55e6209ea1833ceD900989a3b3b22466934E04A5";
|
|
132
|
+
membershipRegistryContractAddress: "0xDF17030Cd65435C86eb043F31DDACa99E819E347";
|
|
133
|
+
appRegistryFromBlock: bigint;
|
|
129
134
|
chain: {
|
|
130
135
|
blockExplorers: {
|
|
131
136
|
readonly default: {
|
|
@@ -159,21 +164,21 @@ declare const FangornConfig: {
|
|
|
159
164
|
testnet: true;
|
|
160
165
|
custom?: Record<string, unknown> | undefined;
|
|
161
166
|
extendSchema?: Record<string, unknown> | undefined;
|
|
162
|
-
fees?:
|
|
167
|
+
fees?: viem5596.ChainFees<undefined> | undefined;
|
|
163
168
|
formatters?: undefined;
|
|
164
|
-
prepareTransactionRequest?: ((args:
|
|
169
|
+
prepareTransactionRequest?: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
165
170
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
166
|
-
}) => Promise<
|
|
171
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | [fn: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
167
172
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
168
|
-
}) => Promise<
|
|
173
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
169
174
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
170
175
|
}] | undefined;
|
|
171
|
-
serializers?:
|
|
172
|
-
verifyHash?: ((client:
|
|
176
|
+
serializers?: viem5596.ChainSerializers<undefined, viem5596.TransactionSerializable> | undefined;
|
|
177
|
+
verifyHash?: ((client: viem5596.Client, parameters: viem5596.VerifyHashActionParameters) => Promise<viem5596.VerifyHashActionReturnType>) | undefined;
|
|
173
178
|
};
|
|
174
179
|
rpcUrl: string;
|
|
175
180
|
caip2: number;
|
|
176
181
|
ipfsGateway: string;
|
|
177
182
|
};
|
|
178
183
|
//#endregion
|
|
179
|
-
export { AppConfig,
|
|
184
|
+
export { AppConfig, FangornConfig, SupportedNetworks, appId, getNetwork as default, nonBlank, toAppId };
|
package/lib/config.js
CHANGED
|
@@ -8,9 +8,19 @@ import { arbitrumSepolia } from "viem/chains";
|
|
|
8
8
|
function appId(name) {
|
|
9
9
|
return keccak256(toHex(name));
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Blank input means "not set", never an app called "". Returns the trimmed value,
|
|
13
|
+
* or undefined when it is missing or only whitespace, so it can sit on the left of
|
|
14
|
+
* a `??` fallback. `??` on the raw value would let "" through: it is not nullish.
|
|
15
|
+
*/
|
|
16
|
+
function nonBlank(value) {
|
|
17
|
+
const trimmed = value?.trim();
|
|
18
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
19
|
+
}
|
|
12
20
|
function toAppId(nameOrId) {
|
|
13
|
-
|
|
21
|
+
const name = nameOrId.trim();
|
|
22
|
+
if (!name) throw new Error("App name or id must not be blank.");
|
|
23
|
+
return /^0x[0-9a-fA-F]{64}$/.test(name) ? name : appId(name);
|
|
14
24
|
}
|
|
15
25
|
/**
|
|
16
26
|
* The networks supported by Fangorn currently
|
|
@@ -29,10 +39,10 @@ function getNetwork(name) {
|
|
|
29
39
|
throw new Error(`Chain ${name} is not supported`);
|
|
30
40
|
}
|
|
31
41
|
const FangornConfig = {
|
|
32
|
-
dataRegistryContractAddress: "
|
|
33
|
-
appRegistryContractAddress: "
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
dataRegistryContractAddress: "0x72B5f83526F3893aF9f1eE0f32A27218EA09f8aE",
|
|
43
|
+
appRegistryContractAddress: "0x55e6209ea1833ceD900989a3b3b22466934E04A5",
|
|
44
|
+
membershipRegistryContractAddress: "0xDF17030Cd65435C86eb043F31DDACa99E819E347",
|
|
45
|
+
appRegistryFromBlock: 319536642n,
|
|
36
46
|
chain: arbitrumSepolia,
|
|
37
47
|
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
|
|
38
48
|
caip2: 421614,
|
|
@@ -40,4 +50,4 @@ const FangornConfig = {
|
|
|
40
50
|
};
|
|
41
51
|
|
|
42
52
|
//#endregion
|
|
43
|
-
export {
|
|
53
|
+
export { FangornConfig, SupportedNetworks, appId, getNetwork as default, nonBlank, toAppId };
|