types

package
v4.0.0-...-1b6ca0a Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 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 (
	EventTypeTimeout      = "timeout"
	EventTypePacket       = "fungible_token_packet"
	EventTypeSwap         = "ibc_swap"
	EventTypeChannelClose = "channel_closed"

	AttributeType          = "type"
	AttributeData          = "data"
	AttributeMemo          = "memo"
	AttributeKeyAmount     = "amount"
	AttributeKeyAckSuccess = "success"
	AttributeKeyAck        = "acknowledgement"
	AttributeKeyAckError   = "error"
)

IBC transfer events

View Source
const (
	// ModuleName defines the IBC swap name
	ModuleName = "atomicswap"

	// Version defines the current version the IBC swap
	// module supports
	Version = "ics31-1"

	// PortID is the default port id that swap module binds to
	PortID = ModuleName

	// StoreKey is the store key string for IBC swap
	StoreKey = ModuleName

	// RouterKey is the message route for IBC swap
	RouterKey = ModuleName

	// QuerierRoute is the querier route for IBC swap
	QuerierRoute = ModuleName
)
View Source
const (
	TypeMsgMakeSwap   = "make_swap"
	TypeMsgTakeSwap   = "take_swap"
	TypeMsgCancelSwap = "cancel_swap"
)

msg types

View Source
const (
	DefaultSwapEnabled = true
	// DefaultMaxFeeRate is 0.0010
	DefaultMaxFeeRate = 10
)

Variables

View Source
var (

	// ModuleCdc references the global x/ibc-transfer module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	//
	// The actual codec used for serialization should be provided to x/ibc transfer and
	// defined at the application level.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())

	// AminoCdc is a amino codec created to support amino json compatible msgs.
	AminoCdc = codec.NewAminoCodec(amino)
)
View Source
var (
	ErrInvalidPacketTimeout        = sdkerrors.Register(ModuleName, 2, "invalid packet timeout")
	ErrInvalidDenomForTransfer     = sdkerrors.Register(ModuleName, 3, "invalid denomination for cross-chain transfer")
	ErrInvalidVersion              = sdkerrors.Register(ModuleName, 4, "invalid ICS31 version")
	ErrInvalidAmount               = sdkerrors.Register(ModuleName, 5, "invalid token amount")
	ErrTraceNotFound               = sdkerrors.Register(ModuleName, 6, "denomination trace not found")
	ErrSendDisabled                = sdkerrors.Register(ModuleName, 7, "swap from this chain are disabled")
	ErrReceiveDisabled             = sdkerrors.Register(ModuleName, 8, "swap to this chain are disabled")
	ErrMaxTransferChannels         = sdkerrors.Register(ModuleName, 9, "max transfer channels")
	ErrInvalidCodec                = sdkerrors.Register(ModuleName, 10, "codec is not supported")
	ErrUnknownDataPacket           = sdkerrors.Register(ModuleName, 11, "data packet is not supported")
	ErrOrderDoesNotExists          = sdkerrors.Register(ModuleName, 12, "Make Order does not exist")
	ErrOrderCanceled               = sdkerrors.Register(ModuleName, 13, "Order has been canceled")
	ErrOrderCompleted              = sdkerrors.Register(ModuleName, 14, "Order has completed already")
	ErrOrderDenominationMismatched = sdkerrors.Register(ModuleName, 15, "denomination are not matched")
	ErrOrderInsufficientAmount     = sdkerrors.Register(ModuleName, 16, "amount of taker token is insufficient")
	ErrOrderPermissionIsNotAllowed = sdkerrors.Register(ModuleName, 17, "sender is not the owner of the order")
)

