types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeSwapPacket = "swap_packet"

	AttributeKeyAckSuccess = "success"
	AttributeKeyAck        = "acknowledgement"
	AttributeKeyAckError   = "error"
)

IBC events

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

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

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

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

Variables

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

Functions

func GetFundAddress added in v0.2.0

func GetFundAddress(portID, channelID string) sdk.AccAddress

GetFundAddress returns the fund address for the specified channel.

func ParseDenonOnRcv added in v0.2.0

func ParseDenonOnRcv(sourcePort, sourceChannel, denom string) string

func ParseTokenOnRcv added in v0.2.0

func ParseTokenOnRcv(sourcePort, sourceChannel, amount, denom string) (sdk.Coin, error)

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func SafeUnmarshalJSON added in v0.2.0

func SafeUnmarshalJSON(pc *codec.ProtoCodec, bz []byte, ptr proto.Message) error

SafeUnmarshalJSON unmarshals JSON data but allow unknown fields.

Types

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)
	SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
}

ChannelKeeper defines the expected IBC channel keeper

type GammKeeper

type GammKeeper interface {
	SwapExactAmountIn(
		ctx sdk.Context,
		sender sdk.AccAddress,
		poolId uint64,
		tokenIn sdk.Coin,
		tokenOutDenom string,
		tokenOutMinAmount sdk.Int,
	) (tokenOutAmount sdk.Int, spotPriceAfter sdk.Dec, err error)
}

GammKeeper defines the expected osmosis gamm keeper

type IbcPacketData added in v0.2.0

type IbcPacketData struct {
	// the token denomination to be transferred
	Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	// the token amount to be transferred
	Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// the sender address
	Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
	// the recipient address on the destination chain
	Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"`
	// the gamm action
	//
	// Types that are valid to be assigned to Gamm:
	//	*IbcPacketData_NoData
	//	*IbcPacketData_Swap
	Gamm isIbcPacketData_Gamm `protobuf_oneof:"gamm"`
}

func NewIbcPacketData added in v0.2.0

func NewIbcPacketData(sender, receiver, amount, denom string, routes []SwapAmountInRoute, tokenOut sdk.Int) IbcPacketData

NewIbcPacketData contructs a new IbcPacketData instance

func (*IbcPacketData) Descriptor added in v0.2.0

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

func (*IbcPacketData) GetAmount added in v0.2.0

func (m *IbcPacketData) GetAmount() string

func (IbcPacketData) GetBytes added in v0.2.0

func (gpd IbcPacketData) GetBytes() []byte

GetBytes is a helper for serialising

func (*IbcPacketData) GetDenom added in v0.2.0

func (m *IbcPacketData) GetDenom() string

func (*IbcPacketData) GetGamm added in v0.2.0

func (m *IbcPacketData) GetGamm() isIbcPacketData_Gamm

func (*IbcPacketData) GetNoData added in v0.2.0

func (m *IbcPacketData) GetNoData() *NoData

func (*IbcPacketData) GetReceiver added in v0.2.0

func (m *IbcPacketData) GetReceiver() string

func (IbcPacketData) GetSafeBytes added in v0.2.0

func (gpd IbcPacketData) GetSafeBytes() ([]byte, error)

GetBytes is a helper for serialising

func (*IbcPacketData) GetSender added in v0.2.0

func (m *IbcPacketData) GetSender() string

func (*IbcPacketData) GetSwap added in v0.2.0

func (*IbcPacketData) Marshal added in v0.2.0

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

func (*IbcPacketData) MarshalTo added in v0.2.0

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

func (*IbcPacketData) MarshalToSizedBuffer added in v0.2.0

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

func (*IbcPacketData) ProtoMessage added in v0.2.0

func (*IbcPacketData) ProtoMessage()

func (*IbcPacketData) Reset added in v0.2.0

func (m *IbcPacketData) Reset()

func (*IbcPacketData) Size added in v0.2.0

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

func (*IbcPacketData) String added in v0.2.0

func (m *IbcPacketData) String() string

func (*IbcPacketData) Unmarshal added in v0.2.0

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

func (*IbcPacketData) XXX_DiscardUnknown added in v0.2.0

func (m *IbcPacketData) XXX_DiscardUnknown()

func (*IbcPacketData) XXX_Marshal added in v0.2.0

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

