This script generates a tx which swaps all balances except for the tx fee and transfers the swapped coins to the kaia chain.
Disclaimer: it's an example. You MUST provide your own values. Misconfiguration might cause PERMANENT FINANCIAL LOSS.
# 1. install the external dependencies (requirement 1).
sudo apt update && sudo apt install jq # ubuntu
# 2. print the usage.
sh guided.sh
# 3. check the finschia client binary version (requirement 2).
fnsad version
# 4. (optional) add the corresponding pubkey of the ledger (refer to requirement 3).
fnsad keys add foo --keyring-backend test --ledger --coin-type 118
# 5. provide the variables and trigger the script.
SENDER=link146asaycmtydq45kxc8evntqfgepagygelel00h \
RECEIVER=0x000000000000000000000000000000000000dEaD \
sh guided.sh
- The script depends on the external command
jq
. - The finschia client binary version MUST be >=4.0.0.
- If you want to use the ledger, you MUST have corresponding privileges.
- install the external dependencies (requirement 1).
- print the usage.
sh swap-and-transfer-all.sh
- set the parameters.
export NODE=https://finschia-rpc.finschia.io:443 export BINARY=./fnsad export GAS=300000
- check the finschia client binary version (requirement 2).
$BINARY version
- prepare the key (either i, ii or iii).
- add the corresponding pubkey of the ledger (refer to requirement 3).
export KEYRING_DIR=$(mktemp -d) $BINARY keys add foo --home $KEYRING_DIR --keyring-backend test --ledger --coin-type 118
- add the key to the local wallet.
export KEYRING_DIR=$(mktemp -d) $BINARY keys add foo --home $KEYRING_DIR --keyring-backend test --recover
- use the local wallet.
export KEYRING_DIR=/foo
- add the corresponding pubkey of the ledger (refer to requirement 3).
- provide the variables and trigger the script.
SENDER=link146asaycmtydq45kxc8evntqfgepagygelel00h \ RECEIVER=0x000000000000000000000000000000000000dEaD \ sh swap-and-transfer-all.sh
- (optional) remove the keyring.
rm -r $KEYRING_DIR
- Finschia mainnet: https://finschia-rpc.finschia.io:443
- Ebony testnet: https://ebony-rpc.finschia.io:443
- I've entered
y
onconfirm transaction before signing and broadcasting
but it does not do anything.- A) You must also confirm your transaction within your ledger device.