curl --request POST \
--url https://mcp.echozero.app/api/v1/wallet/buy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-signature: <x-signature>' \
--header 'x-timestamp: <x-timestamp>' \
--data '{
"amount": 25
}'{
"success": true,
"data": {
"success": true,
"transactionId": "<string>",
"amount": 123,
"tokenSymbol": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"tradeId": "<string>",
"openTradeUpdatePending": true
}
}Buy tokens
Mirrors GraphQL buyTokens. Requires HMAC signing. Fresh buys return openTradeUpdatePending and create the Trade row only after on-chain finality. Concurrent buy/sell on the same wallet fail with TRADE_IN_PROGRESS even without Idempotency-Key. Frozen wallets return WALLET_FROZEN / HTTP 403.
curl --request POST \
--url https://mcp.echozero.app/api/v1/wallet/buy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-signature: <x-signature>' \
--header 'x-timestamp: <x-timestamp>' \
--data '{
"amount": 25
}'{
"success": true,
"data": {
"success": true,
"transactionId": "<string>",
"amount": 123,
"tokenSymbol": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"tradeId": "<string>",
"openTradeUpdatePending": true
}
}Authorizations
Headers
Optional. Replaying the same key for the same user returns the cached result without a second buy.
Required for API-key authenticated requests. HMAC-SHA256(secretKey, timestamp + METHOD + path + body) as lowercase hex. Omit only for JWT/OAuth session tokens or public routes.
Required with x-signature. Epoch milliseconds; rejected if drift exceeds 5 minutes. Omit only for JWT/OAuth session tokens or public routes.
Body
OpenAPI: McpWalletBuySellBodyDto. GraphQL: WalletBuySellOperationArgs in apps/gql-main/src/wallet/args/walletOperation.args.ts.
Amount for the operation
Token mint address (optional; defaults to USDC / PRIMARY_SPEND_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v)
Destination address (required for withdraw)
Optional stop-loss on the open BUY affected by this operation
Show child attributes
Show child attributes
Optional take-profit on the open BUY for this mint
Show child attributes
Show child attributes