feegrant

package
v0.47.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package feegrant provides functionality for authorizing the payment of transaction fees from one account (key) to another account (key).

Effectively, this allows for a user to pay fees using the balance of an account different from their own. Example use cases would be allowing a key on a device to pay for fees using a master wallet, or a third party service allowing users to pay for transactions without ever really holding their own tokens. This package provides ways for specifying fee allowances such that authorizing fee payment to another account can be done with clear and safe restrictions.

A user would authorize granting fee payment to another user using MsgGrantAllowance and revoke that delegation using MsgRevokeAllowance. In both cases, Granter is the one who is authorizing fee payment and Grantee is the one who is receiving the fee payment authorization. So grantee would correspond to the one who is signing a transaction and the granter would be the address that pays the fees.

The fee allowance that a grantee receives is specified by an implementation of the FeeAllowance interface. Two FeeAllowance implementations are provided in this package: BasicAllowance and PeriodicAllowance.

Package feegrant is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeUseFeeGrant    = "use_feegrant"
	EventTypeRevokeFeeGrant = "revoke_feegrant"
	EventTypeSetFeeGrant    = "set_feegrant"

	AttributeKeyGranter = "granter"
	AttributeKeyGrantee = "grantee"

	AttributeValueCategory = ModuleName
)

evidence module events

View Source
const (
	// ModuleName is the module name constant used in many places
	ModuleName = "feegrant"

	// StoreKey is the store key string for supply
	StoreKey = ModuleName

	// RouterKey is the message route for supply
	RouterKey = ModuleName

	// QuerierRoute is the querier route for supply
	QuerierRoute = ModuleName
)
View Source
const (
	DefaultCodespace = ModuleName
)

Codes for governance errors

Variables

