Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterMsgCreatorServer(s grpc1.Server, srv MsgCreatorServer)
- type CosmWasmPool
- func (p *CosmWasmPool) AsSerializablePool() poolmanagertypes.PoolI
- func (*CosmWasmPool) Descriptor() ([]byte, []int)
- func (p CosmWasmPool) GetAddress() sdk.AccAddress
- func (p CosmWasmPool) GetCodeId() uint64
- func (p CosmWasmPool) GetContractAddress() string
- func (p CosmWasmPool) GetExitFee(ctx sdk.Context) osmomath.Dec
- func (p CosmWasmPool) GetId() uint64
- func (p CosmWasmPool) GetInstantiateMsg() []byte
- func (p CosmWasmPool) GetSpreadFactor(ctx sdk.Context) osmomath.Dec
- func (p CosmWasmPool) GetStoreModel() poolmanagertypes.PoolI
- func (p CosmWasmPool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins
- func (p CosmWasmPool) GetType() poolmanagertypes.PoolType
- func (p CosmWasmPool) IsActive(ctx sdk.Context) bool
- func (m *CosmWasmPool) Marshal() (dAtA []byte, err error)
- func (m *CosmWasmPool) MarshalTo(dAtA []byte) (int, error)
- func (m *CosmWasmPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CosmWasmPool) ProtoMessage()
- func (m *CosmWasmPool) Reset()
- func (p *CosmWasmPool) SetContractAddress(contractAddress string)
- func (p CosmWasmPool) SetWasmKeeper(wasmKeeper types.WasmKeeper)
- func (m *CosmWasmPool) Size() (n int)
- func (p CosmWasmPool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom string) (osmomath.BigDec, error)
- func (p CosmWasmPool) String() string
- func (m *CosmWasmPool) Unmarshal(dAtA []byte) error
- func (m *CosmWasmPool) XXX_DiscardUnknown()
- func (m *CosmWasmPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CosmWasmPool) XXX_Merge(src proto.Message)
- func (m *CosmWasmPool) XXX_Size() int
- func (m *CosmWasmPool) XXX_Unmarshal(b []byte) error
- type MsgCreateCosmWasmPool
- func (msg MsgCreateCosmWasmPool) CreatePool(ctx sdk.Context, poolID uint64) (poolmanagertypes.PoolI, error)
- func (*MsgCreateCosmWasmPool) Descriptor() ([]byte, []int)
- func (m *MsgCreateCosmWasmPool) GetCodeId() uint64
- func (m *MsgCreateCosmWasmPool) GetInstantiateMsg() []byte
- func (msg MsgCreateCosmWasmPool) GetPoolType() poolmanagertypes.PoolType
- func (m *MsgCreateCosmWasmPool) GetSender() string
- func (msg MsgCreateCosmWasmPool) GetSignBytes() []byte
- func (msg MsgCreateCosmWasmPool) GetSigners() []sdk.AccAddress
- func (msg MsgCreateCosmWasmPool) InitialLiquidity() sdk.Coins
- func (m *MsgCreateCosmWasmPool) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateCosmWasmPool) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateCosmWasmPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (msg MsgCreateCosmWasmPool) PoolCreator() sdk.AccAddress
- func (*MsgCreateCosmWasmPool) ProtoMessage()
- func (m *MsgCreateCosmWasmPool) Reset()
- func (msg MsgCreateCosmWasmPool) Route() string
- func (m *MsgCreateCosmWasmPool) Size() (n int)
- func (m *MsgCreateCosmWasmPool) String() string
- func (msg MsgCreateCosmWasmPool) Type() string
- func (m *MsgCreateCosmWasmPool) Unmarshal(dAtA []byte) error
- func (msg MsgCreateCosmWasmPool) Validate(ctx sdk.Context) error
- func (msg MsgCreateCosmWasmPool) ValidateBasic() error
- func (m *MsgCreateCosmWasmPool) XXX_DiscardUnknown()
- func (m *MsgCreateCosmWasmPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateCosmWasmPool) XXX_Merge(src proto.Message)
- func (m *MsgCreateCosmWasmPool) XXX_Size() int
- func (m *MsgCreateCosmWasmPool) XXX_Unmarshal(b []byte) error
- type MsgCreateCosmWasmPoolResponse
- func (*MsgCreateCosmWasmPoolResponse) Descriptor() ([]byte, []int)
- func (m *MsgCreateCosmWasmPoolResponse) GetPoolID() uint64
- func (m *MsgCreateCosmWasmPoolResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateCosmWasmPoolResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateCosmWasmPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateCosmWasmPoolResponse) ProtoMessage()
- func (m *MsgCreateCosmWasmPoolResponse) Reset()
- func (m *MsgCreateCosmWasmPoolResponse) Size() (n int)
- func (m *MsgCreateCosmWasmPoolResponse) String() string
- func (m *MsgCreateCosmWasmPoolResponse) Unmarshal(dAtA []byte) error
- func (m *MsgCreateCosmWasmPoolResponse) XXX_DiscardUnknown()
- func (m *MsgCreateCosmWasmPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateCosmWasmPoolResponse) XXX_Merge(src proto.Message)
- func (m *MsgCreateCosmWasmPoolResponse) XXX_Size() int
- func (m *MsgCreateCosmWasmPoolResponse) XXX_Unmarshal(b []byte) error
- type MsgCreatorClient
- type MsgCreatorServer
- type Pool
- func (p Pool) AsSerializablePool() poolmanagertypes.PoolI
- func (p Pool) GetAddress() sdk.AccAddress
- func (p Pool) GetCodeId() uint64
- func (p Pool) GetContractAddress() string
- func (p Pool) GetId() uint64
- func (p Pool) GetInstantiateMsg() []byte
- func (p Pool) GetSpreadFactor(ctx sdk.Context) osmomath.Dec
- func (p Pool) GetStoreModel() poolmanagertypes.PoolI
- func (p Pool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins
- func (p Pool) GetType() poolmanagertypes.PoolType
- func (p Pool) IsActive(ctx sdk.Context) bool
- func (p *Pool) SetContractAddress(contractAddress string)
- func (p *Pool) SetWasmKeeper(wasmKeeper types.WasmKeeper)
- func (p Pool) SpotPrice(ctx sdk.Context, quoteAssetDenom string, baseAssetDenom string) (osmomath.BigDec, error)
- func (p Pool) String() string
- type UnimplementedMsgCreatorServer
Constants ¶
const (
TypeMsgCreateCosmWasmPool = "create_cosmwasm_pool"
)
constants.
Variables ¶
var ( ErrInvalidLengthPool = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPool = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPool = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var (
ModuleCdc = codec.NewAminoCodec(amino)
)
Functions ¶
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterMsgCreatorServer ¶
func RegisterMsgCreatorServer(s grpc1.Server, srv MsgCreatorServer)
Types ¶
type CosmWasmPool ¶
type CosmWasmPool struct { ContractAddress string `` /* 130-byte string literal not displayed */ PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` CodeId uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` InstantiateMsg []byte `` /* 126-byte string literal not displayed */ }
CosmWasmPool represents the data serialized into state for each CW pool.
Note: CW Pool has 2 pool models: - CosmWasmPool which is a proto-generated store model used for serialization into state. - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling the contract.
CosmWasmPool implements the poolmanager.PoolI interface but it panics on all methods. The reason is that access to wasmKeeper is required to call the contract.
Instead, all interactions and poolmanager.PoolI methods are to be performed on the Pool struct. The reason why we cannot have a Pool struct only is because it cannot be serialized into state due to having a non-serializable wasmKeeper field.
func (*CosmWasmPool) AsSerializablePool ¶
func (p *CosmWasmPool) AsSerializablePool() poolmanagertypes.PoolI
func (*CosmWasmPool) Descriptor ¶
func (*CosmWasmPool) Descriptor() ([]byte, []int)
func (CosmWasmPool) GetAddress ¶
func (p CosmWasmPool) GetAddress() sdk.AccAddress
func (CosmWasmPool) GetCodeId ¶
func (p CosmWasmPool) GetCodeId() uint64
func (CosmWasmPool) GetContractAddress ¶
func (p CosmWasmPool) GetContractAddress() string
func (CosmWasmPool) GetExitFee ¶
func (p CosmWasmPool) GetExitFee(ctx sdk.Context) osmomath.Dec
func (CosmWasmPool) GetId ¶
func (p CosmWasmPool) GetId() uint64
func (CosmWasmPool) GetInstantiateMsg ¶
func (p CosmWasmPool) GetInstantiateMsg() []byte
func (CosmWasmPool) GetSpreadFactor ¶
func (p CosmWasmPool) GetSpreadFactor(ctx sdk.Context) osmomath.Dec
func (CosmWasmPool) GetStoreModel ¶
func (p CosmWasmPool) GetStoreModel() poolmanagertypes.PoolI
func (CosmWasmPool) GetTotalPoolLiquidity ¶
func (p CosmWasmPool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins
func (CosmWasmPool) GetType ¶
func (p CosmWasmPool) GetType() poolmanagertypes.PoolType
func (*CosmWasmPool) Marshal ¶
func (m *CosmWasmPool) Marshal() (dAtA []byte, err error)
func (*CosmWasmPool) MarshalToSizedBuffer ¶
func (m *CosmWasmPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CosmWasmPool) ProtoMessage ¶
func (*CosmWasmPool) ProtoMessage()
func (*CosmWasmPool) Reset ¶
func (m *CosmWasmPool) Reset()
func (*CosmWasmPool) SetContractAddress ¶
func (p *CosmWasmPool) SetContractAddress(contractAddress string)
func (CosmWasmPool) SetWasmKeeper ¶
func (p CosmWasmPool) SetWasmKeeper(wasmKeeper types.WasmKeeper)
func (*CosmWasmPool) Size ¶
func (m *CosmWasmPool) Size() (n int)
func (CosmWasmPool) String ¶
func (p CosmWasmPool) String() string
String returns the json marshalled string of the pool
func (*CosmWasmPool) Unmarshal ¶
func (m *CosmWasmPool) Unmarshal(dAtA []byte) error
func (*CosmWasmPool) XXX_DiscardUnknown ¶
func (m *CosmWasmPool) XXX_DiscardUnknown()
func (*CosmWasmPool) XXX_Marshal ¶
func (m *CosmWasmPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CosmWasmPool) XXX_Merge ¶
func (m *CosmWasmPool) XXX_Merge(src proto.Message)
func (*CosmWasmPool) XXX_Size ¶
func (m *CosmWasmPool) XXX_Size() int
func (*CosmWasmPool) XXX_Unmarshal ¶
func (m *CosmWasmPool) XXX_Unmarshal(b []byte) error
type MsgCreateCosmWasmPool ¶
type MsgCreateCosmWasmPool struct { CodeId uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty" yaml:"code_id"` InstantiateMsg []byte `` /* 126-byte string literal not displayed */ Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` }
===================== MsgCreateCosmwasmPool
func NewMsgCreateCosmWasmPool ¶
func NewMsgCreateCosmWasmPool( codeId uint64, sender sdk.AccAddress, instantiateMsg []byte, ) MsgCreateCosmWasmPool
func (MsgCreateCosmWasmPool) CreatePool ¶
func (msg MsgCreateCosmWasmPool) CreatePool(ctx sdk.Context, poolID uint64) (poolmanagertypes.PoolI, error)
func (*MsgCreateCosmWasmPool) Descriptor ¶
func (*MsgCreateCosmWasmPool) Descriptor() ([]byte, []int)
func (*MsgCreateCosmWasmPool) GetCodeId ¶
func (m *MsgCreateCosmWasmPool) GetCodeId() uint64
func (*MsgCreateCosmWasmPool) GetInstantiateMsg ¶
func (m *MsgCreateCosmWasmPool) GetInstantiateMsg() []byte
func (MsgCreateCosmWasmPool) GetPoolType ¶
func (msg MsgCreateCosmWasmPool) GetPoolType() poolmanagertypes.PoolType
func (*MsgCreateCosmWasmPool) GetSender ¶
func (m *MsgCreateCosmWasmPool) GetSender() string
func (MsgCreateCosmWasmPool) GetSignBytes ¶
func (msg MsgCreateCosmWasmPool) GetSignBytes() []byte
func (MsgCreateCosmWasmPool) GetSigners ¶
func (msg MsgCreateCosmWasmPool) GetSigners() []sdk.AccAddress
func (MsgCreateCosmWasmPool) InitialLiquidity ¶
func (msg MsgCreateCosmWasmPool) InitialLiquidity() sdk.Coins
func (*MsgCreateCosmWasmPool) Marshal ¶
func (m *MsgCreateCosmWasmPool) Marshal() (dAtA []byte, err error)
func (*MsgCreateCosmWasmPool) MarshalTo ¶
func (m *MsgCreateCosmWasmPool) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateCosmWasmPool) MarshalToSizedBuffer ¶
func (m *MsgCreateCosmWasmPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (MsgCreateCosmWasmPool) PoolCreator ¶
func (msg MsgCreateCosmWasmPool) PoolCreator() sdk.AccAddress
Implement the CreatePoolMsg interface
func (*MsgCreateCosmWasmPool) ProtoMessage ¶
func (*MsgCreateCosmWasmPool) ProtoMessage()
func (*MsgCreateCosmWasmPool) Reset ¶
func (m *MsgCreateCosmWasmPool) Reset()
func (MsgCreateCosmWasmPool) Route ¶
func (msg MsgCreateCosmWasmPool) Route() string
func (*MsgCreateCosmWasmPool) Size ¶
func (m *MsgCreateCosmWasmPool) Size() (n int)
func (*MsgCreateCosmWasmPool) String ¶
func (m *MsgCreateCosmWasmPool) String() string
func (MsgCreateCosmWasmPool) Type ¶
func (msg MsgCreateCosmWasmPool) Type() string
func (*MsgCreateCosmWasmPool) Unmarshal ¶
func (m *MsgCreateCosmWasmPool) Unmarshal(dAtA []byte) error
func (MsgCreateCosmWasmPool) Validate ¶
func (msg MsgCreateCosmWasmPool) Validate(ctx sdk.Context) error
func (MsgCreateCosmWasmPool) ValidateBasic ¶
func (msg MsgCreateCosmWasmPool) ValidateBasic() error
func (*MsgCreateCosmWasmPool) XXX_DiscardUnknown ¶
func (m *MsgCreateCosmWasmPool) XXX_DiscardUnknown()
func (*MsgCreateCosmWasmPool) XXX_Marshal ¶
func (m *MsgCreateCosmWasmPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateCosmWasmPool) XXX_Merge ¶
func (m *MsgCreateCosmWasmPool) XXX_Merge(src proto.Message)
func (*MsgCreateCosmWasmPool) XXX_Size ¶
func (m *MsgCreateCosmWasmPool) XXX_Size() int
func (*MsgCreateCosmWasmPool) XXX_Unmarshal ¶
func (m *MsgCreateCosmWasmPool) XXX_Unmarshal(b []byte) error
type MsgCreateCosmWasmPoolResponse ¶
type MsgCreateCosmWasmPoolResponse struct {
PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
}
Returns a unique poolID to identify the pool with.
func (*MsgCreateCosmWasmPoolResponse) Descriptor ¶
func (*MsgCreateCosmWasmPoolResponse) Descriptor() ([]byte, []int)
func (*MsgCreateCosmWasmPoolResponse) GetPoolID ¶
func (m *MsgCreateCosmWasmPoolResponse) GetPoolID() uint64
func (*MsgCreateCosmWasmPoolResponse) Marshal ¶
func (m *MsgCreateCosmWasmPoolResponse) Marshal() (dAtA []byte, err error)
func (*MsgCreateCosmWasmPoolResponse) MarshalTo ¶
func (m *MsgCreateCosmWasmPoolResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateCosmWasmPoolResponse) MarshalToSizedBuffer ¶
func (m *MsgCreateCosmWasmPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateCosmWasmPoolResponse) ProtoMessage ¶
func (*MsgCreateCosmWasmPoolResponse) ProtoMessage()
func (*MsgCreateCosmWasmPoolResponse) Reset ¶
func (m *MsgCreateCosmWasmPoolResponse) Reset()
func (*MsgCreateCosmWasmPoolResponse) Size ¶
func (m *MsgCreateCosmWasmPoolResponse) Size() (n int)
func (*MsgCreateCosmWasmPoolResponse) String ¶
func (m *MsgCreateCosmWasmPoolResponse) String() string
func (*MsgCreateCosmWasmPoolResponse) Unmarshal ¶
func (m *MsgCreateCosmWasmPoolResponse) Unmarshal(dAtA []byte) error
func (*MsgCreateCosmWasmPoolResponse) XXX_DiscardUnknown ¶
func (m *MsgCreateCosmWasmPoolResponse) XXX_DiscardUnknown()
func (*MsgCreateCosmWasmPoolResponse) XXX_Marshal ¶
func (m *MsgCreateCosmWasmPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateCosmWasmPoolResponse) XXX_Merge ¶
func (m *MsgCreateCosmWasmPoolResponse) XXX_Merge(src proto.Message)
func (*MsgCreateCosmWasmPoolResponse) XXX_Size ¶
func (m *MsgCreateCosmWasmPoolResponse) XXX_Size() int
func (*MsgCreateCosmWasmPoolResponse) XXX_Unmarshal ¶
func (m *MsgCreateCosmWasmPoolResponse) XXX_Unmarshal(b []byte) error
type MsgCreatorClient ¶
type MsgCreatorClient interface {
CreateCosmWasmPool(ctx context.Context, in *MsgCreateCosmWasmPool, opts ...grpc.CallOption) (*MsgCreateCosmWasmPoolResponse, error)
}
MsgCreatorClient is the client API for MsgCreator service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgCreatorClient ¶
func NewMsgCreatorClient(cc grpc1.ClientConn) MsgCreatorClient
type MsgCreatorServer ¶
type MsgCreatorServer interface {
CreateCosmWasmPool(context.Context, *MsgCreateCosmWasmPool) (*MsgCreateCosmWasmPoolResponse, error)
}
MsgCreatorServer is the server API for MsgCreator service.
type Pool ¶
type Pool struct { CosmWasmPool WasmKeeper types.WasmKeeper }
Pool encapsulates all data and behavior for interacting with a CW pool.
Note: CW Pool has 2 pool models: - CosmWasmPool which is a proto-generated store model used for serialization into state. - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling the contract.
CosmWasmPool implements the poolmanager.PoolI interface but it panics on all methods. The reason is that access to wasmKeeper is required to call the contract.
Instead, all interactions and poolmanager.PoolI methods are to be performed on the Pool struct. The reason why we cannot have a Pool struct only is because it cannot be serialized into state due to having a non-serializable wasmKeeper field.
func NewCosmWasmPool ¶
NewCosmWasmPool creates a new CosmWasm pool with the specified parameters.
func (Pool) AsSerializablePool ¶
func (p Pool) AsSerializablePool() poolmanagertypes.PoolI
func (Pool) GetAddress ¶
func (p Pool) GetAddress() sdk.AccAddress
GetAddress returns the address of the cosmwasm pool
func (Pool) GetContractAddress ¶
func (Pool) GetInstantiateMsg ¶
func (Pool) GetSpreadFactor ¶
GetSpreadFactor returns the swap fee of the pool.
func (Pool) GetStoreModel ¶
func (p Pool) GetStoreModel() poolmanagertypes.PoolI
func (Pool) GetTotalPoolLiquidity ¶
GetTotalPoolLiquidity returns the total pool liquidity
func (Pool) GetType ¶
func (p Pool) GetType() poolmanagertypes.PoolType
GetType returns the type of the pool.
func (*Pool) SetContractAddress ¶
func (*Pool) SetWasmKeeper ¶
func (p *Pool) SetWasmKeeper(wasmKeeper types.WasmKeeper)
Set the wasm keeper.
type UnimplementedMsgCreatorServer ¶
type UnimplementedMsgCreatorServer struct { }
UnimplementedMsgCreatorServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgCreatorServer) CreateCosmWasmPool ¶
func (*UnimplementedMsgCreatorServer) CreateCosmWasmPool(ctx context.Context, req *MsgCreateCosmWasmPool) (*MsgCreateCosmWasmPoolResponse, error)