@fangorn-network/sdk 2026.3.27 → 2026.3.29
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/lib/cli/cli.js +3 -27
- package/lib/cli/index.d.ts +170 -170
- package/lib/config.d.ts +254 -254
- package/lib/fangorn.d.ts +5 -0
- package/lib/fangorn.js +7 -2
- package/lib/modules/gadgets/settledGadget.d.ts +0 -2
- package/lib/registries/datasource-registry/index.d.ts +2 -2
- package/lib/registries/schema-registry/index.d.ts +2 -2
- package/lib/registries/settlement-registry/index.d.ts +2 -2
- package/lib/roles/publisher/index.d.ts +3 -5
- package/lib/roles/publisher/index.js +15 -8
- package/lib/roles/publisher/types.d.ts +1 -1
- package/lib/roles/schema/index.d.ts +1 -7
- package/lib/roles/schema/index.js +1 -32
- package/lib/test/testbed.d.ts +2 -5
- package/lib/test/testbed.js +6 -22
- package/package.json +1 -1
package/lib/cli/cli.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { FangornConfig, SupportedNetworks } from "../config.js";
|
|
3
3
|
import { SettlementRegistry } from "../registries/settlement-registry/index.js";
|
|
4
4
|
import { Fangorn } from "../fangorn.js";
|
|
5
|
-
import { SettledGadget } from "../modules/gadgets/settledGadget.js";
|
|
6
5
|
import { getChain, handleCancel, selectChain } from "./index.js";
|
|
7
6
|
import { createWalletClient, http } from "viem";
|
|
8
7
|
import { privateKeyToAccount } from "viem/accounts";
|
|
@@ -174,28 +173,12 @@ program.command("init").description("Configure your Fangorn credentials").action
|
|
|
174
173
|
outro(`Config saved to ${CONFIG_PATH}`);
|
|
175
174
|
});
|
|
176
175
|
const schemaCmd = program.command("schema").description("Schema registry operations");
|
|
177
|
-
schemaCmd.command("register").description("Register an agent identity and/or a schema on-chain").argument("<name>", "Schema / agent name").
|
|
176
|
+
schemaCmd.command("register").description("Register an agent identity and/or a schema on-chain").argument("<name>", "Schema / agent name").action(async () => {
|
|
178
177
|
try {
|
|
179
178
|
intro("Chain selection");
|
|
180
179
|
outro(`Selected chain: ${(await selectChain()).name}`);
|
|
181
180
|
const fangorn = await getFangorn();
|
|
182
|
-
|
|
183
|
-
let description = "";
|
|
184
|
-
if (!options.skipErc) {
|
|
185
|
-
intro("ERC-8004 Agent Registration");
|
|
186
|
-
description = await text({ message: "Agent description:" });
|
|
187
|
-
handleCancel(description);
|
|
188
|
-
const s$1 = spinner();
|
|
189
|
-
s$1.start("Registering agent...");
|
|
190
|
-
const { agentId } = await fangorn.schema.registerAgent({
|
|
191
|
-
name,
|
|
192
|
-
description
|
|
193
|
-
});
|
|
194
|
-
s$1.stop();
|
|
195
|
-
datasourceAgentId = agentId;
|
|
196
|
-
note(`Agent ID: ${agentId}`, "ERC-8004 registered");
|
|
197
|
-
outro("Agent Registration complete.");
|
|
198
|
-
}
|
|
181
|
+
const datasourceAgentId = "";
|
|
199
182
|
intro("Schema Registration");
|
|
200
183
|
const schemaFilePath = await text({
|
|
201
184
|
message: "Path to your JSON schema file:",
|
|
@@ -266,7 +249,6 @@ publishCmd.command("upload").description("Encrypt and publish file(s) under a sc
|
|
|
266
249
|
try {
|
|
267
250
|
const fangorn = await getFangorn();
|
|
268
251
|
const cfg = loadConfig();
|
|
269
|
-
const owner = getAccount().address;
|
|
270
252
|
const price = BigInt(options.price);
|
|
271
253
|
const s = spinner();
|
|
272
254
|
const schemaId = await resolveSchemaId(fangorn, options.schema);
|
|
@@ -292,13 +274,7 @@ publishCmd.command("upload").description("Encrypt and publish file(s) under a sc
|
|
|
292
274
|
schema,
|
|
293
275
|
schemaId,
|
|
294
276
|
gateway,
|
|
295
|
-
options: { overwrite: options.overwrite }
|
|
296
|
-
gadgetFactory: (tag) => new SettledGadget({
|
|
297
|
-
resourceId: SettlementRegistry.deriveResourceId(owner, schemaId, tag),
|
|
298
|
-
settlementRegistryAddress: cfg.cfg.settlementRegistryContractAddress,
|
|
299
|
-
chainName: cfg.cfg.chainName,
|
|
300
|
-
pinataJwt: cfg.jwt ?? ""
|
|
301
|
-
})
|
|
277
|
+
options: { overwrite: options.overwrite }
|
|
302
278
|
}, price);
|
|
303
279
|
s.stop();
|
|
304
280
|
note(`Manifest CID: ${result.manifestCid}\nEntries: ${result.entryCount.toString()}\nSchema: ${result.schemaId}`, "Upload complete");
|