View Source
var (
	// ErrFeeLimitExceeded error if there are not enough allowance to cover the fees
	ErrFeeLimitExceeded = sdkerrors.Register(DefaultCodespace, 2, "fee limit exceeded")
	// ErrFeeLimitExpired error if the allowance has expired
	ErrFeeLimitExpired = sdkerrors.Register(DefaultCodespace, 3, "fee allowance expired")
	// ErrInvalidDuration error if the Duration is invalid or doesn't match the expiration
	ErrInvalidDuration = sdkerrors.Register(DefaultCodespace, 4, "invalid duration")
	// ErrNoAllowance error if there is no allowance for that pair
	ErrNoAllowance = sdkerrors.Register(DefaultCodespace, 5, "no allowance")
	// ErrNoMessages error if there is no message
	ErrNoMessages = sdkerrors.Register(DefaultCodespace, 6, "allowed messages are empty")
	// ErrMessageNotAllowed error if message is not allowed
	ErrMessageNotAllowed = sdkerrors.Register(DefaultCodespace, 7, "message not allowed")
)
View Source
var (
	ErrInvalidLengthFeegrant        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFeegrant          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFeegrant = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var FeeAllowanceKeyPrefix = []byte{0x00}

FeeAllowanceKeyPrefix is the set of the kvstore for fee allowance data

View Source
var (

	// ModuleCdc references the global x/feegrant module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/feegrant and
	// defined at the application level.
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func FeeAllowanceKey added in v0.46.0

func FeeAllowanceKey(granter sdk.AccAddress, grantee sdk.AccAddress) []byte

FeeAllowanceKey is the canonical key to store a grant from granter to grantee We store by grantee first to allow searching by everyone who granted to you

func FeeAllowancePrefixByGrantee added in v0.46.0

func FeeAllowancePrefixByGrantee(grantee sdk.AccAddress) []byte

FeeAllowancePrefixByGrantee returns a prefix to scan for all grants to this given address.

func ParseAddressesFromFeeAllowanceKey added in v0.46.0

func ParseAddressesFromFeeAllowanceKey(key []byte) (granter, grantee sdk.AccAddress)

func RegisterInterfaces added in v0.46.0

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the interfaces types with the interface registry

func RegisterLegacyAminoCodec added in v0.46.0

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the necessary x/feegrant interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.

func RegisterMsgServer added in v0.46.0

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler added in v0.46.0

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v0.46.0

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint added in v0.46.0

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer added in v0.46.0

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v0.46.0

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateGenesis added in v0.46.0

func ValidateGenesis(data GenesisState) error

ValidateGenesis ensures all grants in the genesis state are valid

Types

type AccountKeeper added in v0.46.0

type AccountKeeper interface {
	GetModuleAddress(moduleName string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, moduleName string) auth.ModuleAccountI

	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI
	SetAccount(ctx sdk.Context, acc auth.AccountI)
}

AccountKeeper defines the expected auth Account Keeper (noalias)

type AllowedMsgAllowance added in v0.46.0

type AllowedMsgAllowance struct {
	// allowance can be any of basic and filtered fee allowance.
	Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"`
	// allowed_messages are the messages for which the grantee has the access.
	AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"`
}

AllowedMsgAllowance creates allowance only for specified message types.

func NewAllowedMsgAllowance added in v0.46.0

func NewAllowedMsgAllowance(allowance FeeAllowanceI, allowedMsgs []string) (*AllowedMsgAllowance, error)

NewAllowedMsgFeeAllowance creates new filtered fee allowance.

func (*AllowedMsgAllowance) Accept added in v0.46.0

func (a *AllowedMsgAllowance) Accept(ctx sdk.Context, fee sdk.Coins, msgs []sdk.Msg) (bool, error)

Accept method checks for the filtered messages has valid expiry

func (*AllowedMsgAllowance) Descriptor added in v0.46.0

func (*AllowedMsgAllowance) Descriptor() ([]byte, []int)

func (*AllowedMsgAllowance) GetAllowance added in v0.46.0

func (a *AllowedMsgAllowance) GetAllowance() (FeeAllowanceI, error)

GetAllowance returns allowed fee allowance.

func (*AllowedMsgAllowance) Marshal added in v0.46.0

func (m *AllowedMsgAllowance) Marshal() (dAtA []byte, err error)

func (*AllowedMsgAllowance) MarshalTo added in v0.46.0

func (m *AllowedMsgAllowance) MarshalTo(dAtA []byte) (int, error)

func (*AllowedMsgAllowance) MarshalToSizedBuffer added in v0.46.0

func (m *AllowedMsgAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AllowedMsgAllowance) ProtoMessage added in v0.46.0

func (*AllowedMsgAllowance) ProtoMessage()

func (*AllowedMsgAllowance) Reset added in v0.46.0

func (m *AllowedMsgAllowance) Reset()

func (*AllowedMsgAllowance) SetAllowance added in v0.46.0

func (a *AllowedMsgAllowance) SetAllowance(allowance FeeAllowanceI) error

SetAllowance sets allowed fee allowance.

func (*AllowedMsgAllowance) Size added in v0.46.0

func (m *AllowedMsgAllowance) Size() (n int)

func (*AllowedMsgAllowance) String added in v0.46.0

func (m *AllowedMsgAllowance) String() string

func (*AllowedMsgAllowance) Unmarshal added in v0.46.0

func (m *AllowedMsgAllowance) Unmarshal(dAtA []byte) error

func (*AllowedMsgAllowance) UnpackInterfaces added in v0.46.0

func (a *AllowedMsgAllowance) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*AllowedMsgAllowance) ValidateBasic added in v0.46.0

func (a *AllowedMsgAllowance) ValidateBasic() error

ValidateBasic implements FeeAllowance and enforces basic sanity checks

func (*AllowedMsgAllowance) XXX_DiscardUnknown added in v0.46.0

func (m *AllowedMsgAllowance) XXX_DiscardUnknown()

func (*AllowedMsgAllowance) XXX_Marshal added in v0.46.0

func (m *AllowedMsgAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AllowedMsgAllowance) XXX_Merge added in v0.46.0

func (m *AllowedMsgAllowance) XXX_Merge(src proto.Message)

func (*AllowedMsgAllowance) XXX_Size added in v0.46.0

func (m *AllowedMsgAllowance) XXX_Size() int

func (*AllowedMsgAllowance) XXX_Unmarshal added in v0.46.0

func (m *AllowedMsgAllowance) XXX_Unmarshal(b []byte) error

type BankKeeper added in v0.46.0

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected supply Keeper (noalias)

type BasicAllowance added in v0.46.0

type BasicAllowance struct {
	// spend_limit specifies the maximum amount of tokens that can be spent
	// by this allowance and will be updated as tokens are spent. If it is
	// empty, there is no spend limit and any amount of coins can be spent.
	SpendLimit github_com_line_lbm_sdk_types.Coins `` /* 130-byte string literal not displayed */
	// expiration specifies an optional time when this allowance expires
	Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"`
}

BasicAllowance implements Allowance with a one-time grant of tokens that optionally expires. The grantee can use up to SpendLimit to cover fees.

func (*BasicAllowance) Accept added in v0.46.0

func (a *BasicAllowance) Accept(ctx sdk.Context, fee sdk.Coins, _ []sdk.Msg) (bool, error)

Accept can use fee payment requested as well as timestamp of the current block to determine whether or not to process this. This is checked in Keeper.UseGrantedFees and the return values should match how it is handled there.

If it returns an error, the fee payment is rejected, otherwise it is accepted. The FeeAllowance implementation is expected to update it's internal state and will be saved again after an acceptance.

If remove is true (regardless of the error), the FeeAllowance will be deleted from storage (eg. when it is used up). (See call to RevokeAllowance in Keeper.UseGrantedFees)

func (*BasicAllowance) Descriptor added in v0.46.0

func (*BasicAllowance) Descriptor() ([]byte, []int)

func (*BasicAllowance) GetExpiration added in v0.46.0

func (m *BasicAllowance) GetExpiration() *time.Time

func (*BasicAllowance) GetSpendLimit added in v0.46.0

func (*BasicAllowance) Marshal added in v0.46.0

func (m *BasicAllowance) Marshal() (dAtA []byte, err error)

func (*BasicAllowance) MarshalTo added in v0.46.0

func (m *BasicAllowance) MarshalTo(dAtA []byte) (int, error)

func (*BasicAllowance) MarshalToSizedBuffer added in v0.46.0

func (m *BasicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BasicAllowance) ProtoMessage added in v0.46.0

func (*BasicAllowance) ProtoMessage()

func (*BasicAllowance) Reset added in v0.46.0

func (m *BasicAllowance) Reset()

func (*BasicAllowance) Size added in v0.46.0

func (m *BasicAllowance) Size() (n int)

func (*BasicAllowance) String added in v0.46.0

func (m *BasicAllowance) String() string

func (*BasicAllowance) Unmarshal added in v0.46.0

func (m *BasicAllowance) Unmarshal(dAtA []byte) error

func (BasicAllowance) ValidateBasic added in v0.46.0

func (a BasicAllowance) ValidateBasic() error

ValidateBasic implements FeeAllowance and enforces basic sanity checks

func (*BasicAllowance) XXX_DiscardUnknown added in v0.46.0

func (m *BasicAllowance) XXX_DiscardUnknown()

func (*BasicAllowance) XXX_Marshal added in v0.46.0

func (m *BasicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BasicAllowance) XXX_Merge added in v0.46.0

func (m *BasicAllowance) XXX_Merge(src proto.Message)

func (*BasicAllowance) XXX_Size added in v0.46.0

func (m *BasicAllowance) XXX_Size() int

func (*BasicAllowance) XXX_Unmarshal added in v0.46.0

func (m *BasicAllowance) XXX_Unmarshal(b []byte) error

type FeeAllowanceI added in v0.46.0

type FeeAllowanceI interface {
	// Accept can use fee payment requested as well as timestamp of the current block
	// to determine whether or not to process this. This is checked in
	// Keeper.UseGrantedFees and the return values should match how it is handled there.
	//
	// If it returns an error, the fee payment is rejected, otherwise it is accepted.
	// The FeeAllowance implementation is expected to update it's internal state
	// and will be saved again after an acceptance.
	//
	// If remove is true (regardless of the error), the FeeAllowance will be deleted from storage
	// (eg. when it is used up). (See call to RevokeAllowance in Keeper.UseGrantedFees)
	Accept(ctx sdk.Context, fee sdk.Coins, msgs []sdk.Msg) (remove bool, err error)

	// ValidateBasic should evaluate this FeeAllowance for internal consistency.
	// Don't allow negative amounts, or negative periods for example.
	ValidateBasic() error
}

FeeAllowance implementations are tied to a given fee delegator and delegatee, and are used to enforce fee grant limits.

type GenesisState added in v0.46.0

type GenesisState struct {
	Allowances []Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances"`
}

GenesisState contains a set of fee allowances, persisted from the store

func DefaultGenesisState added in v0.46.0

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns default state for feegrant module.

func NewGenesisState added in v0.46.0

func NewGenesisState(entries []Grant) *GenesisState

NewGenesisState creates new GenesisState object

func (*GenesisState) Descriptor added in v0.46.0

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetAllowances added in v0.46.0

func (m *GenesisState) GetAllowances() []Grant

func (*GenesisState) Marshal added in v0.46.0

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo added in v0.46.0

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer added in v0.46.0

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage added in v0.46.0

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.46.0

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.46.0

func (m *GenesisState) Size() (n int)

func (*GenesisState) String added in v0.46.0

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.46.0

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) UnpackInterfaces added in v0.46.0

