types

package
v0.0.0-...-ff73d50 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Overview

nolint

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeCreateHTLC = "create_htlc"
	EventTypeClaimHTLC  = "claim_htlc"
	EventTypeRefundHTLC = "refund_htlc"

	AttributeValueCategory = ModuleName

	AttributeKeySender               = "sender"
	AttributeKeyReceiver             = "receiver"
	AttributeKeyReceiverOnOtherChain = "receiver_on_other_chain"
	AttributeKeySenderOnOtherChain   = "sender_on_other_chain"
	AttributeKeyAmount               = "amount"
	AttributeKeyHashLock             = "hash_lock"
	AttributeKeyID                   = "id"
	AttributeKeyTimeLock             = "time_lock"
	AttributeKeySecret               = "secret"
	AttributeKeyTransfer             = "transfer"
	AttributeKeyDirection            = "direction"
)

HTLC module event types and attributes

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

	// StoreKey is the string store representation
	StoreKey string = ModuleName

	// QuerierRoute is the querier route for the HTLC module
	QuerierRoute string = ModuleName

	// RouterKey is the msg router key for the HTLC module
	RouterKey string = ModuleName

	// DefaultParamspace is the default name for parameter store
	DefaultParamspace = ModuleName
)
View Source
const (
	// TypeMsgCreateHTLC is the type for MsgCreateHTLC
	TypeMsgCreateHTLC = "create_htlc"

	// TypeMsgClaimHTLC is the type for MsgClaimHTLC
	TypeMsgClaimHTLC = "claim_htlc"

	// TypeMsgRefundHTLC is the type for MsgRefundHTLC
	TypeMsgRefundHTLC = "refund_htlc"
)
View Source
const (
	QueryHTLC          = "htlc"          // query an HTLC
	QueryAssetSupply   = "assetSupply"   // query an asset supply
	QueryAssetSupplies = "assetSupplies" // query all asset supplies
	QueryParameters    = "parameters"    // query parameters
)
View Source
const (
	// SecretLength is the length for the secret in hex string
	SecretLength = 64
	// HTLCIDLength is the length for the hash lock in hex string
	HTLCIDLength = 64
	// HashLockLength is the length for the hash lock in hex string
	HashLockLength = 64
	// MaxLengthForAddressOnOtherChain is the maximum length for the address on other chains
	MaxLengthForAddressOnOtherChain = 128
	// MinTimeLock is the minimum time span for HTLC in blocks
	MinTimeLock = 50
	// MaxTimeLock is the maximum time span for HTLC in blocks
	MaxTimeLock = 34560
	// MinDenomLength is the min length of the token denom
	MinDenomLength = 6
)

Variables

View Source
var (
	ErrInvalidID                   = sdkerrors.Register(ModuleName, 2, "invalid htlc id")
	ErrInvalidHashLock             = sdkerrors.Register(ModuleName, 3, "invalid hash lock")
	ErrInvalidTimeLock             = sdkerrors.Register(ModuleName, 4, "invalid time lock")
	ErrInvalidSecret               = sdkerrors.Register(ModuleName, 5, "invalid secret")
	ErrInvalidExpirationHeight     = sdkerrors.Register(ModuleName, 6, "invalid expiration height")
	ErrInvalidTimestamp            = sdkerrors.Register(ModuleName, 7, "invalid timestamp")
	ErrInvalidState                = sdkerrors.Register(ModuleName, 8, "invalid state")
	ErrInvalidClosedBlock          = sdkerrors.Register(ModuleName, 9, "invalid closed block")
	ErrInvalidDirection            = sdkerrors.Register(ModuleName, 10, "invalid direction")
	ErrHTLCExists                  = sdkerrors.Register(ModuleName, 11, "htlc already exists")
	ErrUnknownHTLC                 = sdkerrors.Register(ModuleName, 12, "unknown htlc")
	ErrHTLCNotOpen                 = sdkerrors.Register(ModuleName, 13, "htlc not open")
	ErrAssetNotSupported           = sdkerrors.Register(ModuleName, 14, "asset not found")
	ErrAssetNotActive              = sdkerrors.Register(ModuleName, 15, "asset is currently inactive")
	ErrInvalidAccount              = sdkerrors.Register(ModuleName, 16, "invalid account")
	ErrInvalidAmount               = sdkerrors.Register(ModuleName, 17, "invalid amount")
	ErrInsufficientAmount          = sdkerrors.Register(ModuleName, 18, "amount cannot cover the deputy fixed fee")
	ErrExceedsSupplyLimit          = sdkerrors.Register(ModuleName, 19, "asset supply over limit")
	ErrExceedsTimeBasedSupplyLimit = sdkerrors.Register(ModuleName, 20, "asset supply over limit for current time period")
	ErrInvalidCurrentSupply        = sdkerrors.Register(ModuleName, 21, "supply decrease puts current asset supply below 0")
	ErrInvalidIncomingSupply       = sdkerrors.Register(ModuleName, 22, "supply decrease puts incoming asset supply below 0")
	ErrInvalidOutgoingSupply       = sdkerrors.Register(ModuleName, 23, "supply decrease puts outgoing asset supply below 0")
	ErrExceedsAvailableSupply      = sdkerrors.Register(ModuleName, 24, "outgoing swap exceeds total available supply")
	ErrAssetSupplyNotFound         = sdkerrors.Register(ModuleName, 25, "asset supply not found in store")
)

HTLC 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 (
	ErrInvalidLengthHtlc        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHtlc          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHtlc = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// Keys for store prefixes
	HTLCKey              = []byte{0x01} // prefix for HTLC
	HTLCExpiredQueueKey  = []byte{0x02} // prefix for the HTLC expiration queue
	AssetSupplyPrefix    = []byte{0x03} // prefix for the HTLT supply
	PreviousBlockTimeKey = []byte{0x04} // prefix for the HTLT supply previous block time
)
View Source
var (
	KeyAssetParams = []byte("AssetParams") // asset params key

	DefaultPreviousBlockTime = time.Now()
)

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 (
	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 HTLCState_name = map[int32]string{
	0: "HTLC_STATE_OPEN",
	1: "HTLC_STATE_COMPLETED",
	2: "HTLC_STATE_REFUNDED",
}
View Source
var HTLCState_value = map[string]int32{
	"HTLC_STATE_OPEN":      0,
	"HTLC_STATE_COMPLETED": 1,
	"HTLC_STATE_REFUNDED":  2,
}
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

ModuleCdc defines the module codec

Functions

func GetAssetSupplyKey

func GetAssetSupplyKey(denom string) []byte

GetAssetSupplyKey returns the key prefix for the asset supply by the given denom

func GetHTLCExpiredQueueKey

func GetHTLCExpiredQueueKey(expirationHeight uint64, id []byte) []byte

GetHTLCExpiredQueueKey returns the key for the HTLC expiration queue by the specified height and hash lock VALUE: []byte{}

func GetHTLCExpiredQueueSubspace

func GetHTLCExpiredQueueSubspace(expirationHeight uint64) []byte

GetHTLCExpiredQueueSubspace returns the key prefix for the HTLC expiration queue by the given height

func GetHTLCKey

func GetHTLCKey(id []byte) []byte

GetHTLCKey returns the key for the HTLC with the specified hash lock VALUE: htlc/HTLC

func GetHashLock

func GetHashLock(secret tmbytes.HexBytes, timestamp uint64) []byte

GetHashLock calculates the hash lock from the given secret and timestamp

func GetID

func GetID(
	sender sdk.AccAddress,
	to sdk.AccAddress,
	amount sdk.Coins,
	hashLock tmbytes.HexBytes,
) tmbytes.HexBytes

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the TypeTable for coinswap module

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

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 ValidateAmount

func ValidateAmount(amount sdk.Coins) error

ValidateAmount verifies whether the given amount is legal

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the provided HTLC genesis state to ensure the expected invariants holds.

func ValidateHashLock

func ValidateHashLock(hashLock string) error

ValidateHashLock verifies whether the given hash lock is legal

func ValidateID

func ValidateID(id string) error

ValidateID verifies whether the given ID lock is legal

func ValidateSecret

func ValidateSecret(secret string) error

ValidateSecret verifies whether the given secret is legal

func ValidateTimeLock

func ValidateTimeLock(timeLock uint64) error

ValidateTimeLock verifies whether the given time lock is legal

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	SetAccount(ctx sdk.Context, acc authtypes.AccountI)
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI
	SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI)
	GetModuleAddressAndPermissions(moduleName string) (sdk.AccAddress, []string)
}

AccountKeeper defines the expected account keeper (noalias)

type AssetParam

type AssetParam struct {
	Denom         string                                 `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	SupplyLimit   SupplyLimit                            `protobuf:"bytes,2,opt,name=supply_limit,json=supplyLimit,proto3" json:"supply_limit" yaml:"supply_limit"`
	Active        bool                                   `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"`
	DeputyAddress string                                 `protobuf:"bytes,4,opt,name=deputy_address,json=deputyAddress,proto3" json:"deputy_address,omitempty" yaml:"deputy_address"`
	FixedFee      github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=fixed_fee,json=fixedFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fixed_fee"`
	MinSwapAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 142-byte string literal not displayed */
	MaxSwapAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 142-byte string literal not displayed */
	MinBlockLock  uint64                                 `protobuf:"varint,8,opt,name=min_block_lock,json=minBlockLock,proto3" json:"min_block_lock,omitempty" yaml:"min_block_lock"`
	MaxBlockLock  uint64                                 `protobuf:"varint,9,opt,name=max_block_lock,json=maxBlockLock,proto3" json:"max_block_lock,omitempty" yaml:"max_block_lock"`
}

func NewAssetParam

func NewAssetParam(
	denom string, coinID int, limit SupplyLimit, active bool,
	deputyAddr string, fixedFee math.Int, minSwapAmount math.Int,
	maxSwapAmount math.Int, minBlockLock uint64, maxBlockLock uint64,
) AssetParam

func (*AssetParam) Descriptor

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

func (*AssetParam) Equal

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

func (*AssetParam) Marshal

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

func (*AssetParam) MarshalTo

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

func (*AssetParam) MarshalToSizedBuffer

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

func (*AssetParam) ProtoMessage

func (*AssetParam) ProtoMessage()

func (*AssetParam) Reset

func (m *AssetParam) Reset()

func (*AssetParam) Size

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

func (AssetParam) String

func (p AssetParam) String() string

String returns a human readable string representation of the parameters.

func (*AssetParam) Unmarshal

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

func (*AssetParam) XXX_DiscardUnknown

func (m *AssetParam) XXX_DiscardUnknown()

func (*AssetParam) XXX_Marshal

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

func (*AssetParam) XXX_Merge

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

func (*AssetParam) XXX_Size

func (m *AssetParam) XXX_Size() int

func (*AssetParam) XXX_Unmarshal

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

type AssetSupply

type AssetSupply struct {
	IncomingSupply           types.Coin    `protobuf:"bytes,1,opt,name=incoming_supply,json=incomingSupply,proto3" json:"incoming_supply" yaml:"incoming_supply"`
	OutgoingSupply           types.Coin    `` /* 128-byte string literal not displayed */
	CurrentSupply            types.Coin    `protobuf:"bytes,3,opt,name=current_supply,json=currentSupply,proto3" json:"current_supply" yaml:"current_supply"`
	TimeLimitedCurrentSupply types.Coin    `` /* 162-byte string literal not displayed */
	TimeElapsed              time.Duration `protobuf:"bytes,5,opt,name=time_elapsed,json=timeElapsed,proto3,stdduration" json:"time_elapsed" yaml:"time_elapsed"`
}

func DefaultAssetSupplies

func DefaultAssetSupplies() []AssetSupply

DefaultAssetSupplies gets the raw asset supplies for testing

func NewAssetSupply

func NewAssetSupply(
	incomingSupply sdk.Coin,
	outgoingSupply sdk.Coin,
	currentSupply sdk.Coin,
	timeLimitedCurrentSupply sdk.Coin,
	timeElapsed time.Duration,
) AssetSupply

NewAssetSupply constructs a new AssetSupply instance

func (*AssetSupply) Descriptor

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

func (*AssetSupply) Marshal

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

func (*AssetSupply) MarshalTo

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

func (*AssetSupply) MarshalToSizedBuffer

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

func (*AssetSupply) ProtoMessage

func (*AssetSupply) ProtoMessage()

func (*AssetSupply) Reset

func (m *AssetSupply) Reset()

func (*AssetSupply) Size

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

func (*AssetSupply) String

func (m *AssetSupply) String() string

func (*AssetSupply) Unmarshal

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

func (AssetSupply) Validate

func (a AssetSupply) Validate() error

Validate performs a basic validation of an asset supply fields.

func (*AssetSupply) XXX_DiscardUnknown

func (m *AssetSupply) XXX_DiscardUnknown()

func (*AssetSupply) XXX_Marshal

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

func (*AssetSupply) XXX_Merge

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

func (*AssetSupply) XXX_Size

func (m *AssetSupply) XXX_Size() int

func (*AssetSupply) XXX_Unmarshal

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

type BankKeeper

