LeoYeAI/agent-master-skills / skills/aurehub-xaut-trade
xaut-trade
FlaggedBuy or sell XAUT (Tether Gold) on Ethereum. Supports market orders (Uniswap V3) and limit orders (UniswapX). Wallet modes: Foundry keystore or WDK. Delegates non-XAUT intents to registered skills (e.g. Polymarket prediction markets, Hyperliquid trading). Triggers: buy XAUT, XAUT trade, swap USDT for XAUT, sell XAUT, swap XAUT for USDT, limit order, limit buy XAUT, limit sell XAUT, check limit order, cancel limit order, XAUT when, create wallet, setup wallet, polymarket, prediction market, bet on, odds on, hyperliquid, perp, perpetual, long, short, open long, open short, close position, leverage.
scripts/__tests__/swap-cli.test.js
View on GitHubimport { describe, it, expect } from 'vitest';
import { parseCliArgs } from '../swap.js';
describe('parseCliArgs', () => {
it('parses quote subcommand with --side and --amount', () => {
const result = parseCliArgs(['quote', '--side', 'buy', '--amount', '100']);
expect(result.command).toBe('quote');
expect(result.side).toBe('buy');
expect(result.amount).toBe('100');
});
it('parses approve with --token and --amount', () => {
const result = parseCliArgs(['approve', '--token', 'USDT', '--amount', '1000']);
expect(result.command).toBe('approve');
expect(result.token).toBe('USDT');
expect(result.amount).toBe('1000');
});
it('parses swap with --side, --amount, --min-out', () => {
const result = parseCliArgs(['swap', '--side', 'sell', '--amount', '0.5', '--min-out', '1500']);
expect(result.command).toBe('swap');
expect(result.side).toBe('sell');
expect(result.amount).toBe('0.5');
expect(result.minOut).toBe('1500');
});
it('parses balance (no args needed)', () => {
const result = parseCliArgs(['balance']);
expect(result.command).toBe('balance');
});
it('parses allowance with --token', () => {
const result = parseCliArgs(['allowance', '--token', 'XAUT']);
expect(result.command).toBe('allowance');
expect(result.token).toBe('XAUT');
});
it('parses allowance with --token and --spender', () => {
const result = parseCliArgs(['allowance', '--token', 'USDT', '--spender', '0x000000000022D473030F116dDEE9F6B43aC78BA3']);
expect(result.command).toBe('allowance');
expect(result.token).toBe('USDT');
expect(result.spender).toBe('0x000000000022D473030F116dDEE9F6B43aC78BA3');
});
it('parses approve with --token, --amount, and --spender', () => {
const result = parseCliArgs(['approve', '--token', 'USDT', '--amount', '1000', '--spender', '0x000000000022D473030F116dDEE9F6B43aC78BA3']);
expect(result.command).toBe('approve');
expect(result.token).toBe('USDT');
expect(result.amount).toBe('1000');
expect(result.spender).toBe('0x000000000022D473030F116dDEE9F6B43aC78BA3');
});
it('parses address', () => {
const result = parseCliArgs(['address']);
expect(result.command).toBe('address');
});
it('parses sign with --data-file', () => {
const result = parseCliArgs(['sign', '--data-file', '/tmp/typed-data.json']);
expect(result.command).toBe('sign');
expect(result.dataFile).toBe('/tmp/typed-data.json');
});
it('parses cancel-nonce with --word-pos and --mask', () => {
const result = parseCliArgs(['cancel-nonce', '--word-pos', '42', '--mask', '115792089237316195423570985008687907853269984665640564039457584007913129639935']);
expect(result.command).toBe('cancel-nonce');
expect(result.wordPos).toBe('42');
expect(result.mask).toBe('115792089237316195423570985008687907853269984665640564039457584007913129639935');
});
it('errors on unknown subcommand', () => {
expect(() => parseCliArgs(['unknown-cmd'])).toThrow(/unknown command/i);
});
it('normalizes --side for quote/swap', () => {
expect(parseCliArgs(['quote', '--side', 'BUY', '--amount', '1']).side).toBe('buy');
expect(parseCliArgs(['swap', '--side', ' Sell ', '--amount', '1', '--min-out', '1']).side).toBe('sell');
});
it('errors when --side is not buy/sell for quote/swap', () => {
expect(() => parseCliArgs(['quote', '--side', 'long', '--amount', '1'])).toThrow(/invalid --side/i);
expect(() => parseCliArgs(['swap', '--side', 'short', '--amount', '1', '--min-out', '1'])).toThrow(/invalid --side/i);
});
it('parses --config-dir override', () => {
const result = parseCliArgs(['balance', '--config-dir', '/tmp/myconfig']);
expect(result.command).toBe('balance');
expect(result.configDir).toBe('/tmp/myconfig');
});
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |