@fangorn-network/sdk 2026.10.19-dev → 2026.10.20-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 +18 -2
- package/lib/cli/cli.js +13 -8
- package/lib/cli/index.d.ts +2 -90
- package/lib/cli/index.js +5 -2
- package/lib/config.d.ts +350 -111
- package/lib/config.js +31 -19
- package/lib/contracts/app-registry/index.d.ts +2 -1
- package/lib/contracts/app-registry/index.js +3 -2
- package/lib/contracts/logs.d.ts +6 -10
- package/lib/contracts/logs.js +5 -9
- package/lib/fangorn.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/registry.d.ts +2 -0
- package/lib/registry.js +3 -1
- package/lib/test/testbed.d.ts +5012 -5012
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FangornConfig, SupportedNetworks, appId, nonBlank, toAppId } from "./config.js";
|
|
1
|
+
import { BaseSepoliaConfig, FangornConfig, SupportedNetworks, appId, nonBlank, toAppId } from "./config.js";
|
|
2
2
|
import { DEFAULT_SIGNED_URL_WORKER, SignedUrlBackend } from "./providers/storage/signed-url.js";
|
|
3
3
|
import { MAX_UPLOAD_ATTEMPTS, deserialize, fetchRawByCid, isTransientUpload, retrieveByCid, serialize, withUploadRetry } from "./providers/storage/utils.js";
|
|
4
4
|
import { PinataBackend } from "./providers/storage/pinata.js";
|
|
@@ -16,4 +16,4 @@ import { FANGORN_APP_EXTENSION, Fangorn } from "./fangorn.js";
|
|
|
16
16
|
import { buildAssetGraph, buildMarkdownGraph, extractMarkdownLinks } from "./harness/index.js";
|
|
17
17
|
import { GADGET_SELF_HKDF_V1, GADGET_WORKER_USDC_V1, X25519_PUBKEY_LENGTH, accessMessageHash, buildAccessRequest, decryptHandle, encryptAndUpload, seal, sealSelf, sha256Hex, unseal, unsealSelf } from "./crypto/encryption.js";
|
|
18
18
|
|
|
19
|
-
export { APP_REGISTRY_ABI, AppFeed, AppRegistryClient, ChainRegistry, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, EPOCH_SECONDS, FANGORN_APP_EXTENSION, Fangorn, FangornConfig, GADGET_SELF_HKDF_V1, GADGET_WORKER_USDC_V1, MAX_UPLOAD_ATTEMPTS, MEMBERSHIP_REGISTRY_ABI, MembershipRegistryClient, PinataBackend, PublisherStatus, SignedUrlBackend, SupportedNetworks, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessageHash, appId, buildAccessRequest, buildAssetGraph, buildMarkdownGraph, covers, decryptHandle, deserialize, encryptAndUpload, epochOf, exclusionId, extractMarkdownLinks, fetchRawByCid, isTransientUpload, joinNonce, membershipScope, membershipTokenId, nonBlank, repoExcluded, repoId, retrieveByCid, seal, sealSelf, serialize, sha256Hex, toAppId, unseal, unsealSelf, withUploadRetry };
|
|
19
|
+
export { APP_REGISTRY_ABI, AppFeed, AppRegistryClient, BaseSepoliaConfig, ChainRegistry, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, EPOCH_SECONDS, FANGORN_APP_EXTENSION, Fangorn, FangornConfig, GADGET_SELF_HKDF_V1, GADGET_WORKER_USDC_V1, MAX_UPLOAD_ATTEMPTS, MEMBERSHIP_REGISTRY_ABI, MembershipRegistryClient, PinataBackend, PublisherStatus, SignedUrlBackend, SupportedNetworks, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessageHash, appId, buildAccessRequest, buildAssetGraph, buildMarkdownGraph, covers, decryptHandle, deserialize, encryptAndUpload, epochOf, exclusionId, extractMarkdownLinks, fetchRawByCid, isTransientUpload, joinNonce, membershipScope, membershipTokenId, nonBlank, repoExcluded, repoId, retrieveByCid, seal, sealSelf, serialize, sha256Hex, toAppId, unseal, unsealSelf, withUploadRetry };
|
package/lib/registry.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ declare function exclusionId(x: Exclusion): Hex;
|
|
|
75
75
|
interface ChainRegistryConfig {
|
|
76
76
|
dataRegistryContractAddress: Address;
|
|
77
77
|
appRegistryContractAddress: Address;
|
|
78
|
+
logWindow?: bigint;
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
80
81
|
* The registry on the contracts: H and U in the DataRegistry; membership, X and C
|
|
@@ -96,6 +97,7 @@ declare class ChainRegistry implements Registry {
|
|
|
96
97
|
private walletClient?;
|
|
97
98
|
private readonly data;
|
|
98
99
|
private readonly apps;
|
|
100
|
+
private readonly logWindow?;
|
|
99
101
|
constructor(config: ChainRegistryConfig, publicClient: PublicClient, walletClient?: WalletClient | undefined);
|
|
100
102
|
epoch(): Promise<number>;
|
|
101
103
|
head(ref: RepoRef): Promise<Hex>;
|
package/lib/registry.js
CHANGED
|
@@ -58,11 +58,13 @@ function exclusionId(x) {
|
|
|
58
58
|
var ChainRegistry = class {
|
|
59
59
|
data;
|
|
60
60
|
apps;
|
|
61
|
+
logWindow;
|
|
61
62
|
constructor(config, publicClient, walletClient) {
|
|
62
63
|
this.publicClient = publicClient;
|
|
63
64
|
this.walletClient = walletClient;
|
|
64
65
|
this.data = config.dataRegistryContractAddress;
|
|
65
66
|
this.apps = config.appRegistryContractAddress;
|
|
67
|
+
this.logWindow = config.logWindow;
|
|
66
68
|
}
|
|
67
69
|
async epoch() {
|
|
68
70
|
return epochOf((await this.publicClient.getBlock()).timestamp);
|
|
@@ -141,7 +143,7 @@ var ChainRegistry = class {
|
|
|
141
143
|
fromBlock,
|
|
142
144
|
toBlock,
|
|
143
145
|
strict: true
|
|
144
|
-
}))).sort((a, b) => a.blockNumber === b.blockNumber ? a.logIndex - b.logIndex : a.blockNumber < b.blockNumber ? -1 : 1).map(toEntry);
|
|
146
|
+
}), this.logWindow)).sort((a, b) => a.blockNumber === b.blockNumber ? a.logIndex - b.logIndex : a.blockNumber < b.blockNumber ? -1 : 1).map(toEntry);
|
|
145
147
|
}
|
|
146
148
|
watch(filter, onEntry, onError, pollingInterval) {
|
|
147
149
|
return this.publicClient.watchContractEvent({
|