IBC transfer 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 (
	// PortKey defines the key to store the port ID in store
	PortKey = []byte{0x01}
	// LimitOrderBookKey defines the key to store the denomination trace info in store
	LimitOrderBookKey = []byte{0x02}
	// OTCOrderBookKey defines the key to store the denomination trace info in store
	OTCOrderBookKey = []byte{0x03}
)
View Source
var (
	// DefaultRelativePacketTimeoutHeight is the default packet timeout height (in blocks) relative
	// to the current block height of the counterparty chain provided by the client state. The
	// timeout is disabled when set to 0.
	DefaultRelativePacketTimeoutHeight = "0-1000"

	// DefaultRelativePacketTimeoutTimestamp is the default packet timeout timestamp (in nanoseconds)
	// relative to the current block timestamp of the counterparty chain provided by the client
	// state. The timeout is disabled when set to 0. The default is currently set to a 10 minute
	// timeout.
	DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds())
)
View Source
var (
	ErrInvalidLengthPacket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPacket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPacket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeySwapEnabled    = []byte("SwapEnabled")
	KeySwapMaxFeeRate = []byte("MaxFeeRate")
)
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 (
	ErrInvalidLengthSwap        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSwap          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSwap = 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 FillStatus_name = map[int32]string{
	0: "NONE_FILL",
	1: "PARTIAL_FILL",
	2: "COMPLETE_FILL",
}
View Source
var FillStatus_value = map[string]int32{
	"NONE_FILL":     0,
	"PARTIAL_FILL":  1,
	"COMPLETE_FILL": 2,
}
View Source
var Msg_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ibc.applications.atomic_swap.v1.Msg",
	HandlerType: (*MsgServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "MakeSwap",
			Handler:    _Msg_MakeSwap_Handler,
		},
		{
			MethodName: "TakeSwap",
			Handler:    _Msg_TakeSwap_Handler,
		},
		{
			MethodName: "CancelSwap",
			Handler:    _Msg_CancelSwap_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ibc/applications/atomic_swap/v1/tx.proto",
}

Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Query_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ibc.applications.atomic_swap.v1.Query",
	HandlerType: (*QueryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Params",
			Handler:    _Query_Params_Handler,
		},
		{
			MethodName: "EscrowAddress",
			Handler:    _Query_EscrowAddress_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ibc/applications/atomic_swap/v1/query.proto",
}

Query_ServiceDesc is the grpc.ServiceDesc for Query service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Status_name = map[int32]string{
	0: "INITIAL",
	1: "SYNC",
	2: "CANCEL",
	3: "COMPLETE",
}
View Source
var Status_value = map[string]int32{
	"INITIAL":  0,
	"SYNC":     1,
	"CANCEL":   2,
	"COMPLETE": 3,
}
View Source
var SwapMessageType_name = map[int32]string{
	0: "TYPE_UNSPECIFIED",
	1: "TYPE_MSG_MAKE_SWAP",
	2: "TYPE_MSG_TAKE_SWAP",
	3: "TYPE_MSG_CANCEL_SWAP",
}
View Source
var SwapMessageType_value = map[string]int32{
	"TYPE_UNSPECIFIED":     0,
	"TYPE_MSG_MAKE_SWAP":   1,
	"TYPE_MSG_TAKE_SWAP":   2,
	"TYPE_MSG_CANCEL_SWAP": 3,
}

Functions

func GetDenomPrefix

func GetDenomPrefix(portID, channelID string) string

GetDenomPrefix returns the receiving denomination prefix

func GetEscrowAddress

func GetEscrowAddress(portID, channelID string) sdk.AccAddress

GetEscrowAddress returns the escrow address for the specified channel. The escrow address follows the format as outlined in ADR 028: https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-028-public-key-addresses.md

func GetPrefixedDenom

func GetPrefixedDenom(portID, channelID, baseDenom string) string

GetPrefixedDenom returns the denomination with the portID and channelID prefixed

func GetTransferCoin

func GetTransferCoin(portID, channelID, baseDenom string, amount sdk.Int) sdk.Coin

GetTransferCoin creates a transfer coin with the port ID and channel ID prefixed to the base denom.

func Hash

func Hash(content []byte) tmbytes.HexBytes

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable type declaration for parameters

func ReceiverChainIsSource

func ReceiverChainIsSource(sourcePort, sourceChannel, denom string) bool

ReceiverChainIsSource returns true if the denomination originally came from the receiving chain and false otherwise.

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the ibc transfer module interfaces to protobuf Any.

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

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

func RegisterMsgServer

func RegisterMsgServer(s grpc.ServiceRegistrar, 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 grpc.ServiceRegistrar, srv QueryServer)

func SenderChainIsSource

func SenderChainIsSource(sourcePort, sourceChannel, denom string) bool

SenderChainIsSource returns false if the denomination originally came from the receiving chain and true otherwise.

Types

type AccountKeeper

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

AccountKeeper defines the contract required for account APIs.

type AtomicSwapPacketData

type AtomicSwapPacketData struct {
	Type SwapMessageType `protobuf:"varint,1,opt,name=type,proto3,enum=ibc.applications.interchain_accounts.v1.SwapMessageType" json:"type,omitempty"`
	Data []byte          `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Memo string          `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"`
}

AtomicSwapPacketData is comprised of a raw transaction, type of transaction and optional memo field.

func NewAtomicSwapPacketData

func NewAtomicSwapPacketData(
	mType SwapMessageType,
	data []byte,
	memo string,
) AtomicSwapPacketData

NewAtomicSwapPacketData constructs a new AtomicSwapPacketData instance

func (*AtomicSwapPacketData) Descriptor

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

func (AtomicSwapPacketData) GetBytes

func (pd AtomicSwapPacketData) GetBytes() []byte

GetBytes is a helper for serialising

func (*AtomicSwapPacketData) GetData

func (m *AtomicSwapPacketData) GetData() []byte

func (*AtomicSwapPacketData) GetMemo

func (m *AtomicSwapPacketData) GetMemo() string

func (*AtomicSwapPacketData) GetType

func (*AtomicSwapPacketData) Marshal

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

func (*AtomicSwapPacketData) MarshalTo

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

func (*AtomicSwapPacketData) MarshalToSizedBuffer

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

func (*AtomicSwapPacketData) ProtoMessage

func (*AtomicSwapPacketData) ProtoMessage()

func (*AtomicSwapPacketData) Reset

func (m *AtomicSwapPacketData) Reset()

func (*AtomicSwapPacketData) Size

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

func (*AtomicSwapPacketData) String

func (m *AtomicSwapPacketData) String() string

func (*AtomicSwapPacketData) Unmarshal

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

func (AtomicSwapPacketData) ValidateBasic

func (pd AtomicSwapPacketData) ValidateBasic() error

ValidateBasic is used for validating the token swap.

func (*AtomicSwapPacketData) XXX_DiscardUnknown

func (m *AtomicSwapPacketData) XXX_DiscardUnknown()

func (*AtomicSwapPacketData) XXX_Marshal

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

func (*AtomicSwapPacketData) XXX_Merge

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

func (*AtomicSwapPacketData) XXX_Size

func (m *AtomicSwapPacketData) XXX_Size() int

func (*AtomicSwapPacketData) XXX_Unmarshal

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

type BankKeeper

type BankKeeper interface {
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, 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
	BlockedAddr(addr sdk.AccAddress) bool
}

BankKeeper defines the expected bank keeper

type ChannelKeeper

type ChannelKeeper interface {
	GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
	GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
}

ChannelKeeper defines the expected IBC channel keeper

type ClientKeeper

type ClientKeeper interface {
	GetClientConsensusState(ctx sdk.Context, clientID string) (connection ibcexported.ConsensusState, found bool)
}

ClientKeeper defines the expected IBC client keeper

type ConnectionKeeper

type ConnectionKeeper interface {
	GetConnection(ctx sdk.Context, connectionID string) (connection connectiontypes.ConnectionEnd, found bool)
}

ConnectionKeeper defines the expected IBC connection keeper

type FillStatus

type FillStatus int32
const (
	FillStatus_NONE_FILL     FillStatus = 0
	FillStatus_PARTIAL_FILL  FillStatus = 1
	FillStatus_COMPLETE_FILL FillStatus = 2
)

func (FillStatus) EnumDescriptor

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

func (FillStatus) String

func (x FillStatus) String() string

type GenesisState

type GenesisState struct {
	PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"`
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

GenesisState defines the ibc-transfer genesis state

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns a GenesisState with "transfer" as the default PortID.

func NewGenesisState

func NewGenesisState(portID string, params Params) *GenesisState

NewGenesisState creates a new ibc-transfer GenesisState instance.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPortId

func (m *GenesisState) GetPortId() string

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 ICS4Wrapper

type ICS4Wrapper interface {
	SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
}

ICS4Wrapper defines the expected ICS4Wrapper for middleware

type LimitOrder

type LimitOrder struct {
	Id                string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Maker             *SwapMaker   `protobuf:"bytes,2,opt,name=maker,proto3" json:"maker,omitempty"`
	Status            Status       `protobuf:"varint,3,opt,name=status,proto3,enum=ibc.applications.atomic_swap.v1.Status" json:"status,omitempty"`
	FillStatus        FillStatus   `` /* 140-byte string literal not displayed */
	ChannelId         string       `protobuf:"bytes,5,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	Takers            []*SwapTaker `protobuf:"bytes,6,rep,name=takers,proto3" json:"takers,omitempty"`
	CancelTimestamp   int64        `protobuf:"varint,7,opt,name=cancel_timestamp,json=cancelTimestamp,proto3" json:"cancel_timestamp,omitempty"`
	CompleteTimestamp int64        `protobuf:"varint,8,opt,name=complete_timestamp,json=completeTimestamp,proto3" json:"complete_timestamp,omitempty"`
}

func NewLimitOrder

func NewLimitOrder(msg *MsgMakeSwapRequest, channelId string) LimitOrder

func (*LimitOrder) Descriptor

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

func (*LimitOrder) GetCancelTimestamp

func (m *LimitOrder) GetCancelTimestamp() int64

func (*LimitOrder) GetChannelId

func (m *LimitOrder) GetChannelId() string

func (*LimitOrder) GetCompleteTimestamp

func (m *LimitOrder) GetCompleteTimestamp() int64

func (*LimitOrder) GetFillStatus

func (m *LimitOrder) GetFillStatus() FillStatus

func (*LimitOrder) GetId

func (m *LimitOrder) GetId() string

func (*LimitOrder) GetMaker

func (m *LimitOrder) GetMaker() *SwapMaker

func (*LimitOrder) GetStatus

func (m *LimitOrder) GetStatus() Status

func (*LimitOrder) GetTakers

func (m *LimitOrder) GetTakers() []*SwapTaker

func (*LimitOrder) Marshal

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

func (*LimitOrder) MarshalTo

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

func (*LimitOrder) MarshalToSizedBuffer

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

func (*LimitOrder) ProtoMessage

func (*LimitOrder) ProtoMessage()

func (*LimitOrder) Reset

func (m *LimitOrder) Reset()

func (*LimitOrder) Size

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

func (*LimitOrder) String

func (m *LimitOrder) String() string

func (*LimitOrder) Unmarshal

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

func (*LimitOrder) XXX_DiscardUnknown

func (m *LimitOrder) XXX_DiscardUnknown()

func (*LimitOrder) XXX_Marshal

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

func (*LimitOrder) XXX_Merge

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

func (*LimitOrder) XXX_Size

func (m *LimitOrder) XXX_Size() int

func (*LimitOrder) XXX_Unmarshal

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

type MsgCancelSwapRequest

type MsgCancelSwapRequest struct {
	// the port on which the packet will be sent
	SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"`
	// the channel by which the packet will be sent
	SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"`
	OrderId       string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	// the sender address
	MakerAddress string `protobuf:"bytes,5,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty" yaml:"maker_address"`
	// Timeout height relative to the current block height.
	// The timeout is disabled when set to 0.
	TimeoutHeight types1.Height `protobuf:"bytes,8,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// Timeout timestamp in absolute nanoseconds since unix epoch.
	// The timeout is disabled when set to 0.
	TimeoutTimestamp uint64 `` /* 135-byte string literal not displayed */
	CreateTimestamp  int64  `protobuf:"varint,10,opt,name=create_timestamp,json=createTimestamp,proto3" json:"create_timestamp,omitempty"`
}

func NewMsgCancelSwap

func NewMsgCancelSwap(
	sourcePort, sourceChannel string,
	senderAddress, orderId string,
	timeoutHeight clienttypes.Height, timeoutTimestamp uint64,
) *MsgCancelSwapRequest

NewMsgCancelSwap creates a new MsgCancelSwapRequest instance

func (*MsgCancelSwapRequest) Descriptor

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

func (*MsgCancelSwapRequest) GetSignBytes

func (msg *MsgCancelSwapRequest) GetSignBytes() []byte

GetSignBytes implements sdk.Msg.

func (*MsgCancelSwapRequest) GetSigners

func (msg *MsgCancelSwapRequest) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgCancelSwapRequest) Marshal

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

func (*MsgCancelSwapRequest) MarshalTo

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

func (*MsgCancelSwapRequest) MarshalToSizedBuffer

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

func (*MsgCancelSwapRequest) ProtoMessage

func (*MsgCancelSwapRequest) ProtoMessage()

func (*MsgCancelSwapRequest) Reset

func (m *MsgCancelSwapRequest) Reset()

func (*MsgCancelSwapRequest) Route

func (*MsgCancelSwapRequest) Route() string

Route implements sdk.Msg

func (*MsgCancelSwapRequest) Size

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

func (*MsgCancelSwapRequest) String

func (m *MsgCancelSwapRequest) String() string

func (*MsgCancelSwapRequest) Type

func (*MsgCancelSwapRequest) Type() string

Type implements sdk.Msg

func (*MsgCancelSwapRequest) Unmarshal

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

func (*MsgCancelSwapRequest) ValidateBasic

func (msg *MsgCancelSwapRequest) ValidateBasic() error

ValidateBasic performs a basic check of the MsgTransfer fields. NOTE: timeout height or timestamp values can be 0 to disable the timeout. NOTE: The recipient addresses format is not validated as the format defined by the chain is not known to IBC.

func (*MsgCancelSwapRequest) XXX_DiscardUnknown

func (m *MsgCancelSwapRequest) XXX_DiscardUnknown()

func (*MsgCancelSwapRequest) XXX_Marshal

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

func (*MsgCancelSwapRequest) XXX_Merge

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

func (*MsgCancelSwapRequest) XXX_Size

func (m *MsgCancelSwapRequest) XXX_Size() int

func (*MsgCancelSwapRequest) XXX_Unmarshal

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

type MsgCancelSwapResponse

type MsgCancelSwapResponse struct {
}

func (*MsgCancelSwapResponse) Descriptor

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

func (*MsgCancelSwapResponse) Marshal

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

func (*MsgCancelSwapResponse) MarshalTo

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

func (*MsgCancelSwapResponse) MarshalToSizedBuffer

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

func (*MsgCancelSwapResponse) ProtoMessage

func (*MsgCancelSwapResponse) ProtoMessage()

func (*MsgCancelSwapResponse) Reset

func (m *MsgCancelSwapResponse) Reset()

func (*MsgCancelSwapResponse) Size

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

func (*MsgCancelSwapResponse) String

func (m *MsgCancelSwapResponse) String() string

func (*MsgCancelSwapResponse) Unmarshal

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

func (*MsgCancelSwapResponse) XXX_DiscardUnknown

func (m *MsgCancelSwapResponse) XXX_DiscardUnknown()

func (*MsgCancelSwapResponse) XXX_Marshal

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

func (*MsgCancelSwapResponse) XXX_Merge

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

func (*MsgCancelSwapResponse) XXX_Size

func (m *MsgCancelSwapResponse) XXX_Size() int

func (*MsgCancelSwapResponse) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	MakeSwap(ctx context.Context, in *MsgMakeSwapRequest, opts ...grpc.CallOption) (*MsgMakeSwapResponse, error)
	TakeSwap(ctx context.Context, in *MsgTakeSwapRequest, opts ...grpc.CallOption) (*MsgTakeSwapResponse, error)
	CancelSwap(ctx context.Context, in *MsgCancelSwapRequest, opts ...grpc.CallOption) (*MsgCancelSwapResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc.ClientConnInterface) MsgClient

type MsgMakeSwapRequest

type MsgMakeSwapRequest struct {
	// the port on which the packet will be sent
	SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"`
	// the channel by which the packet will be sent
	SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"`
	// the tokens to be sell
	SellToken types.Coin `protobuf:"bytes,3,opt,name=sell_token,json=sellToken,proto3" json:"sell_token"`
	BuyToken  types.Coin `protobuf:"bytes,4,opt,name=buy_token,json=buyToken,proto3" json:"buy_token"`
	// the sender address
	MakerAddress string `protobuf:"bytes,5,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty" yaml:"maker_address"`
	// the sender's address on the destination chain
	MakerReceivingAddress string `` /* 157-byte string literal not displayed */
	// if desired_taker is specified,
	// only the desired_taker is allowed to take this order
	// this is address on destination chain
	DesiredTaker    string `protobuf:"bytes,7,opt,name=desired_taker,json=desiredTaker,proto3" json:"desired_taker,omitempty"`
	CreateTimestamp int64  `protobuf:"varint,8,opt,name=create_timestamp,json=createTimestamp,proto3" json:"create_timestamp,omitempty"`
	// Timeout height relative to the current block height.
	// The timeout is disabled when set to 0.
	TimeoutHeight types1.Height `protobuf:"bytes,9,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// Timeout timestamp in absolute nanoseconds since unix epoch.
	// The timeout is disabled when set to 0.
	TimeoutTimestamp uint64 `` /* 136-byte string literal not displayed */
}

func NewMsgMakeSwap

func NewMsgMakeSwap(
	sourcePort, sourceChannel string,
	sellToken, buyToken sdk.Coin,
	senderAddress, senderReceivingAddress, desiredTaker string,
	timeoutHeight clienttypes.Height, timeoutTimestamp uint64,
	createdTimestamp int64,
) *MsgMakeSwapRequest

NewMsgMakeSwap creates a new MsgMakeSwapRequest instance

func (*MsgMakeSwapRequest) Descriptor

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

func (*MsgMakeSwapRequest) GetSignBytes

func (msg *MsgMakeSwapRequest) GetSignBytes() []byte

GetSignBytes implements sdk.Msg.

func (*MsgMakeSwapRequest) GetSigners

func (msg *MsgMakeSwapRequest) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgMakeSwapRequest) Marshal

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

func (*MsgMakeSwapRequest) MarshalTo

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

func (*MsgMakeSwapRequest) MarshalToSizedBuffer

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

func (*MsgMakeSwapRequest) ProtoMessage

func (*MsgMakeSwapRequest) ProtoMessage()

func (*MsgMakeSwapRequest) Reset

func (m *MsgMakeSwapRequest) Reset()

func (*MsgMakeSwapRequest) Route

func (*MsgMakeSwapRequest) Route() string

Route implements sdk.Msg

func (*MsgMakeSwapRequest) Size

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

func (*MsgMakeSwapRequest) String

func (m *MsgMakeSwapRequest) String() string

func (*MsgMakeSwapRequest) Type

func (*MsgMakeSwapRequest) Type() string

Type implements sdk.Msg

func (*MsgMakeSwapRequest) Unmarshal

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

func (*MsgMakeSwapRequest) ValidateBasic

func (msg *MsgMakeSwapRequest) ValidateBasic() error

ValidateBasic performs a basic check of the MsgTransfer fields. NOTE: timeout height or timestamp values can be 0 to disable the timeout. NOTE: The recipient addresses format is not validated as the format defined by the chain is not known to IBC.

func (*MsgMakeSwapRequest) XXX_DiscardUnknown

func (m *MsgMakeSwapRequest) XXX_DiscardUnknown()

func (*MsgMakeSwapRequest) XXX_Marshal

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

func (*MsgMakeSwapRequest) XXX_Merge

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

func (*MsgMakeSwapRequest) XXX_Size

func (m *MsgMakeSwapRequest) XXX_Size() int

func (*MsgMakeSwapRequest) XXX_Unmarshal

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

type MsgMakeSwapResponse

type MsgMakeSwapResponse struct {
}

func (*MsgMakeSwapResponse) Descriptor

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

func (*MsgMakeSwapResponse) Marshal

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

func (*MsgMakeSwapResponse) MarshalTo

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

func (*MsgMakeSwapResponse) MarshalToSizedBuffer

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

func (*MsgMakeSwapResponse) ProtoMessage

func (*MsgMakeSwapResponse) ProtoMessage()

func (*MsgMakeSwapResponse) Reset

func (m *MsgMakeSwapResponse) Reset()

func (*MsgMakeSwapResponse) Size

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

func (*MsgMakeSwapResponse) String

func (m *MsgMakeSwapResponse) String() string

func (*MsgMakeSwapResponse) Unmarshal

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

func (*MsgMakeSwapResponse) XXX_DiscardUnknown

func (m *MsgMakeSwapResponse) XXX_DiscardUnknown()

func (*MsgMakeSwapResponse) XXX_Marshal

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

func (*MsgMakeSwapResponse) XXX_Merge

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

func (*MsgMakeSwapResponse) XXX_Size

func (m *MsgMakeSwapResponse) XXX_Size() int

func (*MsgMakeSwapResponse) XXX_Unmarshal

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

type MsgServer

MsgServer is the server API for Msg service. All implementations should embed UnimplementedMsgServer for forward compatibility

type MsgTakeSwapRequest

type MsgTakeSwapRequest struct {
	// the port on which the packet will be sent
	SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"`
	// the channel by which the packet will be sent
	SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"`
	OrderId       string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	// the tokens to be sell
	SellToken types.Coin `protobuf:"bytes,4,opt,name=sell_token,json=sellToken,proto3" json:"sell_token"`
	// the sender address
	TakerAddress string `protobuf:"bytes,5,opt,name=taker_address,json=takerAddress,proto3" json:"taker_address,omitempty" yaml:"taker_address"`
	// the sender's address on the destination chain
	TakerReceivingAddress string `` /* 157-byte string literal not displayed */
	// Timeout height relative to the current block height.
	// The timeout is disabled when set to 0.
	TimeoutHeight types1.Height `protobuf:"bytes,7,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// Timeout timestamp in absolute nanoseconds since unix epoch.
	// The timeout is disabled when set to 0.
	TimeoutTimestamp uint64 `` /* 135-byte string literal not displayed */
	CreateTimestamp  int64  `protobuf:"varint,9,opt,name=create_timestamp,json=createTimestamp,proto3" json:"create_timestamp,omitempty"`
}

func NewMsgTakeSwap

func NewMsgTakeSwap(
	sourcePort, sourceChannel string,
	sellToken sdk.Coin,
	senderAddress, senderReceivingAddress string,
	timeoutHeight clienttypes.Height, timeoutTimestamp uint64,
	createdTimestamp int64,
) *MsgTakeSwapRequest

NewMsgTakeSwap creates a new MsgTakeSwapRequest instance

func (*MsgTakeSwapRequest) Descriptor

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

func (*MsgTakeSwapRequest) GetSignBytes

func (msg *MsgTakeSwapRequest) GetSignBytes() []byte

GetSignBytes implements sdk.Msg.

func (*MsgTakeSwapRequest) GetSigners

func (msg *MsgTakeSwapRequest) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgTakeSwapRequest) Marshal

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

func (*MsgTakeSwapRequest) MarshalTo

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

func (*MsgTakeSwapRequest) MarshalToSizedBuffer

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

func (*MsgTakeSwapRequest) ProtoMessage

func (*MsgTakeSwapRequest) ProtoMessage()

func (*MsgTakeSwapRequest) Reset

func (m *MsgTakeSwapRequest) Reset()

func (*MsgTakeSwapRequest) Route

func (*MsgTakeSwapRequest) Route() string

Route implements sdk.Msg

func (*MsgTakeSwapRequest) Size

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

func (*MsgTakeSwapRequest) String

func (m *MsgTakeSwapRequest) String() string

func (*MsgTakeSwapRequest) Type

func (*MsgTakeSwapRequest) Type() string

Type implements sdk.Msg

func (*MsgTakeSwapRequest) Unmarshal

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

func (*MsgTakeSwapRequest) ValidateBasic

func (msg *MsgTakeSwapRequest) ValidateBasic() error

ValidateBasic performs a basic check of the MsgTransfer fields. NOTE: timeout height or timestamp values can be 0 to disable the timeout. NOTE: The recipient addresses format is not validated as the format defined by the chain is not known to IBC.

func (*MsgTakeSwapRequest) XXX_DiscardUnknown

func (m *MsgTakeSwapRequest) XXX_DiscardUnknown()

func (*MsgTakeSwapRequest) XXX_Marshal

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

func (*MsgTakeSwapRequest) XXX_Merge

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

func (*MsgTakeSwapRequest) XXX_Size

func (m *MsgTakeSwapRequest) XXX_Size() int

func (*MsgTakeSwapRequest) XXX_Unmarshal

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

type MsgTakeSwapResponse

type MsgTakeSwapResponse struct {
}

func (*MsgTakeSwapResponse) Descriptor

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

func (*MsgTakeSwapResponse) Marshal

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

func (*MsgTakeSwapResponse) MarshalTo

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

func (*MsgTakeSwapResponse) MarshalToSizedBuffer

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

func (*MsgTakeSwapResponse) ProtoMessage

func (*MsgTakeSwapResponse) ProtoMessage()

func (*MsgTakeSwapResponse) Reset

func (m *MsgTakeSwapResponse) Reset()

func (*MsgTakeSwapResponse) Size

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

func (*MsgTakeSwapResponse) String

func (m *MsgTakeSwapResponse) String() string

func (*MsgTakeSwapResponse) Unmarshal

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

func (*MsgTakeSwapResponse) XXX_DiscardUnknown

func (m *MsgTakeSwapResponse) XXX_DiscardUnknown()

func (*MsgTakeSwapResponse) XXX_Marshal

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

func (*MsgTakeSwapResponse) XXX_Merge

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

func (*MsgTakeSwapResponse) XXX_Size

func (m *MsgTakeSwapResponse) XXX_Size() int

func (*MsgTakeSwapResponse) XXX_Unmarshal

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

type OTCOrder

type OTCOrder struct {
	Id                string     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Maker             *SwapMaker `protobuf:"bytes,2,opt,name=maker,proto3" json:"maker,omitempty"`
	Status            Status     `protobuf:"varint,3,opt,name=status,proto3,enum=ibc.applications.atomic_swap.v1.Status" json:"status,omitempty"`
	ChannelId         string     `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	Takers            *SwapTaker `protobuf:"bytes,5,opt,name=takers,proto3" json:"takers,omitempty"`
	CancelTimestamp   int64      `protobuf:"varint,7,opt,name=cancel_timestamp,json=cancelTimestamp,proto3" json:"cancel_timestamp,omitempty"`
	CompleteTimestamp int64      `protobuf:"varint,8,opt,name=complete_timestamp,json=completeTimestamp,proto3" json:"complete_timestamp,omitempty"`
}

func NewOTCOrder

func NewOTCOrder(msg *MsgMakeSwapRequest, channelId string) OTCOrder

func (*OTCOrder) Descriptor

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

func (*OTCOrder) GetCancelTimestamp

func (m *OTCOrder) GetCancelTimestamp() int64

func (*OTCOrder) GetChannelId

func (m *OTCOrder) GetChannelId() string

func (*OTCOrder) GetCompleteTimestamp

func (m *OTCOrder) GetCompleteTimestamp() int64

func (*OTCOrder) GetId

func (m *OTCOrder) GetId() string

func (*OTCOrder) GetMaker

func (m *OTCOrder) GetMaker() *SwapMaker

func (*OTCOrder) GetStatus

func (m *OTCOrder) GetStatus() Status

func (*OTCOrder) GetTakers

func (m *OTCOrder) GetTakers() *SwapTaker

func (*OTCOrder) Marshal

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

func (*OTCOrder) MarshalTo

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

func (*OTCOrder) MarshalToSizedBuffer

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

func (*OTCOrder) ProtoMessage

func (*OTCOrder) ProtoMessage()

func (*OTCOrder) Reset

func (m *OTCOrder) Reset()

func (*OTCOrder) Size

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

func (*OTCOrder) String

func (m *OTCOrder) String() string

func (*OTCOrder) Unmarshal

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

func (*OTCOrder) XXX_DiscardUnknown

func (m *OTCOrder) XXX_DiscardUnknown()

func (*OTCOrder) XXX_Marshal

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

func (*OTCOrder) XXX_Merge

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

func (*OTCOrder) XXX_Size

func (m *OTCOrder) XXX_Size() int

func (*OTCOrder) XXX_Unmarshal

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

type Params

type Params struct {
	// swap_enabled enables or disables all cross-chain token transfers from this chain.
	SwapEnabled bool `protobuf:"varint,1,opt,name=swap_enabled,json=swapEnabled,proto3" json:"swap_enabled,omitempty" yaml:"swap_enabled"`
	// max_fee_rate set a max value of fee, it's base point, 1/10000
	MaxFeeRate uint32 `protobuf:"varint,2,opt,name=max_fee_rate,json=maxFeeRate,proto3" json:"max_fee_rate,omitempty" yaml:"max_fee_rate"`
}

Params defines the set of IBC swap parameters.

func DefaultParams

func DefaultParams() Params

DefaultParams is the default parameter configuration for the ibc-transfer module

func NewParams

func NewParams(enable bool, feeRate uint32) Params

NewParams creates a new parameter configuration for the ibc transfer module

func (*Params) Descriptor

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

func (*Params) GetMaxFeeRate

func (m *Params) GetMaxFeeRate() uint32

func (*Params) GetSwapEnabled

func (m *Params) GetSwapEnabled() 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

ParamSetPairs implements params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate all ibc-swap module parameters

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type PortKeeper

type PortKeeper interface {
	BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}

PortKeeper defines the expected IBC port keeper

type QueryClient

type QueryClient interface {
	// Params queries all parameters of the ibc-transfer module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// EscrowAddress returns the escrow address for a particular port and channel id.
	EscrowAddress(ctx context.Context, in *QueryEscrowAddressRequest, opts ...grpc.CallOption) (*QueryEscrowAddressResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc.ClientConnInterface) QueryClient

type QueryEscrowAddressRequest

type QueryEscrowAddressRequest struct {
	// unique port identifier
	PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"`
	// unique channel identifier
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
}

QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method.

func (*QueryEscrowAddressRequest) Descriptor

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

func (*QueryEscrowAddressRequest) GetChannelId

func (m *QueryEscrowAddressRequest) GetChannelId() string

func (*QueryEscrowAddressRequest) GetPortId

func (m *QueryEscrowAddressRequest) GetPortId() string

func (*QueryEscrowAddressRequest) Marshal

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

func (*QueryEscrowAddressRequest) MarshalTo

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

func (*QueryEscrowAddressRequest) MarshalToSizedBuffer

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

func (*QueryEscrowAddressRequest) ProtoMessage

func (*QueryEscrowAddressRequest) ProtoMessage()

func (*QueryEscrowAddressRequest) Reset

func (m *QueryEscrowAddressRequest) Reset()

func (*QueryEscrowAddressRequest) Size

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

func (*QueryEscrowAddressRequest) String

func (m *QueryEscrowAddressRequest) String() string

func (*QueryEscrowAddressRequest) Unmarshal

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

func (*QueryEscrowAddressRequest) XXX_DiscardUnknown

func (m *QueryEscrowAddressRequest) XXX_DiscardUnknown()

func (*QueryEscrowAddressRequest) XXX_Marshal

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

func (*QueryEscrowAddressRequest) XXX_Merge

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

func (*QueryEscrowAddressRequest) XXX_Size

func (m *QueryEscrowAddressRequest) XXX_Size() int

func (*QueryEscrowAddressRequest) XXX_Unmarshal

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

type QueryEscrowAddressResponse

type QueryEscrowAddressResponse struct {
	// the escrow account address
	EscrowAddress string `protobuf:"bytes,1,opt,name=escrow_address,json=escrowAddress,proto3" json:"escrow_address,omitempty"`
}

QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method.

func (*QueryEscrowAddressResponse) Descriptor

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

func (*QueryEscrowAddressResponse) GetEscrowAddress

func (m *QueryEscrowAddressResponse) GetEscrowAddress() string

func (*QueryEscrowAddressResponse) Marshal

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

func (*QueryEscrowAddressResponse) MarshalTo

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

func (*QueryEscrowAddressResponse) MarshalToSizedBuffer

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

func (*QueryEscrowAddressResponse) ProtoMessage

func (*QueryEscrowAddressResponse) ProtoMessage()

func (*QueryEscrowAddressResponse) Reset

func (m *QueryEscrowAddressResponse) Reset()

func (*QueryEscrowAddressResponse) Size

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

func (*QueryEscrowAddressResponse) String

func (m *QueryEscrowAddressResponse) String() string

func (*QueryEscrowAddressResponse) Unmarshal

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

func (*QueryEscrowAddressResponse) XXX_DiscardUnknown

func (m *QueryEscrowAddressResponse) XXX_DiscardUnknown()

func (*QueryEscrowAddressResponse) XXX_Marshal

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

func (*QueryEscrowAddressResponse) XXX_Merge

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

func (*QueryEscrowAddressResponse) XXX_Size

func (m *QueryEscrowAddressResponse) XXX_Size() int

func (*QueryEscrowAddressResponse) XXX_Unmarshal

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

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 defines the parameters of the module.
	Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
}

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

func (*QueryParamsResponse) Descriptor

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

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() *Params

func (*QueryParamsResponse) Marshal

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

func (*QueryParamsResponse) MarshalTo

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

func (*QueryParamsResponse) MarshalToSizedBuffer

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

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

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

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

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

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

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

func (*QueryParamsResponse) XXX_Merge

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

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Params queries all parameters of the ibc-transfer module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// EscrowAddress returns the escrow address for a particular port and channel id.
	EscrowAddress(context.Context, *QueryEscrowAddressRequest) (*QueryEscrowAddressResponse, error)
}

QueryServer is the server API for Query service. All implementations should embed UnimplementedQueryServer for forward compatibility

type Status

type Status int32
const (
	Status_INITIAL  Status = 0
	Status_SYNC     Status = 1
	Status_CANCEL   Status = 2
	Status_COMPLETE Status = 3
)

func (Status) EnumDescriptor

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

func (Status) String

func (x Status) String() string

type SwapMaker

type SwapMaker struct {
	// the port on which the packet will be sent
	SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"`
	// the channel by which the packet will be sent
	SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"`
	// the tokens to be sell
	SellToken types.Coin `protobuf:"bytes,3,opt,name=sell_token,json=sellToken,proto3" json:"sell_token"`
	BuyToken  types.Coin `protobuf:"bytes,4,opt,name=buy_token,json=buyToken,proto3" json:"buy_token"`
	// the sender address
	MakerAddress string `protobuf:"bytes,5,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty" yaml:"maker_address"`
	// the sender's address on the destination chain
	MakerReceivingAddress string `` /* 157-byte string literal not displayed */
	// if desired_taker is specified,
	// only the desired_taker is allowed to take this order
	// this is address on destination chain
	DesiredTaker    string `protobuf:"bytes,7,opt,name=desired_taker,json=desiredTaker,proto3" json:"desired_taker,omitempty"`
	CreateTimestamp int64  `protobuf:"varint,8,opt,name=create_timestamp,json=createTimestamp,proto3" json:"create_timestamp,omitempty"`
}

func NewMakerFromMsg

func NewMakerFromMsg(msg *MsgMakeSwapRequest) *SwapMaker

func (*SwapMaker) Descriptor

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

func (*SwapMaker) GetBuyToken

func (m *SwapMaker) GetBuyToken() types.Coin

func (*SwapMaker) GetCreateTimestamp

func (m *SwapMaker) GetCreateTimestamp() int64

func (*SwapMaker) GetDesiredTaker

func (m *SwapMaker) GetDesiredTaker() string

func (*SwapMaker) GetMakerAddress

func (m *SwapMaker) GetMakerAddress() string

func (*SwapMaker) GetMakerReceivingAddress

func (m *SwapMaker) GetMakerReceivingAddress() string

func (*SwapMaker) GetSellToken

func (m *SwapMaker) GetSellToken() types.Coin

func (*SwapMaker) GetSourceChannel

func (m *SwapMaker) GetSourceChannel() string

func (*SwapMaker) GetSourcePort

func (m *SwapMaker) GetSourcePort() string

func (*SwapMaker) Marshal

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

func (*SwapMaker) MarshalTo

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

func (*SwapMaker) MarshalToSizedBuffer

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

func (*SwapMaker) ProtoMessage

func (*SwapMaker) ProtoMessage()

func (*SwapMaker) Reset

func (m *SwapMaker) Reset()

func (*SwapMaker) Size

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

func (*SwapMaker) String

func (m *SwapMaker) String() string

func (*SwapMaker) Unmarshal

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

func (*SwapMaker) XXX_DiscardUnknown

func (m *SwapMaker) XXX_DiscardUnknown()

func (*SwapMaker) XXX_Marshal

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

func (*SwapMaker) XXX_Merge

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

func (*SwapMaker) XXX_Size

func (m *SwapMaker) XXX_Size() int

func (*SwapMaker) XXX_Unmarshal

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

type SwapMessageType

type SwapMessageType int32

Type defines a classification of swap messages

const (
	// Default zero value enumeration
	UNSPECIFIED SwapMessageType = 0
	MAKE_SWAP   SwapMessageType = 1
	TAKE_SWAP   SwapMessageType = 2
	CANCEL_SWAP SwapMessageType = 3
)

func (SwapMessageType) EnumDescriptor

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

func (SwapMessageType) String

func (x SwapMessageType) String() string

type SwapTaker

type SwapTaker struct {
	OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	// the tokens to be sell
	SellToken types.Coin `protobuf:"bytes,2,opt,name=sell_token,json=sellToken,proto3" json:"sell_token"`
	// the sender address
	TakerAddress string `protobuf:"bytes,3,opt,name=taker_address,json=takerAddress,proto3" json:"taker_address,omitempty" yaml:"taker_address"`
	// the sender's address on the destination chain
	TakerReceivingAddress string `` /* 157-byte string literal not displayed */
	CreateTimestamp       int64  `protobuf:"varint,5,opt,name=create_timestamp,json=createTimestamp,proto3" json:"create_timestamp,omitempty"`
}

func NewTakerFromMsg

func NewTakerFromMsg(msg *MsgTakeSwapRequest) *SwapTaker

func (*SwapTaker) Descriptor

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

func (*SwapTaker) GetCreateTimestamp

func (m *SwapTaker) GetCreateTimestamp() int64

func (*SwapTaker) GetOrderId

func (m *SwapTaker) GetOrderId() string

func (*SwapTaker) GetSellToken

func (m *SwapTaker) GetSellToken() types.Coin

func (*SwapTaker) GetTakerAddress

func (m *SwapTaker) GetTakerAddress() string

func (*SwapTaker) GetTakerReceivingAddress

func (m *SwapTaker) GetTakerReceivingAddress() string

func (*SwapTaker) Marshal

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

func (*SwapTaker) MarshalTo

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

func (*SwapTaker) MarshalToSizedBuffer

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

func (*SwapTaker) ProtoMessage

func (*SwapTaker) ProtoMessage()

func (*SwapTaker) Reset

func (m *SwapTaker) Reset()

func (*SwapTaker) Size

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

func (*SwapTaker) String

func (m *SwapTaker) String() string

func (*SwapTaker) Unmarshal

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

func (*SwapTaker) XXX_DiscardUnknown

func (m *SwapTaker) XXX_DiscardUnknown()

func (*SwapTaker) XXX_Marshal

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

func (*SwapTaker) XXX_Merge

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

func (*SwapTaker) XXX_Size

func (m *SwapTaker) XXX_Size() int

func (*SwapTaker) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer should be embedded to have forward compatible implementations.

func (UnimplementedMsgServer) CancelSwap

func (UnimplementedMsgServer) MakeSwap

func (UnimplementedMsgServer) TakeSwap

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer should be embedded to have forward compatible implementations.

func (UnimplementedQueryServer) Params

type UnsafeMsgServer

type UnsafeMsgServer interface {
	// contains filtered or unexported methods
}

UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MsgServer will result in compilation errors.

type UnsafeQueryServer

type UnsafeQueryServer interface {
	// contains filtered or unexported methods
}

UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to QueryServer will result in compilation errors.

Jump to

Keyboard shortcuts

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