@rackspay/wallet-mcp 1.0.1 → 1.0.3

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 +80 -0
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -164,6 +164,86 @@ server.tool("racks_get_wallet_balance", "Return this agent's USDC balance on eve
164
164
  };
165
165
  });
166
166
  // ─────────────────────────────────────────────────────────────────────────────
167
+ // Tool: racks_bridge_usdc
168
+ // ─────────────────────────────────────────────────────────────────────────────
169
+ server.tool("racks_bridge_usdc", "Bridge USDC between chains using the Relay solver network. " +
170
+ "Gas is abstracted — no ETH needed on the destination chain. " +
171
+ "Supports Solana → Arbitrum, Arbitrum → Arbitrum, Polygon → Arbitrum. " +
172
+ "Use this to move funds into Arbitrum before depositing to HyperCore for trading. " +
173
+ "IMPORTANT: call racks_get_wallet_balance first to confirm source chain balance.", {
174
+ origin_chain: z
175
+ .enum(["solana", "arbitrum", "polygon"])
176
+ .describe("Chain to bridge FROM. Use 'solana' to bridge from the agent's Solana wallet"),
177
+ destination_chain: z
178
+ .enum(["arbitrum", "polygon"])
179
+ .describe("Chain to bridge TO. Use 'arbitrum' to fund HyperCore trading"),
180
+ amount_usdc: z
181
+ .number()
182
+ .positive()
183
+ .describe("Amount of USDC to bridge (e.g. 1.0 = $1.00). A small relayer fee is deducted from this amount"),
184
+ }, async ({ origin_chain, destination_chain, amount_usdc }) => {
185
+ const res = await request("POST", "/api/v1/agent/wallet/bridge", {
186
+ origin_chain,
187
+ destination_chain,
188
+ amount_usdc,
189
+ });
190
+ if (!res.ok)
191
+ return apiError(res, "Failed to bridge USDC");
192
+ const d = res.data;
193
+ return {
194
+ content: [
195
+ {
196
+ type: "text",
197
+ text: JSON.stringify({
198
+ success: true,
199
+ bridge: {
200
+ from: origin_chain,
201
+ to: destination_chain,
202
+ amount_usdc,
203
+ relayer_fee: d.relayer_fee_usdc,
204
+ expected_received: d.expected_output,
205
+ request_id: d.request_id,
206
+ },
207
+ steps: d.steps_executed,
208
+ note: `Funds arrive on ${destination_chain} in ~5-30 seconds. Then call racks_deposit_to_hypercore to fund trading.`,
209
+ status_url: d.status_endpoint,
210
+ }, null, 2),
211
+ },
212
+ ],
213
+ };
214
+ });
215
+ // ─────────────────────────────────────────────────────────────────────────────
216
+ // Tool: racks_deposit_to_hypercore
217
+ // ─────────────────────────────────────────────────────────────────────────────
218
+ server.tool("racks_deposit_to_hypercore", "Move USDC from this agent's Arbitrum wallet into HyperCore (Hyperliquid's L1 trading account). " +
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. " +
221
+ "IMPORTANT: call racks_get_wallet_balance first to confirm sufficient Arbitrum USDC.", {
222
+ amount_usdc: z
223
+ .number()
224
+ .positive()
225
+ .describe("Amount of USDC to deposit into HyperCore (e.g. 10.5 = $10.50)"),
226
+ }, async ({ amount_usdc }) => {
227
+ const res = await request("POST", "/api/v1/agent/wallet/deposit/hypercore", { amount_usdc });
228
+ if (!res.ok)
229
+ return apiError(res, "Failed to deposit to HyperCore");
230
+ const d = res.data;
231
+ return {
232
+ content: [
233
+ {
234
+ type: "text",
235
+ text: JSON.stringify({
236
+ success: true,
237
+ deposited_usdc: amount_usdc,
238
+ approve_tx: d.approve_tx,
239
+ deposit_tx: d.deposit_tx,
240
+ note: "Funds typically arrive in HyperCore within 1-2 minutes. Then call racks_get_trade_account to confirm.",
241
+ }, null, 2),
242
+ },
243
+ ],
244
+ };
245
+ });
246
+ // ─────────────────────────────────────────────────────────────────────────────
167
247
  // Tool: racks_get_trade_account
168
248
  // ─────────────────────────────────────────────────────────────────────────────
169
249
  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.1",
3
+ "version": "1.0.3",
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": {