func (data GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*GenesisState) XXX_DiscardUnknown added in v0.46.0

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.46.0

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge added in v0.46.0

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size added in v0.46.0

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.46.0

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type Grant added in v0.46.0

type Grant struct {
	// granter is the address of the user granting an allowance of their funds.
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty" yaml:"granter_address"`
	// grantee is the address of the user being granted an allowance of another user's funds.
	Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty" yaml:"grantee_address"`
	// allowance can be any of basic and filtered fee allowance.
	Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
}

Grant is stored in the KVStore to record a grant with full context

func NewGrant added in v0.46.0

func NewGrant(granter, grantee sdk.AccAddress, feeAllowance FeeAllowanceI) (Grant, error)

NewGrant creates a new FeeAllowanceGrant.

func (*Grant) Descriptor added in v0.46.0

func (*Grant) Descriptor() ([]byte, []int)

func (*Grant) GetAllowance added in v0.46.0

func (m *Grant) GetAllowance() *types1.Any

func (Grant) GetGrant added in v0.46.0

func (a Grant) GetGrant() (FeeAllowanceI, error)

GetGrant unpacks allowance

func (*Grant) GetGrantee added in v0.46.0

func (m *Grant) GetGrantee() string

func (*Grant) GetGranter added in v0.46.0

func (m *Grant) GetGranter() string

func (*Grant) Marshal added in v0.46.0

func (m *Grant) Marshal() (dAtA []byte, err error)

func (*Grant) MarshalTo added in v0.46.0

func (m *Grant) MarshalTo(dAtA []byte) (int, error)

func (*Grant) MarshalToSizedBuffer added in v0.46.0

func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Grant) ProtoMessage added in v0.46.0

func (*Grant) ProtoMessage()

func (*Grant) Reset added in v0.46.0

func (m *Grant) Reset()

func (*Grant) Size added in v0.46.0

func (m *Grant) Size() (n int)

func (*Grant) String added in v0.46.0

func (m *Grant) String() string

func (*Grant) Unmarshal added in v0.46.0

func (m *Grant) Unmarshal(dAtA []byte) error

func (Grant) UnpackInterfaces added in v0.46.0

func (a Grant) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (Grant) ValidateBasic added in v0.46.0

func (a Grant) ValidateBasic() error

ValidateBasic performs basic validation on FeeAllowanceGrant

func (*Grant) XXX_DiscardUnknown added in v0.46.0

func (m *Grant) XXX_DiscardUnknown()

func (*Grant) XXX_Marshal added in v0.46.0

func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Grant) XXX_Merge added in v0.46.0

func (m *Grant) XXX_Merge(src proto.Message)

func (*Grant) XXX_Size added in v0.46.0

func (m *Grant) XXX_Size() int

func (*Grant) XXX_Unmarshal added in v0.46.0

func (m *Grant) XXX_Unmarshal(b []byte) error

type MsgClient added in v0.46.0

type MsgClient interface {
	// GrantAllowance grants fee allowance to the grantee on the granter's
	// account with the provided expiration time.
	GrantAllowance(ctx context.Context, in *MsgGrantAllowance, opts ...grpc.CallOption) (*MsgGrantAllowanceResponse, error)
	// RevokeAllowance revokes any fee allowance of granter's account that
	// has been granted to the grantee.
	RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient added in v0.46.0

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgGrantAllowance added in v0.46.0

type MsgGrantAllowance struct {
	// granter is the address of the user granting an allowance of their funds.
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty" yaml:"granter_address"`
	// grantee is the address of the user being granted an allowance of another user's funds.
	Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty" yaml:"grantee_address"`
	// allowance can be any of basic and filtered fee allowance.
	Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
}

MsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.

func NewMsgGrantAllowance added in v0.46.0

func NewMsgGrantAllowance(feeAllowance FeeAllowanceI, granter, grantee sdk.AccAddress) (*MsgGrantAllowance, error)

NewMsgGrantAllowance creates a new MsgGrantAllowance.

func (*MsgGrantAllowance) Descriptor added in v0.46.0

func (*MsgGrantAllowance) Descriptor() ([]byte, []int)

func (*MsgGrantAllowance) GetAllowance added in v0.46.0

func (m *MsgGrantAllowance) GetAllowance() *types.Any

func (MsgGrantAllowance) GetFeeAllowanceI added in v0.46.0

func (msg MsgGrantAllowance) GetFeeAllowanceI() (FeeAllowanceI, error)

GetFeeAllowanceI returns unpacked FeeAllowance

func (*MsgGrantAllowance) GetGrantee added in v0.46.0

func (m *MsgGrantAllowance) GetGrantee() string

func (*MsgGrantAllowance) GetGranter added in v0.46.0

func (m *MsgGrantAllowance) GetGranter() string

func (MsgGrantAllowance) GetSignBytes added in v0.46.0

func (msg MsgGrantAllowance) GetSignBytes() []byte

GetSignBytes implements the LegacyMsg.GetSignBytes method.

func (MsgGrantAllowance) GetSigners added in v0.46.0

func (msg MsgGrantAllowance) GetSigners() []sdk.AccAddress

GetSigners gets the granter account associated with an allowance

func (*MsgGrantAllowance) Marshal added in v0.46.0

func (m *MsgGrantAllowance) Marshal() (dAtA []byte, err error)

func (*MsgGrantAllowance) MarshalTo added in v0.46.0

func (m *MsgGrantAllowance) MarshalTo(dAtA []byte) (int, error)

func (*MsgGrantAllowance) MarshalToSizedBuffer added in v0.46.0

func (m *MsgGrantAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgGrantAllowance) ProtoMessage added in v0.46.0

func (*MsgGrantAllowance) ProtoMessage()

func (*MsgGrantAllowance) Reset added in v0.46.0

func (m *MsgGrantAllowance) Reset()

func (MsgGrantAllowance) Route added in v0.46.0

func (msg MsgGrantAllowance) Route() string

Route implements the LegacyMsg.Route method.

func (*MsgGrantAllowance) Size added in v0.46.0

func (m *MsgGrantAllowance) Size() (n int)

func (*MsgGrantAllowance) String added in v0.46.0

func (m *MsgGrantAllowance) String() string

func (MsgGrantAllowance) Type added in v0.46.0

func (msg MsgGrantAllowance) Type() string

Type implements the LegacyMsg.Type method.

func (*MsgGrantAllowance) Unmarshal added in v0.46.0

func (m *MsgGrantAllowance) Unmarshal(dAtA []byte) error

func (MsgGrantAllowance) UnpackInterfaces added in v0.46.0

func (msg MsgGrantAllowance) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (MsgGrantAllowance) ValidateBasic added in v0.46.0

func (msg MsgGrantAllowance) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgGrantAllowance) XXX_DiscardUnknown added in v0.46.0

