feegrant

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 8 Imported by: 0

README

Feegrant module

Usage

(Tx) Grant
grantMsg := types.GrantMsg {
    Granter: "xpla1e4f6k98es55vxxv2pcfzpsjrf3mvazeyqpw8g9",
    Grantee: "xpla19yq7kjcgse7x672faptju0lxmy4cvdlcpmxnyn",
    SpendLimit: "1000",
    
    // select options as below
    Period: "3600",
    PeriodLimit: "10",
    Expiration: "2100-01-01T23:59:59+00:00",
}
txbytes, err := xplac.Grant(grantMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)
(Tx) Revoke grant
revokeGrantMsg := types.RevokeGrantMsg{
    Granter: "xpla1e4f6k98es55vxxv2pcfzpsjrf3mvazeyqpw8g9",
    Grantee: "xpla19yq7kjcgse7x672faptju0lxmy4cvdlcpmxnyn",
}
txbytes, err := xplac.RevokeGrant(revokeGrantMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)
(Query) grants
// Query details of single grant
queryGrantMsg := types.QueryGrantMsg{
    Granter: "xpla1e4f6k98es55vxxv2pcfzpsjrf3mvazeyqpw8g9",
    Grantee: "xpla19yq7kjcgse7x672faptju0lxmy4cvdlcpmxnyn",
}

// Query all grants of a grantee
queryGrantMsg := types.QueryGrantMsg{
    Grantee: "xpla19yq7kjcgse7x672faptju0lxmy4cvdlcpmxnyn",
}

// Query all grants of a granter
queryGrantMsg := types.QueryGrantMsg{
    Granter: "xpla1e4f6k98es55vxxv2pcfzpsjrf3mvazeyqpw8g9",
}

res, err := xplac.QueryGrant(queryGrantMsg).Query()

Documentation

Index

Constants

View Source
const (
	FeegrantModule                      = "feegrant"
	FeegrantGrantMsgType                = "grant"
	FeegrantRevokeGrantMsgType          = "revoke-grant"
	FeegrantQueryGrantMsgType           = "query-grant"
	FeegrantQueryGrantsByGranteeMsgType = "grants-by-grantee"
	FeegrantQueryGrantsByGranterMsgType = "grants-by-granter"
)

Variables

This section is empty.

Functions

func MakeFeeGrantMsg added in v0.0.5

func MakeFeeGrantMsg(feeGrantMsg types.FeeGrantMsg, privKey key.PrivateKey) (feegrant.MsgGrantAllowance, error)

(Tx) make msg - fee grant

func MakeQueryFeeGrantMsg added in v0.0.5

func MakeQueryFeeGrantMsg(queryFeeGrantMsg types.QueryFeeGrantMsg) (feegrant.QueryAllowanceRequest, error)

(Query) make msg - query fee grants

func MakeQueryFeeGrantsByGranteeMsg added in v0.0.5

func MakeQueryFeeGrantsByGranteeMsg(queryFeeGrantMsg types.QueryFeeGrantMsg) (feegrant.QueryAllowancesRequest, error)

(Query) make msg - fee grants by grantee

func MakeQueryFeeGrantsByGranterMsg added in v0.0.5

func MakeQueryFeeGrantsByGranterMsg(queryFeeGrantMsg types.QueryFeeGrantMsg) (feegrant.QueryAllowancesByGranterRequest, error)

(Query) make msg - fee grants by granter

func MakeRevokeFeeGrantMsg added in v0.0.5

func MakeRevokeFeeGrantMsg(revokeFeeGrantMsg types.RevokeFeeGrantMsg, privKey key.PrivateKey) (feegrant.MsgRevokeAllowance, error)

(Tx) make msg - fee grant revoke

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL