cardano-docker/scripts/wallet_balance

32 lines
664 B
Plaintext
Raw Permalink Normal View History

2021-02-13 15:19:38 +00:00
#!/bin/bash
WALLET=$1
if [ -z "$WALLET" ]; then
echo "Invalid wallet."
MISSING_ARG=1
fi
if [ -n "$MISSING_ARG" ]; then
exit
fi
# Check for required files
if [ ! -f "${NODE_PATH}/staking/wallets/${WALLET}/payment.addr" ]; then
echo "Missing required payment.addr. You need to run \`generate_waller ${WALLET}\` to generate this key."
MISSING_FILES=1
fi
if [ -n "$MISSING_FILES" ]; then
exit
fi
# Wait for node to sync
if [[ "${WAIT_FOR_SYNC}" == "True" ]]; then
wait_for_sync 99.90
fi
ADDRESS=$(cat ${NODE_PATH}/staking/wallets/${WALLET}/payment.addr)
cardano-cli query utxo ${NETWORK_ARGUMENT} --allegra-era --address ${ADDRESS}