2024-12-16 18:53:52 +00:00
|
|
|
printf "%s" "Public key of the sender address: "
|
|
|
|
read from_address
|
|
|
|
|
|
|
|
printf "%s" "Public key of the recipient address: "
|
|
|
|
read to_address
|
|
|
|
|
|
|
|
printf "%s" "Name of the token to transfer: "
|
|
|
|
read token_name
|
|
|
|
|
|
|
|
printf "%s" "Amount of token to transfer: "
|
|
|
|
read token_amount
|
|
|
|
|
|
|
|
echo "Acquiring blockhash..."
|
2024-12-19 20:44:10 +00:00
|
|
|
blockhash="$(icepick sol get-blockhash --cluster devnet | jq -r .blob.blockhash)"
|
2024-12-16 18:53:52 +00:00
|
|
|
|
|
|
|
echo "Saving information to file"
|
|
|
|
|
|
|
|
cat <<EOF > /data/input.json
|
|
|
|
{
|
|
|
|
"from_address": "$from_address",
|
|
|
|
"to_address": "$to_address",
|
|
|
|
"token_name": "$token_name",
|
|
|
|
"token_amount": "$token_amount",
|
|
|
|
"blockhash": "$blockhash"
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
echo "Waiting for signed transaction..."
|
|
|
|
while test ! -f /data/output.json; do sleep 1; done
|
|
|
|
|
|
|
|
echo "Broadcasting transaction"
|
2024-12-20 22:53:02 +00:00
|
|
|
icepick sol broadcast --cluster devnet < /data/output.json | jq .
|