feat: Binance enhancements — configurable URL, quote, transfer, tests#10
Merged
feat: Binance enhancements — configurable URL, quote, transfer, tests#10
Conversation
…test scripts - Add optional `binance_base_url` config field (defaults to Binance Global, can be set to https://api.binance.us for Binance US spot-only) - Refactor src/binance.rs to use config-based URLs instead of hardcoded constants; futures/options return errors when custom URL is set - Add Binance as a quote data source (24hr ticker, no auth needed) alongside Hyperliquid, Yahoo Finance, and CoinGecko - Add Binance spot↔futures universal transfer command (MAIN_UMFUTURE / UMFUTURE_MAIN) - Add `quote` and `transfer` CLI commands + JSON variants to binance binary - Add new API functions: get_ticker_price, get_futures_ticker_price, universal_transfer, get_funding_rate - Fix bootstrap.sh to install all 5 binaries (was only installing fintool) - Update install.md manual instructions for all binaries - Fix HL chained withdrawal: re-fetch Across quote after Bridge2, account for ~$1 Bridge2 fee by tracking actual arrived balance - Add integration test scripts in tests/binance/ matching hyperliquid patterns: show_status, buy/sell ETH futures, buy/sell BTC spot, deposit addresses, withdraw, transfer, and full e2e_trading Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Michael Yuan <michael@secondstate.io>
New `okx` binary supporting: - Spot trading (buy/sell with cash mode, BTC-USDT instrument format) - Perpetual futures (buy/sell with cross margin, BTC-USDT-SWAP format) - Leverage control, funding rate queries - Orderbook, quote (public, no auth needed) - Balance (trading + funding accounts), positions, orders, cancel - Deposit address lookup, withdrawal with auto fee detection - Funding ↔ trading account transfers - Full --json mode for programmatic use HMAC-SHA256 + base64 authentication matching OKX API spec. Configurable base URL (okx_base_url) for OKX US support. Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
binance_base_urlconfig field for Binance US / custom endpointssrc/binance.rsto use config-based URLs instead of hardcoded constantstransfercommand for spot ↔ futures (universal transfer API)quoteandtransferCLI + JSON commands to thebinancebinarybootstrap.shto install all 5 binaries (was only copyingfintool)tests/binance/matching hyperliquid patternsNew Binance API functions
get_ticker_price— spot 24hr ticker (no auth)get_futures_ticker_price— futures 24hr ticker (no auth)universal_transfer— spot ↔ futures wallet transferget_funding_rate— futures funding rate (no auth)Test scripts
show_status.shbuy_eth.shsell_eth.shbuy_btc_spot.shsell_btc_spot.shdeposit.shwithdraw.shtransfer.she2e_trading.shTest plan
cargo build --releasepassescargo clippyclean (no warnings)cargo fmtappliedbinance quote BTCreturns Binance price databinance --json '{"command":"quote","symbol":"ETH"}'returns JSON with Binance sourcebinance --helpshows newquoteandtransfercommandstests/binance/show_status.shwith live API keystests/binance/e2e_trading.shwith live API keys🤖 Generated with Claude Code