type BankKeeper interface {
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error

	GetSupply(ctx sdk.Context, denom string) sdk.Coin
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin

	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
	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected bank keeper (noalias)

type GenesisState

type GenesisState struct {
	Params            Params        `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Htlcs             []HTLC        `protobuf:"bytes,2,rep,name=htlcs,proto3" json:"htlcs"`
	Supplies          []AssetSupply `protobuf:"bytes,3,rep,name=supplies,proto3" json:"supplies"`
	PreviousBlockTime time.Time     `` /* 139-byte string literal not displayed */
}

GenesisState defines the HTLC module's genesis state

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState gets the raw genesis message for testing

func NewGenesisState

func NewGenesisState(params Params, htlcs []HTLC, Supplies []AssetSupply, previousBlockTime time.Time) *GenesisState

NewGenesisState constructs a new GenesisState instance

func (*GenesisState) Descriptor

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

func (*GenesisState) GetHtlcs

func (m *GenesisState) GetHtlcs() []HTLC

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPreviousBlockTime

func (m *GenesisState) GetPreviousBlockTime() time.Time

func (*GenesisState) GetSupplies

func (m *GenesisState) GetSupplies() []AssetSupply

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 HTLC

type HTLC struct {
	Id               string                                   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Sender           string                                   `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
	To               string                                   `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`
	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"`
	HashLock         string                                   `protobuf:"bytes,5,opt,name=hash_lock,json=hashLock,proto3" json:"hash_lock,omitempty" yaml:"hash_lock"`
	Secret           string                                   `protobuf:"bytes,6,opt,name=secret,proto3" json:"secret,omitempty"`
	Timestamp        uint64                                   `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	ExpirationHeight uint64                                   `` /* 135-byte string literal not displayed */
	State            HTLCState                                `protobuf:"varint,9,opt,name=state,proto3,enum=nucleus.htlc.HTLCState" json:"state,omitempty"`
	ClosedBlock      uint64                                   `protobuf:"varint,10,opt,name=closed_block,json=closedBlock,proto3" json:"closed_block,omitempty" yaml:"closed_block"`
}

HTLC defines the struct of an HTLC

func NewHTLC

func NewHTLC(
	id tmbytes.HexBytes,
	sender sdk.AccAddress,
	to sdk.AccAddress,
	amount sdk.Coins,
	hashLock tmbytes.HexBytes,
	secret tmbytes.HexBytes,
	timestamp uint64,
	expirationHeight uint64,
	state HTLCState,
	closedBlock uint64,
) HTLC

NewHTLC constructs a new HTLC instance

func (*HTLC) Descriptor

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

func (*HTLC) Equal

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

func (*HTLC) Marshal

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

func (*HTLC) MarshalTo

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

func (*HTLC) MarshalToSizedBuffer

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

func (*HTLC) ProtoMessage

func (*HTLC) ProtoMessage()

func (*HTLC) Reset

func (m *HTLC) Reset()

func (*HTLC) Size

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

func (*HTLC) String

func (m *HTLC) String() string

func (*HTLC) Unmarshal

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

func (HTLC) Validate

func (h HTLC) Validate() error

Validate validates the HTLC

func (*HTLC) XXX_DiscardUnknown

func (m *HTLC) XXX_DiscardUnknown()

func (*HTLC) XXX_Marshal

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

func (*HTLC) XXX_Merge

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

func (*HTLC) XXX_Size

func (m *HTLC) XXX_Size() int

func (*HTLC) XXX_Unmarshal

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

type HTLCState

type HTLCState int32

HTLCState defines the state of an HTLC

const (
	// HTLC_STATE_OPEN defines an open state.
	Open HTLCState = 0
	// HTLC_STATE_COMPLETED defines a completed state.
	Completed HTLCState = 1
	// HTLC_STATE_REFUNDED defines a refunded state.
	Refunded HTLCState = 2
)

func (HTLCState) EnumDescriptor

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

func (HTLCState) String

func (x HTLCState) String() string

type MsgClaimHTLC

type MsgClaimHTLC struct {
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Id     string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" yaml:"id"`
	Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"`
}

MsgClaimHTLC defines a message to claim an HTLC

func NewMsgClaimHTLC

func NewMsgClaimHTLC(
	sender string,
	id string,
	secret string,
) MsgClaimHTLC

NewMsgClaimHTLC constructs a new MsgClaimHTLC instance

func (*MsgClaimHTLC) Descriptor

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

func (*MsgClaimHTLC) Equal

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

func (MsgClaimHTLC) GetSignBytes

func (msg MsgClaimHTLC) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgClaimHTLC) GetSigners

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

GetSigners implements Msg

func (*MsgClaimHTLC) Marshal

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

func (*MsgClaimHTLC) MarshalTo

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

func (*MsgClaimHTLC) MarshalToSizedBuffer

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

func (*MsgClaimHTLC) ProtoMessage

func (*MsgClaimHTLC) ProtoMessage()

func (*MsgClaimHTLC) Reset

func (m *MsgClaimHTLC) Reset()

func (MsgClaimHTLC) Route

func (msg MsgClaimHTLC) Route() string

Route implements Msg

func (*MsgClaimHTLC) Size

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

func (*MsgClaimHTLC) String

func (m *MsgClaimHTLC) String() string

func (MsgClaimHTLC) Type

func (msg MsgClaimHTLC) Type() string

Type implements Msg

func (*MsgClaimHTLC) Unmarshal

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

func (MsgClaimHTLC) ValidateBasic

func (msg MsgClaimHTLC) ValidateBasic() error

ValidateBasic implements Msg.

func (*MsgClaimHTLC) XXX_DiscardUnknown

func (m *MsgClaimHTLC) XXX_DiscardUnknown()

func (*MsgClaimHTLC) XXX_Marshal

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

func (*MsgClaimHTLC) XXX_Merge

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

func (*MsgClaimHTLC) XXX_Size

func (m *MsgClaimHTLC) XXX_Size() int

