@agentlayer.tech/wallet 0.1.24 → 0.1.26

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.
@@ -25,6 +25,10 @@ const approvalPreviewCache = new Map();
25
25
  const privateSwapOrderCache = new Map();
26
26
  const WALLET_TOOL_ONLY_GUIDANCE =
27
27
  "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
+ const OPENCLAW_EXECUTE_APPROVAL_GUIDANCE =
29
+ "Preview or prepare first. After the user explicitly confirms the shown summary in chat, call execute with the same semantic params; the OpenClaw plugin handles the internal execution authorization automatically.";
30
+ const APPROVAL_CONTEXT_MISSING_MESSAGE =
31
+ `Confirmation context is not ready or expired. ${OPENCLAW_EXECUTE_APPROVAL_GUIDANCE} Do not ask for /approve, buttons, popups, or a manual token.`;
28
32
  const APPROVAL_PREVIEW_TOOL_ALIASES = new Map([
29
33
  ["x402_pay_request", "x402_preview_request"],
30
34
  ]);
@@ -71,19 +75,19 @@ function pruneApprovalPreviewCache() {
71
75
  function cachePreviewForApproval(userId, toolName, payload) {
72
76
  const cacheToolName = approvalPreviewToolName(toolName);
73
77
  if (!payload || payload.ok !== true || !payload.data || typeof payload.data !== "object") return;
74
- const preview = payload.data;
75
- if (preview.mode !== "preview") return;
76
- if (!preview.confirmation_summary || typeof preview.confirmation_summary !== "object") return;
78
+ const approvalSource = payload.data;
79
+ if (!["preview", "prepare", "intent_preview"].includes(String(approvalSource.mode || ""))) return;
80
+ if (!approvalSource.confirmation_summary || typeof approvalSource.confirmation_summary !== "object") return;
77
81
  pruneApprovalPreviewCache();
78
- const digest = previewDigest(preview);
82
+ const digest = previewDigest(approvalSource);
79
83
  approvalPreviewCache.set(approvalCacheKey(userId, cacheToolName), {
80
84
  digest,
81
85
  expiresAt:
82
86
  cacheToolName === "swap_solana_privately"
83
87
  ? Date.now() + PRIVATE_SWAP_CACHE_TTL_MS
84
88
  : Date.now() + PREVIEW_CACHE_TTL_MS,
85
- preview,
86
- summary: preview.confirmation_summary,
89
+ preview: approvalSource,
90
+ summary: approvalSource.confirmation_summary,
87
91
  });
88
92
  if (cacheToolName === "swap_solana_privately") {
89
93
  privateSwapOrderCache.delete(approvalCacheKey(userId, cacheToolName));
@@ -115,6 +119,45 @@ function cachedPreviewForToken(userId, toolName, token) {
115
119
  return cached.preview && typeof cached.preview === "object" ? cached.preview : null;
116
120
  }
117
121
 
122
+ function isSolanaSwapIntentPayload(payload) {
123
+ return (
124
+ payload &&
125
+ typeof payload === "object" &&
126
+ (String(payload.asset_type || "") === "solana-swap-intent" ||
127
+ String(payload.mode || "") === "intent_preview")
128
+ );
129
+ }
130
+
131
+ function isSolanaSwapIntentExecute(params) {
132
+ return String(params?.mode || "") === "intent_execute";
133
+ }
134
+
135
+ function requiresApprovedPreviewPayload(toolName, params = null) {
136
+ if (toolName === "swap_solana_tokens" && isSolanaSwapIntentExecute(params)) return false;
137
+ return PREVIEW_BOUND_SWAP_TOOLS.has(toolName);
138
+ }
139
+
140
+ function looksLikeApprovalContextError(message) {
141
+ const text = String(message || "").toLowerCase();
142
+ return (
143
+ text.includes("approval_token") ||
144
+ text.includes("approval token") ||
145
+ text.includes("approval context") ||
146
+ text.includes("approved preview") ||
147
+ text.includes("preview payload") ||
148
+ text.includes("previewed operation")
149
+ );
150
+ }
151
+
152
+ function normalizeApprovalContextError(error) {
153
+ const message = String(error?.message || error || "");
154
+ if (!looksLikeApprovalContextError(message)) return error;
155
+ const wrapped = new Error(`${APPROVAL_CONTEXT_MISSING_MESSAGE} Original wallet error: ${message}`);
156
+ if (typeof error?.code === "string") wrapped.code = error.code;
157
+ if (error?.details && typeof error.details === "object") wrapped.details = error.details;
158
+ return wrapped;
159
+ }
160
+
118
161
  function cachePendingPrivateSwapOrder(userId, toolName, preview, details) {
119
162
  if (toolName !== "swap_solana_privately") return;
120
163
  if (!preview || typeof preview !== "object") return;
@@ -507,7 +550,7 @@ async function issueApprovalToken(api, config, userId, toolName, previewPayload)
507
550
  if (!summary || typeof summary !== "object") {
508
551
  throw new Error(`No confirmation_summary available for ${toolName}.`);
509
552
  }
510
- const summaryForToken = PREVIEW_BOUND_SWAP_TOOLS.has(toolName)
553
+ const summaryForToken = PREVIEW_BOUND_SWAP_TOOLS.has(toolName) && !isSolanaSwapIntentPayload(previewPayload)
511
554
  ? { ...summary, _preview_digest: previewDigest(previewPayload) }
512
555
  : { ...summary };
513
556
  const extraArgs = [
@@ -530,6 +573,46 @@ async function issueApprovalToken(api, config, userId, toolName, previewPayload)
530
573
  return token;
531
574
  }
532
575
 
576
+ async function attachApprovalForExecute(api, config, userId, toolName, effectiveParams) {
577
+ if (!["execute", "intent_execute"].includes(String(effectiveParams.mode || ""))) return null;
578
+ if (toolName === "swap_solana_tokens" && String(effectiveParams.mode || "") === "execute") {
579
+ throw new Error(
580
+ "Legacy exact-preview execute is disabled for Solana Jupiter swaps in OpenClaw. Use intent_preview, ask for explicit chat confirmation, then call intent_execute. The intent path binds approval to risk limits instead of a fragile Jupiter quote payload."
581
+ );
582
+ }
583
+
584
+ const cached = latestCachedPreview(userId, toolName);
585
+ if (cached?.preview && cached?.summary) {
586
+ effectiveParams.approval_token = await issueApprovalToken(
587
+ api,
588
+ config,
589
+ userId,
590
+ toolName,
591
+ cached.preview
592
+ );
593
+ if (requiresApprovedPreviewPayload(toolName, effectiveParams)) {
594
+ effectiveParams._approved_preview = cached.preview;
595
+ }
596
+ return cached;
597
+ }
598
+
599
+ if (
600
+ requiresApprovedPreviewPayload(toolName, effectiveParams) &&
601
+ typeof effectiveParams.approval_token === "string" &&
602
+ effectiveParams.approval_token.trim() &&
603
+ effectiveParams._approved_preview === undefined
604
+ ) {
605
+ const cachedPreview = cachedPreviewForToken(userId, toolName, effectiveParams.approval_token);
606
+ if (cachedPreview) {
607
+ effectiveParams._approved_preview = cachedPreview;
608
+ }
609
+ }
610
+
611
+ if (effectiveParams.approval_token) return null;
612
+
613
+ throw new Error(APPROVAL_CONTEXT_MISSING_MESSAGE);
614
+ }
615
+
533
616
  function asContent(data) {
534
617
  return {
535
618
  content: [
@@ -664,40 +747,15 @@ function registerTool(api, definition) {
664
747
  if (activeBackend === "wdk_evm_local" && effectiveParams.network !== undefined) {
665
748
  configOverride.network = normalizeSelectableEvmNetwork(effectiveParams.network);
666
749
  }
667
- if (String(effectiveParams.mode || "") === "execute") {
668
- if (
669
- PREVIEW_BOUND_SWAP_TOOLS.has(definition.name) &&
670
- typeof effectiveParams.approval_token === "string" &&
671
- effectiveParams.approval_token.trim() &&
672
- effectiveParams._approved_preview === undefined
673
- ) {
674
- const cachedPreview = cachedPreviewForToken(userId, definition.name, effectiveParams.approval_token);
675
- if (cachedPreview) {
676
- effectiveParams._approved_preview = cachedPreview;
677
- }
678
- }
679
- if (!effectiveParams.approval_token) {
680
- const cached = latestCachedPreview(userId, definition.name);
681
- if (cached?.preview && cached?.summary) {
682
- effectiveParams.approval_token = await issueApprovalToken(
683
- api,
684
- configOverride,
685
- userId,
686
- definition.name,
687
- cached.preview
688
- );
689
- if (PREVIEW_BOUND_SWAP_TOOLS.has(definition.name) && effectiveParams._approved_preview === undefined) {
690
- effectiveParams._approved_preview = cached.preview;
691
- }
692
- }
693
- }
750
+ if (definition.name !== "continue_solana_private_swap") {
751
+ await attachApprovalForExecute(api, configOverride, userId, definition.name, effectiveParams);
694
752
  }
695
753
  if (definition.name === "continue_solana_private_swap") {
696
754
  const cached = latestCachedPreview(userId, PRIVATE_SWAP_APPROVAL_TOOL_NAME);
697
- if (cached?.preview && effectiveParams._approved_preview === undefined) {
755
+ if (cached?.preview) {
698
756
  effectiveParams._approved_preview = cached.preview;
699
757
  }
700
- if (!effectiveParams.approval_token && cached?.preview && cached?.summary) {
758
+ if (cached?.preview && cached?.summary) {
701
759
  effectiveParams.approval_token = await issueApprovalToken(
702
760
  api,
703
761
  configOverride,
@@ -705,6 +763,8 @@ function registerTool(api, definition) {
705
763
  PRIVATE_SWAP_APPROVAL_TOOL_NAME,
706
764
  cached.preview
707
765
  );
766
+ } else if (!effectiveParams.approval_token) {
767
+ throw new Error(APPROVAL_CONTEXT_MISSING_MESSAGE);
708
768
  }
709
769
  if (effectiveParams._resume_private_swap_order === undefined && cached?.preview) {
710
770
  const pendingOrder = latestPendingPrivateSwapOrder(
@@ -784,16 +844,24 @@ function registerTool(api, definition) {
784
844
  if (errorCode === "houdini_exchange_rate_limited" && errorDetails) {
785
845
  throw new Error(formatPrivateSwapRateLimitError(errorDetails));
786
846
  }
787
- throw error;
847
+ throw normalizeApprovalContextError(error);
788
848
  }
789
849
  }
790
850
  } else if (definition.name === "continue_solana_private_swap") {
791
- payload = await executeWalletTool();
851
+ try {
852
+ payload = await executeWalletTool();
853
+ } catch (error) {
854
+ throw normalizeApprovalContextError(error);
855
+ }
792
856
  if (payload?.data?.execution_state === "funding_submitted") {
793
857
  clearPendingPrivateSwapOrder(userId, PRIVATE_SWAP_APPROVAL_TOOL_NAME);
794
858
  }
795
859
  } else {
796
- payload = await executeWalletTool();
860
+ try {
861
+ payload = await executeWalletTool();
862
+ } catch (error) {
863
+ throw normalizeApprovalContextError(error);
864
+ }
797
865
  }
798
866
  cachePreviewForApproval(userId, definition.name, payload);
799
867
  if (payload?.ok === false) {
@@ -888,7 +956,7 @@ const walletSessionToolDefinitions = [
888
956
  {
889
957
  name: "x402_pay_request",
890
958
  description:
891
- "Prepare or execute an x402 paid request using the active wallet backend. This milestone executes the Solana exact buyer flow and keeps EVM as prepare-only.",
959
+ `Prepare or execute an x402 paid request using the active wallet backend. This milestone executes the Solana exact buyer flow and keeps EVM as prepare-only. ${OPENCLAW_EXECUTE_APPROVAL_GUIDANCE}`,
892
960
  parameters: {
893
961
  type: "object",
894
962
  properties: {
@@ -908,10 +976,6 @@ const walletSessionToolDefinitions = [
908
976
  type: "boolean",
909
977
  description: "Must be true for prepare mode.",
910
978
  },
911
- approval_token: {
912
- type: "string",
913
- description: "Required for execute mode and must be issued against the exact x402 payment summary.",
914
- },
915
979
  },
916
980
  required: ["url", "mode", "purpose"],
917
981
  additionalProperties: false,
@@ -1216,7 +1280,7 @@ const solanaToolDefinitions = [
1216
1280
  },
1217
1281
  {
1218
1282
  name: "sign_wallet_message",
1219
- description: "Sign an arbitrary message with the connected wallet after explicit approval.",
1283
+ description: "Sign an arbitrary message with the connected wallet after explicit user confirmation in chat.",
1220
1284
  optional: true,
1221
1285
  parameters: {
1222
1286
  type: "object",
@@ -1231,7 +1295,7 @@ const solanaToolDefinitions = [
1231
1295
  },
1232
1296
  {
1233
1297
  name: "transfer_sol",
1234
- description: "Preview, prepare, or execute a native SOL transfer. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1298
+ description: "Preview, prepare, or execute a native SOL transfer. 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.",
1235
1299
  optional: true,
1236
1300
  parameters: {
1237
1301
  type: "object",
@@ -1241,7 +1305,6 @@ const solanaToolDefinitions = [
1241
1305
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1242
1306
  purpose: { type: "string" },
1243
1307
  user_intent: { type: "boolean" },
1244
- approval_token: { type: "string" },
1245
1308
  },
1246
1309
  required: ["recipient", "amount", "mode", "purpose"],
1247
1310
  additionalProperties: false,
@@ -1249,7 +1312,7 @@ const solanaToolDefinitions = [
1249
1312
  },
1250
1313
  {
1251
1314
  name: "transfer_spl_token",
1252
- description: "Preview, prepare, or execute an SPL token transfer by mint address. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1315
+ description: "Preview, prepare, or execute an SPL token transfer by mint address. 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.",
1253
1316
  optional: true,
1254
1317
  parameters: {
1255
1318
  type: "object",
@@ -1261,7 +1324,6 @@ const solanaToolDefinitions = [
1261
1324
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1262
1325
  purpose: { type: "string" },
1263
1326
  user_intent: { type: "boolean" },
1264
- approval_token: { type: "string" },
1265
1327
  },
1266
1328
  required: ["recipient", "mint", "amount", "mode", "purpose"],
1267
1329
  additionalProperties: false,
@@ -1269,7 +1331,7 @@ const solanaToolDefinitions = [
1269
1331
  },
1270
1332
  {
1271
1333
  name: "swap_solana_tokens",
1272
- description: `Preview, prepare, or execute a Solana token swap via Jupiter. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation. ${WALLET_TOOL_ONLY_GUIDANCE}`,
1334
+ description: `Preview or execute a Solana token swap via Jupiter. Use intent_preview followed by intent_execute after the user explicitly confirms the intent summary in chat; intent_execute fetches a fresh quote and only executes inside the approved limits. Do not use legacy execute for Solana swaps. The OpenClaw plugin handles internal execution authorization automatically. ${WALLET_TOOL_ONLY_GUIDANCE}`,
1273
1335
  optional: true,
1274
1336
  parameters: {
1275
1337
  type: "object",
@@ -1277,11 +1339,14 @@ const solanaToolDefinitions = [
1277
1339
  input_mint: { type: "string" },
1278
1340
  output_mint: { type: "string" },
1279
1341
  amount: { type: "number" },
1280
- slippage_bps: { type: "integer" },
1281
- mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1342
+ slippage_bps: { type: "integer", description: "Optional slippage tolerance in basis points. Defaults to 300 (3%) for Solana swaps." },
1343
+ minimum_output_amount_raw: { type: "integer", description: "Optional approved minimum output in raw output token units for intent_preview. For intent swaps, overly strict values are clamped to the slippage floor." },
1344
+ max_fee_lamports: { type: "integer" },
1345
+ valid_for_seconds: { type: "integer", description: "Optional intent validity window in seconds. Intent swaps use at least 120 seconds, max 120." },
1346
+ max_attempts: { type: "integer", description: "Optional number of fresh quote/simulate/execute attempts. Intent swaps use at least 3 attempts, max 5." },
1347
+ mode: { type: "string", enum: ["preview", "intent_preview", "intent_execute"] },
1282
1348
  purpose: { type: "string" },
1283
1349
  user_intent: { type: "boolean" },
1284
- approval_token: { type: "string" },
1285
1350
  },
1286
1351
  required: ["input_mint", "output_mint", "amount", "mode", "purpose"],
1287
1352
  additionalProperties: false,
@@ -1289,7 +1354,7 @@ const solanaToolDefinitions = [
1289
1354
  },
1290
1355
  {
1291
1356
  name: "swap_solana_privately",
1292
- 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, then execute after explicit approval. 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}`,
1357
+ 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}`,
1293
1358
  optional: true,
1294
1359
  parameters: {
1295
1360
  type: "object",
@@ -1302,7 +1367,6 @@ const solanaToolDefinitions = [
1302
1367
  mode: { type: "string", enum: ["preview", "execute"] },
1303
1368
  purpose: { type: "string" },
1304
1369
  user_intent: { type: "boolean" },
1305
- approval_token: { type: "string" },
1306
1370
  },
1307
1371
  required: ["input_token", "output_token", "destination_address", "amount", "mode", "purpose"],
1308
1372
  additionalProperties: false,
@@ -1311,15 +1375,13 @@ const solanaToolDefinitions = [
1311
1375
  {
1312
1376
  name: "continue_solana_private_swap",
1313
1377
  description:
1314
- "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.",
1378
+ "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.",
1315
1379
  optional: true,
1316
1380
  parameters: {
1317
1381
  type: "object",
1318
1382
  properties: {
1319
1383
  houdini_id: { type: "string" },
1320
- approval_token: { type: "string" },
1321
1384
  },
1322
- required: ["approval_token"],
1323
1385
  additionalProperties: false,
1324
1386
  },
1325
1387
  },
@@ -1339,7 +1401,7 @@ const solanaToolDefinitions = [
1339
1401
  },
1340
1402
  {
1341
1403
  name: "swap_solana_lifi_cross_chain_tokens",
1342
- 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. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1404
+ 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.",
1343
1405
  optional: true,
1344
1406
  parameters: {
1345
1407
  type: "object",
@@ -1356,7 +1418,6 @@ const solanaToolDefinitions = [
1356
1418
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1357
1419
  purpose: { type: "string" },
1358
1420
  user_intent: { type: "boolean" },
1359
- approval_token: { type: "string" },
1360
1421
  },
1361
1422
  required: [
1362
1423
  "input_token",
@@ -1372,7 +1433,7 @@ const solanaToolDefinitions = [
1372
1433
  },
1373
1434
  {
1374
1435
  name: "claim_bags_fees",
1375
- description: "Preview, prepare, or execute a Bags fee-share claim for the connected wallet on mainnet. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1436
+ description: "Preview, prepare, or execute a Bags fee-share claim for the connected wallet on mainnet. 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.",
1376
1437
  optional: true,
1377
1438
  parameters: {
1378
1439
  type: "object",
@@ -1381,7 +1442,6 @@ const solanaToolDefinitions = [
1381
1442
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1382
1443
  purpose: { type: "string" },
1383
1444
  user_intent: { type: "boolean" },
1384
- approval_token: { type: "string" },
1385
1445
  },
1386
1446
  required: ["token_mint", "mode", "purpose"],
1387
1447
  additionalProperties: false,
@@ -1389,7 +1449,7 @@ const solanaToolDefinitions = [
1389
1449
  },
1390
1450
  {
1391
1451
  name: "launch_bags_token",
1392
- description: "Preview, prepare, or execute a Bags token launch with fee-share config on mainnet. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1452
+ description: "Preview, prepare, or execute a Bags token launch with fee-share config on mainnet. 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.",
1393
1453
  optional: true,
1394
1454
  parameters: {
1395
1455
  type: "object",
@@ -1416,7 +1476,6 @@ const solanaToolDefinitions = [
1416
1476
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1417
1477
  purpose: { type: "string" },
1418
1478
  user_intent: { type: "boolean" },
1419
- approval_token: { type: "string" },
1420
1479
  },
1421
1480
  required: [
1422
1481
  "name",
@@ -1434,7 +1493,7 @@ const solanaToolDefinitions = [
1434
1493
  },
1435
1494
  {
1436
1495
  name: "jupiter_earn_deposit",
1437
- description: "Preview, prepare, or execute a Jupiter Earn deposit using a raw base-unit amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1496
+ 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.",
1438
1497
  optional: true,
1439
1498
  parameters: {
1440
1499
  type: "object",
@@ -1444,7 +1503,6 @@ const solanaToolDefinitions = [
1444
1503
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1445
1504
  purpose: { type: "string" },
1446
1505
  user_intent: { type: "boolean" },
1447
- approval_token: { type: "string" },
1448
1506
  },
1449
1507
  required: ["asset", "amount_raw", "mode", "purpose"],
1450
1508
  additionalProperties: false,
@@ -1452,7 +1510,7 @@ const solanaToolDefinitions = [
1452
1510
  },
1453
1511
  {
1454
1512
  name: "jupiter_earn_withdraw",
1455
- description: "Preview, prepare, or execute a Jupiter Earn withdraw using a raw base-unit amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1513
+ 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.",
1456
1514
  optional: true,
1457
1515
  parameters: {
1458
1516
  type: "object",
@@ -1462,7 +1520,6 @@ const solanaToolDefinitions = [
1462
1520
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1463
1521
  purpose: { type: "string" },
1464
1522
  user_intent: { type: "boolean" },
1465
- approval_token: { type: "string" },
1466
1523
  },
1467
1524
  required: ["asset", "amount_raw", "mode", "purpose"],
1468
1525
  additionalProperties: false,
@@ -1470,7 +1527,7 @@ const solanaToolDefinitions = [
1470
1527
  },
1471
1528
  {
1472
1529
  name: "kamino_lend_deposit",
1473
- description: "Preview, prepare, or execute a Kamino lending deposit using a decimal token amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1530
+ 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.",
1474
1531
  optional: true,
1475
1532
  parameters: {
1476
1533
  type: "object",
@@ -1481,7 +1538,6 @@ const solanaToolDefinitions = [
1481
1538
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1482
1539
  purpose: { type: "string" },
1483
1540
  user_intent: { type: "boolean" },
1484
- approval_token: { type: "string" },
1485
1541
  },
1486
1542
  required: ["market", "reserve", "amount_ui", "mode", "purpose"],
1487
1543
  additionalProperties: false,
@@ -1489,7 +1545,7 @@ const solanaToolDefinitions = [
1489
1545
  },
1490
1546
  {
1491
1547
  name: "kamino_lend_withdraw",
1492
- description: "Preview, prepare, or execute a Kamino lending withdraw using a decimal token amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1548
+ description: "Preview, prepare, or execute a Kamino lending withdraw 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.",
1493
1549
  optional: true,
1494
1550
  parameters: {
1495
1551
  type: "object",
@@ -1500,7 +1556,6 @@ const solanaToolDefinitions = [
1500
1556
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1501
1557
  purpose: { type: "string" },
1502
1558
  user_intent: { type: "boolean" },
1503
- approval_token: { type: "string" },
1504
1559
  },
1505
1560
  required: ["market", "reserve", "amount_ui", "mode", "purpose"],
1506
1561
  additionalProperties: false,
@@ -1508,7 +1563,7 @@ const solanaToolDefinitions = [
1508
1563
  },
1509
1564
  {
1510
1565
  name: "kamino_lend_borrow",
1511
- description: "Preview, prepare, or execute a Kamino lending borrow using a decimal token amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1566
+ description: "Preview, prepare, or execute a Kamino lending borrow 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.",
1512
1567
  optional: true,
1513
1568
  parameters: {
1514
1569
  type: "object",
@@ -1519,7 +1574,6 @@ const solanaToolDefinitions = [
1519
1574
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1520
1575
  purpose: { type: "string" },
1521
1576
  user_intent: { type: "boolean" },
1522
- approval_token: { type: "string" },
1523
1577
  },
1524
1578
  required: ["market", "reserve", "amount_ui", "mode", "purpose"],
1525
1579
  additionalProperties: false,
@@ -1527,7 +1581,7 @@ const solanaToolDefinitions = [
1527
1581
  },
1528
1582
  {
1529
1583
  name: "kamino_lend_repay",
1530
- description: "Preview, prepare, or execute a Kamino lending repay using a decimal token amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1584
+ description: "Preview, prepare, or execute a Kamino lending repay 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.",
1531
1585
  optional: true,
1532
1586
  parameters: {
1533
1587
  type: "object",
@@ -1538,7 +1592,6 @@ const solanaToolDefinitions = [
1538
1592
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1539
1593
  purpose: { type: "string" },
1540
1594
  user_intent: { type: "boolean" },
1541
- approval_token: { type: "string" },
1542
1595
  },
1543
1596
  required: ["market", "reserve", "amount_ui", "mode", "purpose"],
1544
1597
  additionalProperties: false,
@@ -1579,7 +1632,6 @@ const solanaToolDefinitions = [
1579
1632
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1580
1633
  purpose: { type: "string" },
1581
1634
  user_intent: { type: "boolean" },
1582
- approval_token: { type: "string" },
1583
1635
  },
1584
1636
  required: [
1585
1637
  "pool_name",
@@ -1617,7 +1669,6 @@ const solanaToolDefinitions = [
1617
1669
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1618
1670
  purpose: { type: "string" },
1619
1671
  user_intent: { type: "boolean" },
1620
- approval_token: { type: "string" },
1621
1672
  },
1622
1673
  required: ["pool_name", "market_symbol", "side", "mode", "purpose"],
1623
1674
  additionalProperties: false,
@@ -1625,7 +1676,7 @@ const solanaToolDefinitions = [
1625
1676
  },
1626
1677
  {
1627
1678
  name: "close_empty_token_accounts",
1628
- description: "Preview or execute closing zero-balance token accounts. Execute requires a host-issued approval token bound to the previewed operation.",
1679
+ description: "Preview or execute closing zero-balance token accounts. After the user explicitly confirms the shown summary in chat, call execute; the OpenClaw plugin handles the internal execution authorization automatically.",
1629
1680
  optional: true,
1630
1681
  parameters: {
1631
1682
  type: "object",
@@ -1633,7 +1684,6 @@ const solanaToolDefinitions = [
1633
1684
  limit: { type: "integer" },
1634
1685
  mode: { type: "string", enum: ["preview", "execute"] },
1635
1686
  purpose: { type: "string" },
1636
- approval_token: { type: "string" },
1637
1687
  },
1638
1688
  required: ["limit", "mode", "purpose"],
1639
1689
  additionalProperties: false,
@@ -1710,7 +1760,7 @@ const btcToolDefinitions = [
1710
1760
  },
1711
1761
  {
1712
1762
  name: "transfer_btc",
1713
- description: "Preview, prepare, or execute a BTC transfer in satoshis. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1763
+ description: "Preview, prepare, or execute a BTC transfer in satoshis. 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.",
1714
1764
  optional: true,
1715
1765
  parameters: {
1716
1766
  type: "object",
@@ -1722,7 +1772,6 @@ const btcToolDefinitions = [
1722
1772
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1723
1773
  purpose: { type: "string" },
1724
1774
  user_intent: { type: "boolean" },
1725
- approval_token: { type: "string" },
1726
1775
  },
1727
1776
  required: ["recipient", "amount_sats", "mode", "purpose"],
1728
1777
  additionalProperties: false,
@@ -1938,7 +1987,7 @@ const evmToolDefinitions = [
1938
1987
  },
1939
1988
  {
1940
1989
  name: "manage_evm_aave_position",
1941
- description: "Preview, prepare, or execute a narrow Aave V3 lending operation on supported EVM mainnet networks. Supported operations are supply, withdraw, borrow, and repay. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
1990
+ description: "Preview, prepare, or execute a narrow Aave V3 lending operation on supported EVM mainnet networks. Supported operations are supply, withdraw, borrow, and repay. 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.",
1942
1991
  optional: true,
1943
1992
  parameters: {
1944
1993
  type: "object",
@@ -1949,7 +1998,6 @@ const evmToolDefinitions = [
1949
1998
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1950
1999
  purpose: { type: "string" },
1951
2000
  user_intent: { type: "boolean" },
1952
- approval_token: { type: "string" },
1953
2001
  network: { type: "string", enum: ["ethereum", "base"] },
1954
2002
  },
1955
2003
  required: ["operation", "token_address", "amount_raw", "mode", "purpose"],
@@ -1980,7 +2028,7 @@ const evmToolDefinitions = [
1980
2028
  },
1981
2029
  {
1982
2030
  name: "manage_evm_lido_position",
1983
- description: "Preview, prepare, or execute a narrow Lido staking operation on Ethereum mainnet. Supported operations are stake_eth_for_wsteth, wrap_steth, and unwrap_wsteth. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
2031
+ description: "Preview, prepare, or execute a narrow Lido staking operation on Ethereum mainnet. Supported operations are stake_eth_for_wsteth, wrap_steth, and unwrap_wsteth. 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.",
1984
2032
  optional: true,
1985
2033
  parameters: {
1986
2034
  type: "object",
@@ -1990,7 +2038,6 @@ const evmToolDefinitions = [
1990
2038
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
1991
2039
  purpose: { type: "string" },
1992
2040
  user_intent: { type: "boolean" },
1993
- approval_token: { type: "string" },
1994
2041
  network: { type: "string", enum: ["ethereum"] },
1995
2042
  },
1996
2043
  required: ["operation", "amount_raw", "mode", "purpose"],
@@ -2010,7 +2057,7 @@ const evmToolDefinitions = [
2010
2057
  },
2011
2058
  {
2012
2059
  name: "manage_evm_lido_withdrawal",
2013
- description: "Preview, prepare, or execute a narrow Lido withdrawal queue operation on Ethereum mainnet. Supported operations are request_withdrawal_steth, request_withdrawal_wsteth, and claim_withdrawal. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
2060
+ description: "Preview, prepare, or execute a narrow Lido withdrawal queue operation on Ethereum mainnet. Supported operations are request_withdrawal_steth, request_withdrawal_wsteth, and claim_withdrawal. 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.",
2014
2061
  optional: true,
2015
2062
  parameters: {
2016
2063
  type: "object",
@@ -2024,7 +2071,6 @@ const evmToolDefinitions = [
2024
2071
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
2025
2072
  purpose: { type: "string" },
2026
2073
  user_intent: { type: "boolean" },
2027
- approval_token: { type: "string" },
2028
2074
  network: { type: "string", enum: ["ethereum"] },
2029
2075
  },
2030
2076
  required: ["operation", "mode", "purpose"],
@@ -2048,7 +2094,7 @@ const evmToolDefinitions = [
2048
2094
  },
2049
2095
  {
2050
2096
  name: "swap_evm_tokens",
2051
- description: "Preview, prepare, or execute an ERC-20 to ERC-20 swap through Velora on supported EVM mainnet networks. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
2097
+ description: "Preview, prepare, or execute an ERC-20 to ERC-20 swap through Velora on supported EVM mainnet networks. 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.",
2052
2098
  optional: true,
2053
2099
  parameters: {
2054
2100
  type: "object",
@@ -2059,7 +2105,6 @@ const evmToolDefinitions = [
2059
2105
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
2060
2106
  purpose: { type: "string" },
2061
2107
  user_intent: { type: "boolean" },
2062
- approval_token: { type: "string" },
2063
2108
  network: { type: "string", enum: ["ethereum", "base"] },
2064
2109
  },
2065
2110
  required: ["token_in", "token_out", "amount_in_raw", "mode", "purpose"],
@@ -2068,7 +2113,7 @@ const evmToolDefinitions = [
2068
2113
  },
2069
2114
  {
2070
2115
  name: "swap_evm_lifi_cross_chain_tokens",
2071
- description: "Preview, prepare, or execute an EVM-origin cross-chain swap through LI.FI. This currently supports ethereum/base as the source network and ethereum/base/solana as the destination chain. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
2116
+ description: "Preview, prepare, or execute an EVM-origin cross-chain swap through LI.FI. This currently supports ethereum/base as the source network and ethereum/base/solana 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.",
2072
2117
  optional: true,
2073
2118
  parameters: {
2074
2119
  type: "object",
@@ -2085,7 +2130,6 @@ const evmToolDefinitions = [
2085
2130
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
2086
2131
  purpose: { type: "string" },
2087
2132
  user_intent: { type: "boolean" },
2088
- approval_token: { type: "string" },
2089
2133
  network: { type: "string", enum: ["ethereum", "base"] },
2090
2134
  },
2091
2135
  required: [
@@ -2102,7 +2146,7 @@ const evmToolDefinitions = [
2102
2146
  },
2103
2147
  {
2104
2148
  name: "transfer_evm_native",
2105
- description: "Preview, prepare, or execute a native EVM transfer using a wei amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
2149
+ description: "Preview, prepare, or execute a native EVM transfer using a wei 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.",
2106
2150
  optional: true,
2107
2151
  parameters: {
2108
2152
  type: "object",
@@ -2112,7 +2156,6 @@ const evmToolDefinitions = [
2112
2156
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
2113
2157
  purpose: { type: "string" },
2114
2158
  user_intent: { type: "boolean" },
2115
- approval_token: { type: "string" },
2116
2159
  network: { type: "string", enum: ["ethereum", "base"] },
2117
2160
  },
2118
2161
  required: ["recipient", "amount_wei", "mode", "purpose"],
@@ -2121,7 +2164,7 @@ const evmToolDefinitions = [
2121
2164
  },
2122
2165
  {
2123
2166
  name: "transfer_evm_token",
2124
- description: "Preview, prepare, or execute an ERC-20 transfer using a raw base-unit amount. Prepare returns an execution plan only, and execute requires a host-issued approval token bound to the previewed operation.",
2167
+ description: "Preview, prepare, or execute an ERC-20 transfer 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.",
2125
2168
  optional: true,
2126
2169
  parameters: {
2127
2170
  type: "object",
@@ -2132,7 +2175,6 @@ const evmToolDefinitions = [
2132
2175
  mode: { type: "string", enum: ["preview", "prepare", "execute"] },
2133
2176
  purpose: { type: "string" },
2134
2177
  user_intent: { type: "boolean" },
2135
- approval_token: { type: "string" },
2136
2178
  network: { type: "string", enum: ["ethereum", "base"] },
2137
2179
  },
2138
2180
  required: ["token_address", "recipient", "amount_raw", "mode", "purpose"],