func (m *MsgGrantAllowance) XXX_DiscardUnknown()

func (*MsgGrantAllowance) XXX_Marshal added in v0.46.0

func (m *MsgGrantAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgGrantAllowance) XXX_Merge added in v0.46.0

func (m *MsgGrantAllowance) XXX_Merge(src proto.Message)

func (*MsgGrantAllowance) XXX_Size added in v0.46.0

func (m *MsgGrantAllowance) XXX_Size() int

func (*MsgGrantAllowance) XXX_Unmarshal added in v0.46.0

func (m *MsgGrantAllowance) XXX_Unmarshal(b []byte) error

type MsgGrantAllowanceResponse added in v0.46.0

type MsgGrantAllowanceResponse struct {
}

MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type.

func (*MsgGrantAllowanceResponse) Descriptor added in v0.46.0

func (*MsgGrantAllowanceResponse) Descriptor() ([]byte, []int)

func (*MsgGrantAllowanceResponse) Marshal added in v0.46.0

func (m *MsgGrantAllowanceResponse) Marshal() (dAtA []byte, err error)

func (*MsgGrantAllowanceResponse) MarshalTo added in v0.46.0

func (m *MsgGrantAllowanceResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgGrantAllowanceResponse) MarshalToSizedBuffer added in v0.46.0

func (m *MsgGrantAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgGrantAllowanceResponse) ProtoMessage added in v0.46.0

func (*MsgGrantAllowanceResponse) ProtoMessage()

func (*MsgGrantAllowanceResponse) Reset added in v0.46.0

func (m *MsgGrantAllowanceResponse) Reset()

func (*MsgGrantAllowanceResponse) Size added in v0.46.0

func (m *MsgGrantAllowanceResponse) Size() (n int)

func (*MsgGrantAllowanceResponse) String added in v0.46.0

func (m *MsgGrantAllowanceResponse) String() string

func (*MsgGrantAllowanceResponse) Unmarshal added in v0.46.0

func (m *MsgGrantAllowanceResponse) Unmarshal(dAtA []byte) error

func (*MsgGrantAllowanceResponse) XXX_DiscardUnknown added in v0.46.0

func (m *MsgGrantAllowanceResponse) XXX_DiscardUnknown()

func (*MsgGrantAllowanceResponse) XXX_Marshal added in v0.46.0

func (m *MsgGrantAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgGrantAllowanceResponse) XXX_Merge added in v0.46.0

func (m *MsgGrantAllowanceResponse) XXX_Merge(src proto.Message)

func (*MsgGrantAllowanceResponse) XXX_Size added in v0.46.0

func (m *MsgGrantAllowanceResponse) XXX_Size() int

func (*MsgGrantAllowanceResponse) XXX_Unmarshal added in v0.46.0

func (m *MsgGrantAllowanceResponse) XXX_Unmarshal(b []byte) error

type MsgRevokeAllowance added in v0.46.0

type MsgRevokeAllowance struct {
	// granter is the address of the user granting an allowance of their funds.
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty" yaml:"granter_address"`
	// grantee is the address of the user being granted an allowance of another user's funds.
	Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty" yaml:"grantee_address"`
}

MsgRevokeAllowance removes any existing Allowance from Granter to Grantee.

func NewMsgRevokeAllowance added in v0.46.0

func NewMsgRevokeAllowance(granter sdk.AccAddress, grantee sdk.AccAddress) MsgRevokeAllowance

NewMsgRevokeAllowance returns a message to revoke a fee allowance for a given granter and grantee

func (*MsgRevokeAllowance) Descriptor added in v0.46.0

func (*MsgRevokeAllowance) Descriptor() ([]byte, []int)

func (*MsgRevokeAllowance) GetGrantee added in v0.46.0

func (m *MsgRevokeAllowance) GetGrantee() string

func (*MsgRevokeAllowance) GetGranter added in v0.46.0

func (m *MsgRevokeAllowance) GetGranter() string

func (MsgRevokeAllowance) GetSignBytes added in v0.46.0

func (msg MsgRevokeAllowance) GetSignBytes() []byte

GetSignBytes implements the LegacyMsg.GetSignBytes method.

func (MsgRevokeAllowance) GetSigners added in v0.46.0

func (msg MsgRevokeAllowance) GetSigners() []sdk.AccAddress

GetSigners gets the granter address associated with an Allowance to revoke.

func (*MsgRevokeAllowance) Marshal added in v0.46.0

func (m *MsgRevokeAllowance) Marshal() (dAtA []byte, err error)

func (*MsgRevokeAllowance) MarshalTo added in v0.46.0

func (m *MsgRevokeAllowance) MarshalTo(dAtA []byte) (int, error)

func (*MsgRevokeAllowance) MarshalToSizedBuffer added in v0.46.0

