@agether/agether 1.3.1 → 1.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agether/agether",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "OpenClaw plugin for Agether — on-chain credit for AI agents",
5
5
  "main": "src/index.ts",
6
6
  "openclaw": {
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  },
11
11
  "dependencies": {
12
- "@agether/sdk": "^1.10.1",
12
+ "@agether/sdk": "^1.11.0",
13
13
  "axios": "^1.6.0",
14
14
  "ethers": "^6.9.0"
15
15
  },
@@ -230,9 +230,10 @@ Morpho Blue (direct lending, overcollateralized 125%)
230
230
 
231
231
  | Contract | Address |
232
232
  |----------|---------|
233
- | AccountFactory | `0xFab8b924fb292a736BA05AF7b4AEC2c8d05cdcbF` |
234
- | ValidationRegistry | `0x493f1551cbbC75afb2127CDBD5375ad8e8959f42` |
235
- | AgentReputation | `0x1fcb28eE3E8F3234E653b0A7a6fb56dE11E3c203` |
233
+ | AccountFactory | `0x89a8758E60A56EcB47247D92E05447eFd450d6Bf` |
234
+ | KYAHook | `0x28e50Aa9eD517E369b2806928709B44062aD9821` |
235
+ | ValidationRegistry | `0x6f76cF69B71Dc5F9A414BCEe4583b12738E47985` |
236
+ | AgentReputation | `0xe88f3419a2dbac70e3aF6E487b0C63e8301C6A87` |
236
237
  | ERC-8004 Identity | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` |
237
238
  | Morpho Blue | `0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb` |
238
239
  | USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
package/src/index.ts CHANGED
@@ -210,9 +210,9 @@ export default function register(api: any) {
210
210
  api.registerTool({
211
211
  name: "agether_set_kya",
212
212
  description:
213
- "Enable or disable KYA verification gate (owner only). " +
213
+ "Enable or disable KYA verification gate on the KYAHook (owner only). " +
214
214
  "Pass the ValidationRegistry address to enable, or '0x0000000000000000000000000000000000000000' to disable. " +
215
- "Note: the actual transaction must be executed by the owner (TimelockController).",
215
+ "Note: the actual transaction must be executed by the owner (TimelockController) targeting the KYAHook contract.",
216
216
  parameters: {
217
217
  type: "object",
218
218
  properties: {
@@ -229,7 +229,7 @@ export default function register(api: any) {
229
229
  const cfg = getConfig(api);
230
230
  const client = createClient(cfg);
231
231
 
232
- // Build the calldata for setValidationRegistry — the owner (Timelock) must execute it
232
+ // Build the calldata for KYAHook.setValidationRegistry — the owner (Timelock) must execute it
233
233
  const { ethers } = await import("ethers");
234
234
  const iface = new ethers.Interface([
235
235
  "function setValidationRegistry(address newRegistry)",
@@ -247,10 +247,12 @@ export default function register(api: any) {
247
247
  {
248
248
  action: `${action} KYA gate`,
249
249
  registryAddress: params.registryAddress,
250
+ target: "KYAHook contract (not AccountFactory)",
250
251
  calldata,
251
252
  note:
252
253
  "This calldata must be submitted to the TimelockController by the owner. " +
253
- "Schedule via timelock.schedule(accountFactoryAddr, 0, calldata, predecessor, salt, delay).",
254
+ "Schedule via timelock.schedule(kyaHookAddr, 0, calldata, predecessor, salt, delay). " +
255
+ "The target is the KYAHook contract, NOT the AccountFactory.",
254
256
  },
255
257
  null,
256
258
  2,
@@ -316,7 +318,7 @@ export default function register(api: any) {
316
318
  api.registerTool({
317
319
  name: "morpho_deposit_and_borrow",
318
320
  description:
319
- "Deposit collateral AND borrow USDC in one batched transaction via AgentAccount.executeBatch. " +
321
+ "Deposit collateral AND borrow USDC in one batched transaction via AgentAccount (ERC-7579 batch mode). " +
320
322
  "Deposits collateral from EOA into Morpho, then borrows USDC. All in one tx.",
321
323
  parameters: {
322
324
  type: "object",
@@ -536,13 +538,14 @@ export default function register(api: any) {
536
538
  const agentId = client.getAgentId();
537
539
 
538
540
  if (params.refresh) {
539
- // x402-gated fresh score
541
+ // x402-gated fresh score — account address required for payment
542
+ const accountAddress = await client.getAccountAddress();
540
543
  const x402 = new X402Client({
541
544
  privateKey: cfg.privateKey,
542
545
  rpcUrl: cfg.rpcUrl,
543
546
  backendUrl: cfg.backendUrl,
544
547
  agentId,
545
- accountAddress: await client.getAccountAddress().catch(() => undefined),
548
+ accountAddress,
546
549
  });
547
550
  const result = await x402.get(`${cfg.backendUrl}/score/${agentId}`);
548
551
  if (!result.success) return fail(result.error || "Score request failed");
@@ -613,7 +616,9 @@ export default function register(api: any) {
613
616
  try {
614
617
  agentId = client.getAgentId();
615
618
  accountAddress = await client.getAccountAddress();
616
- } catch { /* no account, pay from EOA */ }
619
+ } catch (e) {
620
+ console.warn('[agether] x402_pay: getAccountAddress failed, paying from EOA:', e instanceof Error ? e.message : e);
621
+ }
617
622
 
618
623
  const autoDrawEnabled = params.autoDraw === true; // default false — opt-in only
619
624
  const x402 = new X402Client({