feegrant

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 11 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

func MakeFeeGrantMsg(feeGrantMsg types.FeeGrantMsg, granter sdk.AccAddress) (feegrant.MsgGrantAllowance, error)

(Tx) make msg - fee grant

func MakeQueryFeeGrantMsg

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

(Query) make msg - query fee grants

func MakeQueryFeeGrantsByGranteeMsg

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

(Query) make msg - fee grants by grantee

func MakeQueryFeeGrantsByGranterMsg

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

(Query) make msg - fee grants by granter

func MakeRevokeFeeGrantMsg

func MakeRevokeFeeGrantMsg(revokeFeeGrantMsg types.RevokeFeeGrantMsg, granter sdk.AccAddress) (feegrant.MsgRevokeAllowance, error)

(Tx) make msg - fee grant revoke

func NewCoreModule added in v0.1.2

func NewCoreModule() core.CoreModule

func QueryFeegrant

func QueryFeegrant(i core.QueryClient) (string, error)

Query client for fee-grant module.

Types

type FeegrantExternal added in v0.1.2

type FeegrantExternal struct {
	Xplac provider.XplaClient
}

func NewFeegrantExternal added in v0.1.2

func NewFeegrantExternal(xplac provider.XplaClient) (e FeegrantExternal)

func (FeegrantExternal) FeeGrant added in v0.1.2

func (e FeegrantExternal) FeeGrant(grantMsg types.FeeGrantMsg) provider.XplaClient

Grant fee allowance to an address.

func (FeegrantExternal) QueryFeeGrants added in v0.1.2

func (e FeegrantExternal) QueryFeeGrants(queryFeeGrantMsg types.QueryFeeGrantMsg) provider.XplaClient

Query details of fee grants.

func (FeegrantExternal) RevokeFeeGrant added in v0.1.2

func (e FeegrantExternal) RevokeFeeGrant(revokeGrantMsg types.RevokeFeeGrantMsg) provider.XplaClient

Revoke fee-grant.

Jump to

Keyboard shortcuts

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