func (m *MsgRevokeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgRevokeAllowance) ProtoMessage added in v0.46.0

func (*MsgRevokeAllowance) ProtoMessage()

func (*MsgRevokeAllowance) Reset added in v0.46.0

func (m *MsgRevokeAllowance) Reset()

func (MsgRevokeAllowance) Route added in v0.46.0

func (msg MsgRevokeAllowance) Route() string

Route implements the LegacyMsg.Route method.

func (*MsgRevokeAllowance) Size added in v0.46.0

func (m *MsgRevokeAllowance) Size() (n int)

func (*MsgRevokeAllowance) String added in v0.46.0

func (m *MsgRevokeAllowance) String() string

func (MsgRevokeAllowance) Type added in v0.46.0

func (msg MsgRevokeAllowance) Type() string

Type implements the LegacyMsg.Type method.

func (*MsgRevokeAllowance) Unmarshal added in v0.46.0

func (m *MsgRevokeAllowance) Unmarshal(dAtA []byte) error

func (MsgRevokeAllowance) ValidateBasic added in v0.46.0

func (msg MsgRevokeAllowance) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgRevokeAllowance) XXX_DiscardUnknown added in v0.46.0

func (m *MsgRevokeAllowance) XXX_DiscardUnknown()

func (*MsgRevokeAllowance) XXX_Marshal added in v0.46.0

func (m *MsgRevokeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgRevokeAllowance) XXX_Merge added in v0.46.0

func (m *MsgRevokeAllowance) XXX_Merge(src proto.Message)

func (*MsgRevokeAllowance) XXX_Size added in v0.46.0

func (m *MsgRevokeAllowance) XXX_Size() int

func (*MsgRevokeAllowance) XXX_Unmarshal added in v0.46.0

func (m *MsgRevokeAllowance) XXX_Unmarshal(b []byte) error

type MsgRevokeAllowanceResponse added in v0.46.0

type MsgRevokeAllowanceResponse struct {
}

MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type.

func (*MsgRevokeAllowanceResponse) Descriptor added in v0.46.0

func (*MsgRevokeAllowanceResponse) Descriptor() ([]byte, []int)

func (*MsgRevokeAllowanceResponse) Marshal added in v0.46.0

func (m *MsgRevokeAllowanceResponse) Marshal() (dAtA []byte, err error)

func (*MsgRevokeAllowanceResponse) MarshalTo added in v0.46.0

func (m *MsgRevokeAllowanceResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgRevokeAllowanceResponse) MarshalToSizedBuffer added in v0.46.0

func (m *MsgRevokeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgRevokeAllowanceResponse) ProtoMessage added in v0.46.0

func (*MsgRevokeAllowanceResponse) ProtoMessage()

func (*MsgRevokeAllowanceResponse) Reset added in v0.46.0

func (m *MsgRevokeAllowanceResponse) Reset()

func (*MsgRevokeAllowanceResponse) Size added in v0.46.0

func (m *MsgRevokeAllowanceResponse) Size() (n int)

func (*MsgRevokeAllowanceResponse) String added in v0.46.0

func (m *MsgRevokeAllowanceResponse) String() string

func (*MsgRevokeAllowanceResponse) Unmarshal added in v0.46.0

func (m *MsgRevokeAllowanceResponse) Unmarshal(dAtA []byte) error

func (*MsgRevokeAllowanceResponse) XXX_DiscardUnknown added in v0.46.0

func (m *MsgRevokeAllowanceResponse) XXX_DiscardUnknown()

func (*MsgRevokeAllowanceResponse) XXX_Marshal added in v0.46.0

func (m *MsgRevokeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgRevokeAllowanceResponse) XXX_Merge added in v0.46.0

func (m *MsgRevokeAllowanceResponse) XXX_Merge(src proto.Message)

func (*MsgRevokeAllowanceResponse) XXX_Size added in v0.46.0

func (m *MsgRevokeAllowanceResponse) XXX_Size() int

func (*MsgRevokeAllowanceResponse) XXX_Unmarshal added in v0.46.0

func (m *MsgRevokeAllowanceResponse) XXX_Unmarshal(b []byte) error

type MsgServer added in v0.46.0

type MsgServer interface {
	// GrantAllowance grants fee allowance to the grantee on the granter's
	// account with the provided expiration time.
	GrantAllowance(context.Context, *MsgGrantAllowance) (*MsgGrantAllowanceResponse, error)
	// RevokeAllowance revokes any fee allowance of granter's account that
	// has been granted to the grantee.
	RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error)
}

MsgServer is the server API for Msg service.

type PeriodicAllowance added in v0.46.0

type PeriodicAllowance struct {
	// basic specifies a struct of `BasicAllowance`
	Basic BasicAllowance `protobuf:"bytes,1,opt,name=basic,proto3" json:"basic"`
	// period specifies the time duration in which period_spend_limit coins can
	// be spent before that allowance is reset
	Period time.Duration `protobuf:"bytes,2,opt,name=period,proto3,stdduration" json:"period"`
	// period_spend_limit specifies the maximum number of coins that can be spent
	// in the period
	PeriodSpendLimit github_com_line_lbm_sdk_types.Coins `` /* 150-byte string literal not displayed */
	// period_can_spend is the number of coins left to be spent before the period_reset time
	PeriodCanSpend github_com_line_lbm_sdk_types.Coins `` /* 144-byte string literal not displayed */
	// period_reset is the time at which this period resets and a new one begins,
	// it is calculated from the start time of the first transaction after the
	// last period ended
	PeriodReset time.Time `protobuf:"bytes,5,opt,name=period_reset,json=periodReset,proto3,stdtime" json:"period_reset"`
}

PeriodicAllowance extends Allowance to allow for both a maximum cap, as well as a limit per time period.

func (*PeriodicAllowance) Accept added in v0.46.0

func (a *PeriodicAllowance) Accept(ctx sdk.Context, fee sdk.Coins, _ []sdk.Msg) (bool, error)

Accept can use fee payment requested as well as timestamp of the current block to determine whether or not to process this. This is checked in Keeper.UseGrantedFees and the return values should match how it is handled there.

If it returns an error, the fee payment is rejected, otherwise it is accepted. The FeeAllowance implementation is expected to update it's internal state and will be saved again after an acceptance.

If remove is true (regardless of the error), the FeeAllowance will be deleted from storage (eg. when it is used up). (See call to RevokeAllowance in Keeper.UseGrantedFees)

func (*PeriodicAllowance) Descriptor added in v0.46.0

func (*PeriodicAllowance) Descriptor() ([]byte, []int)

func (*PeriodicAllowance) GetBasic added in v0.46.0

func (m *PeriodicAllowance) GetBasic() BasicAllowance

func (*PeriodicAllowance) GetPeriod added in v0.46.0

func (m *PeriodicAllowance) GetPeriod() time.Duration

func (*PeriodicAllowance) GetPeriodCanSpend added in v0.46.0

func (m *PeriodicAllowance) GetPeriodCanSpend() github_com_line_lbm_sdk_types.Coins

func (*PeriodicAllowance) GetPeriodReset added in v0.46.0

func (m *PeriodicAllowance) GetPeriodReset() time.Time

func (*PeriodicAllowance) GetPeriodSpendLimit added in v0.46.0

func (m *PeriodicAllowance) GetPeriodSpendLimit() github_com_line_lbm_sdk_types.Coins

func (*PeriodicAllowance) Marshal added in v0.46.0

func (m *PeriodicAllowance) Marshal() (dAtA []byte, err error)

func (*PeriodicAllowance) MarshalTo added in v0.46.0

func (m *PeriodicAllowance) MarshalTo(dAtA []byte) (int, error)

func (*PeriodicAllowance) MarshalToSizedBuffer added in v0.46.0

func (m *PeriodicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeriodicAllowance) ProtoMessage added in v0.46.0

func (*PeriodicAllowance) ProtoMessage()

func (*PeriodicAllowance) Reset added in v0.46.0

func (m *PeriodicAllowance) Reset()

func (*PeriodicAllowance) Size added in v0.46.0

func (m *PeriodicAllowance) Size() (n int)

func (*PeriodicAllowance) String added in v0.46.0

func (m *PeriodicAllowance) String() string

func (*PeriodicAllowance) Unmarshal added in v0.46.0

func (m *PeriodicAllowance) Unmarshal(dAtA []byte) error

func (PeriodicAllowance) ValidateBasic added in v0.46.0

func (a PeriodicAllowance) ValidateBasic() error

ValidateBasic implements FeeAllowance and enforces basic sanity checks

func (*PeriodicAllowance) XXX_DiscardUnknown added in v0.46.0

func (m *PeriodicAllowance) XXX_DiscardUnknown()

func (*PeriodicAllowance) XXX_Marshal added in v0.46.0

func (m *PeriodicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeriodicAllowance) XXX_Merge added in v0.46.0

func (m *PeriodicAllowance) XXX_Merge(src proto.Message)

func (*PeriodicAllowance) XXX_Size added in v0.46.0

func (m *PeriodicAllowance) XXX_Size() int

func (*PeriodicAllowance) XXX_Unmarshal added in v0.46.0

func (m *PeriodicAllowance) XXX_Unmarshal(b []byte) error

type QueryAllowanceRequest added in v0.46.0

type QueryAllowanceRequest struct {
	// granter is the address of the user granting an allowance of their funds.
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty" yaml:"granter_address"`
	// grantee is the address of the user being granted an allowance of another user's funds.
	Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty" yaml:"grantee_address"`
}

QueryAllowanceRequest is the request type for the Query/Allowance RPC method.

func (*QueryAllowanceRequest) Descriptor added in v0.46.0

func (*QueryAllowanceRequest) Descriptor() ([]byte, []int)

func (*QueryAllowanceRequest) GetGrantee added in v0.46.0

func (m *QueryAllowanceRequest) GetGrantee() string

func (*QueryAllowanceRequest) GetGranter added in v0.46.0

func (m *QueryAllowanceRequest) GetGranter() string

func (*QueryAllowanceRequest) Marshal added in v0.46.0

func (m *QueryAllowanceRequest) Marshal() (dAtA []byte, err error)

func (*QueryAllowanceRequest) MarshalTo added in v0.46.0

func (m *QueryAllowanceRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllowanceRequest) MarshalToSizedBuffer added in v0.46.0

func (m *QueryAllowanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllowanceRequest) ProtoMessage added in v0.46.0

func (*QueryAllowanceRequest) ProtoMessage()

func (*QueryAllowanceRequest) Reset added in v0.46.0

func (m *QueryAllowanceRequest) Reset()

func (*QueryAllowanceRequest) Size added in v0.46.0

func (m *QueryAllowanceRequest) Size() (n int)

func (*QueryAllowanceRequest) String added in v0.46.0

func (m *QueryAllowanceRequest) String() string

func (*QueryAllowanceRequest) Unmarshal added in v0.46.0

func (m *QueryAllowanceRequest) Unmarshal(dAtA []byte) error

func (*QueryAllowanceRequest) XXX_DiscardUnknown added in v0.46.0

func (m *QueryAllowanceRequest) XXX_DiscardUnknown()

func (*QueryAllowanceRequest) XXX_Marshal added in v0.46.0

func (m *QueryAllowanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllowanceRequest) XXX_Merge added in v0.46.0

func (m *QueryAllowanceRequest) XXX_Merge(src proto.Message)

func (*QueryAllowanceRequest) XXX_Size added in v0.46.0

func (m *QueryAllowanceRequest) XXX_Size() int

func (*QueryAllowanceRequest) XXX_Unmarshal added in v0.46.0

func (m *QueryAllowanceRequest) XXX_Unmarshal(b []byte) error

type QueryAllowanceResponse added in v0.46.0

type QueryAllowanceResponse struct {
	// allowance is a allowance granted for grantee by granter.
	Allowance *Grant `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"`
}

QueryAllowanceResponse is the response type for the Query/Allowance RPC method.

func (*QueryAllowanceResponse) Descriptor added in v0.46.0

func (*QueryAllowanceResponse) Descriptor() ([]byte, []int)

func (*QueryAllowanceResponse) GetAllowance added in v0.46.0

func (m *QueryAllowanceResponse) GetAllowance() *Grant

func (*QueryAllowanceResponse) Marshal added in v0.46.0

func (m *QueryAllowanceResponse) Marshal() (dAtA []byte, err error)

