@agentlayer.tech/wallet 0.1.95 → 0.1.97
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/README.md +2 -2
- package/.openclaw/extensions/agent-wallet/dist/index.js +33 -15
- package/.openclaw/extensions/agent-wallet/index.ts +33 -15
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +2 -2
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/VERSION +1 -1
- package/agent-wallet/README.md +3 -3
- package/agent-wallet/agent_wallet/__init__.py +1 -1
- package/agent-wallet/agent_wallet/autonomous_policy.py +2 -1
- package/agent-wallet/agent_wallet/config.py +7 -11
- package/agent-wallet/agent_wallet/networks.py +25 -0
- package/agent-wallet/agent_wallet/openclaw_adapter.py +43 -25
- package/agent-wallet/agent_wallet/providers/evm_portfolio.py +9 -2
- package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +1 -1
- package/agent-wallet/openclaw.plugin.json +1 -1
- package/agent-wallet/pyproject.toml +1 -1
- package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +1 -1
- package/claude-code/plugins/agent-wallet/AGENTLAYER_AGENT_GUIDE.md +3 -2
- package/claude-code/plugins/agent-wallet/README.md +3 -0
- package/claude-code/plugins/agent-wallet/commands/x402.md +98 -0
- package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +1 -1
- package/codex/plugins/agent-wallet/README.md +7 -2
- package/codex/plugins/agent-wallet/server.py +15 -11
- package/codex/plugins/agent-wallet/skills/wallet-operator/SKILL.md +1 -1
- package/codex/plugins/agent-wallet/skills/x402/SKILL.md +102 -0
- 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/.env.example +4 -1
- package/wdk-evm-wallet/README.md +18 -2
- package/wdk-evm-wallet/package.json +1 -1
- package/wdk-evm-wallet/src/config.js +34 -3
- package/wdk-evm-wallet/src/network_state.js +8 -2
- package/wdk-evm-wallet/src/wdk_evm_wallet.js +8 -2
|
@@ -97,8 +97,8 @@ Important:
|
|
|
97
97
|
- The EVM tool surface is intentionally narrow: Velora and Uniswap swap quote/execute, Aave V3 account/reserve/position flows, native transfers, ERC-20 transfers, fee quotes, and receipt lookup only. No arbitrary calldata, standalone approvals, or generic contract execution are exposed to the agent.
|
|
98
98
|
- Velora swap and Aave V3 support are currently limited to `ethereum` and `base`. Test carefully because the upstream WDK protocol packages are still beta.
|
|
99
99
|
- Agents can call `set_wallet_backend` to switch the active wallet for the current OpenClaw plugin session between Solana, EVM, and Bitcoin. This does not edit `openclaw.json`; plugin config remains the startup default.
|
|
100
|
-
- EVM core read and transfer tools accept an optional per-call `network` override for `ethereum`, `base`, or `
|
|
101
|
-
- Agents can also call `set_evm_network` to select the active EVM network for the current OpenClaw plugin session. After that, EVM tools default to the selected network unless a specific call passes its own `network` value. Do not edit code, plugin config, or environment variables just to switch between Base, Ethereum, and
|
|
100
|
+
- EVM core read and transfer tools accept an optional per-call `network` override for `ethereum`, `base`, `robinhood`, or `goat`; Velora/Aave remain limited to Ethereum/Base, while Uniswap supports Ethereum/Base/Robinhood only. GOAT uses BTC as the native gas asset and exposes no bridge, DEX, or GOAT Flow/x402 operation through this core surface.
|
|
101
|
+
- Agents can also call `set_evm_network` to select the active EVM network for the current OpenClaw plugin session. After that, EVM tools default to the selected network unless a specific call passes its own `network` value. Do not edit code, plugin config, or environment variables just to switch between Base, Ethereum, Robinhood, and GOAT.
|
|
102
102
|
- `get_wallet_balance` returns an enriched wallet overview for Solana and EVM: native balance, discovered token balances, per-asset USD values when pricing is available, and `total_value_usd`.
|
|
103
103
|
- Solana wallet overview uses Solana RPC only for balance and token-account discovery. Token prices come from Jupiter, not RPC, and internal transfer/staking checks continue to use native-only balance reads.
|
|
104
104
|
- If the user needs to recover the mnemonic later, host-side reveal stays outside the agent tool surface via `agent-wallet/scripts/manage_openclaw_btc_wallet.py reveal-seed`.
|
|
@@ -18,7 +18,8 @@ const PREVIEW_BOUND_SWAP_TOOLS = new Set([
|
|
|
18
18
|
"flash_trade_open_position",
|
|
19
19
|
"flash_trade_close_position",
|
|
20
20
|
]);
|
|
21
|
-
const EVM_CORE_NETWORKS = ["ethereum", "base", "robinhood"];
|
|
21
|
+
const EVM_CORE_NETWORKS = ["ethereum", "base", "robinhood", "goat"];
|
|
22
|
+
const EVM_UNISWAP_NETWORKS = ["ethereum", "base", "robinhood"];
|
|
22
23
|
const AUTONOMOUS_BASE_SWAP_TOOLS = new Set([
|
|
23
24
|
"swap_evm_tokens",
|
|
24
25
|
"swap_evm_uniswap_tokens",
|
|
@@ -205,6 +206,7 @@ function normalizeWalletBackend(value) {
|
|
|
205
206
|
eth: "wdk_evm_local",
|
|
206
207
|
base: "wdk_evm_local",
|
|
207
208
|
robinhood: "wdk_evm_local",
|
|
209
|
+
goat: "wdk_evm_local",
|
|
208
210
|
wdk_evm_local: "wdk_evm_local",
|
|
209
211
|
"wdk-evm-local": "wdk_evm_local",
|
|
210
212
|
evm_local: "wdk_evm_local",
|
|
@@ -218,7 +220,7 @@ function normalizeWalletBackend(value) {
|
|
|
218
220
|
};
|
|
219
221
|
const backend = aliases[normalized] || normalized;
|
|
220
222
|
if (!["solana_local", "wdk_evm_local", "wdk_btc_local"].includes(backend)) {
|
|
221
|
-
throw new Error("Wallet backend must be solana, evm, ethereum, base, robinhood, btc, or bitcoin.");
|
|
223
|
+
throw new Error("Wallet backend must be solana, evm, ethereum, base, robinhood, goat, btc, or bitcoin.");
|
|
222
224
|
}
|
|
223
225
|
return backend;
|
|
224
226
|
}
|
|
@@ -236,17 +238,18 @@ function normalizeEvmNetwork(value) {
|
|
|
236
238
|
eth: "ethereum",
|
|
237
239
|
"eth-mainnet": "ethereum",
|
|
238
240
|
"base-mainnet": "base",
|
|
241
|
+
"goat-mainnet": "goat",
|
|
239
242
|
};
|
|
240
243
|
return aliases[normalized] || normalized;
|
|
241
244
|
}
|
|
242
245
|
|
|
243
246
|
function normalizeSelectableEvmNetwork(value) {
|
|
244
247
|
const network = normalizeEvmNetwork(value);
|
|
245
|
-
if (["sepolia", "base-sepolia", "base_sepolia"].includes(network)) {
|
|
246
|
-
throw new Error("EVM testnets are no longer supported. Use ethereum, base, or
|
|
248
|
+
if (["sepolia", "base-sepolia", "base_sepolia", "goat-testnet", "goat-testnet3"].includes(network)) {
|
|
249
|
+
throw new Error("EVM testnets are no longer supported. Use ethereum, base, robinhood, or goat.");
|
|
247
250
|
}
|
|
248
251
|
if (!EVM_CORE_NETWORKS.includes(network)) {
|
|
249
|
-
throw new Error("EVM network must be 'ethereum', 'base', or '
|
|
252
|
+
throw new Error("EVM network must be 'ethereum', 'base', 'robinhood', or 'goat'.");
|
|
250
253
|
}
|
|
251
254
|
return network;
|
|
252
255
|
}
|
|
@@ -370,6 +373,10 @@ function networkForBackend(api, backend) {
|
|
|
370
373
|
}
|
|
371
374
|
}
|
|
372
375
|
|
|
376
|
+
function isGoatEvmNetwork(network) {
|
|
377
|
+
return ["goat", "goat-mainnet", "eip155:2345"].includes(String(network || "").trim().toLowerCase());
|
|
378
|
+
}
|
|
379
|
+
|
|
373
380
|
function effectiveConfigForBackend(api, backend) {
|
|
374
381
|
const config = resolvePluginConfig(api);
|
|
375
382
|
return {
|
|
@@ -591,6 +598,8 @@ function registerTool(api, definition) {
|
|
|
591
598
|
const impliedNetwork =
|
|
592
599
|
["base", "base-mainnet"].includes(requestedWallet)
|
|
593
600
|
? "base"
|
|
601
|
+
: ["goat", "goat-mainnet"].includes(requestedWallet)
|
|
602
|
+
? "goat"
|
|
594
603
|
: ["ethereum", "eth", "mainnet", "eth-mainnet"].includes(requestedWallet)
|
|
595
604
|
? "ethereum"
|
|
596
605
|
: null;
|
|
@@ -674,6 +683,15 @@ function registerTool(api, definition) {
|
|
|
674
683
|
if (activeBackend === "wdk_evm_local" && effectiveParams.network !== undefined) {
|
|
675
684
|
configOverride.network = normalizeSelectableEvmNetwork(effectiveParams.network);
|
|
676
685
|
}
|
|
686
|
+
if (
|
|
687
|
+
definition.name === "x402_pay_request" &&
|
|
688
|
+
activeBackend === "wdk_evm_local" &&
|
|
689
|
+
isGoatEvmNetwork(configOverride.network)
|
|
690
|
+
) {
|
|
691
|
+
throw new Error(
|
|
692
|
+
"GOAT x402 payments are not enabled in this wallet surface. Use the supported core GOAT wallet operations instead."
|
|
693
|
+
);
|
|
694
|
+
}
|
|
677
695
|
await attachApprovalForExecute(api, configOverride, userId, definition.name, effectiveParams);
|
|
678
696
|
const executeWalletTool = async () =>
|
|
679
697
|
callWalletCli(api, "invoke", [
|
|
@@ -844,12 +862,12 @@ const walletSessionToolDefinitions = [
|
|
|
844
862
|
properties: {
|
|
845
863
|
backend: {
|
|
846
864
|
type: "string",
|
|
847
|
-
enum: ["solana", "sol", "evm", "ethereum", "base", "robinhood", "bitcoin", "btc"],
|
|
865
|
+
enum: ["solana", "sol", "evm", "ethereum", "base", "robinhood", "goat", "bitcoin", "btc"],
|
|
848
866
|
description: "Wallet backend or common alias to make active.",
|
|
849
867
|
},
|
|
850
868
|
network: {
|
|
851
869
|
type: "string",
|
|
852
|
-
description: "Optional network for the selected wallet. Examples: mainnet, ethereum, base, robinhood, bitcoin.",
|
|
870
|
+
description: "Optional network for the selected wallet. Examples: mainnet, ethereum, base, robinhood, goat, bitcoin.",
|
|
853
871
|
},
|
|
854
872
|
},
|
|
855
873
|
required: ["backend"],
|
|
@@ -1640,7 +1658,7 @@ const evmToolDefinitions = [
|
|
|
1640
1658
|
{
|
|
1641
1659
|
name: "set_evm_network",
|
|
1642
1660
|
description:
|
|
1643
|
-
"Select the active EVM network for subsequent wallet tool calls in this OpenClaw plugin session. Use this to switch between ethereum, base, and
|
|
1661
|
+
"Select the active EVM network for subsequent wallet tool calls in this OpenClaw plugin session. Use this to switch between ethereum, base, robinhood, and goat instead of editing code or plugin configuration.",
|
|
1644
1662
|
parameters: {
|
|
1645
1663
|
type: "object",
|
|
1646
1664
|
properties: {
|
|
@@ -1693,7 +1711,7 @@ const evmToolDefinitions = [
|
|
|
1693
1711
|
},
|
|
1694
1712
|
{
|
|
1695
1713
|
name: "get_evm_transaction_receipt",
|
|
1696
|
-
description: "Get the transaction receipt for a broadcast EVM transaction hash.",
|
|
1714
|
+
description: "Get the transaction receipt for a broadcast EVM transaction hash. On GOAT, a receipt confirms L2 inclusion; it does not by itself prove Bitcoin-backed finality.",
|
|
1697
1715
|
parameters: {
|
|
1698
1716
|
type: "object",
|
|
1699
1717
|
properties: {
|
|
@@ -1972,7 +1990,7 @@ const evmToolDefinitions = [
|
|
|
1972
1990
|
token_out: { type: "string" },
|
|
1973
1991
|
amount_in_raw: { type: "string" },
|
|
1974
1992
|
slippage_bps: { type: "integer" },
|
|
1975
|
-
network: { type: "string", enum:
|
|
1993
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
1976
1994
|
},
|
|
1977
1995
|
required: ["token_in", "token_out", "amount_in_raw"],
|
|
1978
1996
|
additionalProperties: false,
|
|
@@ -1990,7 +2008,7 @@ const evmToolDefinitions = [
|
|
|
1990
2008
|
dex_id: { type: "string" },
|
|
1991
2009
|
all_chains: { type: "boolean" },
|
|
1992
2010
|
limit: { type: "integer" },
|
|
1993
|
-
network: { type: "string", enum:
|
|
2011
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
1994
2012
|
},
|
|
1995
2013
|
additionalProperties: false,
|
|
1996
2014
|
},
|
|
@@ -2014,7 +2032,7 @@ const evmToolDefinitions = [
|
|
|
2014
2032
|
},
|
|
2015
2033
|
page_size: { type: "integer", minimum: 1, maximum: 20 },
|
|
2016
2034
|
current_page: { type: "integer", minimum: 1 },
|
|
2017
|
-
network: { type: "string", enum:
|
|
2035
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2018
2036
|
},
|
|
2019
2037
|
required: ["protocol"],
|
|
2020
2038
|
additionalProperties: false,
|
|
@@ -2028,7 +2046,7 @@ const evmToolDefinitions = [
|
|
|
2028
2046
|
properties: {
|
|
2029
2047
|
protocol: { type: "string", enum: ["V3"] },
|
|
2030
2048
|
limit: { type: "integer", minimum: 1, maximum: 100 },
|
|
2031
|
-
network: { type: "string", enum:
|
|
2049
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2032
2050
|
},
|
|
2033
2051
|
additionalProperties: false,
|
|
2034
2052
|
},
|
|
@@ -2047,7 +2065,7 @@ const evmToolDefinitions = [
|
|
|
2047
2065
|
mode: { type: "string", enum: ["preview", "prepare", "execute"] },
|
|
2048
2066
|
purpose: { type: "string" },
|
|
2049
2067
|
user_intent: { type: "boolean" },
|
|
2050
|
-
network: { type: "string", enum:
|
|
2068
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2051
2069
|
},
|
|
2052
2070
|
required: ["token_in", "token_out", "amount_in_raw", "mode", "purpose"],
|
|
2053
2071
|
additionalProperties: false,
|
|
@@ -2070,7 +2088,7 @@ const evmToolDefinitions = [
|
|
|
2070
2088
|
mode: { type: "string", enum: ["preview", "prepare", "execute"] },
|
|
2071
2089
|
purpose: { type: "string" },
|
|
2072
2090
|
user_intent: { type: "boolean" },
|
|
2073
|
-
network: { type: "string", enum:
|
|
2091
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2074
2092
|
},
|
|
2075
2093
|
required: ["action", "protocol", "request", "mode", "purpose"],
|
|
2076
2094
|
additionalProperties: false,
|
|
@@ -18,7 +18,8 @@ const PREVIEW_BOUND_SWAP_TOOLS = new Set([
|
|
|
18
18
|
"flash_trade_open_position",
|
|
19
19
|
"flash_trade_close_position",
|
|
20
20
|
]);
|
|
21
|
-
const EVM_CORE_NETWORKS = ["ethereum", "base", "robinhood"];
|
|
21
|
+
const EVM_CORE_NETWORKS = ["ethereum", "base", "robinhood", "goat"];
|
|
22
|
+
const EVM_UNISWAP_NETWORKS = ["ethereum", "base", "robinhood"];
|
|
22
23
|
const AUTONOMOUS_BASE_SWAP_TOOLS = new Set([
|
|
23
24
|
"swap_evm_tokens",
|
|
24
25
|
"swap_evm_uniswap_tokens",
|
|
@@ -205,6 +206,7 @@ function normalizeWalletBackend(value) {
|
|
|
205
206
|
eth: "wdk_evm_local",
|
|
206
207
|
base: "wdk_evm_local",
|
|
207
208
|
robinhood: "wdk_evm_local",
|
|
209
|
+
goat: "wdk_evm_local",
|
|
208
210
|
wdk_evm_local: "wdk_evm_local",
|
|
209
211
|
"wdk-evm-local": "wdk_evm_local",
|
|
210
212
|
evm_local: "wdk_evm_local",
|
|
@@ -218,7 +220,7 @@ function normalizeWalletBackend(value) {
|
|
|
218
220
|
};
|
|
219
221
|
const backend = aliases[normalized] || normalized;
|
|
220
222
|
if (!["solana_local", "wdk_evm_local", "wdk_btc_local"].includes(backend)) {
|
|
221
|
-
throw new Error("Wallet backend must be solana, evm, ethereum, base, robinhood, btc, or bitcoin.");
|
|
223
|
+
throw new Error("Wallet backend must be solana, evm, ethereum, base, robinhood, goat, btc, or bitcoin.");
|
|
222
224
|
}
|
|
223
225
|
return backend;
|
|
224
226
|
}
|
|
@@ -236,17 +238,18 @@ function normalizeEvmNetwork(value) {
|
|
|
236
238
|
eth: "ethereum",
|
|
237
239
|
"eth-mainnet": "ethereum",
|
|
238
240
|
"base-mainnet": "base",
|
|
241
|
+
"goat-mainnet": "goat",
|
|
239
242
|
};
|
|
240
243
|
return aliases[normalized] || normalized;
|
|
241
244
|
}
|
|
242
245
|
|
|
243
246
|
function normalizeSelectableEvmNetwork(value) {
|
|
244
247
|
const network = normalizeEvmNetwork(value);
|
|
245
|
-
if (["sepolia", "base-sepolia", "base_sepolia"].includes(network)) {
|
|
246
|
-
throw new Error("EVM testnets are no longer supported. Use ethereum, base, or
|
|
248
|
+
if (["sepolia", "base-sepolia", "base_sepolia", "goat-testnet", "goat-testnet3"].includes(network)) {
|
|
249
|
+
throw new Error("EVM testnets are no longer supported. Use ethereum, base, robinhood, or goat.");
|
|
247
250
|
}
|
|
248
251
|
if (!EVM_CORE_NETWORKS.includes(network)) {
|
|
249
|
-
throw new Error("EVM network must be 'ethereum', 'base', or '
|
|
252
|
+
throw new Error("EVM network must be 'ethereum', 'base', 'robinhood', or 'goat'.");
|
|
250
253
|
}
|
|
251
254
|
return network;
|
|
252
255
|
}
|
|
@@ -370,6 +373,10 @@ function networkForBackend(api, backend) {
|
|
|
370
373
|
}
|
|
371
374
|
}
|
|
372
375
|
|
|
376
|
+
function isGoatEvmNetwork(network) {
|
|
377
|
+
return ["goat", "goat-mainnet", "eip155:2345"].includes(String(network || "").trim().toLowerCase());
|
|
378
|
+
}
|
|
379
|
+
|
|
373
380
|
function effectiveConfigForBackend(api, backend) {
|
|
374
381
|
const config = resolvePluginConfig(api);
|
|
375
382
|
return {
|
|
@@ -591,6 +598,8 @@ function registerTool(api, definition) {
|
|
|
591
598
|
const impliedNetwork =
|
|
592
599
|
["base", "base-mainnet"].includes(requestedWallet)
|
|
593
600
|
? "base"
|
|
601
|
+
: ["goat", "goat-mainnet"].includes(requestedWallet)
|
|
602
|
+
? "goat"
|
|
594
603
|
: ["ethereum", "eth", "mainnet", "eth-mainnet"].includes(requestedWallet)
|
|
595
604
|
? "ethereum"
|
|
596
605
|
: null;
|
|
@@ -674,6 +683,15 @@ function registerTool(api, definition) {
|
|
|
674
683
|
if (activeBackend === "wdk_evm_local" && effectiveParams.network !== undefined) {
|
|
675
684
|
configOverride.network = normalizeSelectableEvmNetwork(effectiveParams.network);
|
|
676
685
|
}
|
|
686
|
+
if (
|
|
687
|
+
definition.name === "x402_pay_request" &&
|
|
688
|
+
activeBackend === "wdk_evm_local" &&
|
|
689
|
+
isGoatEvmNetwork(configOverride.network)
|
|
690
|
+
) {
|
|
691
|
+
throw new Error(
|
|
692
|
+
"GOAT x402 payments are not enabled in this wallet surface. Use the supported core GOAT wallet operations instead."
|
|
693
|
+
);
|
|
694
|
+
}
|
|
677
695
|
await attachApprovalForExecute(api, configOverride, userId, definition.name, effectiveParams);
|
|
678
696
|
const executeWalletTool = async () =>
|
|
679
697
|
callWalletCli(api, "invoke", [
|
|
@@ -844,12 +862,12 @@ const walletSessionToolDefinitions = [
|
|
|
844
862
|
properties: {
|
|
845
863
|
backend: {
|
|
846
864
|
type: "string",
|
|
847
|
-
enum: ["solana", "sol", "evm", "ethereum", "base", "robinhood", "bitcoin", "btc"],
|
|
865
|
+
enum: ["solana", "sol", "evm", "ethereum", "base", "robinhood", "goat", "bitcoin", "btc"],
|
|
848
866
|
description: "Wallet backend or common alias to make active.",
|
|
849
867
|
},
|
|
850
868
|
network: {
|
|
851
869
|
type: "string",
|
|
852
|
-
description: "Optional network for the selected wallet. Examples: mainnet, ethereum, base, robinhood, bitcoin.",
|
|
870
|
+
description: "Optional network for the selected wallet. Examples: mainnet, ethereum, base, robinhood, goat, bitcoin.",
|
|
853
871
|
},
|
|
854
872
|
},
|
|
855
873
|
required: ["backend"],
|
|
@@ -1640,7 +1658,7 @@ const evmToolDefinitions = [
|
|
|
1640
1658
|
{
|
|
1641
1659
|
name: "set_evm_network",
|
|
1642
1660
|
description:
|
|
1643
|
-
"Select the active EVM network for subsequent wallet tool calls in this OpenClaw plugin session. Use this to switch between ethereum, base, and
|
|
1661
|
+
"Select the active EVM network for subsequent wallet tool calls in this OpenClaw plugin session. Use this to switch between ethereum, base, robinhood, and goat instead of editing code or plugin configuration.",
|
|
1644
1662
|
parameters: {
|
|
1645
1663
|
type: "object",
|
|
1646
1664
|
properties: {
|
|
@@ -1693,7 +1711,7 @@ const evmToolDefinitions = [
|
|
|
1693
1711
|
},
|
|
1694
1712
|
{
|
|
1695
1713
|
name: "get_evm_transaction_receipt",
|
|
1696
|
-
description: "Get the transaction receipt for a broadcast EVM transaction hash.",
|
|
1714
|
+
description: "Get the transaction receipt for a broadcast EVM transaction hash. On GOAT, a receipt confirms L2 inclusion; it does not by itself prove Bitcoin-backed finality.",
|
|
1697
1715
|
parameters: {
|
|
1698
1716
|
type: "object",
|
|
1699
1717
|
properties: {
|
|
@@ -1972,7 +1990,7 @@ const evmToolDefinitions = [
|
|
|
1972
1990
|
token_out: { type: "string" },
|
|
1973
1991
|
amount_in_raw: { type: "string" },
|
|
1974
1992
|
slippage_bps: { type: "integer" },
|
|
1975
|
-
network: { type: "string", enum:
|
|
1993
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
1976
1994
|
},
|
|
1977
1995
|
required: ["token_in", "token_out", "amount_in_raw"],
|
|
1978
1996
|
additionalProperties: false,
|
|
@@ -1990,7 +2008,7 @@ const evmToolDefinitions = [
|
|
|
1990
2008
|
dex_id: { type: "string" },
|
|
1991
2009
|
all_chains: { type: "boolean" },
|
|
1992
2010
|
limit: { type: "integer" },
|
|
1993
|
-
network: { type: "string", enum:
|
|
2011
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
1994
2012
|
},
|
|
1995
2013
|
additionalProperties: false,
|
|
1996
2014
|
},
|
|
@@ -2014,7 +2032,7 @@ const evmToolDefinitions = [
|
|
|
2014
2032
|
},
|
|
2015
2033
|
page_size: { type: "integer", minimum: 1, maximum: 20 },
|
|
2016
2034
|
current_page: { type: "integer", minimum: 1 },
|
|
2017
|
-
network: { type: "string", enum:
|
|
2035
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2018
2036
|
},
|
|
2019
2037
|
required: ["protocol"],
|
|
2020
2038
|
additionalProperties: false,
|
|
@@ -2028,7 +2046,7 @@ const evmToolDefinitions = [
|
|
|
2028
2046
|
properties: {
|
|
2029
2047
|
protocol: { type: "string", enum: ["V3"] },
|
|
2030
2048
|
limit: { type: "integer", minimum: 1, maximum: 100 },
|
|
2031
|
-
network: { type: "string", enum:
|
|
2049
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2032
2050
|
},
|
|
2033
2051
|
additionalProperties: false,
|
|
2034
2052
|
},
|
|
@@ -2047,7 +2065,7 @@ const evmToolDefinitions = [
|
|
|
2047
2065
|
mode: { type: "string", enum: ["preview", "prepare", "execute"] },
|
|
2048
2066
|
purpose: { type: "string" },
|
|
2049
2067
|
user_intent: { type: "boolean" },
|
|
2050
|
-
network: { type: "string", enum:
|
|
2068
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2051
2069
|
},
|
|
2052
2070
|
required: ["token_in", "token_out", "amount_in_raw", "mode", "purpose"],
|
|
2053
2071
|
additionalProperties: false,
|
|
@@ -2070,7 +2088,7 @@ const evmToolDefinitions = [
|
|
|
2070
2088
|
mode: { type: "string", enum: ["preview", "prepare", "execute"] },
|
|
2071
2089
|
purpose: { type: "string" },
|
|
2072
2090
|
user_intent: { type: "boolean" },
|
|
2073
|
-
network: { type: "string", enum:
|
|
2091
|
+
network: { type: "string", enum: EVM_UNISWAP_NETWORKS },
|
|
2074
2092
|
},
|
|
2075
2093
|
required: ["action", "protocol", "request", "mode", "purpose"],
|
|
2076
2094
|
additionalProperties: false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "agent-wallet",
|
|
3
3
|
"name": "Agent Wallet",
|
|
4
4
|
"description": "Official OpenClaw plugin bridge for the agent-wallet backends, including Solana, local BTC, and local EVM.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.97",
|
|
6
6
|
"contracts": {
|
|
7
7
|
"tools": [
|
|
8
8
|
"agentlayer_autonomous_approve",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
"network": {
|
|
102
102
|
"type": "string",
|
|
103
|
-
"description": "Backend network selector. Solana uses mainnet. BTC uses bitcoin. EVM uses ethereum/base."
|
|
103
|
+
"description": "Backend network selector. Solana uses mainnet. BTC uses bitcoin. EVM uses ethereum/base/robinhood/goat."
|
|
104
104
|
},
|
|
105
105
|
"wdkBtcServiceUrl": {
|
|
106
106
|
"type": "string",
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.97
|
package/agent-wallet/README.md
CHANGED
|
@@ -383,8 +383,8 @@ For the local EVM backend (`backend=wdk_evm_local`), the lifecycle mirrors the B
|
|
|
383
383
|
- `agent-wallet` talks to it through a local bearer token loaded from `~/.openclaw/wdk-evm-wallet/local-auth-token`
|
|
384
384
|
- `agent-wallet` stores only a per-user EVM wallet binding under `~/.openclaw/users/<normalized-user-id>/wallets/evm-<network>-agent.json`
|
|
385
385
|
- the runtime can auto-create missing EVM bindings or auto-unlock the local vault during ordinary OpenClaw switching/tool calls when `sealed_keys.json` contains `wdk_evm_wallet_password`
|
|
386
|
-
- supported EVM networks are `ethereum` and `
|
|
387
|
-
- OpenClaw-facing EVM tools accept an optional per-call `network` override for
|
|
386
|
+
- supported EVM networks are `ethereum`, `base`, `robinhood`, and `goat`
|
|
387
|
+
- OpenClaw-facing EVM core read and transfer tools accept an optional per-call `network` override for those mainnet networks, so the agent can switch without editing host config. GOAT uses BTC as its 18-decimal native gas asset; token discovery is intentionally native-only until a reviewed GOAT indexer is added, while explicit ERC-20 balance and metadata reads remain available.
|
|
388
388
|
- EVM `get_wallet_balance` now returns an enriched portfolio-style payload with native balance, discovered ERC-20 balances, and USD values when token discovery and pricing are available
|
|
389
389
|
- if a requested EVM network binding is missing, `agent-wallet` auto-binds it from the same local wallet when there is exactly one reusable EVM wallet for that user or when `wdkEvmWalletId` is provided explicitly
|
|
390
390
|
- you can manage that binding through `agent_wallet.openclaw_cli`:
|
|
@@ -406,7 +406,7 @@ That wrapper:
|
|
|
406
406
|
- defaults to `http://127.0.0.1:8081`
|
|
407
407
|
- can auto-start `wdk-evm-wallet/run-local.sh` if the local service is not already healthy
|
|
408
408
|
- creates or unlocks the local EVM wallet binding
|
|
409
|
-
- also binds the paired EVM network by default: `ethereum <-> base`
|
|
409
|
+
- also binds the paired EVM network by default: `ethereum <-> base` (GOAT remains an independent EVM network binding)
|
|
410
410
|
- stores the entered EVM vault password into `sealed_keys.json` when `AGENT_WALLET_BOOT_KEY` is available, so later OpenClaw wallet switching can auto-raise the EVM backend without another password prompt
|
|
411
411
|
- patches OpenClaw config to `backend=wdk_evm_local`
|
|
412
412
|
|
|
@@ -37,6 +37,7 @@ from dataclasses import dataclass, field
|
|
|
37
37
|
from typing import Callable
|
|
38
38
|
|
|
39
39
|
from agent_wallet.approval import issue_approval_token
|
|
40
|
+
from agent_wallet.networks import AUTONOMOUS_MAINNET_NETWORKS
|
|
40
41
|
from agent_wallet.spending_limits import SpendingConfig, SpendingLedger
|
|
41
42
|
from agent_wallet.wallet_layer.base import WalletBackendError
|
|
42
43
|
|
|
@@ -46,7 +47,7 @@ AUTONOMOUS_ISSUER = "autonomous-policy"
|
|
|
46
47
|
|
|
47
48
|
#: Networks treated as "real money" and therefore gated behind
|
|
48
49
|
#: ``allow_mainnet`` regardless of the per-tool allow-list.
|
|
49
|
-
MAINNET_NETWORKS =
|
|
50
|
+
MAINNET_NETWORKS = AUTONOMOUS_MAINNET_NETWORKS
|
|
50
51
|
|
|
51
52
|
TokenIssuer = Callable[..., str]
|
|
52
53
|
|
|
@@ -7,6 +7,8 @@ from typing import Iterator
|
|
|
7
7
|
|
|
8
8
|
from pydantic_settings import BaseSettings
|
|
9
9
|
|
|
10
|
+
from agent_wallet.networks import EVM_CORE_MAINNETS, EVM_CORE_NETWORK_ALIASES, EVM_CORE_TESTNETS
|
|
11
|
+
|
|
10
12
|
PACKAGE_ROOT = Path(__file__).resolve().parents[1]
|
|
11
13
|
DEFAULT_PROVIDER_GATEWAY_URL = "https://agent-layer-production.up.railway.app"
|
|
12
14
|
|
|
@@ -112,24 +114,18 @@ def normalize_solana_network(network: str | None) -> str:
|
|
|
112
114
|
def normalize_evm_network(network: str | None) -> str:
|
|
113
115
|
"""Canonicalize supported EVM network names and reject testnets."""
|
|
114
116
|
normalized = str(network or "").strip().lower() or "ethereum"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"eth": "ethereum",
|
|
118
|
-
"eth-mainnet": "ethereum",
|
|
119
|
-
"base-mainnet": "base",
|
|
120
|
-
}
|
|
121
|
-
normalized = aliases.get(normalized, normalized)
|
|
122
|
-
if normalized in {"sepolia", "base-sepolia", "base_sepolia"}:
|
|
117
|
+
normalized = EVM_CORE_NETWORK_ALIASES.get(normalized, normalized)
|
|
118
|
+
if normalized in EVM_CORE_TESTNETS:
|
|
123
119
|
from agent_wallet.wallet_layer.base import WalletBackendError
|
|
124
120
|
|
|
125
121
|
raise WalletBackendError(
|
|
126
|
-
"EVM testnets are no longer supported by agent-wallet. Use ethereum, base, or
|
|
122
|
+
"EVM testnets are no longer supported by agent-wallet. Use ethereum, base, robinhood, or goat."
|
|
127
123
|
)
|
|
128
|
-
if normalized not in
|
|
124
|
+
if normalized not in EVM_CORE_MAINNETS:
|
|
129
125
|
from agent_wallet.wallet_layer.base import WalletBackendError
|
|
130
126
|
|
|
131
127
|
raise WalletBackendError(
|
|
132
|
-
f"Unsupported EVM network: {normalized}. Use ethereum, base, or
|
|
128
|
+
f"Unsupported EVM network: {normalized}. Use ethereum, base, robinhood, or goat."
|
|
133
129
|
)
|
|
134
130
|
return normalized
|
|
135
131
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Canonical network identifiers used by agent-wallet policy gates.
|
|
2
|
+
|
|
3
|
+
The Python wallet backend owns approval and autonomous-execution policy. Keep
|
|
4
|
+
the selectable EVM network set and its mainnet identities here so additions
|
|
5
|
+
cannot silently reach one policy gate but miss another.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
EVM_CORE_MAINNETS = frozenset({"ethereum", "base", "robinhood", "goat"})
|
|
9
|
+
EVM_CORE_NETWORK_ALIASES = {
|
|
10
|
+
"mainnet": "ethereum",
|
|
11
|
+
"eth": "ethereum",
|
|
12
|
+
"eth-mainnet": "ethereum",
|
|
13
|
+
"base-mainnet": "base",
|
|
14
|
+
"goat-mainnet": "goat",
|
|
15
|
+
}
|
|
16
|
+
EVM_CORE_TESTNETS = frozenset({"sepolia", "base-sepolia", "base_sepolia", "goat-testnet", "goat-testnet3"})
|
|
17
|
+
EVM_CORE_MAINNET_CAIP_IDS = frozenset({"eip155:1", "eip155:8453", "eip155:4663", "eip155:2345"})
|
|
18
|
+
GOAT_EVM_NETWORK_IDENTIFIERS = frozenset({"goat", "goat-mainnet", "eip155:2345"})
|
|
19
|
+
|
|
20
|
+
# The autonomous engine may also govern legacy supported operation classes
|
|
21
|
+
# outside the selectable EVM wallet surface. Keep that superset derived from
|
|
22
|
+
# the core EVM mainnet definition rather than re-listing its members.
|
|
23
|
+
AUTONOMOUS_MAINNET_NETWORKS = frozenset(
|
|
24
|
+
{"mainnet", "mainnet-beta", "arbitrum", "optimism", "polygon"} | EVM_CORE_MAINNETS
|
|
25
|
+
)
|