func (*MsgClaimHTLC) XXX_Unmarshal

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

type MsgClaimHTLCResponse

type MsgClaimHTLCResponse struct {
}

MsgClaimHTLCResponse defines the Msg/ClaimHTLC response type

func (*MsgClaimHTLCResponse) Descriptor

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

func (*MsgClaimHTLCResponse) Marshal

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

func (*MsgClaimHTLCResponse) MarshalTo

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

func (*MsgClaimHTLCResponse) MarshalToSizedBuffer

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

func (*MsgClaimHTLCResponse) ProtoMessage

func (*MsgClaimHTLCResponse) ProtoMessage()

func (*MsgClaimHTLCResponse) Reset

func (m *MsgClaimHTLCResponse) Reset()

func (*MsgClaimHTLCResponse) Size

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

func (*MsgClaimHTLCResponse) String

func (m *MsgClaimHTLCResponse) String() string

func (*MsgClaimHTLCResponse) Unmarshal

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

func (*MsgClaimHTLCResponse) XXX_DiscardUnknown

func (m *MsgClaimHTLCResponse) XXX_DiscardUnknown()

func (*MsgClaimHTLCResponse) XXX_Marshal

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

func (*MsgClaimHTLCResponse) XXX_Merge

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

func (*MsgClaimHTLCResponse) XXX_Size

func (m *MsgClaimHTLCResponse) XXX_Size() int