func (*IbcPacketData) XXX_Merge added in v0.2.0

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

func (*IbcPacketData) XXX_OneofWrappers added in v0.2.0

func (*IbcPacketData) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*IbcPacketData) XXX_Size added in v0.2.0

func (m *IbcPacketData) XXX_Size() int

func (*IbcPacketData) XXX_Unmarshal added in v0.2.0

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

type IbcPacketData_NoData added in v0.2.0

type IbcPacketData_NoData struct {
	NoData *NoData `protobuf:"bytes,5,opt,name=noData,proto3,oneof" json:"noData,omitempty"`
}

func (*IbcPacketData_NoData) MarshalTo added in v0.2.0

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

func (*IbcPacketData_NoData) MarshalToSizedBuffer added in v0.2.0

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

func (*IbcPacketData_NoData) Size added in v0.2.0

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

type IbcPacketData_Swap added in v0.2.0

type IbcPacketData_Swap struct {
	Swap *SwapExactAmountInPacketData `protobuf:"bytes,6,opt,name=swap,proto3,oneof" json:"swap,omitempty"`
}

func (*IbcPacketData_Swap) MarshalTo added in v0.2.0

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

func (*IbcPacketData_Swap) MarshalToSizedBuffer added in v0.2.0

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

func (*IbcPacketData_Swap) Size added in v0.2.0

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

type NoData

type NoData struct {
}

func (*NoData) Descriptor

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

func (*NoData) Marshal

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

func (*NoData) MarshalTo

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

func (*NoData) MarshalToSizedBuffer

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

func (*NoData) ProtoMessage

func (*NoData) ProtoMessage()

func (*NoData) Reset

func (m *NoData) Reset()

func (*NoData) Size

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

func (*NoData) String

func (m *NoData) String() string

func (*NoData) Unmarshal

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

func (*NoData) XXX_DiscardUnknown

func (m *NoData) XXX_DiscardUnknown()

func (*NoData) XXX_Marshal

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

func (*NoData) XXX_Merge

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

func (*NoData) XXX_Size

func (m *NoData) XXX_Size() int

func (*NoData) XXX_Unmarshal

func (m *NoData) 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 ScopedKeeper

type ScopedKeeper interface {
	GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool)
	AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
	ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
}

ScopedKeeper defines the expected IBC scoped keeper

type SwapAmountInRoute added in v0.2.0

type SwapAmountInRoute struct {
	PoolId        uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	TokenOutDenom string `protobuf:"bytes,2,opt,name=token_out_denom,json=tokenOutDenom,proto3" json:"token_out_denom,omitempty"`
}

func (*SwapAmountInRoute) Descriptor added in v0.2.0

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

func (*SwapAmountInRoute) GetPoolId added in v0.2.0

func (m *SwapAmountInRoute) GetPoolId() uint64

func (*SwapAmountInRoute) GetTokenOutDenom added in v0.2.0

func (m *SwapAmountInRoute) GetTokenOutDenom() string

func (*SwapAmountInRoute) Marshal added in v0.2.0

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

func (*SwapAmountInRoute) MarshalTo added in v0.2.0

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

func (*SwapAmountInRoute) MarshalToSizedBuffer added in v0.2.0

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

func (*SwapAmountInRoute) ProtoMessage added in v0.2.0

func (*SwapAmountInRoute) ProtoMessage()

func (*SwapAmountInRoute) Reset added in v0.2.0

func (m *SwapAmountInRoute) Reset()

func (*SwapAmountInRoute) Size added in v0.2.0

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

func (*SwapAmountInRoute) String added in v0.2.0

func (m *SwapAmountInRoute) String() string

func (*SwapAmountInRoute) Unmarshal added in v0.2.0

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

func (*SwapAmountInRoute) XXX_DiscardUnknown added in v0.2.0

func (m *SwapAmountInRoute) XXX_DiscardUnknown()

func (*SwapAmountInRoute) XXX_Marshal added in v0.2.0

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

func (*SwapAmountInRoute) XXX_Merge added in v0.2.0

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

func (*SwapAmountInRoute) XXX_Size added in v0.2.0

func (m *SwapAmountInRoute) XXX_Size() int

func (*SwapAmountInRoute) XXX_Unmarshal added in v0.2.0

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

type SwapExactAmountInAck added in v0.2.0

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

SwapExactAmountInAck defines a struct for the swap packet acknowledgment

func (*SwapExactAmountInAck) Descriptor added in v0.2.0

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

func (*SwapExactAmountInAck) GetAmount added in v0.2.0

func (m *SwapExactAmountInAck) GetAmount() string

func (*SwapExactAmountInAck) GetDenom added in v0.2.0

func (m *SwapExactAmountInAck) GetDenom() string

func (*SwapExactAmountInAck) Marshal added in v0.2.0

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

func (*SwapExactAmountInAck) MarshalTo added in v0.2.0

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

func (*SwapExactAmountInAck) MarshalToSizedBuffer added in v0.2.0

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

func (*SwapExactAmountInAck) ProtoMessage added in v0.2.0

func (*SwapExactAmountInAck) ProtoMessage()

func (*SwapExactAmountInAck) Reset added in v0.2.0

func (m *SwapExactAmountInAck) Reset()

func (*SwapExactAmountInAck) Size added in v0.2.0

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

func (*SwapExactAmountInAck) String added in v0.2.0

func (m *SwapExactAmountInAck) String() string

func (*SwapExactAmountInAck) Unmarshal added in v0.2.0

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

func (*SwapExactAmountInAck) XXX_DiscardUnknown added in v0.2.0

func (m *SwapExactAmountInAck) XXX_DiscardUnknown()

func (*SwapExactAmountInAck) XXX_Marshal added in v0.2.0

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

func (*SwapExactAmountInAck) XXX_Merge added in v0.2.0

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

func (*SwapExactAmountInAck) XXX_Size added in v0.2.0

func (m *SwapExactAmountInAck) XXX_Size() int

func (*SwapExactAmountInAck) XXX_Unmarshal added in v0.2.0

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

type SwapExactAmountInPacketData added in v0.2.0

type SwapExactAmountInPacketData struct {
	Sender            string                                 `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Routes            []SwapAmountInRoute                    `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes"`
	TokenOutMinAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 156-byte string literal not displayed */
}

func (*SwapExactAmountInPacketData) Descriptor added in v0.2.0

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

func (*SwapExactAmountInPacketData) GetRoutes added in v0.2.0

func (*SwapExactAmountInPacketData) GetSender added in v0.2.0

func (m *SwapExactAmountInPacketData) GetSender() string

func (*SwapExactAmountInPacketData) Marshal added in v0.2.0

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

func (*SwapExactAmountInPacketData) MarshalTo added in v0.2.0

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

func (*SwapExactAmountInPacketData) MarshalToSizedBuffer added in v0.2.0

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

func (*SwapExactAmountInPacketData) ProtoMessage added in v0.2.0

func (*SwapExactAmountInPacketData) ProtoMessage()

func (*SwapExactAmountInPacketData) Reset added in v0.2.0

func (m *SwapExactAmountInPacketData) Reset()

func (*SwapExactAmountInPacketData) Size added in v0.2.0

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

func (*SwapExactAmountInPacketData) String added in v0.2.0

func (m *SwapExactAmountInPacketData) String() string

func (*SwapExactAmountInPacketData) Unmarshal added in v0.2.0

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

func (SwapExactAmountInPacketData) ValidateBasic added in v0.2.0

func (p SwapExactAmountInPacketData) ValidateBasic() error

ValidateBasic is used for validating the packet

func (*SwapExactAmountInPacketData) XXX_DiscardUnknown added in v0.2.0

func (m *SwapExactAmountInPacketData) XXX_DiscardUnknown()

func (*SwapExactAmountInPacketData) XXX_Marshal added in v0.2.0

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

func (*SwapExactAmountInPacketData) XXX_Merge added in v0.2.0

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

func (*SwapExactAmountInPacketData) XXX_Size added in v0.2.0

func (m *SwapExactAmountInPacketData) XXX_Size() int

func (*SwapExactAmountInPacketData) XXX_Unmarshal added in v0.2.0

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

type TransferKeeper added in v0.2.0

type TransferKeeper interface {
	SendTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.Coin, sender sdk.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64) error
	DenomPathFromHash(ctx sdk.Context, denom string) (string, error)
}

TransferKeeper defines the expected transfer keeper

Jump to

Keyboard shortcuts

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