Skip to content

Instantly share code, notes, and snippets.

@toml01
Last active July 11, 2022 09:35
Show Gist options
  • Save toml01/4ea09eb7924ee7c745b7b009f6874bba to your computer and use it in GitHub Desktop.
Save toml01/4ea09eb7924ee7c745b7b009f6874bba to your computer and use it in GitHub Desktop.
# This commands are using `secretcli`
# It is possible to use the same messages using `secretjs` or any preferred client
CONTRACT_ADDRESS="secret19prkwdj0yue044rrleszga3e4t5x2fypzrcg82"
BENEFICIARY_ADDRESS="<enter address here>"
# Query beneficiaries for the fund
secretcli q compute query "$CONTRACT_ADDRESS" '{"get_beneficiaries":{}}'
# Query beneficiary's available balance
secretcli q compute query "$CONTRACT_ADDRESS" '{"get_beneficiary_balance":{"address":"'"$BENEFICIARY_ADDRESS"'"}}'
# Withdraw from fund
secretcli tx compute execute "$CONTRACT_ADDRESS" '{"withdraw":{"amount":"<enter desired amount here (or drop amount to withdraw all)>"}}' --from <enter beneficiary key here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment