@rackspay/wallet-mcp 1.0.1 → 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.
- package/build/index.js +118 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -164,6 +164,124 @@ 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
|
+
"Sends a single USDC.transfer() to the Bridge2 contract. Minimum deposit: 5 USDC. " +
|
|
221
|
+
"IMPORTANT: call racks_get_wallet_balance first to confirm sufficient Arbitrum USDC.", {
|
|
222
|
+
amount_usdc: z
|
|
223
|
+
.number()
|
|
224
|
+
.min(5)
|
|
225
|
+
.describe("Amount of USDC to deposit into HyperCore (minimum 5.0). Deposits below 5 USDC are lost."),
|
|
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
|
+
deposit_tx: d.deposit_tx,
|
|
239
|
+
note: "Funds typically arrive in HyperCore within 1-2 minutes. Then call racks_get_trade_account to confirm.",
|
|
240
|
+
}, null, 2),
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
};
|
|
244
|
+
});
|
|
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
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
167
285
|
// Tool: racks_get_trade_account
|
|
168
286
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
169
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
|
+
"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": {
|