@agether/agether 2.5.1 → 2.6.1
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 +2 -2
- package/skills/agether/SKILL.md +49 -12
- package/src/index.ts +31 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agether/agether",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "OpenClaw plugin for Agether — onchain credit for AI agents on Ethereum & Base",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"openclaw": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@agether/sdk": "^2.
|
|
12
|
+
"@agether/sdk": "^2.8.0",
|
|
13
13
|
"axios": "^1.6.0",
|
|
14
14
|
"ethers": "^6.9.0"
|
|
15
15
|
},
|
package/skills/agether/SKILL.md
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agether
|
|
3
|
-
description: On-chain credit protocol for AI
|
|
3
|
+
description: On-chain credit protocol for AI a## 🔗 CHAIN RESOLUTION (CRITICAL — HARD REQUIREMENT)
|
|
4
|
+
|
|
5
|
+
All on-chain tools (register, borrow, deposit, withdraw, pay, etc.) will **FAIL with an error** if chain is not configured. You MUST call `agether_set_chain` FIRST.
|
|
6
|
+
|
|
7
|
+
If `agether_health` returns `chain: "?"`, the chain is NOT configured:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
1. Ask user: "Which blockchain would you like to use? **Ethereum** or **Base**?"
|
|
11
|
+
2. User chooses a chain
|
|
12
|
+
3. Call `agether_set_chain(chain: "<ethereum or base>")`
|
|
13
|
+
4. After set → call `agether_health` to confirm everything is working on that chain
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`agether_set_chain` saves the chain to config permanently (survives restarts). Accepts: `ethereum`, `eth`, `1`, `base`, `8453`.
|
|
17
|
+
|
|
18
|
+
**IMPORTANT:** Resolve chain BEFORE doing ANYTHING else — including `agether_register`. The agent identity is chain-specific. If you skip this step, all write tools will return an error. Morpho credit & lending, x402 payments, ERC-8004 identity.
|
|
4
19
|
---
|
|
5
20
|
|
|
6
21
|
# Agether — On-Chain Credit for AI Agents
|
|
@@ -430,23 +445,45 @@ Wallet transfers:
|
|
|
430
445
|
|
|
431
446
|
## 📍 CONTRACT ADDRESSES
|
|
432
447
|
|
|
433
|
-
Contracts are deployed on both **Ethereum** and **Base** mainnets. The SDK auto-resolves the correct addresses based on the configured chain.
|
|
448
|
+
Contracts are deployed on both **Ethereum** and **Base** mainnets. The SDK auto-resolves the correct addresses based on the configured chain.
|
|
449
|
+
|
|
450
|
+
### Base (Chain ID 8453)
|
|
451
|
+
|
|
452
|
+
| Contract | Address |
|
|
453
|
+
|----------|---------|
|
|
454
|
+
| Agether4337Factory | `0x8aeE4961EfaA4a1D36e2b24C5b430C8613fB5b8C` |
|
|
455
|
+
| Agether8004ValidationModule | `0x7B18a7E3D5B3d043FC3525Efcd9a2bB1aE1369Ab` |
|
|
456
|
+
| AgetherHookMultiplexer | `0x2D98eff4b959F3dc76f14c5682A8546438406c4A` |
|
|
457
|
+
| Agether7579Bootstrap | `0x5e8e4644c628CB464936981e338635476d012B5F` |
|
|
458
|
+
| Agether8004Scorer | `0xA1a0B09147688a09A3027F960623Ae16d1ca7F69` |
|
|
459
|
+
| TimelockController | `0x7f104DBe209E2a05FFc1700b27eaE1C397f011c4` |
|
|
460
|
+
| USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
|
|
461
|
+
| WETH | `0x4200000000000000000000000000000000000006` |
|
|
462
|
+
| wstETH | `0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452` |
|
|
463
|
+
| cbETH | `0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22` |
|
|
464
|
+
|
|
465
|
+
### Ethereum (Chain ID 1)
|
|
466
|
+
|
|
467
|
+
| Contract | Address |
|
|
468
|
+
|----------|---------|
|
|
469
|
+
| Agether4337Factory | `0xE350660Ab3EA87b50233854eacCC6328e268fb48` |
|
|
470
|
+
| Agether8004ValidationModule | `0x87Aa07Be4Ab4A2e8EeBf4a4e2451c775D0e3fbf1` |
|
|
471
|
+
| AgetherHookMultiplexer | `0xC0b96e36B20d6689F4E4b8C7A0c19C28e8B45B8B` |
|
|
472
|
+
| Agether7579Bootstrap | `0xD1268B50149e468591Bcba5f6fD3E87b49D43008` |
|
|
473
|
+
| Agether8004Scorer | `0xd281a8ec667E406Fcf1097A64A65d1C88Fb0F7Fa` |
|
|
474
|
+
| TimelockController | `0x2033CD354aAf19191F23211c6A6974fCE038AFBe` |
|
|
475
|
+
| USDC | `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48` |
|
|
476
|
+
| WETH | `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` |
|
|
477
|
+
| wstETH | `0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0` |
|
|
478
|
+
| cbETH | `0xBe9895146f7AF43049ca1c1AE358B0541Ea49704` |
|
|
479
|
+
|
|
480
|
+
### Cross-chain (same address on both networks)
|
|
434
481
|
|
|
435
482
|
| Contract | Address |
|
|
436
483
|
|----------|---------|
|
|
437
|
-
| Agether4337Factory | `0x67DE66D07ff3dba0092C21f070f8a0f53D657BC3` |
|
|
438
|
-
| Agether8004ValidationModule | `0xde896C58163b5f6cAC5B16C1b0109843f26106F6` |
|
|
439
|
-
| AgetherHookMultiplexer | `0x4AB6DaD0f7360fa8d8c75889A5c206B65d7CbeDb` |
|
|
440
|
-
| Agether7579Bootstrap | `0xCc83AA714c05B7141B21a17e80EB21bD09652b27` |
|
|
441
|
-
| Agether8004Scorer | `0x56c7D35A976fac67b1993b66b861fCA32f59104F` |
|
|
442
|
-
| TimelockController | `0xc600e7AAB8a230326C714CE66f356fdf6aC021d8` |
|
|
443
484
|
| Safe Singleton | `0x41675C099F32341bf84BFc5382aF534df5C7461a` |
|
|
444
485
|
| SafeProxyFactory | `0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67` |
|
|
445
486
|
| Safe7579 | `0x7579EE8307284F293B1927136486880611F20002` |
|
|
446
487
|
| EntryPoint v0.7 | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` |
|
|
447
488
|
| ERC-8004 Identity | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` |
|
|
448
489
|
| Morpho Blue | `0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb` |
|
|
449
|
-
| USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
|
|
450
|
-
| WETH | `0x4200000000000000000000000000000000000006` |
|
|
451
|
-
| wstETH | `0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452` |
|
|
452
|
-
| cbETH | `0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22` |
|
package/src/index.ts
CHANGED
|
@@ -175,6 +175,20 @@ function getConfig(api: any): PluginConfig {
|
|
|
175
175
|
let cachedAgentId: string | undefined;
|
|
176
176
|
let activeChainId: ChainId = ChainId.Ethereum;
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Hard guardrail: refuse to proceed if chain was never explicitly configured.
|
|
180
|
+
* Prevents silent default-to-Ethereum when user hasn't chosen a chain.
|
|
181
|
+
* Throws an error that the LLM sees, forcing it to call agether_set_chain first.
|
|
182
|
+
*/
|
|
183
|
+
function requireChain(cfg: PluginConfig): void {
|
|
184
|
+
if (!cfg.chainConfigured) {
|
|
185
|
+
throw new Error(
|
|
186
|
+
"Chain not configured. Ask the user which chain to use (Ethereum or Base), " +
|
|
187
|
+
"then call agether_set_chain before proceeding."
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
178
192
|
function createClient(cfg: PluginConfig): MorphoClient {
|
|
179
193
|
const agentId = cachedAgentId || cfg.agentId;
|
|
180
194
|
return new MorphoClient({
|
|
@@ -258,7 +272,8 @@ export default function register(api: any) {
|
|
|
258
272
|
api.registerTool({
|
|
259
273
|
name: "agether_register",
|
|
260
274
|
description:
|
|
261
|
-
"Register a new ERC-8004 agent identity and create a Safe smart account (via Safe7579).
|
|
275
|
+
"Register a new ERC-8004 agent identity and create a Safe smart account (via Safe7579). " +
|
|
276
|
+
"REQUIRES chain to be configured first — call agether_set_chain before this tool. Returns the new agentId.",
|
|
262
277
|
parameters: {
|
|
263
278
|
type: "object",
|
|
264
279
|
properties: {
|
|
@@ -269,6 +284,7 @@ export default function register(api: any) {
|
|
|
269
284
|
async execute(_id: string, params: { name: string }) {
|
|
270
285
|
try {
|
|
271
286
|
const cfg = getConfig(api);
|
|
287
|
+
requireChain(cfg);
|
|
272
288
|
const client = createClient(cfg);
|
|
273
289
|
const result = await client.register(params.name);
|
|
274
290
|
const persistStatus = persistAgentId(result.agentId);
|
|
@@ -417,6 +433,7 @@ export default function register(api: any) {
|
|
|
417
433
|
async execute(_id: string, params: { registryAddress: string }) {
|
|
418
434
|
try {
|
|
419
435
|
const cfg = getConfig(api);
|
|
436
|
+
requireChain(cfg);
|
|
420
437
|
const client = createClient(cfg);
|
|
421
438
|
|
|
422
439
|
// Build the calldata for ERC8004ValidationModule.setValidationRegistry — the owner (Timelock) must execute it
|
|
@@ -526,6 +543,7 @@ export default function register(api: any) {
|
|
|
526
543
|
async execute(_id: string, params: { amount: string; token: string }) {
|
|
527
544
|
try {
|
|
528
545
|
const cfg = getConfig(api);
|
|
546
|
+
requireChain(cfg);
|
|
529
547
|
const client = createClient(cfg);
|
|
530
548
|
const result = await client.supplyCollateral(params.token, params.amount);
|
|
531
549
|
return ok(JSON.stringify({
|
|
@@ -558,6 +576,7 @@ export default function register(api: any) {
|
|
|
558
576
|
async execute(_id: string, params: { collateralAmount: string; token: string; borrowAmount: string }) {
|
|
559
577
|
try {
|
|
560
578
|
const cfg = getConfig(api);
|
|
579
|
+
requireChain(cfg);
|
|
561
580
|
const client = createClient(cfg);
|
|
562
581
|
const result = await client.depositAndBorrow(
|
|
563
582
|
params.token,
|
|
@@ -597,6 +616,7 @@ export default function register(api: any) {
|
|
|
597
616
|
try {
|
|
598
617
|
if (!params.agentId && !params.agentAddress) return fail("Provide either agentId or agentAddress");
|
|
599
618
|
const cfg = getConfig(api);
|
|
619
|
+
requireChain(cfg);
|
|
600
620
|
const client = createClient(cfg);
|
|
601
621
|
|
|
602
622
|
const target = params.agentId
|
|
@@ -634,6 +654,7 @@ export default function register(api: any) {
|
|
|
634
654
|
async execute(_id: string, params: { amount: string; token?: string }) {
|
|
635
655
|
try {
|
|
636
656
|
const cfg = getConfig(api);
|
|
657
|
+
requireChain(cfg);
|
|
637
658
|
const client = createClient(cfg);
|
|
638
659
|
const result = await client.borrow(params.amount, params.token);
|
|
639
660
|
return ok(JSON.stringify({
|
|
@@ -666,6 +687,7 @@ export default function register(api: any) {
|
|
|
666
687
|
async execute(_id: string, params: { amount: string; token?: string }) {
|
|
667
688
|
try {
|
|
668
689
|
const cfg = getConfig(api);
|
|
690
|
+
requireChain(cfg);
|
|
669
691
|
const client = createClient(cfg);
|
|
670
692
|
const result = await client.repay(params.amount, params.token);
|
|
671
693
|
return ok(JSON.stringify({
|
|
@@ -699,6 +721,7 @@ export default function register(api: any) {
|
|
|
699
721
|
async execute(_id: string, params: { amount: string; token: string; toEoa?: boolean }) {
|
|
700
722
|
try {
|
|
701
723
|
const cfg = getConfig(api);
|
|
724
|
+
requireChain(cfg);
|
|
702
725
|
const client = createClient(cfg);
|
|
703
726
|
// Default: keep in AgentAccount. toEoa=true → send to EOA.
|
|
704
727
|
const receiver = params.toEoa ? await client.getSignerAddress() : await client.getAccountAddress();
|
|
@@ -739,6 +762,7 @@ export default function register(api: any) {
|
|
|
739
762
|
async execute(_id: string, params: { amount: string; market?: string }) {
|
|
740
763
|
try {
|
|
741
764
|
const cfg = getConfig(api);
|
|
765
|
+
requireChain(cfg);
|
|
742
766
|
const client = createClient(cfg);
|
|
743
767
|
const result = await client.supplyAsset(params.amount, params.market);
|
|
744
768
|
return ok(JSON.stringify({
|
|
@@ -831,6 +855,7 @@ export default function register(api: any) {
|
|
|
831
855
|
async execute(_id: string, params: { amount: string; market?: string; toEoa?: boolean }) {
|
|
832
856
|
try {
|
|
833
857
|
const cfg = getConfig(api);
|
|
858
|
+
requireChain(cfg);
|
|
834
859
|
const client = createClient(cfg);
|
|
835
860
|
// Default: keep in AgentAccount. toEoa=true → send to EOA.
|
|
836
861
|
const receiver = params.toEoa ? await client.getSignerAddress() : await client.getAccountAddress();
|
|
@@ -903,6 +928,7 @@ export default function register(api: any) {
|
|
|
903
928
|
async execute(_id: string, params: { refresh?: boolean }) {
|
|
904
929
|
try {
|
|
905
930
|
const cfg = getConfig(api);
|
|
931
|
+
requireChain(cfg);
|
|
906
932
|
const client = createClient(cfg);
|
|
907
933
|
const agentId = client.getAgentId();
|
|
908
934
|
|
|
@@ -952,6 +978,7 @@ export default function register(api: any) {
|
|
|
952
978
|
async execute(_id: string, params: { amount: string }) {
|
|
953
979
|
try {
|
|
954
980
|
const cfg = getConfig(api);
|
|
981
|
+
requireChain(cfg);
|
|
955
982
|
const client = createClient(cfg);
|
|
956
983
|
const result = await client.fundAccount(params.amount);
|
|
957
984
|
return ok(JSON.stringify({
|
|
@@ -984,6 +1011,7 @@ export default function register(api: any) {
|
|
|
984
1011
|
async execute(_id: string, params: { token: string; amount: string }) {
|
|
985
1012
|
try {
|
|
986
1013
|
const cfg = getConfig(api);
|
|
1014
|
+
requireChain(cfg);
|
|
987
1015
|
const client = createClient(cfg);
|
|
988
1016
|
const result = await client.withdrawToken(params.token, params.amount);
|
|
989
1017
|
return ok(JSON.stringify({
|
|
@@ -1015,6 +1043,7 @@ export default function register(api: any) {
|
|
|
1015
1043
|
async execute(_id: string, params: { amount: string }) {
|
|
1016
1044
|
try {
|
|
1017
1045
|
const cfg = getConfig(api);
|
|
1046
|
+
requireChain(cfg);
|
|
1018
1047
|
const client = createClient(cfg);
|
|
1019
1048
|
const result = await client.withdrawEth(params.amount);
|
|
1020
1049
|
return ok(JSON.stringify({
|
|
@@ -1049,6 +1078,7 @@ export default function register(api: any) {
|
|
|
1049
1078
|
async execute(_id: string, params: { url: string; method?: string; body?: string }) {
|
|
1050
1079
|
try {
|
|
1051
1080
|
const cfg = getConfig(api);
|
|
1081
|
+
requireChain(cfg);
|
|
1052
1082
|
const agetherCfg = api.config?.plugins?.entries?.agether?.config || {};
|
|
1053
1083
|
const client = createClient(cfg);
|
|
1054
1084
|
|