@agentlayer.tech/wallet 0.1.44 → 0.1.47
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/.openclaw/extensions/agent-wallet/index.ts +99 -0
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +6 -1
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/CHANGELOG.md +62 -0
- package/README.md +2 -2
- package/VERSION +1 -1
- package/agent-wallet/agent_wallet/__init__.py +1 -1
- package/agent-wallet/agent_wallet/openclaw_adapter.py +686 -0
- package/agent-wallet/agent_wallet/providers/jupiter.py +5 -0
- package/agent-wallet/agent_wallet/providers/wdk_evm_local.py +6 -0
- package/agent-wallet/agent_wallet/wallet_layer/base.py +79 -0
- package/agent-wallet/agent_wallet/wallet_layer/solana.py +14 -0
- package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +404 -0
- package/agent-wallet/openclaw.plugin.json +1 -1
- package/agent-wallet/pyproject.toml +1 -1
- package/agent-wallet/scripts/install_agent_wallet.py +33 -8
- package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +1 -1
- package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +1 -1
- package/hermes/plugins/agent_wallet/plugin.yaml +1 -1
- package/package.json +1 -1
- package/wdk-btc-wallet/package.json +1 -1
- package/wdk-evm-wallet/README.md +31 -0
- package/wdk-evm-wallet/package-lock.json +268 -64
- package/wdk-evm-wallet/package.json +4 -1
- package/wdk-evm-wallet/src/config.js +2 -0
- package/wdk-evm-wallet/src/server.js +66 -0
- package/wdk-evm-wallet/src/wdk_evm_wallet.js +2725 -939
|
@@ -38,6 +38,11 @@ function normalizeErrorCode(errorCode, pathname, message) {
|
|
|
38
38
|
code === "aave_approval_required" ||
|
|
39
39
|
code === "aave_fee_unavailable" ||
|
|
40
40
|
code === "aave_cleanup_failed" ||
|
|
41
|
+
code === "morpho_api_failed" ||
|
|
42
|
+
code === "morpho_quote_changed" ||
|
|
43
|
+
code === "morpho_requirements_unresolved" ||
|
|
44
|
+
code === "morpho_fee_unavailable" ||
|
|
45
|
+
code === "morpho_cleanup_failed" ||
|
|
41
46
|
code === "token_transfer_failed" ||
|
|
42
47
|
code === "fee_limit_exceeded" ||
|
|
43
48
|
code === "token_read_failed" ||
|
|
@@ -122,6 +127,9 @@ function errorStatusCode(errorCode, fallback = 400) {
|
|
|
122
127
|
if (errorCode === "aave_quote_changed") {
|
|
123
128
|
return 409;
|
|
124
129
|
}
|
|
130
|
+
if (errorCode === "morpho_quote_changed") {
|
|
131
|
+
return 409;
|
|
132
|
+
}
|
|
125
133
|
if (
|
|
126
134
|
errorCode === "swap_simulation_failed" ||
|
|
127
135
|
errorCode === "swap_approval_required" ||
|
|
@@ -131,6 +139,10 @@ function errorStatusCode(errorCode, fallback = 400) {
|
|
|
131
139
|
errorCode === "aave_approval_required" ||
|
|
132
140
|
errorCode === "aave_fee_unavailable" ||
|
|
133
141
|
errorCode === "aave_cleanup_failed" ||
|
|
142
|
+
errorCode === "morpho_api_failed" ||
|
|
143
|
+
errorCode === "morpho_requirements_unresolved" ||
|
|
144
|
+
errorCode === "morpho_fee_unavailable" ||
|
|
145
|
+
errorCode === "morpho_cleanup_failed" ||
|
|
134
146
|
errorCode === "token_transfer_failed" ||
|
|
135
147
|
errorCode === "fee_limit_exceeded" ||
|
|
136
148
|
errorCode === "uniswap_api_key_missing"
|
|
@@ -445,6 +457,60 @@ async function handleRequest(request, response) {
|
|
|
445
457
|
return sendJson(response, 200, { ok: true, data });
|
|
446
458
|
}
|
|
447
459
|
|
|
460
|
+
if (method === "POST" && url.pathname === "/v1/evm/morpho/vaults/get") {
|
|
461
|
+
const body = await withResolvedNetwork(await readJsonBody(request));
|
|
462
|
+
const data = await service.getMorphoVaults(body);
|
|
463
|
+
return sendJson(response, 200, { ok: true, data });
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
if (method === "POST" && url.pathname === "/v1/evm/morpho/markets/get") {
|
|
467
|
+
const body = await withResolvedNetwork(await readJsonBody(request));
|
|
468
|
+
const data = await service.getMorphoMarkets(body);
|
|
469
|
+
return sendJson(response, 200, { ok: true, data });
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (method === "POST" && url.pathname === "/v1/evm/morpho/positions/get") {
|
|
473
|
+
const body = await withResolvedNetwork(await withResolvedSeedOrAddress(await readJsonBody(request)));
|
|
474
|
+
const data = await service.getMorphoPositions(body);
|
|
475
|
+
return sendJson(response, 200, { ok: true, data });
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const morphoVaultOperationMatch = url.pathname.match(
|
|
479
|
+
/^\/v1\/evm\/morpho\/vault\/(supply|withdraw)\/(quote|send)$/
|
|
480
|
+
);
|
|
481
|
+
if (method === "POST" && morphoVaultOperationMatch) {
|
|
482
|
+
const operation = morphoVaultOperationMatch[1];
|
|
483
|
+
const action = morphoVaultOperationMatch[2];
|
|
484
|
+
const rawBody = await readJsonBody(request);
|
|
485
|
+
const body =
|
|
486
|
+
action === "quote"
|
|
487
|
+
? await withResolvedNetwork(await withResolvedSeedOrAddress(rawBody))
|
|
488
|
+
: await withResolvedNetwork(await withResolvedSeed(rawBody));
|
|
489
|
+
const data =
|
|
490
|
+
action === "quote"
|
|
491
|
+
? await service.quoteMorphoVaultOperation({ ...body, operation })
|
|
492
|
+
: await service.sendMorphoVaultOperation({ ...body, operation });
|
|
493
|
+
return sendJson(response, 200, { ok: true, data });
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const morphoMarketOperationMatch = url.pathname.match(
|
|
497
|
+
/^\/v1\/evm\/morpho\/market\/(supply_collateral|borrow|repay|withdraw_collateral)\/(quote|send)$/
|
|
498
|
+
);
|
|
499
|
+
if (method === "POST" && morphoMarketOperationMatch) {
|
|
500
|
+
const operation = morphoMarketOperationMatch[1];
|
|
501
|
+
const action = morphoMarketOperationMatch[2];
|
|
502
|
+
const rawBody = await readJsonBody(request);
|
|
503
|
+
const body =
|
|
504
|
+
action === "quote"
|
|
505
|
+
? await withResolvedNetwork(await withResolvedSeedOrAddress(rawBody))
|
|
506
|
+
: await withResolvedNetwork(await withResolvedSeed(rawBody));
|
|
507
|
+
const data =
|
|
508
|
+
action === "quote"
|
|
509
|
+
? await service.quoteMorphoMarketOperation({ ...body, operation })
|
|
510
|
+
: await service.sendMorphoMarketOperation({ ...body, operation });
|
|
511
|
+
return sendJson(response, 200, { ok: true, data });
|
|
512
|
+
}
|
|
513
|
+
|
|
448
514
|
if (method === "POST" && url.pathname === "/v1/evm/lido/overview/get") {
|
|
449
515
|
const body = await withResolvedNetwork(await withResolvedSeedOrAddress(await readJsonBody(request)));
|
|
450
516
|
const data = await service.getLidoOverview(body);
|