types

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 29 Imported by: 36

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"
	EventTypeHTLCExpired = "htlc_expired"

	AttributeValueCategory = ModuleName

	AttributeKeySender               = "sender"
	AttributeKeyReceiver             = "receiver"
	AttributeKeyReceiverOnOtherChain = "receiver_on_other_chain"
	AttributeKeyAmount               = "amount"
	AttributeKeyHashLock             = "hash_lock"
	AttributeKeyTimeLock             = "time_lock"
	AttributeKeySecret               = "secret"
)

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
)
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 (
	// SecretLength ength for the secret in hex string
	SecretLength = 64
	// HashLockLength for the hash lock in hex string
	HashLockLength = 64
	// MaxLengthForAddressOnOtherChain length for the address on other chains
	MaxLengthForAddressOnOtherChain = 128
	// MinTimeLock time span for HTLC
	MinTimeLock = 50
	// MaxTimeLock time span for HTLC
	MaxTimeLock = 25480
)
View Source
const (
	QueryHTLC = "htlc" // query an HTLC
)

Variables

View Source
var (
	ErrInvalidHashLock = sdkerrors.Register(ModuleName, 2, "invalid hash lock")
	ErrInvalidTimeLock = sdkerrors.Register(ModuleName, 3, "invalid time lock")
	ErrInvalidSecret   = sdkerrors.Register(ModuleName, 4, "invalid secret")
	ErrHTLCExists      = sdkerrors.Register(ModuleName, 5, "htlc already exists")
	ErrUnknownHTLC     = sdkerrors.Register(ModuleName, 6, "unknown htlc")
	ErrHTLCNotOpen     = sdkerrors.Register(ModuleName, 7, "htlc not open")
	ErrHTLCNotExpired  = sdkerrors.Register(ModuleName, 8, "htlc not expired")
)

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

ModuleCdc defines the module codec

Functions

func GetHTLCExpiredQueueKey

func GetHTLCExpiredQueueKey(expirationHeight uint64, hashLock []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(hashLock []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 RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func RegisterMsgServer added in v1.2.0

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 ValidateAmount added in v1.2.1

func ValidateAmount(amount sdk.Coins) error

ValidateAmount verifies whether the parameters are legal

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

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

func ValidateHashLock added in v1.2.1

func ValidateHashLock(hashLock string) error

ValidateHashLock verifies whether the parameters are legal

func ValidateReceiverOnOtherChain added in v1.2.1

func ValidateReceiverOnOtherChain(receiverOnOtherChain string) error

ValidateReceiverOnOtherChain verifies whether the parameters are legal

func ValidateSecret added in v1.2.1

func ValidateSecret(secret string) error

ValidateSecret verifies whether the parameters are legal

func ValidateTimeLock added in v1.2.1

func ValidateTimeLock(timeLock uint64) error

ValidateTimeLock verifies whether the parameters are legal

Types

type AccountKeeper

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

AccountKeeper defines the expected account keeper (noalias)

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) (supply bank.SupplyI)
	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 for module accounts (noalias)

type GenesisState

type GenesisState struct {
	PendingHtlcs map[string]HTLC `` /* 175-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(pendingHtlcs map[string]HTLC) GenesisState

NewGenesisState constructs a new GenesisState instance

func (*GenesisState) Descriptor

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

func (*GenesisState) GetPendingHtlcs

func (m *GenesisState) GetPendingHtlcs() map[string]HTLC

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 {
	Sender               string                                   `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	To                   string                                   `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	ReceiverOnOtherChain string                                   `` /* 156-byte string literal not displayed */
	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"`
	Secret               string                                   `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"`
	Timestamp            uint64                                   `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	ExpirationHeight     uint64                                   `` /* 135-byte string literal not displayed */
	State                HTLCState                                `protobuf:"varint,8,opt,name=state,proto3,enum=irismod.htlc.HTLCState" json:"state,omitempty"`
}

HTLC defines a struct for an HTLC

func NewHTLC

func NewHTLC(
	sender sdk.AccAddress,
	to sdk.AccAddress,
	receiverOnOtherChain string,
	amount sdk.Coins,
	secret tmbytes.HexBytes,
	timestamp uint64,
	expirationHeight uint64,
	state HTLCState,
) 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 a state for 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_EXPIRED defines an expired state.
	Expired HTLCState = 2
	// HTLC_STATE_REFUNDED defines a refunded state.
	Refunded HTLCState = 3
)

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"`
	HashLock string `protobuf:"bytes,2,opt,name=hash_lock,json=hashLock,proto3" json:"hash_lock,omitempty" yaml:"hash_lock"`
	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,
	hashLock 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 added in v1.2.0

type MsgClaimHTLCResponse struct {
}

MsgClaimHTLCResponse defines the Msg/ClaimHTLC response type.

func (*MsgClaimHTLCResponse) Descriptor added in v1.2.0

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

func (*MsgClaimHTLCResponse) Marshal added in v1.2.0

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

func (*MsgClaimHTLCResponse) MarshalTo added in v1.2.0

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

func (*MsgClaimHTLCResponse) MarshalToSizedBuffer added in v1.2.0

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

func (*MsgClaimHTLCResponse) ProtoMessage added in v1.2.0

func (*MsgClaimHTLCResponse) ProtoMessage()

func (*MsgClaimHTLCResponse) Reset added in v1.2.0

func (m *MsgClaimHTLCResponse) Reset()

func (*MsgClaimHTLCResponse) Size added in v1.2.0

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

func (*MsgClaimHTLCResponse) String added in v1.2.0

func (m *MsgClaimHTLCResponse) String() string

func (*MsgClaimHTLCResponse) Unmarshal added in v1.2.0

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

func (*MsgClaimHTLCResponse) XXX_DiscardUnknown added in v1.2.0

func (m *MsgClaimHTLCResponse) XXX_DiscardUnknown()

func (*MsgClaimHTLCResponse) XXX_Marshal added in v1.2.0

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

func (*MsgClaimHTLCResponse) XXX_Merge added in v1.2.0

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

func (*MsgClaimHTLCResponse) XXX_Size added in v1.2.0

func (m *MsgClaimHTLCResponse) XXX_Size() int

func (*MsgClaimHTLCResponse) XXX_Unmarshal added in v1.2.0

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

type MsgClient added in v1.2.0

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)
	// RefundHTLC defines a method for refunding a HTLC.
	RefundHTLC(ctx context.Context, in *MsgRefundHTLC, opts ...grpc.CallOption) (*MsgRefundHTLCResponse, error)
}

MsgClient is the client API for Msg service.

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

func NewMsgClient added in v1.2.0

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"`
	ReceiverOnOtherChain string                                   `` /* 156-byte string literal not displayed */
	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"`
	Timestamp            uint64                                   `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	TimeLock             uint64                                   `protobuf:"varint,7,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,
	receiverOnOtherChain 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 added in v1.2.0

type MsgCreateHTLCResponse struct {
}

MsgCreateHTLCResponse defines the Msg/CreateHTLC response type.

func (*MsgCreateHTLCResponse) Descriptor added in v1.2.0

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

func (*MsgCreateHTLCResponse) Marshal added in v1.2.0

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

func (*MsgCreateHTLCResponse) MarshalTo added in v1.2.0

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

func (*MsgCreateHTLCResponse) MarshalToSizedBuffer added in v1.2.0

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

func (*MsgCreateHTLCResponse) ProtoMessage added in v1.2.0

func (*MsgCreateHTLCResponse) ProtoMessage()

func (*MsgCreateHTLCResponse) Reset added in v1.2.0

func (m *MsgCreateHTLCResponse) Reset()

func (*MsgCreateHTLCResponse) Size added in v1.2.0

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

func (*MsgCreateHTLCResponse) String added in v1.2.0

func (m *MsgCreateHTLCResponse) String() string

func (*MsgCreateHTLCResponse) Unmarshal added in v1.2.0

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

func (*MsgCreateHTLCResponse) XXX_DiscardUnknown added in v1.2.0

func (m *MsgCreateHTLCResponse) XXX_DiscardUnknown()

func (*MsgCreateHTLCResponse) XXX_Marshal added in v1.2.0

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

func (*MsgCreateHTLCResponse) XXX_Merge added in v1.2.0

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

func (*MsgCreateHTLCResponse) XXX_Size added in v1.2.0

func (m *MsgCreateHTLCResponse) XXX_Size() int

func (*MsgCreateHTLCResponse) XXX_Unmarshal added in v1.2.0

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

type MsgRefundHTLC

type MsgRefundHTLC struct {
	Sender   string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	HashLock string `protobuf:"bytes,2,opt,name=hash_lock,json=hashLock,proto3" json:"hash_lock,omitempty" yaml:"hash_lock"`
}

MsgRefundHTLC defines a message to refund an HTLC

func NewMsgRefundHTLC

func NewMsgRefundHTLC(
	sender string,
	hashLock string,
) MsgRefundHTLC

NewMsgRefundHTLC constructs a new MsgRefundHTLC instance

func (*MsgRefundHTLC) Descriptor

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

func (*MsgRefundHTLC) Equal

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

