types

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 36 Imported by: 14

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeBudgetCollected = "budget_collected"

	AttributeValueName   = "name"
	AttributeValueAmount = "amount"
)

Event types for the budget module.

View Source
const (
	// ModuleName is the name of the budget module
	ModuleName = "budget"

	// RouterKey is the message router key for the budget module
	RouterKey = ModuleName

	// StoreKey is the default store key for the budget module
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the budget module
	QuerierRoute = ModuleName
)
View Source
const (
	// MaxBudgetNameLength is the maximum length of the name of each budget.
	MaxBudgetNameLength int = 50
	// DefaultEpochBlocks is the default epoch blocks.
	DefaultEpochBlocks uint32 = 1
)

Variables

View Source
var (
	ErrInvalidLengthBudget        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBudget          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBudget = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidBudgetName         = sdkerrors.Register(ModuleName, 2, "budget name only allows letters, digits, and dash(-) without spaces and the maximum length is 50")
	ErrInvalidStartEndTime       = sdkerrors.Register(ModuleName, 3, "budget end time must be after the start time")
	ErrInvalidBudgetRate         = sdkerrors.Register(ModuleName, 4, "invalid budget rate")
	ErrInvalidTotalBudgetRate    = sdkerrors.Register(ModuleName, 5, "invalid total rate of the budgets with the same source address")
	ErrDuplicateBudgetName       = sdkerrors.Register(ModuleName, 6, "duplicate budget name")
	ErrSameSourceDestinationAddr = sdkerrors.Register(ModuleName, 7, "budget source address and destination address cannot be the same")
)

Sentinel errors for the budget module.

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 (
	KeyBudgets     = []byte("Budgets")
	KeyEpochBlocks = []byte("EpochBlocks")
)