func (*QueryAllowanceResponse) MarshalTo added in v0.46.0

func (m *QueryAllowanceResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllowanceResponse) MarshalToSizedBuffer added in v0.46.0

func (m *QueryAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllowanceResponse) ProtoMessage added in v0.46.0

func (*QueryAllowanceResponse) ProtoMessage()

func (*QueryAllowanceResponse) Reset added in v0.46.0

func (m *QueryAllowanceResponse) Reset()

func (*QueryAllowanceResponse) Size added in v0.46.0

func (m *QueryAllowanceResponse) Size() (n int)

func (*QueryAllowanceResponse) String added in v0.46.0

func (m *QueryAllowanceResponse) String() string

func (*QueryAllowanceResponse) Unmarshal added in v0.46.0

func (m *QueryAllowanceResponse) Unmarshal(dAtA []byte) error

func (*QueryAllowanceResponse) XXX_DiscardUnknown added in v0.46.0

func (m *QueryAllowanceResponse) XXX_DiscardUnknown()

func (*QueryAllowanceResponse) XXX_Marshal added in v0.46.0

func (m *QueryAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllowanceResponse) XXX_Merge added in v0.46.0

func (m *QueryAllowanceResponse) XXX_Merge(src proto.Message)

func (*QueryAllowanceResponse) XXX_Size added in v0.46.0

func (m *QueryAllowanceResponse) XXX_Size() int

func (*QueryAllowanceResponse) XXX_Unmarshal added in v0.46.0

func (m *QueryAllowanceResponse) XXX_Unmarshal(b []byte) error

type QueryAllowancesByGranterRequest added in v0.46.0

