types

package
v0.1.0-blackfury Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

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

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

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

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// DenomPrefix is the prefix used for internal SDK coin representation.
	DenomPrefix = "erc20"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default capability global index

View Source
const (
	ERC20EventTransfer = "Transfer"
)

erc20 events

Variables

View Source
var (
	ErrInvalidLengthErc20        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowErc20          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupErc20 = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInternalTokenPair      = erc20types.ErrInternalTokenPair
	ErrTokenPairNotFound      = erc20types.ErrTokenPairNotFound
	ErrTokenPairAlreadyExists = erc20types.ErrTokenPairAlreadyExists
	ErrABIPack                = erc20types.ErrABIPack
	ErrABIUnpack              = erc20types.ErrABIUnpack
	ErrEVMDenom               = erc20types.ErrEVMDenom
)

x/erc20 module sentinel errors

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 (
	KeyPrefixTokenPair        = []byte{prefixTokenPair}
	KeyPrefixTokenPairByERC20 = []byte{prefixTokenPairByERC20}
	KeyPrefixTokenPairByDenom = []byte{prefixTokenPairByDenom}
)

KVStore key prefixes

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 ModuleAddress common.Address

ModuleAddress is the native module address for EVM

View Source
var Owner_name = map[int32]string{
	0: "OWNER_UNSPECIFIED",
	1: "OWNER_MODULE",
	2: "OWNER_EXTERNAL",
}
View Source
var Owner_value = map[string]int32{
	"OWNER_UNSPECIFIED": 0,
	"OWNER_MODULE":      1,
	"OWNER_EXTERNAL":    2,
}

Functions

func CreateDenom

func CreateDenom(address string) string

CreateDenom generates a string the module name plus the address to avoid conflicts with names staring with a number

func CreateDenomDescription

func CreateDenomDescription(address string) string

CreateDenomDescription generates a string with the coin description

func KeyPrefix

func KeyPrefix(p string) []byte

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func SanitizeERC20Name

func SanitizeERC20Name(name string) string

SanitizeERC20Name enforces snake_case and removes all "coin" and "token" strings from the ERC20 name.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
	GetModuleAddress(moduleName string) sdk.AccAddress
	GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
	SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
	HasSupply(ctx sdk.Context, denom string) bool
	IterateAllBalances(ctx sdk.Context, cb func(address sdk.AccAddress, coin sdk.Coin) (stop bool))
}

BankKeeper defines the expected interface needed to retrieve account balances.

type ERC20BoolResponse

type ERC20BoolResponse struct {
	Value bool
}

ERC20BoolResponse defines the bool value from the call response

type ERC20Data

type ERC20Data struct {
	Name     string
	Symbol   string
	Decimals uint8
}

ERC20Data represents the ERC20 token details used to map the token to a Cosmos Coin

func NewERC20Data

func NewERC20Data(name, symbol string, decimals uint8) ERC20Data

NewERC20Data creates a new ERC20Data instance

type ERC20StringResponse

type ERC20StringResponse struct {
	Value string
}

ERC20StringResponse defines the string value from the call response

type ERC20Uint8Response

type ERC20Uint8Response struct {
	Value uint8
}

ERC20Uint8Response defines the uint8 value from the call response

type EVMKeeper

type EVMKeeper interface {
	GetParams(ctx sdk.Context) evmtypes.Params
	GetAccountWithoutBalance(ctx sdk.Context, addr common.Address) *statedb.Account
	EstimateGas(c context.Context, req *evmtypes.EthCallRequest) (*evmtypes.EstimateGasResponse, error)
	ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*evmtypes.MsgEthereumTxResponse, error)
}

EVMKeeper defines the expected EVM keeper interface used on erc20

type GenesisState

type GenesisState struct {
	// module parameters
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// registered token pairs
	TokenPairs []TokenPair `protobuf:"bytes,2,rep,name=token_pairs,json=tokenPairs,proto3" json:"token_pairs"`
}

GenesisState defines the module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func (*GenesisState) Descriptor

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

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetTokenPairs

func (m *GenesisState) GetTokenPairs() []TokenPair

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 (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

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 {
}

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 MsgServer

type MsgServer interface {
}

MsgServer is the server API for Msg service.

type Owner

type Owner int32

Owner enumerates the ownership of a ERC20 contract.

const (
	// OWNER_UNSPECIFIED defines an invalid/undefined owner.
	OWNER_UNSPECIFIED Owner = 0
	// OWNER_MODULE erc20 is owned by the erc20 module account.
	OWNER_MODULE Owner = 1
	// EXTERNAL erc20 is owned by an external account.
	OWNER_EXTERNAL Owner = 2
)

func (Owner) EnumDescriptor

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

func (Owner) String

func (x Owner) String() string

type Params

type Params struct {
}

Params defines the erc20 module params

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams

func NewParams() Params

NewParams creates a new Params instance

func (*Params) Descriptor

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

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

ParamSetPairs get the 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 implements the Stringer interface.

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate validates the 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 {
	// Retrieves registered token pairs
	TokenPairs(ctx context.Context, in *QueryTokenPairsRequest, opts ...grpc.CallOption) (*QueryTokenPairsResponse, error)
	// Retrieves a registered token pair
	TokenPair(ctx context.Context, in *QueryTokenPairRequest, opts ...grpc.CallOption) (*QueryTokenPairResponse, error)
	// Params retrieves the erc20 module params
	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 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 {
	// Retrieves registered token pairs
	TokenPairs(context.Context, *QueryTokenPairsRequest) (*QueryTokenPairsResponse, error)
	// Retrieves a registered token pair
	TokenPair(context.Context, *QueryTokenPairRequest) (*QueryTokenPairResponse, error)
	// Params retrieves the erc20 module params
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type QueryTokenPairRequest

type QueryTokenPairRequest struct {
	// token identifier can be either the hex contract address of the ERC20 or the
	// Cosmos base denomination
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}

QueryTokenPairRequest is the request type for the Query/TokenPair RPC method.

func (*QueryTokenPairRequest) Descriptor

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

func (*QueryTokenPairRequest) GetToken

func (m *QueryTokenPairRequest) GetToken() string

func (*QueryTokenPairRequest) Marshal

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

func (*QueryTokenPairRequest) MarshalTo

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

func (*QueryTokenPairRequest) MarshalToSizedBuffer

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

func (*QueryTokenPairRequest) ProtoMessage

func (*QueryTokenPairRequest) ProtoMessage()

func (*QueryTokenPairRequest) Reset

func (m *QueryTokenPairRequest) Reset()

func (*QueryTokenPairRequest) Size

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

func (*QueryTokenPairRequest) String

func (m *QueryTokenPairRequest) String() string

func (*QueryTokenPairRequest) Unmarshal

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

func (*QueryTokenPairRequest) XXX_DiscardUnknown

func (m *QueryTokenPairRequest) XXX_DiscardUnknown()

func (*QueryTokenPairRequest) XXX_Marshal

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

func (*QueryTokenPairRequest) XXX_Merge

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

func (*QueryTokenPairRequest) XXX_Size

func (m *QueryTokenPairRequest) XXX_Size() int

func (*QueryTokenPairRequest) XXX_Unmarshal

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

type QueryTokenPairResponse

type QueryTokenPairResponse struct {
	TokenPair TokenPair `protobuf:"bytes,1,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair"`
}

QueryTokenPairResponse is the response type for the Query/TokenPair RPC method.

func (*QueryTokenPairResponse) Descriptor

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

func (*QueryTokenPairResponse) GetTokenPair

func (m *QueryTokenPairResponse) GetTokenPair() TokenPair

func (*QueryTokenPairResponse) Marshal

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

func (*QueryTokenPairResponse) MarshalTo

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

func (*QueryTokenPairResponse) MarshalToSizedBuffer

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

func (*QueryTokenPairResponse) ProtoMessage

func (*QueryTokenPairResponse) ProtoMessage()

func (*QueryTokenPairResponse) Reset

func (m *QueryTokenPairResponse) Reset()

func (*QueryTokenPairResponse) Size

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

func (*QueryTokenPairResponse) String

func (m *QueryTokenPairResponse) String() string

func (*QueryTokenPairResponse) Unmarshal

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

func (*QueryTokenPairResponse) XXX_DiscardUnknown

func (m *QueryTokenPairResponse) XXX_DiscardUnknown()

func (*QueryTokenPairResponse) XXX_Marshal

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

func (*QueryTokenPairResponse) XXX_Merge

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

func (*QueryTokenPairResponse) XXX_Size

func (m *QueryTokenPairResponse) XXX_Size() int

func (*QueryTokenPairResponse) XXX_Unmarshal

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

type QueryTokenPairsRequest

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

QueryTokenPairsRequest is the request type for the Query/TokenPairs RPC method.

func (*QueryTokenPairsRequest) Descriptor

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

func (*QueryTokenPairsRequest) GetPagination

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

func (*QueryTokenPairsRequest) Marshal

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

func (*QueryTokenPairsRequest) MarshalTo

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

func (*QueryTokenPairsRequest) MarshalToSizedBuffer

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

func (*QueryTokenPairsRequest) ProtoMessage

func (*QueryTokenPairsRequest) ProtoMessage()

func (*QueryTokenPairsRequest) Reset

func (m *QueryTokenPairsRequest) Reset()

func (*QueryTokenPairsRequest) Size

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

func (*QueryTokenPairsRequest) String

func (m *QueryTokenPairsRequest) String() string

func (*QueryTokenPairsRequest) Unmarshal

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

func (*QueryTokenPairsRequest) XXX_DiscardUnknown

func (m *QueryTokenPairsRequest) XXX_DiscardUnknown()

func (*QueryTokenPairsRequest) XXX_Marshal

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

func (*QueryTokenPairsRequest) XXX_Merge

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

func (*QueryTokenPairsRequest) XXX_Size

func (m *QueryTokenPairsRequest) XXX_Size() int

func (*QueryTokenPairsRequest) XXX_Unmarshal

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

type QueryTokenPairsResponse

type QueryTokenPairsResponse struct {
	TokenPairs []TokenPair `protobuf:"bytes,1,rep,name=token_pairs,json=tokenPairs,proto3" json:"token_pairs"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryTokenPairsResponse is the response type for the Query/TokenPairs RPC method.

func (*QueryTokenPairsResponse) Descriptor

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

func (*QueryTokenPairsResponse) GetPagination

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

func (*QueryTokenPairsResponse) GetTokenPairs

func (m *QueryTokenPairsResponse) GetTokenPairs() []TokenPair

func (*QueryTokenPairsResponse) Marshal

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

func (*QueryTokenPairsResponse) MarshalTo

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

func (*QueryTokenPairsResponse) MarshalToSizedBuffer

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

func (*QueryTokenPairsResponse) ProtoMessage

func (*QueryTokenPairsResponse) ProtoMessage()

func (*QueryTokenPairsResponse) Reset

func (m *QueryTokenPairsResponse) Reset()

func (*QueryTokenPairsResponse) Size

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

func (*QueryTokenPairsResponse) String

func (m *QueryTokenPairsResponse) String() string

func (*QueryTokenPairsResponse) Unmarshal

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

func (*QueryTokenPairsResponse) XXX_DiscardUnknown

func (m *QueryTokenPairsResponse) XXX_DiscardUnknown()

func (*QueryTokenPairsResponse) XXX_Marshal

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

func (*QueryTokenPairsResponse) XXX_Merge

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

func (*QueryTokenPairsResponse) XXX_Size

func (m *QueryTokenPairsResponse) XXX_Size() int

func (*QueryTokenPairsResponse) XXX_Unmarshal

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

type TokenPair

type TokenPair struct {
	// address of ERC20 contract token
	Erc20Address string `protobuf:"bytes,1,opt,name=erc20_address,json=erc20Address,proto3" json:"erc20_address,omitempty"`
	// cosmos base denomination to be mapped to
	Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"`
	// ERC20 owner address ENUM (0 invalid, 1 ModuleAccount, 2 external address)
	ContractOwner Owner `` /* 131-byte string literal not displayed */
}

TokenPair defines an instance that records pairing consisting of a Cosmos native Coin and an ERC20 token address.

func NewTokenPair

func NewTokenPair(erc20Address common.Address, denom string, contractOwner Owner) TokenPair

NewTokenPair returns an instance of TokenPair

func (*TokenPair) Descriptor

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

func (*TokenPair) Equal

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

func (*TokenPair) GetContractOwner

func (m *TokenPair) GetContractOwner() Owner

func (*TokenPair) GetDenom

func (m *TokenPair) GetDenom() string

func (TokenPair) GetERC20Contract

func (tp TokenPair) GetERC20Contract() common.Address

GetERC20Contract casts the hex string address of the ERC20 to common.Address

func (*TokenPair) GetErc20Address

func (m *TokenPair) GetErc20Address() string

func (TokenPair) GetID

func (tp TokenPair) GetID() []byte

GetID returns the SHA256 hash of the ERC20 address and denomination

func (TokenPair) IsNativeCoin

func (tp TokenPair) IsNativeCoin() bool

IsNativeCoin returns true if the owner of the ERC20 contract is the erc20 module account

func (TokenPair) IsNativeERC20

func (tp TokenPair) IsNativeERC20() bool

IsNativeERC20 returns true if the owner of the ERC20 contract is not the erc20 module account

func (*TokenPair) Marshal

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

func (*TokenPair) MarshalTo

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

func (*TokenPair) MarshalToSizedBuffer

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

func (*TokenPair) ProtoMessage

func (*TokenPair) ProtoMessage()

func (*TokenPair) Reset

func (m *TokenPair) Reset()

func (*TokenPair) Size

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

func (*TokenPair) String

func (m *TokenPair) String() string

func (*TokenPair) Unmarshal

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

func (TokenPair) Validate

func (tp TokenPair) Validate() error

Validate performs a stateless validation of a TokenPair

func (*TokenPair) XXX_DiscardUnknown

func (m *TokenPair) XXX_DiscardUnknown()

func (*TokenPair) XXX_Marshal

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

func (*TokenPair) XXX_Merge

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

func (*TokenPair) XXX_Size

func (m *TokenPair) XXX_Size() int

func (*TokenPair) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) TokenPair

func (*UnimplementedQueryServer) TokenPairs

Jump to

Keyboard shortcuts

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