@openserv-labs/client 2.4.4 → 2.4.6
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/dist/erc8004-api.d.ts.map +1 -1
- package/dist/erc8004-api.js +10 -16
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erc8004-api.d.ts","sourceRoot":"","sources":["../src/erc8004-api.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACb,MAAM,SAAS,CAAC;AAKjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAM1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqDG;IACG,MAAM,CACV,MAAM,EAAE,oBAAoB,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GACpD,OAAO,CAAC,YAAY,CAAC;IAsBxB;;;OAGG;YACW,iBAAiB;IAiC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,eAAe,CAAC,MAAM,EAAE;QAC5B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"erc8004-api.d.ts","sourceRoot":"","sources":["../src/erc8004-api.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAA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;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/erc8004-api.js
CHANGED
|
@@ -227,6 +227,7 @@ class Erc8004API {
|
|
|
227
227
|
// Build the full request schema including the x402 envelope
|
|
228
228
|
// (buyerAddress + payload wrapping the trigger's own input schema)
|
|
229
229
|
const requestSchema = {
|
|
230
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
230
231
|
type: "object",
|
|
231
232
|
required: ["buyerAddress", "payload"],
|
|
232
233
|
properties: {
|
|
@@ -234,10 +235,13 @@ class Erc8004API {
|
|
|
234
235
|
type: "string",
|
|
235
236
|
description: "The buyer's wallet address (e.g. 0x...) for x402 payment",
|
|
236
237
|
},
|
|
237
|
-
payload: t.inputSchema
|
|
238
|
+
payload: t.inputSchema
|
|
239
|
+
? Object.fromEntries(Object.entries(t.inputSchema).filter(([key]) => key !== "$schema"))
|
|
240
|
+
: { type: "object" },
|
|
238
241
|
},
|
|
239
242
|
};
|
|
240
|
-
httpMeta.
|
|
243
|
+
httpMeta.schema = requestSchema;
|
|
244
|
+
httpMeta.method = "POST";
|
|
241
245
|
services.push({
|
|
242
246
|
name: "http",
|
|
243
247
|
endpoint: t.httpEndpoint,
|
|
@@ -293,7 +297,7 @@ class Erc8004API {
|
|
|
293
297
|
};
|
|
294
298
|
const agentCardJson = JSON.stringify(agentCard);
|
|
295
299
|
// 3. Detect first deploy vs re-deploy
|
|
296
|
-
const isRedeploy = !!wallet.latestDeploymentTransactionHash;
|
|
300
|
+
const isRedeploy = !!wallet.latestDeploymentTransactionHash || !!wallet.erc8004AgentId;
|
|
297
301
|
// 4. On-chain setup
|
|
298
302
|
const contracts = (0, erc8004_contracts_js_1.getErc8004Contracts)(chainId);
|
|
299
303
|
const chainConfig = (0, erc8004_contracts_js_1.getErc8004Chain)(chainId);
|
|
@@ -373,20 +377,10 @@ class Erc8004API {
|
|
|
373
377
|
}
|
|
374
378
|
}
|
|
375
379
|
}
|
|
376
|
-
// 6.
|
|
377
|
-
await this.deploy({
|
|
378
|
-
workflowId,
|
|
379
|
-
erc8004AgentId: existingAgentId ?? "",
|
|
380
|
-
stringifiedAgentCard: agentCardJson,
|
|
381
|
-
...(wallet.address ? { walletAddress: wallet.address } : {}),
|
|
382
|
-
network: "base",
|
|
383
|
-
chainId,
|
|
384
|
-
rpcUrl,
|
|
385
|
-
});
|
|
386
|
-
// 7. Upload to IPFS
|
|
380
|
+
// 6. Upload to IPFS
|
|
387
381
|
const { url: presignedUrl } = await this.presignIpfsUrl({ workflowId });
|
|
388
382
|
const ipfsCid = await this.uploadToIpfs(agentCardJson, presignedUrl);
|
|
389
|
-
//
|
|
383
|
+
// 7. On-chain registration
|
|
390
384
|
const walletClient = (0, viem_1.createWalletClient)({
|
|
391
385
|
account,
|
|
392
386
|
chain: viemChain,
|
|
@@ -429,7 +423,7 @@ class Erc8004API {
|
|
|
429
423
|
agentId = `${chainId}:${tokenId}`;
|
|
430
424
|
txHash = registerHash;
|
|
431
425
|
}
|
|
432
|
-
//
|
|
426
|
+
// 8. Save state
|
|
433
427
|
await this.deploy({
|
|
434
428
|
workflowId,
|
|
435
429
|
erc8004AgentId: agentId,
|
package/package.json
CHANGED