type QueryAllowancesByGranterRequest struct {
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
	// pagination defines an pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method.

func (*QueryAllowancesByGranterRequest) Descriptor added in v0.46.0

func (*QueryAllowancesByGranterRequest) Descriptor() ([]byte, []int)

func (*QueryAllowancesByGranterRequest) GetGranter added in v0.46.0

func (m *QueryAllowancesByGranterRequest) GetGranter() string

func (*QueryAllowancesByGranterRequest) GetPagination added in v0.46.0

func (*QueryAllowancesByGranterRequest) Marshal added in v0.46.0

func (m *QueryAllowancesByGranterRequest) Marshal() (dAtA []byte, err error)

func (*QueryAllowancesByGranterRequest) MarshalTo added in v0.46.0

func (m *QueryAllowancesByGranterRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllowancesByGranterRequest) MarshalToSizedBuffer added in v0.46.0

func (m *QueryAllowancesByGranterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllowancesByGranterRequest) ProtoMessage added in v0.46.0

func (*QueryAllowancesByGranterRequest) ProtoMessage()

func (*QueryAllowancesByGranterRequest) Reset added in v0.46.0

func (*QueryAllowancesByGranterRequest) Size added in v0.46.0

func (m *QueryAllowancesByGranterRequest) Size() (n int)

func (*QueryAllowancesByGranterRequest) String added in v0.46.0

func (*QueryAllowancesByGranterRequest) Unmarshal added in v0.46.0

func (m *QueryAllowancesByGranterRequest) Unmarshal(dAtA []byte) error

func (*QueryAllowancesByGranterRequest) XXX_DiscardUnknown added in v0.46.0

func (m *QueryAllowancesByGranterRequest) XXX_DiscardUnknown()

func (*QueryAllowancesByGranterRequest) XXX_Marshal added in v0.46.0

func (m *QueryAllowancesByGranterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllowancesByGranterRequest) XXX_Merge added in v0.46.0

func (m *QueryAllowancesByGranterRequest) XXX_Merge(src proto.Message)

func (*QueryAllowancesByGranterRequest) XXX_Size added in v0.46.0

func (m *QueryAllowancesByGranterRequest) XXX_Size() int

func (*QueryAllowancesByGranterRequest) XXX_Unmarshal added in v0.46.0

func (m *QueryAllowancesByGranterRequest) XXX_Unmarshal(b []byte) error

type QueryAllowancesByGranterResponse added in v0.46.0

type QueryAllowancesByGranterResponse struct {
	// allowances that have been issued by the granter.
	Allowances []*Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty"`
	// pagination defines an pagination for the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method.

func (*QueryAllowancesByGranterResponse) Descriptor added in v0.46.0

func (*QueryAllowancesByGranterResponse) Descriptor() ([]byte, []int)

func (*QueryAllowancesByGranterResponse) GetAllowances added in v0.46.0

func (m *QueryAllowancesByGranterResponse) GetAllowances() []*Grant

func (*QueryAllowancesByGranterResponse) GetPagination added in v0.46.0

func (*QueryAllowancesByGranterResponse) Marshal added in v0.46.0

func (m *QueryAllowancesByGranterResponse) Marshal() (dAtA []byte, err error)

func (*QueryAllowancesByGranterResponse) MarshalTo added in v0.46.0

func (m *QueryAllowancesByGranterResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllowancesByGranterResponse) MarshalToSizedBuffer added in v0.46.0

func (m *QueryAllowancesByGranterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllowancesByGranterResponse) ProtoMessage added in v0.46.0

func (*QueryAllowancesByGranterResponse) ProtoMessage()

func (*QueryAllowancesByGranterResponse) Reset added in v0.46.0

func (*QueryAllowancesByGranterResponse) Size added in v0.46.0

func (m *QueryAllowancesByGranterResponse) Size() (n int)

func (*QueryAllowancesByGranterResponse) String added in v0.46.0

func (*QueryAllowancesByGranterResponse) Unmarshal added in v0.46.0

func (m *QueryAllowancesByGranterResponse) Unmarshal(dAtA []byte) error

func (*QueryAllowancesByGranterResponse) XXX_DiscardUnknown added in v0.46.0

func (m *QueryAllowancesByGranterResponse) XXX_DiscardUnknown()

func (*QueryAllowancesByGranterResponse) XXX_Marshal added in v0.46.0

func (m *QueryAllowancesByGranterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllowancesByGranterResponse) XXX_Merge added in v0.46.0

func (*QueryAllowancesByGranterResponse) XXX_Size added in v0.46.0

func (m *QueryAllowancesByGranterResponse) XXX_Size() int

func (*QueryAllowancesByGranterResponse) XXX_Unmarshal added in v0.46.0

func (m *QueryAllowancesByGranterResponse) XXX_Unmarshal(b []byte) error

type QueryAllowancesRequest added in v0.46.0

type QueryAllowancesRequest struct {
	Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty" yaml:"grantee_address"`
	// pagination defines an pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllowancesRequest is the request type for the Query/Allowances RPC method.

func (*QueryAllowancesRequest) Descriptor added in v0.46.0

func (*QueryAllowancesRequest) Descriptor() ([]byte, []int)

func (*QueryAllowancesRequest) GetGrantee added in v0.46.0

func (m *QueryAllowancesRequest) GetGrantee() string

func (*QueryAllowancesRequest) GetPagination added in v0.46.0

func (m *QueryAllowancesRequest) GetPagination() *query.PageRequest

func (*QueryAllowancesRequest) Marshal added in v0.46.0

func (m *QueryAllowancesRequest) Marshal() (dAtA []byte, err error)

func (*QueryAllowancesRequest) MarshalTo added in v0.46.0

func (m *QueryAllowancesRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllowancesRequest) MarshalToSizedBuffer added in v0.46.0

func (m *QueryAllowancesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllowancesRequest) ProtoMessage added in v0.46.0

func (*QueryAllowancesRequest) ProtoMessage()

func (*QueryAllowancesRequest) Reset added in v0.46.0

func (m *QueryAllowancesRequest) Reset()

func (*QueryAllowancesRequest) Size added in v0.46.0

func (m *QueryAllowancesRequest) Size() (n int)

func (*QueryAllowancesRequest) String added in v0.46.0

func (m *QueryAllowancesRequest) String() string

func (*QueryAllowancesRequest) Unmarshal added in v0.46.0

func (m *QueryAllowancesRequest) Unmarshal(dAtA []byte) error

func (*QueryAllowancesRequest) XXX_DiscardUnknown added in v0.46.0

func (m *QueryAllowancesRequest) XXX_DiscardUnknown()

func (*QueryAllowancesRequest) XXX_Marshal added in v0.46.0

func (m *QueryAllowancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllowancesRequest) XXX_Merge added in v0.46.0

func (m *QueryAllowancesRequest) XXX_Merge(src proto.Message)

func (*QueryAllowancesRequest) XXX_Size added in v0.46.0

func (m *QueryAllowancesRequest) XXX_Size() int

func (*QueryAllowancesRequest) XXX_Unmarshal added in v0.46.0

func (m *QueryAllowancesRequest) XXX_Unmarshal(b []byte) error

type QueryAllowancesResponse added in v0.46.0

type QueryAllowancesResponse struct {
	// allowances are allowance's granted for grantee by granter.
	Allowances []*Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty"`
	// pagination defines an pagination for the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllowancesResponse is the response type for the Query/Allowances RPC method.

func (*QueryAllowancesResponse) Descriptor added in v0.46.0

func (*QueryAllowancesResponse) Descriptor() ([]byte, []int)

func (*QueryAllowancesResponse) GetAllowances added in v0.46.0

func (m *QueryAllowancesResponse) GetAllowances() []*Grant

func (*QueryAllowancesResponse) GetPagination added in v0.46.0

func (m *QueryAllowancesResponse) GetPagination() *query.PageResponse

func (*QueryAllowancesResponse) Marshal added in v0.46.0

func (m *QueryAllowancesResponse) Marshal() (dAtA []byte, err error)

func (*QueryAllowancesResponse) MarshalTo added in v0.46.0

func (m *QueryAllowancesResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllowancesResponse) MarshalToSizedBuffer added in v0.46.0

func (m *QueryAllowancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllowancesResponse) ProtoMessage added in v0.46.0

func (*QueryAllowancesResponse) ProtoMessage()

func (*QueryAllowancesResponse) Reset added in v0.46.0

func (m *QueryAllowancesResponse) Reset()

func (*QueryAllowancesResponse) Size added in v0.46.0

func (m *QueryAllowancesResponse) Size() (n int)

func (*QueryAllowancesResponse) String added in v0.46.0

func (m *QueryAllowancesResponse) String() string

func (*QueryAllowancesResponse) Unmarshal added in v0.46.0

func (m *QueryAllowancesResponse) Unmarshal(dAtA []byte) error

func (*QueryAllowancesResponse) XXX_DiscardUnknown added in v0.46.0

func (m *QueryAllowancesResponse) XXX_DiscardUnknown()

func (*QueryAllowancesResponse) XXX_Marshal added in v0.46.0

func (m *QueryAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllowancesResponse) XXX_Merge added in v0.46.0

func (m *QueryAllowancesResponse) XXX_Merge(src proto.Message)

func (*QueryAllowancesResponse) XXX_Size added in v0.46.0

func (m *QueryAllowancesResponse) XXX_Size() int

func (*QueryAllowancesResponse) XXX_Unmarshal added in v0.46.0

func (m *QueryAllowancesResponse) XXX_Unmarshal(b []byte) error

type QueryClient added in v0.46.0

type QueryClient interface {
	// Allowance returns fee granted to the grantee by the granter.
	Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error)
	// Allowances returns all the grants for address.
	Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error)
	// AllowancesByGranter returns all the grants given by an address
	// Since v0.46
	AllowancesByGranter(ctx context.Context, in *QueryAllowancesByGranterRequest, opts ...grpc.CallOption) (*QueryAllowancesByGranterResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient added in v0.46.0

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer added in v0.46.0

type QueryServer interface {
	// Allowance returns fee granted to the grantee by the granter.
	Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error)
	// Allowances returns all the grants for address.
	Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error)
	// AllowancesByGranter returns all the grants given by an address
	// Since v0.46
	AllowancesByGranter(context.Context, *QueryAllowancesByGranterRequest) (*QueryAllowancesByGranterResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer added in v0.46.0

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) GrantAllowance added in v0.46.0

func (*UnimplementedMsgServer) RevokeAllowance added in v0.46.0

type UnimplementedQueryServer added in v0.46.0

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Allowance added in v0.46.0

func (*UnimplementedQueryServer) Allowances added in v0.46.0

func (*UnimplementedQueryServer) AllowancesByGranter added in v0.46.0

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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