Authz
ℹ️info
Terra's Authz module inherits from the Cosmos SDK's authz
module. This document is a stub and mainly explains important Terra-specific notes on how it is used.
The authz (message authorization) module allows users to authorize another account to send messages on their behalf. Certain authorizations, such as the spending of another account's tokens, can be parameterized to constrain the permissions of the grantee, such as setting a spending limit.
Message types
MsgGrant
_7// MsgGrant is a request type for Grant method. It declares authorization to the grantee_7// on behalf of the granter with the provided expiration time._7type MsgGrant struct {_7 Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`_7 Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`_7 Grant Grant `protobuf:"bytes,3,opt,name=grant,proto3" json:"grant"`_7}
MsgRevoke
_8// MsgRevoke revokes any authorization with the provided sdk.Msg type on the_8// granter's account with that has been granted to the grantee._8type MsgRevoke struct {_8 Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`_8 Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`_8 MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"`_8}_8}
MsgExec
_10// MsgExec attempts to execute the provided messages using_10// authorizations granted to the grantee. Each message should have only_10// one signer corresponding to the granter of the authorization._10type MsgExec struct {_10 Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"`_10 // Authorization Msg requests to execute. Each msg must implement Authorization interface_10 // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))_10 // triple and validate it._10 Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"`_10}