2024-12-16 18:53:52 +00:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
echo "Loading Keyfork by mnemonic"
|
|
|
|
export KEYFORKD_SOCKET_PATH=/tmp/keyforkd.sock
|
|
|
|
( keyfork recover mnemonic & )
|
|
|
|
|
|
|
|
while test ! -e $KEYFORKD_SOCKET_PATH; do sleep 1; done
|
|
|
|
|
|
|
|
echo "Waiting for inputs from online system..."
|
|
|
|
while test ! -f /data/input.json; do sleep 1; done
|
|
|
|
|
|
|
|
from_address="$(jq -r .from_address /data/input.json)"
|
|
|
|
to_address="$(jq -r .to_address /data/input.json)"
|
|
|
|
token_name="$(jq -r .token_name /data/input.json)"
|
|
|
|
token_amount="$(jq -r .token_amount /data/input.json)"
|
|
|
|
|
|
|
|
jq . /data/input.json
|
2024-12-16 18:56:34 +00:00
|
|
|
echo "Do these values look correct? If not, press ctrl-c. Otherwise, press Enter."
|
2024-12-24 00:02:30 +00:00
|
|
|
read -r _
|
2024-12-16 18:53:52 +00:00
|
|
|
|
|
|
|
echo "Creating and signing transaction"
|
|
|
|
|
2024-12-24 00:02:30 +00:00
|
|
|
icepick workflow sol transfer-token --from-address "$from_address" --to-address "$to_address" --token-name "$token_name" --token-amount "$token_amount"
|