Parameter store keys

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 AddressType_name = map[int32]string{
	0: "ADDRESS_TYPE_32_BYTES",
	1: "ADDRESS_TYPE_20_BYTES",
}
View Source
var AddressType_value = map[string]int32{
	"ADDRESS_TYPE_32_BYTES": 0,
	"ADDRESS_TYPE_20_BYTES": 1,
}
View Source
var (

	// ModuleCdc references the global x/budget 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/budget and
	// defined at the application level.
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var (
	// Keys for store prefixes
	TotalCollectedCoinsKeyPrefix = []byte{0x11}
)

Functions

func DateRangeIncludes added in v1.1.0

func DateRangeIncludes(startTime, endTime, targetTime time.Time) bool

DateRangeIncludes returns true if the target date included on the start, end time range. End time is exclusive and start time is inclusive.

func DateRangesOverlap added in v1.0.0

func DateRangesOverlap(startTimeA, endTimeA, startTimeB, endTimeB time.Time) bool

DateRangesOverlap returns true if two date ranges overlap each other. End time is exclusive and start time is inclusive.

func DeriveAddress added in v1.0.0

func DeriveAddress(addressType AddressType, moduleName, name string) sdk.AccAddress

DeriveAddress derives an address with the given address length type, module name, and address derivation name. It is used to derive source or destination address.

func GetTotalCollectedCoinsKey

func GetTotalCollectedCoinsKey(budgetName string) []byte

GetTotalCollectedCoinsKey creates the key for the total collected coins for a budget.

func MustParseRFC3339 added in v1.0.0

func MustParseRFC3339(s string) time.Time

MustParseRFC3339 parses string time to time in RFC3339 format.

func ParamKeyTable

func ParamKeyTable() paramstypes.KeyTable

ParamKeyTable returns the parameter key table.

func ParseTotalCollectedCoinsKey

func ParseTotalCollectedCoinsKey(key []byte) (budgetName string)

ParseTotalCollectedCoinsKey parses the total collected coins key and returns the budget name.

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the x/budget interfaces types with the interface registry.

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

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

func RegisterQueryHandler

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

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

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

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

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateBudgets

func ValidateBudgets(input interface{}) error

ValidateBudgets validates budget name and total rate. The total rate of budgets with the same source address must not exceed 1.

func ValidateEpochBlocks

func ValidateEpochBlocks(i interface{}) error

ValidateEpochBlocks validates epoch blocks.

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates GenesisState.

func ValidateName

func ValidateName(name string) error

ValidateName is the default validation function for Budget.Name. A budget name only allows alphabet letters(`A-Z, a-z`), digit numbers(`0-9`), and `-`. It doesn't allow spaces and the maximum length is 50 characters.

Types

type AccountKeeper

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

AccountKeeper defines the expected account keeper

type AddressType added in v1.0.0

type AddressType int32

AddressType enumerates the available types of a address.

const (
	// the 32 bytes length address type of ADR 028.
	AddressType32Bytes AddressType = 0
	// the default 20 bytes length address type.
	AddressType20Bytes AddressType = 1
)

func (AddressType) EnumDescriptor added in v1.0.0

func (AddressType) EnumDescriptor() ([]byte, []int)

func (AddressType) String added in v1.0.0

func (x AddressType) String() string

type BankKeeper

type BankKeeper interface {
	InputOutputCoins(ctx sdk.Context, inputs []banktypes.Input, outputs []banktypes.Output) error
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected bank send keeper

type Budget

type Budget struct {
	// name defines the name of the budget
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"`
	// rate specifies the distributing amount by ratio of total budget source
	Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate" yaml:"rate"`
	// source_address defines the bech32-encoded address that source of the budget
	SourceAddress string `protobuf:"bytes,3,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" yaml:"source_address"`
	// destination_address defines the bech32-encoded address of the budget pool to distribute
	DestinationAddress string `` /* 142-byte string literal not displayed */
	// start_time specifies the start time of the budget
	StartTime time.Time `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"`
	// end_time specifies the end time of the budget
	EndTime time.Time `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"`
}

Budget defines a budget object.

func CollectibleBudgets added in v1.0.0

func CollectibleBudgets(budgets []Budget, blockTime time.Time) (collectibleBudgets []Budget)

CollectibleBudgets returns only the valid and started and not expired budgets based on the given block time.

func (Budget) Collectible added in v1.0.0

func (budget Budget) Collectible(blockTime time.Time) bool

Collectible validates the budget has reached its start time and that the end time has not elapsed.

func (*Budget) Descriptor

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

func (*Budget) Marshal

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

func (*Budget) MarshalTo

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

func (*Budget) MarshalToSizedBuffer

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

func (Budget) MarshalYAML

func (budget Budget) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of a Budget.

func (*Budget) ProtoMessage

func (*Budget) ProtoMessage()

func (*Budget) Reset

func (m *Budget) Reset()

func (*Budget) Size

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

func (Budget) String

func (budget Budget) String() string

String returns a human-readable string representation of the budget.

func (*Budget) Unmarshal

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

func (Budget) Validate

func (budget Budget) Validate() error

Validate validates the budget.

func (*Budget) XXX_DiscardUnknown

func (m *Budget) XXX_DiscardUnknown()

func (*Budget) XXX_Marshal

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

func (*Budget) XXX_Merge

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

func (*Budget) XXX_Size

func (m *Budget) XXX_Size() int

func (*Budget) XXX_Unmarshal

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

type BudgetRecord

type BudgetRecord struct {
	// name defines the name of the budget
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"`
	// total_collected_coins specifies the total collected coins in a budget ever since the budget is created
	TotalCollectedCoins github_com_cosmos_cosmos_sdk_types.Coins `` /* 193-byte string literal not displayed */
}

BudgetRecord records the state of each budget after genesis import or export.

func (*BudgetRecord) Descriptor

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

func (*BudgetRecord) Equal

func (this *BudgetRecord) Equal(that interface{}) bool

func (*BudgetRecord) GetName

func (m *BudgetRecord) GetName() string

func (*BudgetRecord) GetTotalCollectedCoins

func (m *BudgetRecord) GetTotalCollectedCoins() github_com_cosmos_cosmos_sdk_types.Coins

func (*BudgetRecord) Marshal

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

func (*BudgetRecord) MarshalTo

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

func (*BudgetRecord) MarshalToSizedBuffer

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

func (*BudgetRecord) ProtoMessage

func (*BudgetRecord) ProtoMessage()

func (*BudgetRecord) Reset

func (m *BudgetRecord) Reset()

func (*BudgetRecord) Size

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

func (*BudgetRecord) String

func (m *BudgetRecord) String() string

func (*BudgetRecord) Unmarshal

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

func (*BudgetRecord) XXX_DiscardUnknown

func (m *BudgetRecord) XXX_DiscardUnknown()

func (*BudgetRecord) XXX_Marshal

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

func (*BudgetRecord) XXX_Merge

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

func (*BudgetRecord) XXX_Size

func (m *BudgetRecord) XXX_Size() int

func (*BudgetRecord) XXX_Unmarshal

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

type BudgetResponse

type BudgetResponse struct {
	Budget              Budget                                   `protobuf:"bytes,1,opt,name=budget,proto3" json:"budget"`
	TotalCollectedCoins github_com_cosmos_cosmos_sdk_types.Coins `` /* 193-byte string literal not displayed */
}

func (*BudgetResponse) Descriptor

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

func (*BudgetResponse) GetBudget

func (m *BudgetResponse) GetBudget() Budget

func (*BudgetResponse) GetTotalCollectedCoins

func (m *BudgetResponse) GetTotalCollectedCoins() github_com_cosmos_cosmos_sdk_types.Coins

func (*BudgetResponse) Marshal

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

func (*BudgetResponse) MarshalTo

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

func (*BudgetResponse) MarshalToSizedBuffer

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

func (*BudgetResponse) ProtoMessage

func (*BudgetResponse) ProtoMessage()

func (*BudgetResponse) Reset

func (m *BudgetResponse) Reset()

func (*BudgetResponse) Size

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

func (*BudgetResponse) String

func (m *BudgetResponse) String() string

func (*BudgetResponse) Unmarshal

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

func (*BudgetResponse) XXX_DiscardUnknown

func (m *BudgetResponse) XXX_DiscardUnknown()

func (*BudgetResponse) XXX_Marshal

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

func (*BudgetResponse) XXX_Merge

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

func (*BudgetResponse) XXX_Size

func (m *BudgetResponse) XXX_Size() int

func (*BudgetResponse) XXX_Unmarshal

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

type BudgetsBySource

type BudgetsBySource struct {
	Budgets         []Budget
	CollectionCoins []sdk.Coins
	TotalRate       sdk.Dec
}

BudgetsBySource defines the total rate of budget lists.

type BudgetsBySourceMap

type BudgetsBySourceMap map[string]BudgetsBySource

func GetBudgetsBySourceMap

func GetBudgetsBySourceMap(budgets []Budget) (BudgetsBySourceMap, []string)

GetBudgetsBySourceMap returns BudgetsBySourceMap that has a list of budgets and their total rate which contain the same SourceAddress. It can be used to track of what budgets are available with SourceAddress and validate their total rate.

type GenesisState

type GenesisState struct {
	// params defines all the parameters for the budget module
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// budget_records defines the budget records used for genesis state
	BudgetRecords []BudgetRecord `protobuf:"bytes,2,rep,name=budget_records,json=budgetRecords,proto3" json:"budget_records" yaml:"budget_records"`
}

GenesisState defines the budget module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns the default genesis state.

func NewGenesisState

func NewGenesisState(params Params, records []BudgetRecord) *GenesisState

NewGenesisState returns new GenesisState instance.

func (*GenesisState) Descriptor

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

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

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

func (*GenesisState) XXX_Merge

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

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

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

type Params

type Params struct {
	// The universal epoch length in number of blocks
	// A collection of budgets is executed with this epoch_blocks parameter
	EpochBlocks uint32 `protobuf:"varint,1,opt,name=epoch_blocks,json=epochBlocks,proto3" json:"epoch_blocks,omitempty" yaml:"epoch_blocks"`
	// Budgets parameter can be added, modified, and deleted through
	// parameter change governance proposal
	Budgets []Budget `protobuf:"bytes,2,rep,name=budgets,proto3" json:"budgets" yaml:"budgets"`
}

Params defines the parameters for the budget module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns the default budget module parameters.

func (*Params) Descriptor

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

func (*Params) GetBudgets

func (m *Params) GetBudgets() []Budget

func (*Params) GetEpochBlocks

func (m *Params) GetEpochBlocks() uint32

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramstypes.ParamSetPairs

ParamSetPairs implements paramstypes.ParamSet.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (Params) String

func (p Params) String() string

String returns a human-readable string representation of the parameters.

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate validates parameters.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type QueryAddressesRequest added in v1.0.0

type QueryAddressesRequest struct {
	// The Address Type, default 0 for ADDRESS_TYPE_32_BYTES or 1 for ADDRESS_TYPE_20_BYTES
	Type AddressType `protobuf:"varint,1,opt,name=type,proto3,enum=cosmos.budget.v1beta1.AddressType" json:"type,omitempty"`
	// The module name to be used for address derivation, default is budget.
	ModuleName string `protobuf:"bytes,2,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"`
	// The name to be used for address derivation.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
}

QueryAddressesRequest is the request type for the Query/Addresses RPC method.

func (*QueryAddressesRequest) Descriptor added in v1.0.0

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

func (*QueryAddressesRequest) GetModuleName added in v1.0.0

func (m *QueryAddressesRequest) GetModuleName() string

func (*QueryAddressesRequest) GetName added in v1.0.0

func (m *QueryAddressesRequest) GetName() string

func (*QueryAddressesRequest) GetType added in v1.0.0

func (m *QueryAddressesRequest) GetType() AddressType

func (*QueryAddressesRequest) Marshal added in v1.0.0

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

func (*QueryAddressesRequest) MarshalTo added in v1.0.0

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

func (*QueryAddressesRequest) MarshalToSizedBuffer added in v1.0.0

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

func (*QueryAddressesRequest) ProtoMessage added in v1.0.0

func (*QueryAddressesRequest) ProtoMessage()

func (*QueryAddressesRequest) Reset added in v1.0.0

func (m *QueryAddressesRequest) Reset()

func (*QueryAddressesRequest) Size added in v1.0.0

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

func (*QueryAddressesRequest) String added in v1.0.0

func (m *QueryAddressesRequest) String() string

func (*QueryAddressesRequest) Unmarshal added in v1.0.0

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

func (*QueryAddressesRequest) XXX_DiscardUnknown added in v1.0.0

func (m *QueryAddressesRequest) XXX_DiscardUnknown()

func (*QueryAddressesRequest) XXX_Marshal added in v1.0.0

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

func (*QueryAddressesRequest) XXX_Merge added in v1.0.0

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

func (*QueryAddressesRequest) XXX_Size added in v1.0.0

func (m *QueryAddressesRequest) XXX_Size() int

func (*QueryAddressesRequest) XXX_Unmarshal added in v1.0.0

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

type QueryAddressesResponse added in v1.0.0

type QueryAddressesResponse struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

QueryAddressesResponse is the response type for the Query/Addresses RPC method.

func (*QueryAddressesResponse) Descriptor added in v1.0.0

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

func (*QueryAddressesResponse) GetAddress added in v1.0.0

func (m *QueryAddressesResponse) GetAddress() string

func (*QueryAddressesResponse) Marshal added in v1.0.0

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

func (*QueryAddressesResponse) MarshalTo added in v1.0.0

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

func (*QueryAddressesResponse) MarshalToSizedBuffer added in v1.0.0

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

func (*QueryAddressesResponse) ProtoMessage added in v1.0.0

func (*QueryAddressesResponse) ProtoMessage()

func (*QueryAddressesResponse) Reset added in v1.0.0

func (m *QueryAddressesResponse) Reset()

func (*QueryAddressesResponse) Size added in v1.0.0

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

func (*QueryAddressesResponse) String added in v1.0.0

func (m *QueryAddressesResponse) String() string

func (*QueryAddressesResponse) Unmarshal added in v1.0.0

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

func (*QueryAddressesResponse) XXX_DiscardUnknown added in v1.0.0

func (m *QueryAddressesResponse) XXX_DiscardUnknown()

func (*QueryAddressesResponse) XXX_Marshal added in v1.0.0

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

func (*QueryAddressesResponse) XXX_Merge added in v1.0.0

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

func (*QueryAddressesResponse) XXX_Size added in v1.0.0

func (m *QueryAddressesResponse) XXX_Size() int

func (*QueryAddressesResponse) XXX_Unmarshal added in v1.0.0

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

type QueryBudgetsRequest

type QueryBudgetsRequest struct {
	Name               string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	SourceAddress      string `protobuf:"bytes,2,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"`
	DestinationAddress string `protobuf:"bytes,3,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"`
}

QueryBudgetsRequest is the request type for the Query/Budgets RPC method.

func (*QueryBudgetsRequest) Descriptor

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

func (*QueryBudgetsRequest) GetDestinationAddress added in v1.0.0

func (m *QueryBudgetsRequest) GetDestinationAddress() string

func (*QueryBudgetsRequest) GetName

func (m *QueryBudgetsRequest) GetName() string

func (*QueryBudgetsRequest) GetSourceAddress added in v1.0.0

func (m *QueryBudgetsRequest) GetSourceAddress() string

func (*QueryBudgetsRequest) Marshal

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

func (*QueryBudgetsRequest) MarshalTo

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

func (*QueryBudgetsRequest) MarshalToSizedBuffer

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

func (*QueryBudgetsRequest) ProtoMessage

func (*QueryBudgetsRequest) ProtoMessage()

func (*QueryBudgetsRequest) Reset

func (m *QueryBudgetsRequest) Reset()

func (*QueryBudgetsRequest) Size

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

func (*QueryBudgetsRequest) String

func (m *QueryBudgetsRequest) String() string

func (*QueryBudgetsRequest) Unmarshal

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

func (*QueryBudgetsRequest) XXX_DiscardUnknown

func (m *QueryBudgetsRequest) XXX_DiscardUnknown()

func (*QueryBudgetsRequest) XXX_Marshal

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

func (*QueryBudgetsRequest) XXX_Merge

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

func (*QueryBudgetsRequest) XXX_Size

func (m *QueryBudgetsRequest) XXX_Size() int

func (*QueryBudgetsRequest) XXX_Unmarshal

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

type QueryBudgetsResponse

type QueryBudgetsResponse struct {
	Budgets []BudgetResponse `protobuf:"bytes,1,rep,name=budgets,proto3" json:"budgets"`
}

QueryBudgetsResponse is the response type for the Query/Budgets RPC method.

func (*QueryBudgetsResponse) Descriptor

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

func (*QueryBudgetsResponse) GetBudgets

func (m *QueryBudgetsResponse) GetBudgets() []BudgetResponse

func (*QueryBudgetsResponse) Marshal

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

func (*QueryBudgetsResponse) MarshalTo

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

func (*QueryBudgetsResponse) MarshalToSizedBuffer

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

func (*QueryBudgetsResponse) ProtoMessage

func (*QueryBudgetsResponse) ProtoMessage()

func (*QueryBudgetsResponse) Reset

func (m *QueryBudgetsResponse) Reset()

func (*QueryBudgetsResponse) Size

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

func (*QueryBudgetsResponse) String

func (m *QueryBudgetsResponse) String() string

func (*QueryBudgetsResponse) Unmarshal

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

func (*QueryBudgetsResponse) XXX_DiscardUnknown

func (m *QueryBudgetsResponse) XXX_DiscardUnknown()

func (*QueryBudgetsResponse) XXX_Marshal

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

func (*QueryBudgetsResponse) XXX_Merge

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

func (*QueryBudgetsResponse) XXX_Size

func (m *QueryBudgetsResponse) XXX_Size() int

func (*QueryBudgetsResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Params returns parameters of the budget module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Budgets returns all budgets.
	Budgets(ctx context.Context, in *QueryBudgetsRequest, opts ...grpc.CallOption) (*QueryBudgetsResponse, error)
	// Addresses returns an address that can be used as source and destination is derived according to the given type,
	// module name, and name.
	Addresses(ctx context.Context, in *QueryAddressesRequest, opts ...grpc.CallOption) (*QueryAddressesResponse, 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

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

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

func (*QueryParamsRequest) Marshal

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

func (*QueryParamsRequest) MarshalTo

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

func (*QueryParamsRequest) MarshalToSizedBuffer

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

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

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

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

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

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

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

func (*QueryParamsRequest) XXX_Merge

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

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

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

type QueryParamsResponse

type QueryParamsResponse struct {
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor

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

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

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

func (*QueryParamsResponse) MarshalTo

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

func (*QueryParamsResponse) MarshalToSizedBuffer

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

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

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

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

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

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

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

func (*QueryParamsResponse) XXX_Merge

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

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Params returns parameters of the budget module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Budgets returns all budgets.
	Budgets(context.Context, *QueryBudgetsRequest) (*QueryBudgetsResponse, error)
	// Addresses returns an address that can be used as source and destination is derived according to the given type,
	// module name, and name.
	Addresses(context.Context, *QueryAddressesRequest) (*QueryAddressesResponse, error)
}

QueryServer is the server API for Query service.

type TotalCollectedCoins

type TotalCollectedCoins struct {
	// total_collected_coins specifies the total collected coins in a budget ever since the budget is created
	TotalCollectedCoins github_com_cosmos_cosmos_sdk_types.Coins `` /* 193-byte string literal not displayed */
}

TotalCollectedCoins defines total collected coins with relevant metadata.

func (*TotalCollectedCoins) Descriptor

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

func (*TotalCollectedCoins) Marshal

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

func (*TotalCollectedCoins) MarshalTo

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

func (*TotalCollectedCoins) MarshalToSizedBuffer

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

func (*TotalCollectedCoins) ProtoMessage

func (*TotalCollectedCoins) ProtoMessage()

func (*TotalCollectedCoins) Reset

func (m *TotalCollectedCoins) Reset()

func (*TotalCollectedCoins) Size

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

func (*TotalCollectedCoins) String

func (m *TotalCollectedCoins) String() string

func (*TotalCollectedCoins) Unmarshal

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

func (*TotalCollectedCoins) XXX_DiscardUnknown

func (m *TotalCollectedCoins) XXX_DiscardUnknown()

func (*TotalCollectedCoins) XXX_Marshal

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

func (*TotalCollectedCoins) XXX_Merge

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

func (*TotalCollectedCoins) XXX_Size

func (m *TotalCollectedCoins) XXX_Size() int

func (*TotalCollectedCoins) XXX_Unmarshal

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

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Addresses added in v1.0.0

func (*UnimplementedQueryServer) Budgets

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

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