types

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeCreateTokenswap = "create_tokenswap"

	AttributeKeyTxHash     = "tx_hash"
	AttributeKeyReceiver   = "receiver"
	AttributeValueCategory = ModuleName
)

tokenswap event types and attribute keys

View Source
const (
	// ModuleName defines the module name
	ModuleName = "tokenswap"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey defines message route key
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName
)
View Source
const (
	// tokenswap module is enabled or not
	DefaultSwappable = true
	// who can request tokenswap
	DefaultSigner = "rizon1cafygu0kppg46tq9kkzz9z9nrf5v8zwwnf5t9l"
	// tokenswap amount limitation
	DefaultLimit = rizon.SwapLimitation
)
View Source
const (
	QueryTokenswap     = "get"
	QuerySwappedAmount = "swapped"
	QueryParams        = "parameters"
)

query endpoints supported by the Querier

View Source
const (
	// 32 byte tx hash's hexadecimal string length
	TxHashStringLength = 64
	// lower case hexadecimal typed string format
	TxHashRegExp = "[a-f0-9]{64}$"
)

Variables

View Source
var (
	ErrUnswappable        = sdkerrors.Register(ModuleName, 2, "tokenswap is disabled")
	ErrUnauthorizedSigner = sdkerrors.Register(ModuleName, 3, "unauthorized signer")
	ErrInvalidTxHash      = sdkerrors.Register(ModuleName, 4, "invalid tx hash")
	ErrAlreadySwapped     = sdkerrors.Register(ModuleName, 5, "already swapped tx hash")
	ErrSwapLimitExceed    = sdkerrors.Register(ModuleName, 6, "swap limitation has exceeded")
)
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 (
	KeySwappable = []byte("Swappable")
	KeySigner    = []byte("Signer")
	KeyLimit     = []byte("Limit")
)
View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = 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 (
	ErrInvalidLengthTokenswap        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTokenswap          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTokenswap = 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 (
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var (
	// global key of current swapped amount
	SwappedAmountKey = []byte{0x11}
)

Functions

func GetSwapKey added in v0.3.0

func GetSwapKey(txHash string) []byte

get the key for the swap from tx hash string

func ParamsKeyTable

func ParamsKeyTable() paramtypes.KeyTable

making keyTable for tokenswap module

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the module interfaces types with the interface registry

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the necessary module interfaces and concrete types on the provided LegacyAmino codec These types are used for Amino JSON serialization

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidTxHash

func ValidTxHash(hash string) bool

ValidTxHash returns whether tx hash is valid or not tx hash should be 64-length, lower case, hexadecimal type string

Types

type BankKeeper

type BankKeeper interface {
	// MintCoins is used for minting new coins to swap
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	// SendCoinsFromModuleToAccount is used for sending minted coins to proper receiver
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the expected bank keeper

type GenesisState

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

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns default genesis state of tokenswap module

func NewGenesisState

func NewGenesisState(params Params) *GenesisState

NewGenesisState creates a new GenesisState instance

func (*GenesisState) Descriptor

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

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

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) Validate

func (s *GenesisState) Validate() error

Validate checks all genesis states are valid

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 MsgClient

type MsgClient interface {
	// CreateTokenswap defines a method for creating a new tokenswap
	CreateTokenswap(ctx context.Context, in *MsgCreateTokenswapRequest, opts ...grpc.CallOption) (*MsgCreateTokenswapResponse, 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

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgCreateTokenswapRequest

type MsgCreateTokenswapRequest struct {
	// tx_hash is the tx hash of burn tx from legacy chain
	// tx_hash is used for store key
	TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty" yaml:"tx_hash"`
	// receiver is the target of tokenswap
	Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty" yaml:"receiver"`
	// signer is who confirms the swap process
	Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty" yaml:"signer"`
	// amount is the amount of swap process
	Amount *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"amount,omitempty"`
}

MsgCreateTokenswapRequest defines a SDK message for creating a new tokenswap

func NewMsgCreateTokenswapRequest

func NewMsgCreateTokenswapRequest(tx_hash string, receiver string, signer string, amount sdk.Dec) *MsgCreateTokenswapRequest

NewMsgCreateTokenswapRequest creates a new MsgCreateTokenswapRequest object

func (*MsgCreateTokenswapRequest) Descriptor

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

func (*MsgCreateTokenswapRequest) GetReceiver

func (m *MsgCreateTokenswapRequest) GetReceiver() string

func (MsgCreateTokenswapRequest) GetSignBytes

func (msg MsgCreateTokenswapRequest) GetSignBytes() []byte

GetSignBytes returns the message bytes to sign over

func (*MsgCreateTokenswapRequest) GetSigner

func (m *MsgCreateTokenswapRequest) GetSigner() string

func (MsgCreateTokenswapRequest) GetSigners

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

GetSigners returns the AccAddress of signer

func (*MsgCreateTokenswapRequest) GetTxHash

func (m *MsgCreateTokenswapRequest) GetTxHash() string

func (*MsgCreateTokenswapRequest) Marshal

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

func (*MsgCreateTokenswapRequest) MarshalTo

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

func (*MsgCreateTokenswapRequest) MarshalToSizedBuffer

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

func (*MsgCreateTokenswapRequest) ProtoMessage

func (*MsgCreateTokenswapRequest) ProtoMessage()

func (*MsgCreateTokenswapRequest) Reset

func (m *MsgCreateTokenswapRequest) Reset()

func (MsgCreateTokenswapRequest) Route

func (msg MsgCreateTokenswapRequest) Route() string

implements of the sdk.Msg interface // Route returns the RouterKey

func (*MsgCreateTokenswapRequest) Size

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

func (*MsgCreateTokenswapRequest) String

func (m *MsgCreateTokenswapRequest) String() string

func (MsgCreateTokenswapRequest) Type

func (msg MsgCreateTokenswapRequest) Type() string

Type returns the name of message type

func (*MsgCreateTokenswapRequest) Unmarshal

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

func (MsgCreateTokenswapRequest) ValidateBasic

func (msg MsgCreateTokenswapRequest) ValidateBasic() error

ValidateBasic validates the MsgCreateTokenswapRequest

func (*MsgCreateTokenswapRequest) XXX_DiscardUnknown

func (m *MsgCreateTokenswapRequest) XXX_DiscardUnknown()

func (*MsgCreateTokenswapRequest) XXX_Marshal

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

func (*MsgCreateTokenswapRequest) XXX_Merge

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

func (*MsgCreateTokenswapRequest) XXX_Size

func (m *MsgCreateTokenswapRequest) XXX_Size() int

func (*MsgCreateTokenswapRequest) XXX_Unmarshal

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

type MsgCreateTokenswapResponse

type MsgCreateTokenswapResponse struct {
}

MsgCreatetokenswapResponse defines the Msg/CreateTokenswap response type

func (*MsgCreateTokenswapResponse) Descriptor

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

func (*MsgCreateTokenswapResponse) Marshal

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

func (*MsgCreateTokenswapResponse) MarshalTo

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

func (*MsgCreateTokenswapResponse) MarshalToSizedBuffer

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

func (*MsgCreateTokenswapResponse) ProtoMessage

func (*MsgCreateTokenswapResponse) ProtoMessage()

func (*MsgCreateTokenswapResponse) Reset

func (m *MsgCreateTokenswapResponse) Reset()

func (*MsgCreateTokenswapResponse) Size

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

func (*MsgCreateTokenswapResponse) String

func (m *MsgCreateTokenswapResponse) String() string

func (*MsgCreateTokenswapResponse) Unmarshal

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

func (*MsgCreateTokenswapResponse) XXX_DiscardUnknown

func (m *MsgCreateTokenswapResponse) XXX_DiscardUnknown()

func (*MsgCreateTokenswapResponse) XXX_Marshal

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

func (*MsgCreateTokenswapResponse) XXX_Merge

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

func (*MsgCreateTokenswapResponse) XXX_Size

func (m *MsgCreateTokenswapResponse) XXX_Size() int

func (*MsgCreateTokenswapResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// CreateTokenswap defines a method for creating a new tokenswap
	CreateTokenswap(context.Context, *MsgCreateTokenswapRequest) (*MsgCreateTokenswapResponse, error)
}

MsgServer is the server API for Msg service.

type Params

type Params struct {
	// swappable indicates whether tokenswap module is enabled or not
	Swappable bool `protobuf:"varint,1,opt,name=swappable,proto3" json:"swappable,omitempty" yaml:"swappable"`
	// signer is someone who can request tokenswap
	Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty" yaml:"signer"`
	// limit is the maximum swappable amount
	Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty" yaml:"limit"`
}

Params defines the parameters for the tokenswap module

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams

func NewParams(swappable bool, signer string, limit int64) Params

NewParams creates a new Params instance

func (*Params) Descriptor

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

func (*Params) GetLimit added in v0.2.3

func (m *Params) GetLimit() int64

func (*Params) GetSigner

func (m *Params) GetSigner() string

func (*Params) GetSwappable

func (m *Params) GetSwappable() bool

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() paramtypes.ParamSetPairs

implements params.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 a set of params

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 QueryClient

type QueryClient interface {
	// Tokenswap queries tokenswap item for given tx hash
	Tokenswap(ctx context.Context, in *QueryTokenswapRequest, opts ...grpc.CallOption) (*QueryTokenswapResponse, error)
	// SwappedAmount queries current swapped amount of tokenswap
	SwappedAmount(ctx context.Context, in *QuerySwappedAmountRequest, opts ...grpc.CallOption) (*QuerySwappedAmountResponse, error)
	// Params queries parameters of tokenswap
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, 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 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 defines the parameters of tokenswap
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is 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 {
	// Tokenswap queries tokenswap item for given tx hash
	Tokenswap(context.Context, *QueryTokenswapRequest) (*QueryTokenswapResponse, error)
	// SwappedAmount queries current swapped amount of tokenswap
	SwappedAmount(context.Context, *QuerySwappedAmountRequest) (*QuerySwappedAmountResponse, error)
	// Params queries parameters of tokenswap
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type QuerySwappedAmountRequest added in v0.2.3

type QuerySwappedAmountRequest struct {
}

QuerySwappedAmountRequest is request type for the Query/SwappedAmount RPC method

func (*QuerySwappedAmountRequest) Descriptor added in v0.2.3

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

func (*QuerySwappedAmountRequest) Marshal added in v0.2.3

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

func (*QuerySwappedAmountRequest) MarshalTo added in v0.2.3

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

func (*QuerySwappedAmountRequest) MarshalToSizedBuffer added in v0.2.3

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

func (*QuerySwappedAmountRequest) ProtoMessage added in v0.2.3

func (*QuerySwappedAmountRequest) ProtoMessage()

func (*QuerySwappedAmountRequest) Reset added in v0.2.3

func (m *QuerySwappedAmountRequest) Reset()

func (*QuerySwappedAmountRequest) Size added in v0.2.3

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

func (*QuerySwappedAmountRequest) String added in v0.2.3

func (m *QuerySwappedAmountRequest) String() string

func (*QuerySwappedAmountRequest) Unmarshal added in v0.2.3

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

func (*QuerySwappedAmountRequest) XXX_DiscardUnknown added in v0.2.3

func (m *QuerySwappedAmountRequest) XXX_DiscardUnknown()

func (*QuerySwappedAmountRequest) XXX_Marshal added in v0.2.3

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

func (*QuerySwappedAmountRequest) XXX_Merge added in v0.2.3

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

func (*QuerySwappedAmountRequest) XXX_Size added in v0.2.3

func (m *QuerySwappedAmountRequest) XXX_Size() int

func (*QuerySwappedAmountRequest) XXX_Unmarshal added in v0.2.3

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

type QuerySwappedAmountResponse added in v0.2.3

type QuerySwappedAmountResponse struct {
	// amount defines current swapped amount of tokenswap
	SwappedAmount SwappedAmount `protobuf:"bytes,1,opt,name=swapped_amount,json=swappedAmount,proto3" json:"swapped_amount"`
}

QuerySwappedAmountResponse is response type for the Query/SwappedAmount RPC method

func (*QuerySwappedAmountResponse) Descriptor added in v0.2.3

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

func (*QuerySwappedAmountResponse) GetSwappedAmount added in v0.2.3

func (m *QuerySwappedAmountResponse) GetSwappedAmount() SwappedAmount

func (*QuerySwappedAmountResponse) Marshal added in v0.2.3

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

func (*QuerySwappedAmountResponse) MarshalTo added in v0.2.3

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

func (*QuerySwappedAmountResponse) MarshalToSizedBuffer added in v0.2.3

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

func (*QuerySwappedAmountResponse) ProtoMessage added in v0.2.3

func (*QuerySwappedAmountResponse) ProtoMessage()

func (*QuerySwappedAmountResponse) Reset added in v0.2.3

func (m *QuerySwappedAmountResponse) Reset()

func (*QuerySwappedAmountResponse) Size added in v0.2.3

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

func (*QuerySwappedAmountResponse) String added in v0.2.3

func (m *QuerySwappedAmountResponse) String() string

func (*QuerySwappedAmountResponse) Unmarshal added in v0.2.3

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

func (*QuerySwappedAmountResponse) XXX_DiscardUnknown added in v0.2.3

func (m *QuerySwappedAmountResponse) XXX_DiscardUnknown()

func (*QuerySwappedAmountResponse) XXX_Marshal added in v0.2.3

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

func (*QuerySwappedAmountResponse) XXX_Merge added in v0.2.3

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

func (*QuerySwappedAmountResponse) XXX_Size added in v0.2.3

func (m *QuerySwappedAmountResponse) XXX_Size() int

func (*QuerySwappedAmountResponse) XXX_Unmarshal added in v0.2.3

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

type QueryTokenswapParam

type QueryTokenswapParam struct {
	TxHash string
}

QueryTokenswapParam defines the param for the following query: - 'custom/tokenswap/get/'

func NewQueryTokenswapParam

func NewQueryTokenswapParam(txHash string) QueryTokenswapParam

NewQueryTokenswapParam creates a new QueryTokenswapParam

type QueryTokenswapRequest

type QueryTokenswapRequest struct {
	// tx_hash defines the tx hash to query for
	TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
}

QueryTokenswapRequest is request type for the Query/Tokenswap RPC method

func (*QueryTokenswapRequest) Descriptor

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

func (*QueryTokenswapRequest) GetTxHash

func (m *QueryTokenswapRequest) GetTxHash() string

func (*QueryTokenswapRequest) Marshal

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

func (*QueryTokenswapRequest) MarshalTo

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

func (*QueryTokenswapRequest) MarshalToSizedBuffer

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

func (*QueryTokenswapRequest) ProtoMessage

func (*QueryTokenswapRequest) ProtoMessage()

func (*QueryTokenswapRequest) Reset

func (m *QueryTokenswapRequest) Reset()

func (*QueryTokenswapRequest) Size

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

func (*QueryTokenswapRequest) String

func (m *QueryTokenswapRequest) String() string

func (*QueryTokenswapRequest) Unmarshal

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

func (*QueryTokenswapRequest) XXX_DiscardUnknown

func (m *QueryTokenswapRequest) XXX_DiscardUnknown()

func (*QueryTokenswapRequest) XXX_Marshal

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

func (*QueryTokenswapRequest) XXX_Merge

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

func (*QueryTokenswapRequest) XXX_Size

func (m *QueryTokenswapRequest) XXX_Size() int

func (*QueryTokenswapRequest) XXX_Unmarshal

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

type QueryTokenswapResponse

type QueryTokenswapResponse struct {
	// tokenswap defines the tokenswap info
	Tokenswap *Tokenswap `protobuf:"bytes,1,opt,name=tokenswap,proto3" json:"tokenswap,omitempty"`
}

QueryTokenswapResponse is response type for the Query/Tokenswap RPC method

func (*QueryTokenswapResponse) Descriptor

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

func (*QueryTokenswapResponse) GetTokenswap

func (m *QueryTokenswapResponse) GetTokenswap() *Tokenswap

func (*QueryTokenswapResponse) Marshal

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

func (*QueryTokenswapResponse) MarshalTo

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

func (*QueryTokenswapResponse) MarshalToSizedBuffer

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

func (*QueryTokenswapResponse) ProtoMessage

func (*QueryTokenswapResponse) ProtoMessage()

func (*QueryTokenswapResponse) Reset

func (m *QueryTokenswapResponse) Reset()

func (*QueryTokenswapResponse) Size

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

func (*QueryTokenswapResponse) String

func (m *QueryTokenswapResponse) String() string

func (*QueryTokenswapResponse) Unmarshal

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

func (*QueryTokenswapResponse) XXX_DiscardUnknown

func (m *QueryTokenswapResponse) XXX_DiscardUnknown()

func (*QueryTokenswapResponse) XXX_Marshal

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

func (*QueryTokenswapResponse) XXX_Merge

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

func (*QueryTokenswapResponse) XXX_Size

func (m *QueryTokenswapResponse) XXX_Size() int

func (*QueryTokenswapResponse) XXX_Unmarshal

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

type SwappedAmount added in v0.2.3

type SwappedAmount struct {
	// amount is the amount of already swapped
	Amount int64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty" yaml:"amount"`
}

Current swapped amount of tokenswap module

func NewSwappedAmount added in v0.2.3

func NewSwappedAmount(amount int64) SwappedAmount

NewSwappedAmount creates a new swapped amount

func (*SwappedAmount) Descriptor added in v0.2.3

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

func (*SwappedAmount) GetAmount added in v0.2.3

func (m *SwappedAmount) GetAmount() int64

func (*SwappedAmount) Marshal added in v0.2.3

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

func (*SwappedAmount) MarshalTo added in v0.2.3

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

func (*SwappedAmount) MarshalToSizedBuffer added in v0.2.3

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

func (*SwappedAmount) ProtoMessage added in v0.2.3

func (*SwappedAmount) ProtoMessage()

func (*SwappedAmount) Reset added in v0.2.3

func (m *SwappedAmount) Reset()

func (*SwappedAmount) Size added in v0.2.3

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

func (*SwappedAmount) String added in v0.2.3

func (m *SwappedAmount) String() string

func (*SwappedAmount) Unmarshal added in v0.2.3

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

func (*SwappedAmount) XXX_DiscardUnknown added in v0.2.3

func (m *SwappedAmount) XXX_DiscardUnknown()

func (*SwappedAmount) XXX_Marshal added in v0.2.3

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

func (*SwappedAmount) XXX_Merge added in v0.2.3

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

func (*SwappedAmount) XXX_Size added in v0.2.3

func (m *SwappedAmount) XXX_Size() int

func (*SwappedAmount) XXX_Unmarshal added in v0.2.3

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

type Tokenswap

type Tokenswap struct {
	// tx_hash is the tx hash of burn tx from legacy chain
	// tx_hash is used for store key
	TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	// receiver is the target of tokenswap
	Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"`
	// signer is who confirms the swap process
	Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"`
	// amount is the amount of swap process
	Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

Tokenswap defines the tokenswap state

func NewTokenswap

func NewTokenswap(txHash string, receiver string, signer string, amount sdk.Coins) Tokenswap

NewTokenswap creates a new swap state object

func (*Tokenswap) Descriptor

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

func (*Tokenswap) GetAmount

func (*Tokenswap) GetReceiver

func (m *Tokenswap) GetReceiver() string

func (*Tokenswap) GetSigner

func (m *Tokenswap) GetSigner() string

func (*Tokenswap) GetTxHash

func (m *Tokenswap) GetTxHash() string

func (*Tokenswap) Marshal

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

func (*Tokenswap) MarshalTo

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

func (*Tokenswap) MarshalToSizedBuffer

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

func (*Tokenswap) ProtoMessage

func (*Tokenswap) ProtoMessage()

func (*Tokenswap) Reset

func (m *Tokenswap) Reset()

func (*Tokenswap) Size

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

func (*Tokenswap) String

func (m *Tokenswap) String() string

func (*Tokenswap) Unmarshal

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

func (*Tokenswap) XXX_DiscardUnknown

func (m *Tokenswap) XXX_DiscardUnknown()

func (*Tokenswap) XXX_Marshal

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

func (*Tokenswap) XXX_Merge

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

func (*Tokenswap) XXX_Size

func (m *Tokenswap) XXX_Size() int

func (*Tokenswap) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreateTokenswap

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) SwappedAmount added in v0.2.3

func (*UnimplementedQueryServer) Tokenswap

Jump to

Keyboard shortcuts

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