@fangorn-network/sdk 2026.11.3-dev → 2026.11.4-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 +9 -3
- package/lib/cli/cli.js +18 -3
- package/lib/cli/sell.d.ts +28 -0
- package/lib/cli/sell.js +95 -0
- package/lib/config.js +2 -2
- package/lib/contracts/data-registry/abi.js +341 -341
- package/lib/contracts/index.d.ts +1 -1
- package/lib/contracts/settlement-registry/abi.d.ts +14 -0
- package/lib/contracts/settlement-registry/abi.js +627 -612
- package/lib/contracts/settlement-registry/index.d.ts +2 -0
- package/lib/contracts/settlement-registry/index.js +4 -0
- package/lib/crypto/paid.d.ts +1 -1
- package/lib/erc8004.js +6 -6
- package/lib/fangorn.d.ts +2 -2
- package/lib/fangorn.js +4 -4
- package/lib/index.d.ts +6 -5
- package/lib/index.js +2 -1
- package/lib/providers/storage/signed-url.js +1 -1
- package/lib/test/testbed.d.ts +93 -93
- package/lib/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -109,6 +109,8 @@ declare class SettlementRegistryClient {
|
|
|
109
109
|
generationOf(publisher: Address, repo: Hex): Promise<bigint>;
|
|
110
110
|
isDenied(publisher: Address, referrer: Address): Promise<boolean>;
|
|
111
111
|
isDisabled(subject: Hex): Promise<boolean>;
|
|
112
|
+
/** Every commitment in the subject's group, in the order it was added: what a Semaphore proof is built from. */
|
|
113
|
+
membersOf(subject: Hex): Promise<readonly bigint[]>;
|
|
112
114
|
isRegistered(subject: Hex, commitment: bigint): Promise<boolean>;
|
|
113
115
|
isSettled(reader: Address, subject: Hex): Promise<boolean>;
|
|
114
116
|
/** Settled for the record or the whole repo, and neither is disabled. */
|
|
@@ -170,6 +170,10 @@ var SettlementRegistryClient = class {
|
|
|
170
170
|
isDisabled(subject) {
|
|
171
171
|
return this.read("isDisabled", [subject]);
|
|
172
172
|
}
|
|
173
|
+
/** Every commitment in the subject's group, in the order it was added: what a Semaphore proof is built from. */
|
|
174
|
+
membersOf(subject) {
|
|
175
|
+
return this.read("membersOf", [subject]);
|
|
176
|
+
}
|
|
173
177
|
isRegistered(subject, commitment) {
|
|
174
178
|
return this.read("isRegistered", [subject, commitment]);
|
|
175
179
|
}
|
package/lib/crypto/paid.d.ts
CHANGED
package/lib/erc8004.js
CHANGED
|
@@ -11,12 +11,12 @@ const ABI = parseAbi([
|
|
|
11
11
|
/**
|
|
12
12
|
* Get the agent card URL based on the access worker if defined, else return the carUrl
|
|
13
13
|
* Both params are optional, but at least one must be defined.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* Agent cards must live at accessWorker/.well-known/agent-card.json
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* @param cardUrl The cardUrl (passthrough when defined)
|
|
18
|
-
* @param accessWorker The (optional) access worker url
|
|
19
|
-
* @returns
|
|
18
|
+
* @param accessWorker The (optional) access worker url
|
|
19
|
+
* @returns
|
|
20
20
|
*/
|
|
21
21
|
function agentCardUrl(cardUrl, accessWorker) {
|
|
22
22
|
if (cardUrl) return cardUrl;
|
|
@@ -48,8 +48,8 @@ async function mcpTools(endpoint) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Build a registration file
|
|
52
|
-
* Since it desfines its own agent id,
|
|
51
|
+
* Build a registration file
|
|
52
|
+
* Since it desfines its own agent id,
|
|
53
53
|
* first registration mints without an agent URI and must be set retroactively.
|
|
54
54
|
*/
|
|
55
55
|
function registrationFile(opts) {
|
package/lib/fangorn.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { NetworkConfig } from "./config.js";
|
|
2
1
|
import { PreparedTx } from "./contracts/write.js";
|
|
3
2
|
import { Registry } from "./contracts/data-registry/index.js";
|
|
4
3
|
import { SettlementRegistryClient } from "./contracts/settlement-registry/index.js";
|
|
5
4
|
import "./contracts/index.js";
|
|
6
5
|
import { MetadataStorage } from "./providers/storage/types.js";
|
|
7
6
|
import { CommitDiff, FangornEngine, RecordInput, RepoContents, RepoDiff, SignedUpdate } from "./engine/index.js";
|
|
8
|
-
import {
|
|
7
|
+
import { NetworkConfig } from "./config.js";
|
|
9
8
|
import { FangornCreateOptions, StorageConfig } from "./types/index.js";
|
|
9
|
+
import { AgentCard as AgentCard$1 } from "./erc8004.js";
|
|
10
10
|
import { CommitFeed } from "./feed.js";
|
|
11
11
|
import { Hash, Hex, WalletClient } from "viem";
|
|
12
12
|
import { CID } from "multiformats/cid";
|
package/lib/fangorn.js
CHANGED
|
@@ -52,7 +52,7 @@ var Fangorn = class Fangorn {
|
|
|
52
52
|
_engine = null;
|
|
53
53
|
_feed = null;
|
|
54
54
|
_settlement = null;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
56
|
* The repo cache
|
|
57
57
|
* Insertion order = LRU order
|
|
58
58
|
*/
|
|
@@ -67,8 +67,8 @@ var Fangorn = class Fangorn {
|
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Static creation of a new Fangorn client
|
|
70
|
-
*
|
|
71
|
-
* @param options
|
|
70
|
+
*
|
|
71
|
+
* @param options
|
|
72
72
|
* @returns the client
|
|
73
73
|
*/
|
|
74
74
|
static create(options) {
|
|
@@ -121,7 +121,7 @@ var Fangorn = class Fangorn {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* Allocates a repo in the publisher's root map.
|
|
124
|
+
* Allocates a repo in the publisher's root map.
|
|
125
125
|
* A no-op (no on-chain tx) if the repo is already initialized.
|
|
126
126
|
*/
|
|
127
127
|
async initRepo(repoName) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BaseSepoliaConfig, FangornConfig, NetworkConfig, SupportedNetworks, nonBlank } from "./config.js";
|
|
2
|
-
import { DATA_REGISTRY_ABI } from "./contracts/data-registry/abi.js";
|
|
3
1
|
import { PreparedTx } from "./contracts/write.js";
|
|
4
2
|
import { ChainRegistry, ChainRegistryConfig, CommitUpdate, EPOCH_SECONDS, LogFilter, Registry, RepoRef, UPDATE_TYPES, UpdateEntry, WINDOW, ZERO_HEAD, dataDomain, epochOf, repoId, updateMessage } from "./contracts/data-registry/index.js";
|
|
3
|
+
import { DATA_REGISTRY_ABI } from "./contracts/data-registry/abi.js";
|
|
5
4
|
import { RegisterArgs, SettleArgs, SettlementPayment, SettlementRegistryClient, TERMS_TYPES, Terms, TermsJson, WHOLE_REPO, recordKey, registerNonce, settlementDomain, subjectOf, termsFromJson, termsToJson } from "./contracts/settlement-registry/index.js";
|
|
6
5
|
import { SETTLEMENT_REGISTRY_ABI } from "./contracts/settlement-registry/abi.js";
|
|
7
6
|
import "./contracts/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { AccessRequest, Deposit, FieldHandle, GADGET_FIELD_V1, PaidScope, accessMessage, buildAccessRequest, decryptField, deriveRecordKey, encryptField, makeDeposit, newRepoKey, openField, requestKey, sealField, statement } from "./crypto/paid.js";
|
|
7
|
+
import { BaseSepoliaConfig, FangornConfig, NetworkConfig, SupportedNetworks, nonBlank } from "./config.js";
|
|
10
8
|
import { FangornContext, FangornCreateOptions, StorageConfig } from "./types/index.js";
|
|
11
9
|
import { CommitFeed } from "./feed.js";
|
|
12
10
|
import { AgentCard, CARD_RECORD, FANGORN_REPO_EXTENSION, Fangorn, RepoChange, SubscribeOptions } from "./fangorn.js";
|
|
11
|
+
import { SellOptions, sealRecords } from "./cli/sell.js";
|
|
12
|
+
import { AccessSigner, GADGET_SELF_HKDF_V1, X25519_PUBKEY_LENGTH, seal, sealSelf, unseal, unsealSelf } from "./crypto/encryption.js";
|
|
13
|
+
import { AccessRequest, Deposit, FieldHandle, GADGET_FIELD_V1, PaidScope, accessMessage, buildAccessRequest, decryptField, deriveRecordKey, encryptField, makeDeposit, newRepoKey, openField, requestKey, sealField, statement } from "./crypto/paid.js";
|
|
13
14
|
import { PinataBackend } from "./providers/storage/pinata.js";
|
|
14
15
|
import { DEFAULT_SIGNED_URL_WORKER, SignedUrlBackend, SignedUrlSigner } from "./providers/storage/signed-url.js";
|
|
15
16
|
import { MAX_UPLOAD_ATTEMPTS, deserialize, fetchRawByCid, isTransientUpload, retrieveByCid, serialize, withUploadRetry } from "./providers/storage/utils.js";
|
|
16
|
-
export { AccessRequest, AccessSigner, AgentCard, BaseSepoliaConfig, CARD_RECORD, ChainRegistry, ChainRegistryConfig, CommitFeed, CommitUpdate, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, Deposit, EPOCH_SECONDS, FANGORN_REPO_EXTENSION, Fangorn, FangornConfig, FangornContext, FangornCreateOptions, FieldHandle, GADGET_FIELD_V1, GADGET_SELF_HKDF_V1, LogFilter, MAX_UPLOAD_ATTEMPTS, NetworkConfig, PaidScope, PinataBackend, PreparedTx, RegisterArgs, Registry, RepoChange, RepoRef, SETTLEMENT_REGISTRY_ABI, SettleArgs, SettlementPayment, SettlementRegistryClient, SignedUrlBackend, SignedUrlSigner, StorageConfig, SubscribeOptions, SupportedNetworks, TERMS_TYPES, Terms, TermsJson, UPDATE_TYPES, UpdateEntry, WHOLE_REPO, WINDOW, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessage, buildAccessRequest, dataDomain, decryptField, deriveRecordKey, deserialize, encryptField, epochOf, fetchRawByCid, isTransientUpload, makeDeposit, newRepoKey, nonBlank, openField, recordKey, registerNonce, repoId, requestKey, retrieveByCid, seal, sealField, sealSelf, serialize, settlementDomain, statement, subjectOf, termsFromJson, termsToJson, unseal, unsealSelf, updateMessage, withUploadRetry };
|
|
17
|
+
export { AccessRequest, AccessSigner, AgentCard, BaseSepoliaConfig, CARD_RECORD, ChainRegistry, ChainRegistryConfig, CommitFeed, CommitUpdate, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, Deposit, EPOCH_SECONDS, FANGORN_REPO_EXTENSION, Fangorn, FangornConfig, FangornContext, FangornCreateOptions, FieldHandle, GADGET_FIELD_V1, GADGET_SELF_HKDF_V1, LogFilter, MAX_UPLOAD_ATTEMPTS, NetworkConfig, PaidScope, PinataBackend, PreparedTx, RegisterArgs, Registry, RepoChange, RepoRef, SETTLEMENT_REGISTRY_ABI, SellOptions, SettleArgs, SettlementPayment, SettlementRegistryClient, SignedUrlBackend, SignedUrlSigner, StorageConfig, SubscribeOptions, SupportedNetworks, TERMS_TYPES, Terms, TermsJson, UPDATE_TYPES, UpdateEntry, WHOLE_REPO, WINDOW, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessage, buildAccessRequest, dataDomain, decryptField, deriveRecordKey, deserialize, encryptField, epochOf, fetchRawByCid, isTransientUpload, makeDeposit, newRepoKey, nonBlank, openField, recordKey, registerNonce, repoId, requestKey, retrieveByCid, seal, sealField, sealRecords, sealSelf, serialize, settlementDomain, statement, subjectOf, termsFromJson, termsToJson, unseal, unsealSelf, updateMessage, withUploadRetry };
|
package/lib/index.js
CHANGED
|
@@ -11,5 +11,6 @@ import { CommitFeed } from "./feed.js";
|
|
|
11
11
|
import { CARD_RECORD, FANGORN_REPO_EXTENSION, Fangorn } from "./fangorn.js";
|
|
12
12
|
import { GADGET_SELF_HKDF_V1, X25519_PUBKEY_LENGTH, seal, sealSelf, unseal, unsealSelf } from "./crypto/encryption.js";
|
|
13
13
|
import { GADGET_FIELD_V1, accessMessage, buildAccessRequest, decryptField, deriveRecordKey, encryptField, makeDeposit, newRepoKey, openField, requestKey, sealField, statement } from "./crypto/paid.js";
|
|
14
|
+
import { sealRecords } from "./cli/sell.js";
|
|
14
15
|
|
|
15
|
-
export { BaseSepoliaConfig, CARD_RECORD, ChainRegistry, CommitFeed, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, EPOCH_SECONDS, FANGORN_REPO_EXTENSION, Fangorn, FangornConfig, GADGET_FIELD_V1, GADGET_SELF_HKDF_V1, MAX_UPLOAD_ATTEMPTS, PinataBackend, SETTLEMENT_REGISTRY_ABI, SettlementRegistryClient, SignedUrlBackend, SupportedNetworks, TERMS_TYPES, UPDATE_TYPES, WHOLE_REPO, WINDOW, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessage, buildAccessRequest, dataDomain, decryptField, deriveRecordKey, deserialize, encryptField, epochOf, fetchRawByCid, isTransientUpload, makeDeposit, newRepoKey, nonBlank, openField, recordKey, registerNonce, repoId, requestKey, retrieveByCid, seal, sealField, sealSelf, serialize, settlementDomain, statement, subjectOf, termsFromJson, termsToJson, unseal, unsealSelf, updateMessage, withUploadRetry };
|
|
16
|
+
export { BaseSepoliaConfig, CARD_RECORD, ChainRegistry, CommitFeed, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, EPOCH_SECONDS, FANGORN_REPO_EXTENSION, Fangorn, FangornConfig, GADGET_FIELD_V1, GADGET_SELF_HKDF_V1, MAX_UPLOAD_ATTEMPTS, PinataBackend, SETTLEMENT_REGISTRY_ABI, SettlementRegistryClient, SignedUrlBackend, SupportedNetworks, TERMS_TYPES, UPDATE_TYPES, WHOLE_REPO, WINDOW, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessage, buildAccessRequest, dataDomain, decryptField, deriveRecordKey, deserialize, encryptField, epochOf, fetchRawByCid, isTransientUpload, makeDeposit, newRepoKey, nonBlank, openField, recordKey, registerNonce, repoId, requestKey, retrieveByCid, seal, sealField, sealRecords, sealSelf, serialize, settlementDomain, statement, subjectOf, termsFromJson, termsToJson, unseal, unsealSelf, updateMessage, withUploadRetry };
|
|
@@ -18,7 +18,7 @@ function workerError(r) {
|
|
|
18
18
|
*
|
|
19
19
|
* Uploads go through the pinata-url-provider Worker. Prove wallet ownership by
|
|
20
20
|
* signing the worker's challenge, and it hands back a short-lived, single-use
|
|
21
|
-
* Pinata presigned upload URL that users POST the file to.
|
|
21
|
+
* Pinata presigned upload URL that users POST the file to.
|
|
22
22
|
* Reads need no auth: every Fangorn block is public content, so it's
|
|
23
23
|
* fetched straight from a public IPFS gateway by CID (privacy is cryptographic,
|
|
24
24
|
* not access-controlled). Each upload runs a fresh handshake because the
|