# Authz Delegation In this example: * `granter` is `tp1mpapyn7sgdrrmpx8ed7haprt8m0039gg0nyn8f` (aka `large-testnet-hashholder`) * `grantee` is `tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2` (aka `mobile-wallet`) ## Fee Grant ### Set up Fee Grant ```bash= provenanced tx feegrant grant large-testnet-hashholder tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2 \ --expiration 2023-10-13T11:59:59Z \ --allowed-messages "/cosmos.authz.v1beta1.MsgExec,/cosmos.staking.v1beta1.MsgDelegate,/cosmos.staking.v1beta1.MsgBeginRedelegate,/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation,/cosmos.staking.v1beta1.MsgUndelegate" \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ``` ### Revoke Fee Grant ```bash= provenanced tx feegrant revoke tp1mpapyn7sgdrrmpx8ed7haprt8m0039gg0nyn8f tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2 \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ``` ## Authz Grants ### Delegate ```bash= provenanced tx authz grant tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2 generic \ --msg-type=/cosmos.staking.v1beta1.MsgDelegate \ --from large-testnet-hashholder \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ``` ### Redelegate ```bash= provenanced tx authz grant tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2 generic \ --msg-type=/cosmos.staking.v1beta1.MsgBeginRedelegate \ --from large-testnet-hashholder \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ``` ### Undelegate ```bash= provenanced tx authz grant tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2 generic \ --msg-type=/cosmos.staking.v1beta1.MsgUndelegate \ --from large-testnet-hashholder \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ``` ## Create Txs For some reason, need to get the sequence first: ```bash= provenanced q account tp1mpapyn7sgdrrmpx8ed7haprt8m0039gg0nyn8f \ --chain-id pio-testnet-1 \ --node=https://rpc.test.provenance.io:443 --testnet ``` ### Delegate ```bash= provenanced tx staking delegate tpvaloper1tgq6cpu6hmsrvkvdu82j99tsxxw7qqajn843fe 100nhash \ --from tp1mpapyn7sgdrrmpx8ed7haprt8m0039gg0nyn8f \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet \ --sequence <sequence from above> \ --generate-only > tx.json ``` ### Redelegate source -> destination: ```bash= provenanced tx staking redelegate tpvaloper1tgq6cpu6hmsrvkvdu82j99tsxxw7qqajn843fe tpvaloper1x299m72h6n88sswg2p9fp8lvkhrtqsvvv3rxsd 100nhash \ --from tp1mpapyn7sgdrrmpx8ed7haprt8m0039gg0nyn8f \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet \ --sequence <sequence from above> \ --generate-only > tx.json ``` ## Execute Tx ```bash= provenanced tx authz exec tx.json \ --from mobile-wallet \ --chain-id pio-testnet-1 \ --fee-account tp1mpapyn7sgdrrmpx8ed7haprt8m0039gg0nyn8f \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ``` ## Revoke Grant ```bash= provenanced tx authz revoke tp1yrtcht90kvscc796adaj7vhr74295teqa6qsr2 \ /cosmos.staking.v1beta1.MsgDelegate \ --from large-testnet-hashholder \ --chain-id pio-testnet-1 \ --gas auto --gas-adjustment 1.25 --gas-prices 1905nhash \ --node=https://rpc.test.provenance.io:443 \ --testnet ```