fixed spl-token accounts command

This commit is contained in:
dd 2021-04-05 13:22:06 -04:00
parent a4e6cc16d5
commit 948da75f57
1 changed files with 12 additions and 12 deletions

View File

@ -7,31 +7,31 @@ MARKET_STR="${2^^}/${3^^}"
if [ $MARKET_STR = "BTC/USDT" ]; then
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["BTC/USDT"]' -r)
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
BASE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
elif [ $MARKET_STR = "ETH/USDT" ]; then
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["ETH/USDT"]' -r)
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
BASE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $USDT | tail -1 | cut -d' ' -f1)
elif [ $MARKET_STR = "BTC/USDC" ]; then
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["BTC/USDC"]' -r)
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
BASE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
elif [ $MARKET_STR = "ETH/USDC" ]; then
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["ETH/USDC"]' -r)
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
BASE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $USDC | tail -1 | cut -d' ' -f1)
elif [ $MARKET_STR = "BTC/WUSDT" ]; then
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["BTC/WUSDT"]' -r)
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
BASE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $BTC | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
elif [ $MARKET_STR = "ETH/WUSDT" ]; then
MARKET=$(cat ~/mango-client-ts/src/ids.json | jq '.devnet.spot_markets|.["ETH/WUSDT"]' -r)
BASE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --url $CLUSTER --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
BASE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $ETH | tail -1 | cut -d' ' -f1)
QUOTE_WALLET=$(spl-token accounts --verbose --url $CLUSTER --owner $KEYPAIR $WUSDT | tail -1 | cut -d' ' -f1)
else
echo "invalid args"
fi