MsgAuth

API

class terra_sdk.client.lcd.api.msgauth.MsgAuthAPI(c)[source]
grants(granter, grantee, msg_type=None)[source]

Fetches current active message authorization grants.

Parameters
  • granter (AccAddress) – granter account address

  • grantee (AccAddress) – grantee account address

  • msg_type (Optional[str], optional) – message type.

Returns

message authorization grants matching criteria

Return type

List[AuthorizationGrant]

Data

MsgAuth module data types.

class terra_sdk.core.msgauth.data.Authorization[source]

Base class for authorization types.

class terra_sdk.core.msgauth.data.AuthorizationGrant(authorization, expiration)[source]

Contains information about an existing granted authorization between two users.

authorization: terra_sdk.core.msgauth.data.Authorization

Grant authorization details.

expiration: str

Grant expiration.

class terra_sdk.core.msgauth.data.GenericAuthorization(grant_msg_type)[source]

Generic type of Authorization, specifying the type of message to allow.

Parameters

grant_msg_type (str) – type of message allowed by authorization

type: str = 'msgauth/GenericAuthorization'
class terra_sdk.core.msgauth.data.SendAuthorization(spend_limit)[source]

Type of Authorization for MsgSend, which can be parameterized by setting a spend_limit allowance for the grantee.

Parameters

spend_limit (Coins.Input) – coins representing allowance of grant

type: str = 'msgauth/SendAuthorization'

Messages

MsgAuth module message types.

class terra_sdk.core.msgauth.msgs.MsgExecAuthorized(grantee, msgs)[source]

Execute a set of messages, exercising an existing authorization.

Parameters
  • grantee (AccAddress) – grantee account (submitting on behalf of granter)

  • msg (List[Msg]) – list of messages to execute using authorization grant

type: str = 'msgauth/MsgExecAuthorized'
class terra_sdk.core.msgauth.msgs.MsgGrantAuthorization(granter, grantee, authorization, period)[source]

Grant an authorization to grantee to call messages on behalf of granter.

Parameters
  • granter (AccAddress) – account giving authorization

  • grantee (AccAddress) – account receiving authorization

  • authorization (Authorization) – details of authorization granted

  • period (int) – timeframe during which the authorization is considered valid

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

class terra_sdk.core.msgauth.msgs.MsgRevokeAuthorization(granter, grantee, authorization_msg_type)[source]

Remove existing authorization grant of the specified message type.

Parameters
  • granter (AccAddress) – account removing authorization

  • grantee (AccAddress) – account having authorization removed

  • authorization_msg_type (str) – type of message to remove authorization for

type: str = 'msgauth/MsgRevokeAuthorization'