You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wow-btc-swap/docs/cli/discover_and_take.sh

28 lines
762 B

#!/bin/bash
CLI_PATH=$1
YOUR_MONERO_ADDR=$2
CLI_LIST_SELLERS="$CLI_PATH --testnet --json --debug list-sellers"
echo "Requesting sellers with command: $CLI_LIST_SELLERS"
echo
BEST_SELLER=$($CLI_LIST_SELLERS | jq -s -c 'min_by(.status .Online .price)' | jq -r '.multiaddr, (.status .Online .price), (.status .Online .min_quantity), (.status .Online .max_quantity)')
read ADDR PRICE MIN MAX < <(echo $BEST_SELLER)
echo
echo "Seller with best price:"
echo " multiaddr : $ADDR"
echo " price : $PRICE sat"
echo " min_quantity: $MIN sat"
echo " max_quantity: $MAX sat"
echo
CLI_SWAP="$CLI_PATH --testnet --debug buy-xmr --receive-address $YOUR_MONERO_ADDR --seller $ADDR"
echo "Starting swap with best seller using command $CLI_SWAP"
echo
$CLI_SWAP