@fangorn-network/sdk 2026.11.3-dev → 2026.11.3
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.d.ts +148 -148
- package/lib/contracts/data-registry/abi.js +341 -341
- package/lib/contracts/index.d.ts +1 -1
- package/lib/contracts/settlement-registry/abi.js +612 -612
- 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/mem-registry.d.ts +2 -2
- package/lib/test/testbed.d.ts +5210 -5210
- package/lib/types/index.d.ts +1 -1
- package/package.json +2 -2
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
|
|
@@ -2,11 +2,11 @@ import { PreparedTx } from "../contracts/write.js";
|
|
|
2
2
|
import { CommitUpdate, LogFilter, Registry, RepoRef, UpdateEntry } from "../contracts/data-registry/index.js";
|
|
3
3
|
import "../contracts/index.js";
|
|
4
4
|
import { Address, Hash, Hex, LocalAccount } from "viem";
|
|
5
|
-
import * as
|
|
5
|
+
import * as abitype0 from "abitype";
|
|
6
6
|
|
|
7
7
|
//#region src/test/mem-registry.d.ts
|
|
8
8
|
/** The EIP-712 domain a MemRegistry signs under. */
|
|
9
|
-
declare const MEM_DOMAIN:
|
|
9
|
+
declare const MEM_DOMAIN: abitype0.TypedDataDomain;
|
|
10
10
|
/** One ordering and the registry state over it, shared by every signer of a MemRegistry. */
|
|
11
11
|
declare class MemLedger {
|
|
12
12
|
/** H: position and head */
|