@agentlayer.tech/wallet 0.1.30 → 0.1.32
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 +1 -2
- package/.openclaw/extensions/agent-wallet/dist/index.js +6 -340
- package/.openclaw/extensions/agent-wallet/index.ts +6 -340
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +0 -43
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/.openclaw/extensions/agent-wallet/skills/wallet-operator/SKILL.md +1 -3
- package/CHANGELOG.md +35 -0
- package/README.md +0 -5
- package/agent-wallet/.env.example +0 -12
- package/agent-wallet/README.md +0 -35
- package/agent-wallet/agent_wallet/btc_user_wallets.py +32 -1
- package/agent-wallet/agent_wallet/config.py +11 -7
- package/agent-wallet/agent_wallet/evm_user_wallets.py +2 -0
- package/agent-wallet/agent_wallet/openclaw_adapter.py +1 -655
- package/agent-wallet/agent_wallet/openclaw_cli.py +0 -7
- package/agent-wallet/agent_wallet/providers/evm_portfolio.py +18 -42
- package/agent-wallet/agent_wallet/providers/jupiter.py +1 -307
- package/agent-wallet/agent_wallet/providers/wdk_btc_local.py +31 -3
- package/agent-wallet/agent_wallet/providers/wdk_evm_local.py +37 -3
- package/agent-wallet/agent_wallet/transaction_policy.py +0 -262
- package/agent-wallet/agent_wallet/wallet_layer/base.py +0 -100
- package/agent-wallet/agent_wallet/wallet_layer/solana.py +1 -1118
- package/agent-wallet/openclaw.plugin.json +0 -4
- package/agent-wallet/pyproject.toml +1 -1
- package/agent-wallet/scripts/install_agent_wallet.py +113 -6
- package/agent-wallet/scripts/install_openclaw_local_config.py +7 -5
- package/agent-wallet/skills/wallet-operator/SKILL.md +1 -5
- package/bin/openclaw-agent-wallet.mjs +103 -36
- package/claude-code/plugins/agent-wallet/scripts/run_mcp.sh +7 -2
- package/codex/plugins/agent-wallet/server.py +2 -118
- package/hermes/plugins/agent_wallet/tools.py +1 -1
- package/package.json +1 -1
- package/wdk-btc-wallet/src/local_vault.js +45 -68
- package/wdk-btc-wallet/src/server.js +1 -0
- package/wdk-evm-wallet/README.md +4 -3
- package/wdk-evm-wallet/src/config.js +15 -0
- package/wdk-evm-wallet/src/local_vault.js +45 -68
- package/wdk-evm-wallet/src/server.js +1 -0
- package/agent-wallet/agent_wallet/providers/houdini.py +0 -539
|
@@ -13,16 +13,12 @@ let selectedSolanaNetwork = null;
|
|
|
13
13
|
let selectedEvmNetwork = null;
|
|
14
14
|
let selectedBtcNetwork = null;
|
|
15
15
|
const PREVIEW_CACHE_TTL_MS = 15 * 60 * 1000;
|
|
16
|
-
const PRIVATE_SWAP_CACHE_TTL_MS = 35 * 60 * 1000;
|
|
17
16
|
const PREVIEW_BOUND_SWAP_TOOLS = new Set([
|
|
18
17
|
"swap_solana_tokens",
|
|
19
|
-
"swap_solana_privately",
|
|
20
18
|
"flash_trade_open_position",
|
|
21
19
|
"flash_trade_close_position",
|
|
22
20
|
]);
|
|
23
|
-
const PRIVATE_SWAP_APPROVAL_TOOL_NAME = "swap_solana_privately";
|
|
24
21
|
const approvalPreviewCache = new Map();
|
|
25
|
-
const privateSwapOrderCache = new Map();
|
|
26
22
|
const WALLET_TOOL_ONLY_GUIDANCE =
|
|
27
23
|
"Use this wallet tool instead of shelling out to solana CLI, spl-token CLI, curl, or exec. If it fails, surface the wallet-tool error and stop rather than falling back to terminal commands.";
|
|
28
24
|
const OPENCLAW_EXECUTE_APPROVAL_GUIDANCE =
|
|
@@ -82,16 +78,10 @@ function cachePreviewForApproval(userId, toolName, payload) {
|
|
|
82
78
|
const digest = previewDigest(approvalSource);
|
|
83
79
|
approvalPreviewCache.set(approvalCacheKey(userId, cacheToolName), {
|
|
84
80
|
digest,
|
|
85
|
-
expiresAt:
|
|
86
|
-
cacheToolName === "swap_solana_privately"
|
|
87
|
-
? Date.now() + PRIVATE_SWAP_CACHE_TTL_MS
|
|
88
|
-
: Date.now() + PREVIEW_CACHE_TTL_MS,
|
|
81
|
+
expiresAt: Date.now() + PREVIEW_CACHE_TTL_MS,
|
|
89
82
|
preview: approvalSource,
|
|
90
83
|
summary: approvalSource.confirmation_summary,
|
|
91
84
|
});
|
|
92
|
-
if (cacheToolName === "swap_solana_privately") {
|
|
93
|
-
privateSwapOrderCache.delete(approvalCacheKey(userId, cacheToolName));
|
|
94
|
-
}
|
|
95
85
|
}
|
|
96
86
|
|
|
97
87
|
function latestCachedPreview(userId, toolName) {
|
|
@@ -158,93 +148,6 @@ function normalizeApprovalContextError(error) {
|
|
|
158
148
|
return wrapped;
|
|
159
149
|
}
|
|
160
150
|
|
|
161
|
-
function cachePendingPrivateSwapOrder(userId, toolName, preview, details) {
|
|
162
|
-
if (toolName !== "swap_solana_privately") return;
|
|
163
|
-
if (!preview || typeof preview !== "object") return;
|
|
164
|
-
if (!details || typeof details !== "object") return;
|
|
165
|
-
const houdiniId = typeof details.houdini_id === "string" ? details.houdini_id.trim() : "";
|
|
166
|
-
const depositAddress =
|
|
167
|
-
typeof details.deposit_address === "string" ? details.deposit_address.trim() : "";
|
|
168
|
-
if (!houdiniId || !depositAddress) return;
|
|
169
|
-
privateSwapOrderCache.set(approvalCacheKey(userId, toolName), {
|
|
170
|
-
digest: previewDigest(preview),
|
|
171
|
-
expiresAt: Date.now() + PRIVATE_SWAP_CACHE_TTL_MS,
|
|
172
|
-
order: {
|
|
173
|
-
multi_id: typeof details.multi_id === "string" ? details.multi_id.trim() : null,
|
|
174
|
-
houdini_id: houdiniId,
|
|
175
|
-
deposit_address: depositAddress,
|
|
176
|
-
order: details.order && typeof details.order === "object" ? details.order : {},
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function latestPendingPrivateSwapOrder(userId, toolName, preview) {
|
|
182
|
-
if (toolName !== "swap_solana_privately") return null;
|
|
183
|
-
const cached = privateSwapOrderCache.get(approvalCacheKey(userId, toolName));
|
|
184
|
-
if (!cached || typeof cached !== "object") return null;
|
|
185
|
-
if (Number(cached.expiresAt || 0) <= Date.now()) {
|
|
186
|
-
privateSwapOrderCache.delete(approvalCacheKey(userId, toolName));
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
if (!preview || typeof preview !== "object") return null;
|
|
190
|
-
if (cached.digest !== previewDigest(preview)) return null;
|
|
191
|
-
return cached.order && typeof cached.order === "object" ? cached.order : null;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function clearPendingPrivateSwapOrder(userId, toolName) {
|
|
195
|
-
if (toolName !== "swap_solana_privately") return;
|
|
196
|
-
privateSwapOrderCache.delete(approvalCacheKey(userId, toolName));
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function formatPrivateSwapPendingOrderError(details) {
|
|
200
|
-
const houdiniId = typeof details?.houdini_id === "string" ? details.houdini_id.trim() : "";
|
|
201
|
-
const multiId = typeof details?.multi_id === "string" ? details.multi_id.trim() : "";
|
|
202
|
-
const depositAddress =
|
|
203
|
-
typeof details?.deposit_address === "string" ? details.deposit_address.trim() : "";
|
|
204
|
-
const orderStatus =
|
|
205
|
-
typeof details?.order_status === "string" ? details.order_status.trim() : "";
|
|
206
|
-
const parts = [
|
|
207
|
-
"Houdini order was created, but the Solana deposit account is not ready yet.",
|
|
208
|
-
];
|
|
209
|
-
if (houdiniId) parts.push(`houdini_id=${houdiniId}`);
|
|
210
|
-
if (multiId) parts.push(`multi_id=${multiId}`);
|
|
211
|
-
if (depositAddress) parts.push(`deposit_address=${depositAddress}`);
|
|
212
|
-
if (orderStatus) parts.push(`status=${orderStatus}`);
|
|
213
|
-
parts.push("Retry execute for this existing order instead of generating a new preview.");
|
|
214
|
-
return parts.join(" ");
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function formatPrivateSwapRateLimitError(details) {
|
|
218
|
-
const retryAfter =
|
|
219
|
-
typeof details?.retry_after === "number"
|
|
220
|
-
? details.retry_after
|
|
221
|
-
: typeof details?.retry_after === "string"
|
|
222
|
-
? details.retry_after
|
|
223
|
-
: "";
|
|
224
|
-
const quoteId = typeof details?.quote_id === "string" ? details.quote_id.trim() : "";
|
|
225
|
-
const parts = [
|
|
226
|
-
"Houdini exchange create is rate-limited right now.",
|
|
227
|
-
];
|
|
228
|
-
if (retryAfter !== "") parts.push(`retry_after=${retryAfter}s`);
|
|
229
|
-
if (quoteId) parts.push(`quote_id=${quoteId}`);
|
|
230
|
-
parts.push("Do not generate a new preview yet; wait, then retry execute.");
|
|
231
|
-
return parts.join(" ");
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function listPendingPrivateSwapOrders(userId) {
|
|
235
|
-
const key = approvalCacheKey(userId, PRIVATE_SWAP_APPROVAL_TOOL_NAME);
|
|
236
|
-
const pending = privateSwapOrderCache.get(key);
|
|
237
|
-
if (!pending || typeof pending !== "object" || Number(pending.expiresAt || 0) <= Date.now()) {
|
|
238
|
-
privateSwapOrderCache.delete(key);
|
|
239
|
-
return [];
|
|
240
|
-
}
|
|
241
|
-
return [
|
|
242
|
-
{
|
|
243
|
-
...(pending.order && typeof pending.order === "object" ? pending.order : {}),
|
|
244
|
-
expires_at_ms: Number(pending.expiresAt || 0),
|
|
245
|
-
},
|
|
246
|
-
];
|
|
247
|
-
}
|
|
248
151
|
|
|
249
152
|
function resolvePluginConfig(api) {
|
|
250
153
|
const globalConfig = api?.config ?? {};
|
|
@@ -569,9 +472,6 @@ async function issueApprovalToken(api, config, userId, toolName, previewPayload)
|
|
|
569
472
|
if (previewPayload?.is_mainnet === true) {
|
|
570
473
|
extraArgs.push("--mainnet-confirmed");
|
|
571
474
|
}
|
|
572
|
-
if (toolName === "swap_solana_privately") {
|
|
573
|
-
extraArgs.push("--ttl-seconds", "1800");
|
|
574
|
-
}
|
|
575
475
|
const payload = await callWalletCli(api, "issue-approval", extraArgs, config);
|
|
576
476
|
const token = String(payload?.approval_token || "").trim();
|
|
577
477
|
if (!token) {
|
|
@@ -733,12 +633,6 @@ function registerTool(api, definition) {
|
|
|
733
633
|
});
|
|
734
634
|
}
|
|
735
635
|
|
|
736
|
-
if (definition.name === "list_pending_solana_private_swaps") {
|
|
737
|
-
return asContent({
|
|
738
|
-
orders: listPendingPrivateSwapOrders(resolveUserId(api, resolvePluginConfig(api))),
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
|
|
742
636
|
const effectiveParams = { ...(params ?? {}) };
|
|
743
637
|
const activeBackend = activeBackendForTool(api, definition.name);
|
|
744
638
|
const userId = resolveUserId(api, resolvePluginConfig(api));
|
|
@@ -754,43 +648,7 @@ function registerTool(api, definition) {
|
|
|
754
648
|
if (activeBackend === "wdk_evm_local" && effectiveParams.network !== undefined) {
|
|
755
649
|
configOverride.network = normalizeSelectableEvmNetwork(effectiveParams.network);
|
|
756
650
|
}
|
|
757
|
-
|
|
758
|
-
await attachApprovalForExecute(api, configOverride, userId, definition.name, effectiveParams);
|
|
759
|
-
}
|
|
760
|
-
if (definition.name === "continue_solana_private_swap") {
|
|
761
|
-
const cached = latestCachedPreview(userId, PRIVATE_SWAP_APPROVAL_TOOL_NAME);
|
|
762
|
-
if (cached?.preview) {
|
|
763
|
-
effectiveParams._approved_preview = cached.preview;
|
|
764
|
-
}
|
|
765
|
-
if (cached?.preview && cached?.summary) {
|
|
766
|
-
effectiveParams.approval_token = await issueApprovalToken(
|
|
767
|
-
api,
|
|
768
|
-
configOverride,
|
|
769
|
-
userId,
|
|
770
|
-
PRIVATE_SWAP_APPROVAL_TOOL_NAME,
|
|
771
|
-
cached.preview
|
|
772
|
-
);
|
|
773
|
-
} else if (!effectiveParams.approval_token) {
|
|
774
|
-
throw new Error(APPROVAL_CONTEXT_MISSING_MESSAGE);
|
|
775
|
-
}
|
|
776
|
-
if (effectiveParams._resume_private_swap_order === undefined && cached?.preview) {
|
|
777
|
-
const pendingOrder = latestPendingPrivateSwapOrder(
|
|
778
|
-
userId,
|
|
779
|
-
PRIVATE_SWAP_APPROVAL_TOOL_NAME,
|
|
780
|
-
cached.preview
|
|
781
|
-
);
|
|
782
|
-
if (pendingOrder) {
|
|
783
|
-
if (
|
|
784
|
-
effectiveParams.houdini_id &&
|
|
785
|
-
pendingOrder.houdini_id &&
|
|
786
|
-
String(effectiveParams.houdini_id).trim() !== String(pendingOrder.houdini_id).trim()
|
|
787
|
-
) {
|
|
788
|
-
throw new Error("The requested houdini_id does not match the cached pending private swap order.");
|
|
789
|
-
}
|
|
790
|
-
effectiveParams._resume_private_swap_order = pendingOrder;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
651
|
+
await attachApprovalForExecute(api, configOverride, userId, definition.name, effectiveParams);
|
|
794
652
|
const executeWalletTool = async () =>
|
|
795
653
|
callWalletCli(api, "invoke", [
|
|
796
654
|
"--tool",
|
|
@@ -800,75 +658,10 @@ function registerTool(api, definition) {
|
|
|
800
658
|
], configOverride);
|
|
801
659
|
|
|
802
660
|
let payload;
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
: null;
|
|
808
|
-
const pendingOrder = approvedPreview
|
|
809
|
-
? latestPendingPrivateSwapOrder(userId, definition.name, approvedPreview)
|
|
810
|
-
: null;
|
|
811
|
-
if (pendingOrder && effectiveParams._resume_private_swap_order === undefined) {
|
|
812
|
-
effectiveParams._resume_private_swap_order = pendingOrder;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
let remainingRetries = 3;
|
|
816
|
-
while (true) {
|
|
817
|
-
try {
|
|
818
|
-
payload = await executeWalletTool();
|
|
819
|
-
const executionState = payload?.data?.execution_state;
|
|
820
|
-
if (executionState === "awaiting_deposit_funding" && approvedPreview) {
|
|
821
|
-
cachePendingPrivateSwapOrder(userId, definition.name, approvedPreview, payload.data);
|
|
822
|
-
} else {
|
|
823
|
-
clearPendingPrivateSwapOrder(userId, definition.name);
|
|
824
|
-
}
|
|
825
|
-
break;
|
|
826
|
-
} catch (error) {
|
|
827
|
-
const errorCode = typeof error?.code === "string" ? error.code : "";
|
|
828
|
-
const errorDetails =
|
|
829
|
-
error?.details && typeof error.details === "object" ? error.details : null;
|
|
830
|
-
if (
|
|
831
|
-
(errorCode === "houdini_deposit_not_ready" ||
|
|
832
|
-
errorCode === "houdini_order_initializing_timeout") &&
|
|
833
|
-
approvedPreview &&
|
|
834
|
-
errorDetails &&
|
|
835
|
-
remainingRetries > 0
|
|
836
|
-
) {
|
|
837
|
-
cachePendingPrivateSwapOrder(userId, definition.name, approvedPreview, errorDetails);
|
|
838
|
-
effectiveParams._resume_private_swap_order =
|
|
839
|
-
latestPendingPrivateSwapOrder(userId, definition.name, approvedPreview) || undefined;
|
|
840
|
-
remainingRetries -= 1;
|
|
841
|
-
continue;
|
|
842
|
-
}
|
|
843
|
-
if (
|
|
844
|
-
(errorCode === "houdini_deposit_not_ready" ||
|
|
845
|
-
errorCode === "houdini_order_initializing_timeout") &&
|
|
846
|
-
errorDetails
|
|
847
|
-
) {
|
|
848
|
-
cachePendingPrivateSwapOrder(userId, definition.name, approvedPreview, errorDetails);
|
|
849
|
-
throw new Error(formatPrivateSwapPendingOrderError(errorDetails));
|
|
850
|
-
}
|
|
851
|
-
if (errorCode === "houdini_exchange_rate_limited" && errorDetails) {
|
|
852
|
-
throw new Error(formatPrivateSwapRateLimitError(errorDetails));
|
|
853
|
-
}
|
|
854
|
-
throw normalizeApprovalContextError(error);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
} else if (definition.name === "continue_solana_private_swap") {
|
|
858
|
-
try {
|
|
859
|
-
payload = await executeWalletTool();
|
|
860
|
-
} catch (error) {
|
|
861
|
-
throw normalizeApprovalContextError(error);
|
|
862
|
-
}
|
|
863
|
-
if (payload?.data?.execution_state === "funding_submitted") {
|
|
864
|
-
clearPendingPrivateSwapOrder(userId, PRIVATE_SWAP_APPROVAL_TOOL_NAME);
|
|
865
|
-
}
|
|
866
|
-
} else {
|
|
867
|
-
try {
|
|
868
|
-
payload = await executeWalletTool();
|
|
869
|
-
} catch (error) {
|
|
870
|
-
throw normalizeApprovalContextError(error);
|
|
871
|
-
}
|
|
661
|
+
try {
|
|
662
|
+
payload = await executeWalletTool();
|
|
663
|
+
} catch (error) {
|
|
664
|
+
throw normalizeApprovalContextError(error);
|
|
872
665
|
}
|
|
873
666
|
cachePreviewForApproval(userId, definition.name, payload);
|
|
874
667
|
if (payload?.ok === false) {
|
|
@@ -1008,12 +801,6 @@ const walletSessionToolDefinitions = [
|
|
|
1008
801
|
];
|
|
1009
802
|
|
|
1010
803
|
const solanaToolDefinitions = [
|
|
1011
|
-
{
|
|
1012
|
-
name: "list_pending_solana_private_swaps",
|
|
1013
|
-
description:
|
|
1014
|
-
"List cached pending Houdini private Solana orders from this OpenClaw session, including houdini_id, multi_id, deposit_address, and the last known order payload.",
|
|
1015
|
-
parameters: { type: "object", properties: {}, additionalProperties: false },
|
|
1016
|
-
},
|
|
1017
804
|
{
|
|
1018
805
|
name: "get_wallet_capabilities",
|
|
1019
806
|
description: "Describe the connected wallet backend, chain, and safety limits.",
|
|
@@ -1151,46 +938,6 @@ const solanaToolDefinitions = [
|
|
|
1151
938
|
additionalProperties: false,
|
|
1152
939
|
},
|
|
1153
940
|
},
|
|
1154
|
-
{
|
|
1155
|
-
name: "get_jupiter_earn_tokens",
|
|
1156
|
-
description: "List Jupiter Earn vault tokens currently supported on Solana mainnet.",
|
|
1157
|
-
parameters: { type: "object", properties: {}, additionalProperties: false },
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
name: "get_jupiter_earn_positions",
|
|
1161
|
-
description: "Get Jupiter Earn positions for one or more Solana wallet addresses on mainnet.",
|
|
1162
|
-
parameters: {
|
|
1163
|
-
type: "object",
|
|
1164
|
-
properties: {
|
|
1165
|
-
users: {
|
|
1166
|
-
type: "array",
|
|
1167
|
-
items: { type: "string" },
|
|
1168
|
-
description: "Optional list of Solana wallet addresses. If omitted, use the configured wallet address.",
|
|
1169
|
-
},
|
|
1170
|
-
},
|
|
1171
|
-
additionalProperties: false,
|
|
1172
|
-
},
|
|
1173
|
-
},
|
|
1174
|
-
{
|
|
1175
|
-
name: "get_jupiter_earn_earnings",
|
|
1176
|
-
description: "Get Jupiter Earn earnings for a wallet and one or more position addresses on mainnet.",
|
|
1177
|
-
parameters: {
|
|
1178
|
-
type: "object",
|
|
1179
|
-
properties: {
|
|
1180
|
-
user: {
|
|
1181
|
-
type: "string",
|
|
1182
|
-
description: "Optional Solana wallet address override.",
|
|
1183
|
-
},
|
|
1184
|
-
positions: {
|
|
1185
|
-
type: "array",
|
|
1186
|
-
items: { type: "string" },
|
|
1187
|
-
description: "List of Jupiter Earn position addresses.",
|
|
1188
|
-
},
|
|
1189
|
-
},
|
|
1190
|
-
required: ["positions"],
|
|
1191
|
-
additionalProperties: false,
|
|
1192
|
-
},
|
|
1193
|
-
},
|
|
1194
941
|
{
|
|
1195
942
|
name: "get_flash_trade_markets",
|
|
1196
943
|
description: "List Flash Trade perpetual markets currently available on Solana mainnet.",
|
|
@@ -1365,53 +1112,6 @@ const solanaToolDefinitions = [
|
|
|
1365
1112
|
additionalProperties: false,
|
|
1366
1113
|
},
|
|
1367
1114
|
},
|
|
1368
|
-
{
|
|
1369
|
-
name: "swap_solana_privately",
|
|
1370
|
-
description: `Preview or create a Solana private payout through Houdini's anonymous routing. The initial implementation supports same-token private payouts only, such as SOL->SOL or USDC->USDC. Use preview first. After the user explicitly confirms the shown summary in chat, call execute; the OpenClaw plugin handles the internal execution authorization automatically. The first execute creates the Houdini order and returns its deposit address; use continue_solana_private_swap to submit the funding transfer. ${WALLET_TOOL_ONLY_GUIDANCE}`,
|
|
1371
|
-
optional: true,
|
|
1372
|
-
parameters: {
|
|
1373
|
-
type: "object",
|
|
1374
|
-
properties: {
|
|
1375
|
-
input_token: { type: "string" },
|
|
1376
|
-
output_token: { type: "string" },
|
|
1377
|
-
destination_address: { type: "string" },
|
|
1378
|
-
amount: { type: "number" },
|
|
1379
|
-
use_xmr: { type: "boolean" },
|
|
1380
|
-
mode: { type: "string", enum: ["preview", "execute"] },
|
|
1381
|
-
purpose: { type: "string" },
|
|
1382
|
-
user_intent: { type: "boolean" },
|
|
1383
|
-
},
|
|
1384
|
-
required: ["input_token", "output_token", "destination_address", "amount", "mode", "purpose"],
|
|
1385
|
-
additionalProperties: false,
|
|
1386
|
-
},
|
|
1387
|
-
},
|
|
1388
|
-
{
|
|
1389
|
-
name: "continue_solana_private_swap",
|
|
1390
|
-
description:
|
|
1391
|
-
"Continue a previously created Houdini private Solana payout and submit the funding transfer to the cached deposit address. Use this after swap_solana_privately execute has returned a pending order; the OpenClaw plugin reuses the cached confirmation context automatically.",
|
|
1392
|
-
optional: true,
|
|
1393
|
-
parameters: {
|
|
1394
|
-
type: "object",
|
|
1395
|
-
properties: {
|
|
1396
|
-
houdini_id: { type: "string" },
|
|
1397
|
-
},
|
|
1398
|
-
additionalProperties: false,
|
|
1399
|
-
},
|
|
1400
|
-
},
|
|
1401
|
-
{
|
|
1402
|
-
name: "get_solana_private_swap_status",
|
|
1403
|
-
description: "Check Houdini status for a Solana private payout created by swap_solana_privately. Prefer houdini_id from the execute result; multi_id is only needed for legacy multi-order flows.",
|
|
1404
|
-
optional: true,
|
|
1405
|
-
parameters: {
|
|
1406
|
-
type: "object",
|
|
1407
|
-
properties: {
|
|
1408
|
-
multi_id: { type: "string" },
|
|
1409
|
-
houdini_id: { type: "string" },
|
|
1410
|
-
},
|
|
1411
|
-
anyOf: [{ required: ["multi_id"] }, { required: ["houdini_id"] }],
|
|
1412
|
-
additionalProperties: false,
|
|
1413
|
-
},
|
|
1414
|
-
},
|
|
1415
1115
|
{
|
|
1416
1116
|
name: "swap_solana_lifi_cross_chain_tokens",
|
|
1417
1117
|
description: "Preview, prepare, or execute a Solana-origin cross-chain swap through LI.FI. This currently supports Solana as the source chain and ethereum/base as the destination chain. Preview or prepare first. After the user explicitly confirms the shown summary in chat, call execute; the OpenClaw plugin handles the internal execution authorization automatically.",
|
|
@@ -1504,40 +1204,6 @@ const solanaToolDefinitions = [
|
|
|
1504
1204
|
additionalProperties: false,
|
|
1505
1205
|
},
|
|
1506
1206
|
},
|
|
1507
|
-
{
|
|
1508
|
-
name: "jupiter_earn_deposit",
|
|
1509
|
-
description: "Preview, prepare, or execute a Jupiter Earn deposit using a raw base-unit amount. Preview or prepare first. After the user explicitly confirms the shown summary in chat, call execute; the OpenClaw plugin handles the internal execution authorization automatically.",
|
|
1510
|
-
optional: true,
|
|
1511
|
-
parameters: {
|
|
1512
|
-
type: "object",
|
|
1513
|
-
properties: {
|
|
1514
|
-
asset: { type: "string" },
|
|
1515
|
-
amount_raw: { type: "string" },
|
|
1516
|
-
mode: { type: "string", enum: ["preview", "prepare", "execute"] },
|
|
1517
|
-
purpose: { type: "string" },
|
|
1518
|
-
user_intent: { type: "boolean" },
|
|
1519
|
-
},
|
|
1520
|
-
required: ["asset", "amount_raw", "mode", "purpose"],
|
|
1521
|
-
additionalProperties: false,
|
|
1522
|
-
},
|
|
1523
|
-
},
|
|
1524
|
-
{
|
|
1525
|
-
name: "jupiter_earn_withdraw",
|
|
1526
|
-
description: "Preview, prepare, or execute a Jupiter Earn withdraw using a raw base-unit amount. Preview or prepare first. After the user explicitly confirms the shown summary in chat, call execute; the OpenClaw plugin handles the internal execution authorization automatically.",
|
|
1527
|
-
optional: true,
|
|
1528
|
-
parameters: {
|
|
1529
|
-
type: "object",
|
|
1530
|
-
properties: {
|
|
1531
|
-
asset: { type: "string" },
|
|
1532
|
-
amount_raw: { type: "string" },
|
|
1533
|
-
mode: { type: "string", enum: ["preview", "prepare", "execute"] },
|
|
1534
|
-
purpose: { type: "string" },
|
|
1535
|
-
user_intent: { type: "boolean" },
|
|
1536
|
-
},
|
|
1537
|
-
required: ["asset", "amount_raw", "mode", "purpose"],
|
|
1538
|
-
additionalProperties: false,
|
|
1539
|
-
},
|
|
1540
|
-
},
|
|
1541
1207
|
{
|
|
1542
1208
|
name: "kamino_lend_deposit",
|
|
1543
1209
|
description: "Preview, prepare, or execute a Kamino lending deposit using a decimal token amount. Preview or prepare first. After the user explicitly confirms the shown summary in chat, call execute; the OpenClaw plugin handles the internal execution authorization automatically.",
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"tools": [
|
|
8
8
|
"claim_bags_fees",
|
|
9
9
|
"close_empty_token_accounts",
|
|
10
|
-
"continue_solana_private_swap",
|
|
11
10
|
"flash_trade_close_position",
|
|
12
11
|
"flash_trade_open_position",
|
|
13
12
|
"get_active_wallet_backend",
|
|
@@ -30,9 +29,6 @@
|
|
|
30
29
|
"get_evm_transaction_receipt",
|
|
31
30
|
"get_flash_trade_markets",
|
|
32
31
|
"get_flash_trade_positions",
|
|
33
|
-
"get_jupiter_earn_earnings",
|
|
34
|
-
"get_jupiter_earn_positions",
|
|
35
|
-
"get_jupiter_earn_tokens",
|
|
36
32
|
"get_kamino_lend_market_reserves",
|
|
37
33
|
"get_kamino_lend_markets",
|
|
38
34
|
"get_kamino_open_positions",
|
|
@@ -41,20 +37,16 @@
|
|
|
41
37
|
"get_lifi_quote",
|
|
42
38
|
"get_lifi_supported_chains",
|
|
43
39
|
"get_lifi_transfer_status",
|
|
44
|
-
"get_solana_private_swap_status",
|
|
45
40
|
"get_solana_token_prices",
|
|
46
41
|
"get_wallet_address",
|
|
47
42
|
"get_wallet_balance",
|
|
48
43
|
"get_wallet_capabilities",
|
|
49
44
|
"get_wallet_portfolio",
|
|
50
|
-
"jupiter_earn_deposit",
|
|
51
|
-
"jupiter_earn_withdraw",
|
|
52
45
|
"kamino_lend_borrow",
|
|
53
46
|
"kamino_lend_deposit",
|
|
54
47
|
"kamino_lend_repay",
|
|
55
48
|
"kamino_lend_withdraw",
|
|
56
49
|
"launch_bags_token",
|
|
57
|
-
"list_pending_solana_private_swaps",
|
|
58
50
|
"manage_evm_aave_position",
|
|
59
51
|
"manage_evm_lido_position",
|
|
60
52
|
"manage_evm_lido_withdrawal",
|
|
@@ -64,7 +56,6 @@
|
|
|
64
56
|
"swap_evm_lifi_cross_chain_tokens",
|
|
65
57
|
"swap_evm_tokens",
|
|
66
58
|
"swap_solana_lifi_cross_chain_tokens",
|
|
67
|
-
"swap_solana_privately",
|
|
68
59
|
"swap_solana_tokens",
|
|
69
60
|
"transfer_btc",
|
|
70
61
|
"transfer_evm_native",
|
|
@@ -238,10 +229,6 @@
|
|
|
238
229
|
"type": "string",
|
|
239
230
|
"description": "Optional Jupiter Portfolio API base URL."
|
|
240
231
|
},
|
|
241
|
-
"jupiterLendBaseUrl": {
|
|
242
|
-
"type": "string",
|
|
243
|
-
"description": "Optional Jupiter Lend API base URL."
|
|
244
|
-
},
|
|
245
232
|
"jupiterApiKey": {
|
|
246
233
|
"type": "string",
|
|
247
234
|
"description": "Optional Jupiter API key.",
|
|
@@ -249,36 +236,6 @@
|
|
|
249
236
|
"sensitive": true
|
|
250
237
|
}
|
|
251
238
|
},
|
|
252
|
-
"houdiniBaseUrl": {
|
|
253
|
-
"type": "string",
|
|
254
|
-
"description": "Optional Houdini Partner API base URL for private Solana payouts."
|
|
255
|
-
},
|
|
256
|
-
"houdiniApiKey": {
|
|
257
|
-
"type": "string",
|
|
258
|
-
"description": "Optional Houdini Partner API key.",
|
|
259
|
-
"uiHints": {
|
|
260
|
-
"sensitive": true
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
"houdiniApiSecret": {
|
|
264
|
-
"type": "string",
|
|
265
|
-
"description": "Optional Houdini Partner API secret.",
|
|
266
|
-
"uiHints": {
|
|
267
|
-
"sensitive": true
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
"houdiniUserIp": {
|
|
271
|
-
"type": "string",
|
|
272
|
-
"description": "Required Houdini compliance header: end-user IP address."
|
|
273
|
-
},
|
|
274
|
-
"houdiniUserAgent": {
|
|
275
|
-
"type": "string",
|
|
276
|
-
"description": "Required Houdini compliance header: end-user agent string."
|
|
277
|
-
},
|
|
278
|
-
"houdiniUserTimezone": {
|
|
279
|
-
"type": "string",
|
|
280
|
-
"description": "Required Houdini compliance header: end-user timezone, for example Europe/Moscow."
|
|
281
|
-
},
|
|
282
239
|
"kaminoBaseUrl": {
|
|
283
240
|
"type": "string",
|
|
284
241
|
"description": "Optional Kamino REST API base URL."
|
|
@@ -7,15 +7,13 @@ Safety rules:
|
|
|
7
7
|
- Prefer read-only tools first.
|
|
8
8
|
- When a wallet tool exists for the task, do not fall back to `exec`, `solana`, `spl-token`, `bitcoin-cli`, `curl`, or any shell-based wallet workflow. If the wallet tool fails, report the tool error and stop.
|
|
9
9
|
- Jupiter Portfolio tools are temporarily disabled. Do not suggest or call them until they are re-enabled.
|
|
10
|
-
- Use Jupiter Earn read tools before Jupiter Earn writes when the user needs lending/yield context.
|
|
11
10
|
- Use Kamino market/reserve reads before Kamino writes when the user needs lending context.
|
|
12
11
|
- Use Aave account reads before Aave writes when the user needs EVM lending context.
|
|
13
|
-
- For transfers, native staking, swaps, Aave writes,
|
|
12
|
+
- For transfers, native staking, swaps, Aave writes, and Kamino writes, use `preview` before `prepare` or `execute`.
|
|
14
13
|
- For Solana Jupiter swaps through `swap_solana_tokens`, prefer `intent_preview` then `intent_execute` after explicit chat confirmation. The user confirms risk limits; the backend refreshes the quote and only executes inside those limits.
|
|
15
14
|
- Solana swap intent defaults to at least 300 bps (3%) slippage, 120 seconds validity, and 3 fresh execution attempts. The backend computes the approved minimum output from the indicative output and slippage, clamps hand-tightened minimums to that floor, then executes through Jupiter Swap API V2 `/order` + `/execute` when available.
|
|
16
15
|
- Metis `/swap` fallback builds use Jupiter dynamic slippage and a bounded `veryHigh` priority fee instead of the old `"auto"` priority mode.
|
|
17
16
|
- Do not use legacy `execute` for Solana Jupiter swaps in OpenClaw. Exact quote-bound approval is too fragile for active markets and will be rejected by the bridge.
|
|
18
|
-
- For `swap_solana_privately`, use `preview` and then `execute` after explicit user approval. Do not use `prepare` for this tool.
|
|
19
17
|
- Use `prepare` only when the user clearly intends to produce an execution plan.
|
|
20
18
|
- Use `execute` only after the user explicitly confirms the shown summary in chat. OpenClaw handles the internal approval token; do not ask for `/approve`, buttons, popups, or a manual token. For Solana swap intents, the token is bound to the approved intent limits instead of one fragile quote.
|
|
21
19
|
- On `mainnet`, require an approval token that includes explicit mainnet confirmation before any execution.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.1.32 - 2026-06-01
|
|
6
|
+
|
|
7
|
+
- Fixed a `SyntaxError` in `codex/plugins/agent-wallet/server.py` introduced by
|
|
8
|
+
the Houdini private-swap removal in v0.1.31: the deletion left the orphaned
|
|
9
|
+
`_cache_pending_private_swap_order` signature fused onto the body of
|
|
10
|
+
`_normalize_wallet_backend`, leaving an unclosed parenthesis. The Codex and
|
|
11
|
+
Claude Code plugins share this `server.py`, so the broken file prevented the
|
|
12
|
+
agent-wallet MCP server from starting in both runtimes (JSON-RPC `-32000` /
|
|
13
|
+
"failed to reconnect"). Restored the `_normalize_wallet_backend` definition;
|
|
14
|
+
the server now starts and completes the MCP `initialize` handshake.
|
|
15
|
+
- Fixed Claude Code agent-wallet MCP failing to start (`-32000` / "failed to
|
|
16
|
+
reconnect"). When Claude Code copies the plugin into its plugin cache, the
|
|
17
|
+
launcher's relative `../../codex/...` and local `server.py` paths no longer
|
|
18
|
+
resolve, so it reported "server.py not found". `run_mcp.sh` now falls back to
|
|
19
|
+
the codex `server.py` inside the installed runtime package
|
|
20
|
+
(`~/.openclaw/agent-wallet-runtime/current/codex/plugins/agent-wallet`), which
|
|
21
|
+
is always present after install. Codex was unaffected (its launcher is
|
|
22
|
+
self-contained).
|
|
23
|
+
|
|
24
|
+
## v0.1.31 - 2026-05-31
|
|
25
|
+
|
|
26
|
+
- Hardened the WDK EVM/BTC local vaults with a decrypt-on-demand key model: the
|
|
27
|
+
decrypted seed is no longer held in process memory between requests. Each
|
|
28
|
+
signing request decrypts the seed just-in-time from the sealed password and
|
|
29
|
+
zeroizes the key/plaintext buffers afterward; `unlock`/`lock` are now
|
|
30
|
+
deprecated no-ops. The at-rest format is unchanged, so existing wallets keep
|
|
31
|
+
working without migration.
|
|
32
|
+
- EVM wallets are now provisioned automatically at install, alongside Solana.
|
|
33
|
+
Every install creates both wallets; `--backend` only selects the active one.
|
|
34
|
+
EVM provisioning auto-generates and seals the vault password and binds both
|
|
35
|
+
base and ethereum. It is best-effort: an install-time failure does not abort
|
|
36
|
+
the install, and the wallet is created lazily on first EVM use instead.
|
|
37
|
+
- Fixed the local config installer to validate EVM networks with the EVM
|
|
38
|
+
normalizer (previously an EVM backend was rejected as a Solana network).
|
|
39
|
+
|
|
5
40
|
## v0.1.30 - 2026-05-30
|
|
6
41
|
|
|
7
42
|
- Added a Claude Code plugin bridge under `claude-code/plugins/agent-wallet` so
|
package/README.md
CHANGED
|
@@ -16,11 +16,6 @@ For Hermes:
|
|
|
16
16
|
npx @agentlayer.tech/wallet install --yes && npx @agentlayer.tech/wallet hermes install --yes
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
For Codex:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npx @agentlayer.tech/wallet install --yes && npx @agentlayer.tech/wallet codex install --yes
|
|
23
|
-
```
|
|
24
19
|
|
|
25
20
|
AgentLayer is a beta local-first wallet and finance stack for agents.
|
|
26
21
|
|
|
@@ -44,7 +44,6 @@ JUPITER_API_BASE_URL=https://lite-api.jup.ag/swap/v1
|
|
|
44
44
|
JUPITER_ULTRA_API_BASE_URL=https://lite-api.jup.ag/ultra/v1
|
|
45
45
|
JUPITER_PRICE_API_BASE_URL=https://lite-api.jup.ag/price/v3
|
|
46
46
|
JUPITER_PORTFOLIO_API_BASE_URL=https://api.jup.ag/portfolio/v1
|
|
47
|
-
JUPITER_LEND_API_BASE_URL=https://api.jup.ag/lend/v1
|
|
48
47
|
JUPITER_API_KEY=
|
|
49
48
|
|
|
50
49
|
# LI.FI cross-chain routing. API key is optional for basic read-only quote/status calls.
|
|
@@ -54,17 +53,6 @@ LIFI_API_KEY=
|
|
|
54
53
|
LIFI_INTEGRATOR=openclaw
|
|
55
54
|
LIFI_DEFAULT_DENY_BRIDGES=mayan
|
|
56
55
|
|
|
57
|
-
# Houdini Partner API for private Solana payouts.
|
|
58
|
-
# HOUDINI_USER_IP is required because Houdini rejects requests without compliance headers.
|
|
59
|
-
# If PROVIDER_GATEWAY_URL points at a gateway with Houdini enabled,
|
|
60
|
-
# the wallet runtime can omit these partner secrets and route through the gateway instead.
|
|
61
|
-
HOUDINI_API_BASE_URL=https://api-partner.houdiniswap.com/v2
|
|
62
|
-
HOUDINI_API_KEY=
|
|
63
|
-
HOUDINI_API_SECRET=
|
|
64
|
-
HOUDINI_USER_IP=
|
|
65
|
-
HOUDINI_USER_AGENT=AgentLayer/0.1.12
|
|
66
|
-
HOUDINI_USER_TIMEZONE=UTC
|
|
67
|
-
|
|
68
56
|
# Flash Trade perps
|
|
69
57
|
FLASH_API_BASE_URL=
|
|
70
58
|
FLASH_SDK_BRIDGE_COMMAND=
|