@fangorn-network/sdk 2026.9.22-dev → 2026.10.1-9.0-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 +190 -194
- package/lib/cli/cli.d.ts +0 -0
- package/lib/cli/cli.js +177 -201
- package/lib/cli/index.d.ts +3 -91
- package/lib/cli/index.js +5 -2
- package/lib/config.d.ts +358 -117
- package/lib/config.js +43 -23
- 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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keccak256, toHex } from "viem";
|
|
2
|
-
import { arbitrumSepolia } from "viem/chains";
|
|
2
|
+
import { arbitrumSepolia, baseSepolia } from "viem/chains";
|
|
3
3
|
|
|
4
4
|
//#region src/config.ts
|
|
5
5
|
/**
|
|
@@ -8,36 +8,56 @@ import { arbitrumSepolia } from "viem/chains";
|
|
|
8
8
|
function appId(name) {
|
|
9
9
|
return keccak256(toHex(name));
|
|
10
10
|
}
|
|
11
|
-
const DEFAULT_APP = "fangorn";
|
|
12
|
-
function toAppId(nameOrId) {
|
|
13
|
-
return /^0x[0-9a-fA-F]{64}$/.test(nameOrId) ? nameOrId : appId(nameOrId);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The networks supported by Fangorn currently
|
|
17
|
-
*/
|
|
18
|
-
const SupportedNetworks = { ArbitrumSepolia: {
|
|
19
|
-
name: "arbitrumSepolia",
|
|
20
|
-
chain: arbitrumSepolia
|
|
21
|
-
} };
|
|
22
11
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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.
|
|
26
15
|
*/
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
function nonBlank(value) {
|
|
17
|
+
const trimmed = value?.trim();
|
|
18
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
19
|
+
}
|
|
20
|
+
function toAppId(nameOrId) {
|
|
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);
|
|
30
24
|
}
|
|
31
25
|
const FangornConfig = {
|
|
32
|
-
dataRegistryContractAddress: "
|
|
33
|
-
appRegistryContractAddress: "
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
dataRegistryContractAddress: "0x72B5f83526F3893aF9f1eE0f32A27218EA09f8aE",
|
|
27
|
+
appRegistryContractAddress: "0x55e6209ea1833ceD900989a3b3b22466934E04A5",
|
|
28
|
+
membershipRegistryContractAddress: "0xDF17030Cd65435C86eb043F31DDACa99E819E347",
|
|
29
|
+
appRegistryFromBlock: 319536642n,
|
|
36
30
|
chain: arbitrumSepolia,
|
|
37
31
|
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
|
|
38
32
|
caip2: 421614,
|
|
39
33
|
ipfsGateway: "https://ipfs.io"
|
|
40
34
|
};
|
|
35
|
+
const BaseSepoliaConfig = {
|
|
36
|
+
dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0",
|
|
37
|
+
appRegistryContractAddress: "0x0D3e98399df41b558048Cdd7D71723c37A3A9D6F",
|
|
38
|
+
membershipRegistryContractAddress: "0x0e96C012b5c53622EcDAA82F342E31C2623A04f5",
|
|
39
|
+
appRegistryFromBlock: 48340483n,
|
|
40
|
+
chain: baseSepolia,
|
|
41
|
+
rpcUrl: "https://sepolia.base.org",
|
|
42
|
+
caip2: 84532,
|
|
43
|
+
ipfsGateway: "https://ipfs.io"
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The networks supported by Fangorn, by the name `CHAIN_NAME` takes.
|
|
47
|
+
*/
|
|
48
|
+
const SupportedNetworks = {
|
|
49
|
+
arbitrumSepolia: FangornConfig,
|
|
50
|
+
baseSepolia: BaseSepoliaConfig
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Get a network's deployment by name ("arbitrumSepolia" or "baseSepolia").
|
|
54
|
+
* @returns The corresponding config if it is supported, otherwise an error
|
|
55
|
+
*/
|
|
56
|
+
function getNetwork(name) {
|
|
57
|
+
const config = SupportedNetworks[name];
|
|
58
|
+
if (!config) throw new Error(`Chain ${name} is not supported. Use one of: ${Object.keys(SupportedNetworks).join(", ")}`);
|
|
59
|
+
return config;
|
|
60
|
+
}
|
|
41
61
|
|
|
42
62
|
//#endregion
|
|
43
|
-
export {
|
|
63
|
+
export { BaseSepoliaConfig, FangornConfig, SupportedNetworks, appId, getNetwork as default, nonBlank, toAppId };
|