func (MsgRefundHTLC) GetSignBytes

func (msg MsgRefundHTLC) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgRefundHTLC) GetSigners

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

GetSigners implements Msg

func (*MsgRefundHTLC) Marshal

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

func (*MsgRefundHTLC) MarshalTo

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

func (*MsgRefundHTLC) MarshalToSizedBuffer

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

func (*MsgRefundHTLC) ProtoMessage

func (*MsgRefundHTLC) ProtoMessage()

func (*MsgRefundHTLC) Reset

func (m *MsgRefundHTLC) Reset()

func (MsgRefundHTLC) Route

func (msg MsgRefundHTLC) Route() string

Route implements Msg

func (*MsgRefundHTLC) Size

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

func (*MsgRefundHTLC) String

func (m *MsgRefundHTLC) String() string

func (MsgRefundHTLC) Type

func (msg MsgRefundHTLC) Type() string

Type implements Msg

func (*MsgRefundHTLC) Unmarshal

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

func (MsgRefundHTLC) ValidateBasic

func (msg MsgRefundHTLC) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgRefundHTLC) XXX_DiscardUnknown

func (m *MsgRefundHTLC) XXX_DiscardUnknown()

func (*MsgRefundHTLC) XXX_Marshal

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

func (*MsgRefundHTLC) XXX_Merge

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

func (*MsgRefundHTLC) XXX_Size

func (m *MsgRefundHTLC) XXX_Size() int

func (*MsgRefundHTLC) XXX_Unmarshal

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

type MsgRefundHTLCResponse added in v1.2.0

type MsgRefundHTLCResponse struct {
}

MsgRefundHTLCResponse defines the Msg/RefundHTLC response type.

func (*MsgRefundHTLCResponse) Descriptor added in v1.2.0

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

func (*MsgRefundHTLCResponse) Marshal added in v1.2.0

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

func (*MsgRefundHTLCResponse) MarshalTo added in v1.2.0

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

func (*MsgRefundHTLCResponse) MarshalToSizedBuffer added in v1.2.0

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

func (*MsgRefundHTLCResponse) ProtoMessage added in v1.2.0

func (*MsgRefundHTLCResponse) ProtoMessage()

func (*MsgRefundHTLCResponse) Reset added in v1.2.0

func (m *MsgRefundHTLCResponse) Reset()

func (*MsgRefundHTLCResponse) Size added in v1.2.0

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

func (*MsgRefundHTLCResponse) String added in v1.2.0

func (m *MsgRefundHTLCResponse) String() string

func (*MsgRefundHTLCResponse) Unmarshal added in v1.2.0

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

func (*MsgRefundHTLCResponse) XXX_DiscardUnknown added in v1.2.0

func (m *MsgRefundHTLCResponse) XXX_DiscardUnknown()

func (*MsgRefundHTLCResponse) XXX_Marshal added in v1.2.0

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

func (*MsgRefundHTLCResponse) XXX_Merge added in v1.2.0

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

func (*MsgRefundHTLCResponse) XXX_Size added in v1.2.0

func (m *MsgRefundHTLCResponse) XXX_Size() int

func (*MsgRefundHTLCResponse) XXX_Unmarshal added in v1.2.0

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

type MsgServer added in v1.2.0

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)
	// RefundHTLC defines a method for refunding a HTLC.
	RefundHTLC(context.Context, *MsgRefundHTLC) (*MsgRefundHTLCResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// Balance queries the balance of a single coin for a single account
	HTLC(ctx context.Context, in *QueryHTLCRequest, opts ...grpc.CallOption) (*QueryHTLCResponse, 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 {
	HashLock tmbytes.HexBytes
}

QueryHTLCParams defines the params to query an HTLC

type QueryHTLCRequest

type QueryHTLCRequest struct {
	// address is the address to query balances for
	HashLock string `protobuf:"bytes,1,opt,name=hash_lock,json=hashLock,proto3" json:"hash_lock,omitempty"`
}

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

func (*QueryHTLCRequest) Descriptor

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

func (*QueryHTLCRequest) GetHashLock

func (m *QueryHTLCRequest) GetHashLock() 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 QueryServer

type QueryServer interface {
	// Balance queries the balance of a single coin for a single account
	HTLC(context.Context, *QueryHTLCRequest) (*QueryHTLCResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer added in v1.2.0

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) ClaimHTLC added in v1.2.0

func (*UnimplementedMsgServer) CreateHTLC added in v1.2.0

func (*UnimplementedMsgServer) RefundHTLC added in v1.2.0

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) HTLC

Jump to

Keyboard shortcuts

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