This one-liner converts an address from one HRP to another using Axoned's logic ask
command.
(
# Define the input address and target HRP
addr='axone17sc02mcgjzdv5l4jwnzffxw7g60y5ta4zwy04g'
to_hrp='stars'
# Convert the address using the Axoned logic 'ask' command
axoned query logic ask \
--node "https://api.dentrite.axone.xyz:443/rpc" \
--program "
convert_addr(FROM_BECH32, TO_HRP, TO_BECH32) :-
bech32_address(-(_, FROM_BYTES), FROM_BECH32),
bech32_address(-(TO_HRP, FROM_BYTES), TO_BECH32).
" \
"convert_addr('$addr', '$to_hrp', S)." \
-ojson | jq -r '.answer.results[0].substitutions[0].expression'
)
stars17sc02mcgjzdv5l4jwnzffxw7g60y5ta445l92y
Prerequisites:
References: