@rackspay/wallet-mcp 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/build/index.js +42 -4
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -217,12 +217,12 @@ server.tool("racks_bridge_usdc", "Bridge USDC between chains using the Relay sol
217
217
  // ─────────────────────────────────────────────────────────────────────────────
218
218
  server.tool("racks_deposit_to_hypercore", "Move USDC from this agent's Arbitrum wallet into HyperCore (Hyperliquid's L1 trading account). " +
219
219
  "This is required before placing any trades — Hyperliquid only accepts funds from Arbitrum. " +
220
- "The agent signs two transactions via Privy: ERC-20 approve, then bridge deposit. " +
220
+ "Sends a single USDC.transfer() to the Bridge2 contract. Minimum deposit: 5 USDC. " +
221
221
  "IMPORTANT: call racks_get_wallet_balance first to confirm sufficient Arbitrum USDC.", {
222
222
  amount_usdc: z
223
223
  .number()
224
- .positive()
225
- .describe("Amount of USDC to deposit into HyperCore (e.g. 10.5 = $10.50)"),
224
+ .min(5)
225
+ .describe("Amount of USDC to deposit into HyperCore (minimum 5.0). Deposits below 5 USDC are lost."),
226
226
  }, async ({ amount_usdc }) => {
227
227
  const res = await request("POST", "/api/v1/agent/wallet/deposit/hypercore", { amount_usdc });
228
228
  if (!res.ok)
@@ -235,7 +235,6 @@ server.tool("racks_deposit_to_hypercore", "Move USDC from this agent's Arbitrum
235
235
  text: JSON.stringify({
236
236
  success: true,
237
237
  deposited_usdc: amount_usdc,
238
- approve_tx: d.approve_tx,
239
238
  deposit_tx: d.deposit_tx,
240
239
  note: "Funds typically arrive in HyperCore within 1-2 minutes. Then call racks_get_trade_account to confirm.",
241
240
  }, null, 2),
@@ -244,6 +243,45 @@ server.tool("racks_deposit_to_hypercore", "Move USDC from this agent's Arbitrum
244
243
  };
245
244
  });
246
245
  // ─────────────────────────────────────────────────────────────────────────────
246
+ // Tool: racks_withdraw_from_hypercore
247
+ // ─────────────────────────────────────────────────────────────────────────────
248
+ server.tool("racks_withdraw_from_hypercore", "Withdraw USDC from HyperCore back to the agent's Arbitrum wallet. " +
249
+ "This is an L1 action signed and submitted to Hyperliquid. " +
250
+ "Validators process it and send USDC on Arbitrum in 3-4 minutes. " +
251
+ "IMPORTANT: call racks_get_trade_account first to check withdrawable balance. " +
252
+ "Funds in open positions are NOT withdrawable — close positions first.", {
253
+ amount_usdc: z
254
+ .number()
255
+ .positive()
256
+ .describe("Amount of USDC to withdraw from HyperCore (e.g. 5.0 = $5.00)"),
257
+ destination: z
258
+ .string()
259
+ .optional()
260
+ .describe("Arbitrum address to receive funds. Defaults to this agent's own wallet."),
261
+ }, async ({ amount_usdc, destination }) => {
262
+ const body = { amount_usdc };
263
+ if (destination)
264
+ body.destination = destination;
265
+ const res = await request("POST", "/api/v1/agent/wallet/withdraw/hypercore", body);
266
+ if (!res.ok)
267
+ return apiError(res, "Failed to withdraw from HyperCore");
268
+ const d = res.data;
269
+ return {
270
+ content: [
271
+ {
272
+ type: "text",
273
+ text: JSON.stringify({
274
+ success: true,
275
+ withdrawn_usdc: amount_usdc,
276
+ destination: d.destination,
277
+ status: d.status,
278
+ note: "Withdrawal takes 3-4 minutes. Then call racks_get_wallet_balance to confirm Arbitrum balance.",
279
+ }, null, 2),
280
+ },
281
+ ],
282
+ };
283
+ });
284
+ // ─────────────────────────────────────────────────────────────────────────────
247
285
  // Tool: racks_get_trade_account
248
286
  // ─────────────────────────────────────────────────────────────────────────────
249
287
  server.tool("racks_get_trade_account", "Fetch this agent's full Hyperliquid HyperCore account state: account value, margin, " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rackspay/wallet-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "RACKS Wallet MCP — crypto trading and betting infrastructure for AI agents. Trade perps on Hyperliquid, bet on Polymarket, and check on-chain balances via Claude Desktop or any MCP client.",
5
5
  "type": "module",
6
6
  "bin": {