func (*MsgClaimHTLCResponse) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	// CreateHTLC defines a method for creating a HTLC
	CreateHTLC(ctx context.Context, in *MsgCreateHTLC, opts ...grpc.CallOption) (*MsgCreateHTLCResponse, error)
	// ClaimHTLC defines a method for claiming a HTLC
	ClaimHTLC(ctx context.Context, in *MsgClaimHTLC, opts ...grpc.CallOption) (*MsgClaimHTLCResponse, 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 MsgCreateHTLC

type MsgCreateHTLC struct {
	Sender    string                                   `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	To        string                                   `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	Amount    github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
	HashLock  string                                   `protobuf:"bytes,4,opt,name=hash_lock,json=hashLock,proto3" json:"hash_lock,omitempty" yaml:"hash_lock"`
	Timestamp uint64                                   `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	TimeLock  uint64                                   `protobuf:"varint,6,opt,name=time_lock,json=timeLock,proto3" json:"time_lock,omitempty" yaml:"time_lock"`
}

MsgCreateHTLC defines a message to create an HTLC

func NewMsgCreateHTLC

func NewMsgCreateHTLC(
	sender string,
	to string,
	amount sdk.Coins,
	hashLock string,
	timestamp uint64,
	timeLock uint64,
) MsgCreateHTLC

NewMsgCreateHTLC creates a new MsgCreateHTLC instance

func (*MsgCreateHTLC) Descriptor

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

func (*MsgCreateHTLC) Equal

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

func (MsgCreateHTLC) GetSignBytes

func (msg MsgCreateHTLC) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgCreateHTLC) GetSigners

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

GetSigners implements Msg

func (*MsgCreateHTLC) Marshal

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

func (*MsgCreateHTLC) MarshalTo

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

func (*MsgCreateHTLC) MarshalToSizedBuffer

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

func (*MsgCreateHTLC) ProtoMessage

func (*MsgCreateHTLC) ProtoMessage()

func (*MsgCreateHTLC) Reset

func (m *MsgCreateHTLC) Reset()

func (MsgCreateHTLC) Route

func (msg MsgCreateHTLC) Route() string

Route implements Msg

func (*MsgCreateHTLC) Size

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

func (*MsgCreateHTLC) String

func (m *MsgCreateHTLC) String() string

func (MsgCreateHTLC) Type

func (msg MsgCreateHTLC) Type() string

Type implements Msg

func (*MsgCreateHTLC) Unmarshal

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

func (MsgCreateHTLC) ValidateBasic

func (msg MsgCreateHTLC) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgCreateHTLC) XXX_DiscardUnknown

func (m *MsgCreateHTLC) XXX_DiscardUnknown()

func (*MsgCreateHTLC) XXX_Marshal

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

func (*MsgCreateHTLC) XXX_Merge

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

func (*MsgCreateHTLC) XXX_Size

func (m *MsgCreateHTLC) XXX_Size() int

func (*MsgCreateHTLC) XXX_Unmarshal

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

type MsgCreateHTLCResponse

type MsgCreateHTLCResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}

MsgCreateHTLCResponse defines the Msg/CreateHTLC response type

func (*MsgCreateHTLCResponse) Descriptor

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

func (*MsgCreateHTLCResponse) Marshal

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

func (*MsgCreateHTLCResponse) MarshalTo

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

func (*MsgCreateHTLCResponse) MarshalToSizedBuffer

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

func (*MsgCreateHTLCResponse) ProtoMessage

func (*MsgCreateHTLCResponse) ProtoMessage()

func (*MsgCreateHTLCResponse) Reset

func (m *MsgCreateHTLCResponse) Reset()

func (*MsgCreateHTLCResponse) Size

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

func (*MsgCreateHTLCResponse) String

func (m *MsgCreateHTLCResponse) String() string

func (*MsgCreateHTLCResponse) Unmarshal

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

func (*MsgCreateHTLCResponse) XXX_DiscardUnknown

func (m *MsgCreateHTLCResponse) XXX_DiscardUnknown()

func (*MsgCreateHTLCResponse) XXX_Marshal

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

func (*MsgCreateHTLCResponse) XXX_Merge

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

func (*MsgCreateHTLCResponse) XXX_Size

func (m *MsgCreateHTLCResponse) XXX_Size() int

func (*MsgCreateHTLCResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// CreateHTLC defines a method for creating a HTLC
	CreateHTLC(context.Context, *MsgCreateHTLC) (*MsgCreateHTLCResponse, error)
	// ClaimHTLC defines a method for claiming a HTLC
	ClaimHTLC(context.Context, *MsgClaimHTLC) (*MsgClaimHTLCResponse, error)
}

MsgServer is the server API for Msg service.

type Params

type Params struct {
	AssetParams []AssetParam `protobuf:"bytes,1,rep,name=asset_params,json=assetParams,proto3" json:"asset_params" yaml:"asset_params"`
}

Params defines token module's parameters

func DefaultParams

func DefaultParams() Params

DefaultParams returns the default coinswap module parameters

func NewParams

func NewParams(assetParams []AssetParam) Params

NewParams is the HTLC params constructor

func (*Params) Descriptor

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

func (*Params) Equal

func (this *Params) Equal(that interface{}) 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

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 returns err if Params is invalid

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 QueryAssetSuppliesRequest

type QueryAssetSuppliesRequest struct {
}

QueryAssetSuppliesRequest is request type for the Query/AssetSupplies RPC method

func (*QueryAssetSuppliesRequest) Descriptor

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

func (*QueryAssetSuppliesRequest) Marshal

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

func (*QueryAssetSuppliesRequest) MarshalTo

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

func (*QueryAssetSuppliesRequest) MarshalToSizedBuffer

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

func (*QueryAssetSuppliesRequest) ProtoMessage

func (*QueryAssetSuppliesRequest) ProtoMessage()

func (*QueryAssetSuppliesRequest) Reset

func (m *QueryAssetSuppliesRequest) Reset()

func (*QueryAssetSuppliesRequest) Size

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

func (*QueryAssetSuppliesRequest) String

func (m *QueryAssetSuppliesRequest) String() string

func (*QueryAssetSuppliesRequest) Unmarshal

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

func (*QueryAssetSuppliesRequest) XXX_DiscardUnknown

func (m *QueryAssetSuppliesRequest) XXX_DiscardUnknown()

func (*QueryAssetSuppliesRequest) XXX_Marshal

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

func (*QueryAssetSuppliesRequest) XXX_Merge

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

func (*QueryAssetSuppliesRequest) XXX_Size

func (m *QueryAssetSuppliesRequest) XXX_Size() int

func (*QueryAssetSuppliesRequest) XXX_Unmarshal

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

type QueryAssetSuppliesResponse

type QueryAssetSuppliesResponse struct {
	AssetSupplies []AssetSupply `protobuf:"bytes,1,rep,name=asset_supplies,json=assetSupplies,proto3" json:"asset_supplies" yaml:"asset_supplies"`
}

QueryAssetSuppliesResponse is response type for the Query/AssetSupplies RPC method

func (*QueryAssetSuppliesResponse) Descriptor

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

func (*QueryAssetSuppliesResponse) GetAssetSupplies

func (m *QueryAssetSuppliesResponse) GetAssetSupplies() []AssetSupply

func (*QueryAssetSuppliesResponse) Marshal

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

func (*QueryAssetSuppliesResponse) MarshalTo

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

func (*QueryAssetSuppliesResponse) MarshalToSizedBuffer

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

func (*QueryAssetSuppliesResponse) ProtoMessage

func (*QueryAssetSuppliesResponse) ProtoMessage()

func (*QueryAssetSuppliesResponse) Reset

func (m *QueryAssetSuppliesResponse) Reset()

func (*QueryAssetSuppliesResponse) Size

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

func (*QueryAssetSuppliesResponse) String

func (m *QueryAssetSuppliesResponse) String() string

func (*QueryAssetSuppliesResponse) Unmarshal

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

func (*QueryAssetSuppliesResponse) XXX_DiscardUnknown

func (m *QueryAssetSuppliesResponse) XXX_DiscardUnknown()

func (*QueryAssetSuppliesResponse) XXX_Marshal

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

func (*QueryAssetSuppliesResponse) XXX_Merge

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

func (*QueryAssetSuppliesResponse) XXX_Size

func (m *QueryAssetSuppliesResponse) XXX_Size() int

func (*QueryAssetSuppliesResponse) XXX_Unmarshal

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

type QueryAssetSupplyParams

type QueryAssetSupplyParams struct {
	Denom string
}

type QueryAssetSupplyRequest

type QueryAssetSupplyRequest struct {
	Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
}

QueryAssetSupplyRequest is request type for the Query/AssetSupply RPC method

func (*QueryAssetSupplyRequest) Descriptor

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

func (*QueryAssetSupplyRequest) GetDenom

func (m *QueryAssetSupplyRequest) GetDenom() string

func (*QueryAssetSupplyRequest) Marshal

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

func (*QueryAssetSupplyRequest) MarshalTo

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

func (*QueryAssetSupplyRequest) MarshalToSizedBuffer

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

func (*QueryAssetSupplyRequest) ProtoMessage

func (*QueryAssetSupplyRequest) ProtoMessage()

func (*QueryAssetSupplyRequest) Reset

func (m *QueryAssetSupplyRequest) Reset()

func (*QueryAssetSupplyRequest) Size

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

func (*QueryAssetSupplyRequest) String

func (m *QueryAssetSupplyRequest) String() string

func (*QueryAssetSupplyRequest) Unmarshal

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

func (*QueryAssetSupplyRequest) XXX_DiscardUnknown

func (m *QueryAssetSupplyRequest) XXX_DiscardUnknown()

func (*QueryAssetSupplyRequest) XXX_Marshal

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

func (*QueryAssetSupplyRequest) XXX_Merge

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

func (*QueryAssetSupplyRequest) XXX_Size

func (m *QueryAssetSupplyRequest) XXX_Size() int

func (*QueryAssetSupplyRequest) XXX_Unmarshal

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

type QueryAssetSupplyResponse

type QueryAssetSupplyResponse struct {
	AssetSupply *AssetSupply `protobuf:"bytes,1,opt,name=asset_supply,json=assetSupply,proto3" json:"asset_supply,omitempty" yaml:"asset_supply"`
}

QueryAssetSupplyResponse is response type for the Query/AssetSupply RPC method

func (*QueryAssetSupplyResponse) Descriptor

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

func (*QueryAssetSupplyResponse) GetAssetSupply

func (m *QueryAssetSupplyResponse) GetAssetSupply() *AssetSupply

func (*QueryAssetSupplyResponse) Marshal

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

func (*QueryAssetSupplyResponse) MarshalTo

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

func (*QueryAssetSupplyResponse) MarshalToSizedBuffer

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

func (*QueryAssetSupplyResponse) ProtoMessage

func (*QueryAssetSupplyResponse) ProtoMessage()

func (*QueryAssetSupplyResponse) Reset

func (m *QueryAssetSupplyResponse) Reset()

func (*QueryAssetSupplyResponse) Size

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

func (*QueryAssetSupplyResponse) String

func (m *QueryAssetSupplyResponse) String() string

func (*QueryAssetSupplyResponse) Unmarshal

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

func (*QueryAssetSupplyResponse) XXX_DiscardUnknown

func (m *QueryAssetSupplyResponse) XXX_DiscardUnknown()

func (*QueryAssetSupplyResponse) XXX_Marshal

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

func (*QueryAssetSupplyResponse) XXX_Merge

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

func (*QueryAssetSupplyResponse) XXX_Size

func (m *QueryAssetSupplyResponse) XXX_Size() int

func (*QueryAssetSupplyResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// HTLC queries the HTLC by the specified hash lock
	HTLC(ctx context.Context, in *QueryHTLCRequest, opts ...grpc.CallOption) (*QueryHTLCResponse, error)
	// AssetSupply queries the supply of an asset
	AssetSupply(ctx context.Context, in *QueryAssetSupplyRequest, opts ...grpc.CallOption) (*QueryAssetSupplyResponse, error)
	// AssetSupplies queries the supplies of all assets
	AssetSupplies(ctx context.Context, in *QueryAssetSuppliesRequest, opts ...grpc.CallOption) (*QueryAssetSuppliesResponse, error)
	// Params queries the htlc parameters
	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 QueryHTLCParams

type QueryHTLCParams struct {
	ID tmbytes.HexBytes
}

QueryHTLCParams defines the params to query an HTLC

type QueryHTLCRequest

type QueryHTLCRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}

QueryHTLCRequest is the request type for the Query/HTLC RPC method

func (*QueryHTLCRequest) Descriptor

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

func (*QueryHTLCRequest) GetId

func (m *QueryHTLCRequest) GetId() string

func (*QueryHTLCRequest) Marshal

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

func (*QueryHTLCRequest) MarshalTo

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

func (*QueryHTLCRequest) MarshalToSizedBuffer

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

func (*QueryHTLCRequest) ProtoMessage

func (*QueryHTLCRequest) ProtoMessage()

func (*QueryHTLCRequest) Reset

func (m *QueryHTLCRequest) Reset()

func (*QueryHTLCRequest) Size

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

func (*QueryHTLCRequest) String

func (m *QueryHTLCRequest) String() string

func (*QueryHTLCRequest) Unmarshal

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

func (*QueryHTLCRequest) XXX_DiscardUnknown

func (m *QueryHTLCRequest) XXX_DiscardUnknown()

func (*QueryHTLCRequest) XXX_Marshal

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

func (*QueryHTLCRequest) XXX_Merge

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

func (*QueryHTLCRequest) XXX_Size

func (m *QueryHTLCRequest) XXX_Size() int

func (*QueryHTLCRequest) XXX_Unmarshal

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

type QueryHTLCResponse

type QueryHTLCResponse struct {
	Htlc *HTLC `protobuf:"bytes,1,opt,name=htlc,proto3" json:"htlc,omitempty"`
}

QueryBalanceResponse is the response type for the Query/HTLC RPC method

func (*QueryHTLCResponse) Descriptor

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

func (*QueryHTLCResponse) GetHtlc

func (m *QueryHTLCResponse) GetHtlc() *HTLC

func (*QueryHTLCResponse) Marshal

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

func (*QueryHTLCResponse) MarshalTo

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

func (*QueryHTLCResponse) MarshalToSizedBuffer

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

func (*QueryHTLCResponse) ProtoMessage

func (*QueryHTLCResponse) ProtoMessage()

func (*QueryHTLCResponse) Reset

func (m *QueryHTLCResponse) Reset()

func (*QueryHTLCResponse) Size

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

func (*QueryHTLCResponse) String

func (m *QueryHTLCResponse) String() string

func (*QueryHTLCResponse) Unmarshal

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

func (*QueryHTLCResponse) XXX_DiscardUnknown

func (m *QueryHTLCResponse) XXX_DiscardUnknown()

func (*QueryHTLCResponse) XXX_Marshal

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

func (*QueryHTLCResponse) XXX_Merge

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

func (*QueryHTLCResponse) XXX_Size

func (m *QueryHTLCResponse) XXX_Size() int

func (*QueryHTLCResponse) XXX_Unmarshal

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

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is request type for the Query/Parameters 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 response type for the Query/Parameters 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 {
	// HTLC queries the HTLC by the specified hash lock
	HTLC(context.Context, *QueryHTLCRequest) (*QueryHTLCResponse, error)
	// AssetSupply queries the supply of an asset
	AssetSupply(context.Context, *QueryAssetSupplyRequest) (*QueryAssetSupplyResponse, error)
	// AssetSupplies queries the supplies of all assets
	AssetSupplies(context.Context, *QueryAssetSuppliesRequest) (*QueryAssetSuppliesResponse, error)
	// Params queries the htlc parameters
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type SupplyLimit

type SupplyLimit struct {
	Limit          github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=limit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"limit"`
	TimeLimited    bool                                   `protobuf:"varint,2,opt,name=time_limited,json=timeLimited,proto3" json:"time_limited,omitempty" yaml:"time_limited"`
	TimePeriod     time.Duration                          `protobuf:"bytes,3,opt,name=time_period,json=timePeriod,proto3,stdduration" json:"time_period" yaml:"time_period"`
	TimeBasedLimit github_com_cosmos_cosmos_sdk_types.Int `` /* 145-byte string literal not displayed */
}

func (*SupplyLimit) Descriptor

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

func (*SupplyLimit) Equal

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

func (*SupplyLimit) Marshal

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

func (*SupplyLimit) MarshalTo

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

func (*SupplyLimit) MarshalToSizedBuffer

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

func (*SupplyLimit) ProtoMessage

func (*SupplyLimit) ProtoMessage()

func (*SupplyLimit) Reset

func (m *SupplyLimit) Reset()

func (*SupplyLimit) Size

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

func (SupplyLimit) String

func (p SupplyLimit) String() string

String returns a human readable string representation of the parameters.

func (*SupplyLimit) Unmarshal

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

func (*SupplyLimit) XXX_DiscardUnknown

func (m *SupplyLimit) XXX_DiscardUnknown()

func (*SupplyLimit) XXX_Marshal

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

func (*SupplyLimit) XXX_Merge

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

func (*SupplyLimit) XXX_Size

func (m *SupplyLimit) XXX_Size() int

func (*SupplyLimit) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) ClaimHTLC

func (*UnimplementedMsgServer) CreateHTLC

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) AssetSupplies

func (*UnimplementedQueryServer) AssetSupply

func (*UnimplementedQueryServer) HTLC

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

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