types

package
v0.0.0-...-def7031 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeLoanAsset            = "loan_asset"
	EventTypeWithdrawLoanedAsset  = "withdraw_loaned_asset"
	EventTypeSetCollateralSetting = "set_collateral_setting"
	EventTypeBorrowAsset          = "borrow_asset"
	EventTypeRepayBorrowedAsset   = "repay_borrowed_asset"

	EventAttrModule   = ModuleName
	EventAttrLender   = "lender"
	EventAttrBorrower = "borrower"
	EventAttrDenom    = "denom"
	EventAttrEnable   = "enabled"
)

Event types and attributes for the leverage module

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

	// 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
)
View Source
const (
	// UTokenPrefix defines the uToken denomination prefix for all uToken types.
	UTokenPrefix = "u/"

	// ProposalTypeUpdateRegistryProposal defines the type for a UpdateRegistryProposal
	// proposal type.
	ProposalTypeUpdateRegistryProposal = "UpdateRegistryProposal"
)
View Source
const (
	// ProposalTypeChange defines the type for a UpdateAssetsProposal
	ProposalTypeUpdateAssetsProposal = "UpdateAssetsProposal"
)

Variables

View Source
var (
	ErrInvalidAsset            = sdkerrors.Register(ModuleName, 1100, "invalid asset")
	ErrInsufficientBalance     = sdkerrors.Register(ModuleName, 1101, "insufficient balance")
	ErrBorrowLimitLow          = sdkerrors.Register(ModuleName, 1102, "borrow limit too low")
	ErrLendingPoolInsufficient = sdkerrors.Register(ModuleName, 1103, "lending pool insufficient")
	ErrInvalidRepayment        = sdkerrors.Register(ModuleName, 1104, "invalid repayment")
	ErrInvalidAddress          = sdkerrors.Register(ModuleName, 1105, "invalid address")
)
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 (
	ErrInvalidLengthGov        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGov          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeyPrefixTokenDenom        = []byte{0x01}
	KeyPrefixUTokenDenom       = []byte{0x02}
	KeyPrefixRegisteredToken   = []byte{0x03}
	KeyPrefixLoanToken         = []byte{0x04}
	KeyPrefixCollateralSetting = []byte{0x05}
)

KVStore key prefixes

View Source
var (
	ErrInvalidLengthLeverage        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLeverage          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLeverage = 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 (

	// ModuleCdc references the global x/leverage module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding as
	// Amino is still used for that purpose.
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func CreateCollateralSettingKey

func CreateCollateralSettingKey(borrowerAddr sdk.AccAddress, uTokenDenom string) []byte

CreateCollateralSettingKey returns a KVStore key for getting and setting a borrower's collateral setting for a single uToken

func CreateLoanKey

func CreateLoanKey(borrowerAddr sdk.AccAddress, tokenDenom string) []byte

CreateLoanKey returns a KVStore key for getting and setting a Loan for a denom and borrower address.

func CreateLoanKeyNoDenom

func CreateLoanKeyNoDenom(borrowerAddr sdk.AccAddress) []byte

CreateLoanKeyNoDenom returns the common prefix used by all loans associated with a given borrower address.

func CreateRegisteredTokenKey

func CreateRegisteredTokenKey(baseTokenDenom string) []byte

CreateRegisteredTokenKey returns a KVStore key for getting and setting a Token.

func CreateTokenDenomKey

func CreateTokenDenomKey(tokenDenom string) []byte

CreateTokenDenomKey returns a KVStore key for getting and storing a token's associated uToken denomination.

func CreateUTokenDenomKey

func CreateUTokenDenomKey(uTokenDenom string) []byte

CreateUTokenDenomKey returns a KVStore key for getting and storing a uToken's associated token denomination.

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the x/leverage module's parameter KeyTable expected by the x/params module.

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

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

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func UTokenFromTokenDenom

func UTokenFromTokenDenom(tokenDenom string) string

UTokenFromTokenDenom returns the uToken denom given a token denom.

Types

type BankKeeper

type BankKeeper interface {
	GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
	SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
	IterateAllDenomMetaData(ctx sdk.Context, cb func(banktypes.Metadata) bool)
	GetSupply(ctx sdk.Context, denom string) sdk.Coin
	// Note: The following will panic until we have a module account
	// See auth/types/ModuleAccount
	MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amounts 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
	// Question: Do we need the following (commented out)?
	// SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
	// BlockedAddr(addr sdk.AccAddress) bool
	HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool
}

BankKeeper defines the expected x/bank keeper interface.

type GenesisState

type GenesisState struct {
	Params   Params  `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Registry []Token `protobuf:"bytes,2,rep,name=registry,proto3" json:"registry"`
}

GenesisState defines the x/leverage module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default genesis state of the x/leverage module.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetRegistry

func (m *GenesisState) GetRegistry() []Token

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 MsgBorrowAsset

type MsgBorrowAsset struct {
	Borrower string     `protobuf:"bytes,1,opt,name=borrower,proto3" json:"borrower,omitempty"`
	Amount   types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
}

MsgBorrowAsset represents a lender's request to borrow a base asset type from the module.

func (*MsgBorrowAsset) Descriptor

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

func (*MsgBorrowAsset) GetAmount

func (m *MsgBorrowAsset) GetAmount() types.Coin

func (*MsgBorrowAsset) GetBorrower

func (m *MsgBorrowAsset) GetBorrower() string

func (*MsgBorrowAsset) GetSigners

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

func (*MsgBorrowAsset) Marshal

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

func (*MsgBorrowAsset) MarshalTo

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

func (*MsgBorrowAsset) MarshalToSizedBuffer

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

func (*MsgBorrowAsset) ProtoMessage

func (*MsgBorrowAsset) ProtoMessage()

func (*MsgBorrowAsset) Reset

func (m *MsgBorrowAsset) Reset()

func (*MsgBorrowAsset) Size

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

func (*MsgBorrowAsset) String

func (m *MsgBorrowAsset) String() string

func (*MsgBorrowAsset) Unmarshal

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

func (*MsgBorrowAsset) ValidateBasic

func (msg *MsgBorrowAsset) ValidateBasic() error

func (*MsgBorrowAsset) XXX_DiscardUnknown

func (m *MsgBorrowAsset) XXX_DiscardUnknown()

func (*MsgBorrowAsset) XXX_Marshal

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

func (*MsgBorrowAsset) XXX_Merge

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

func (*MsgBorrowAsset) XXX_Size

func (m *MsgBorrowAsset) XXX_Size() int

func (*MsgBorrowAsset) XXX_Unmarshal

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

type MsgBorrowAssetResponse

type MsgBorrowAssetResponse struct {
}

MsgBorrowAssetResponse defines the Msg/BorrowAsset response type.

func (*MsgBorrowAssetResponse) Descriptor

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

func (*MsgBorrowAssetResponse) Marshal

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

func (*MsgBorrowAssetResponse) MarshalTo

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

func (*MsgBorrowAssetResponse) MarshalToSizedBuffer

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

func (*MsgBorrowAssetResponse) ProtoMessage

func (*MsgBorrowAssetResponse) ProtoMessage()

func (*MsgBorrowAssetResponse) Reset

func (m *MsgBorrowAssetResponse) Reset()

func (*MsgBorrowAssetResponse) Size

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

func (*MsgBorrowAssetResponse) String

func (m *MsgBorrowAssetResponse) String() string

func (*MsgBorrowAssetResponse) Unmarshal

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

func (*MsgBorrowAssetResponse) XXX_DiscardUnknown

func (m *MsgBorrowAssetResponse) XXX_DiscardUnknown()

func (*MsgBorrowAssetResponse) XXX_Marshal

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

func (*MsgBorrowAssetResponse) XXX_Merge

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

func (*MsgBorrowAssetResponse) XXX_Size

func (m *MsgBorrowAssetResponse) XXX_Size() int

func (*MsgBorrowAssetResponse) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	// LendAsset defines a method for lending coins to the capital facility.
	LendAsset(ctx context.Context, in *MsgLendAsset, opts ...grpc.CallOption) (*MsgLendAssetResponse, error)
	// WithdrawAsset defines a method for withdrawing previously lent coins from
	// the capital facility.
	WithdrawAsset(ctx context.Context, in *MsgWithdrawAsset, opts ...grpc.CallOption) (*MsgWithdrawAssetResponse, error)
	// SetCollateral defines a method for users to enable or disable a uToken
	// denomination in their wallet for use as collateral.
	SetCollateral(ctx context.Context, in *MsgSetCollateral, opts ...grpc.CallOption) (*MsgSetCollateralResponse, error)
	// BorrowAsset defines a method for borrowing coins from the capital facility.
	BorrowAsset(ctx context.Context, in *MsgBorrowAsset, opts ...grpc.CallOption) (*MsgBorrowAssetResponse, error)
	// RepayAsset defines a method for repaying borrowed coins to the capital facility.
	RepayAsset(ctx context.Context, in *MsgRepayAsset, opts ...grpc.CallOption) (*MsgRepayAssetResponse, error)
}

MsgClient is the client API for Msg service.

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

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgLendAsset

type MsgLendAsset struct {
	Lender string     `protobuf:"bytes,1,opt,name=lender,proto3" json:"lender,omitempty"`
	Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
}

MsgLendAsset represents a lender's request to lend a base asset type to the module

func (*MsgLendAsset) Descriptor

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

func (*MsgLendAsset) GetAmount

func (m *MsgLendAsset) GetAmount() types.Coin

func (*MsgLendAsset) GetLender

func (m *MsgLendAsset) GetLender() string

func (*MsgLendAsset) GetSigners

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

func (*MsgLendAsset) Marshal

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

func (*MsgLendAsset) MarshalTo

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

func (*MsgLendAsset) MarshalToSizedBuffer

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

func (*MsgLendAsset) ProtoMessage

func (*MsgLendAsset) ProtoMessage()

func (*MsgLendAsset) Reset

func (m *MsgLendAsset) Reset()

func (*MsgLendAsset) Size

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

func (*MsgLendAsset) String

func (m *MsgLendAsset) String() string

func (*MsgLendAsset) Unmarshal

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

func (*MsgLendAsset) ValidateBasic

func (msg *MsgLendAsset) ValidateBasic() error

func (*MsgLendAsset) XXX_DiscardUnknown

func (m *MsgLendAsset) XXX_DiscardUnknown()

func (*MsgLendAsset) XXX_Marshal

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

func (*MsgLendAsset) XXX_Merge

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

func (*MsgLendAsset) XXX_Size

func (m *MsgLendAsset) XXX_Size() int

func (*MsgLendAsset) XXX_Unmarshal

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

type MsgLendAssetResponse

type MsgLendAssetResponse struct {
}

MsgLendAssetResponse defines the Msg/LendAsset response type.

func (*MsgLendAssetResponse) Descriptor

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

func (*MsgLendAssetResponse) Marshal

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

func (*MsgLendAssetResponse) MarshalTo

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

func (*MsgLendAssetResponse) MarshalToSizedBuffer

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

func (*MsgLendAssetResponse) ProtoMessage

func (*MsgLendAssetResponse) ProtoMessage()

func (*MsgLendAssetResponse) Reset

func (m *MsgLendAssetResponse) Reset()

func (*MsgLendAssetResponse) Size

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

func (*MsgLendAssetResponse) String

func (m *MsgLendAssetResponse) String() string

func (*MsgLendAssetResponse) Unmarshal

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

func (*MsgLendAssetResponse) XXX_DiscardUnknown

func (m *MsgLendAssetResponse) XXX_DiscardUnknown()

func (*MsgLendAssetResponse) XXX_Marshal

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

func (*MsgLendAssetResponse) XXX_Merge

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

func (*MsgLendAssetResponse) XXX_Size

func (m *MsgLendAssetResponse) XXX_Size() int

func (*MsgLendAssetResponse) XXX_Unmarshal

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

type MsgRepayAsset

type MsgRepayAsset struct {
	Borrower string     `protobuf:"bytes,1,opt,name=borrower,proto3" json:"borrower,omitempty"`
	Amount   types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
}

MsgRepayAsset represents a lender's request to repay a borrowed base asset type to the module.

func (*MsgRepayAsset) Descriptor

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

func (*MsgRepayAsset) GetAmount

func (m *MsgRepayAsset) GetAmount() types.Coin

func (*MsgRepayAsset) GetBorrower

func (m *MsgRepayAsset) GetBorrower() string

func (*MsgRepayAsset) GetSigners

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

func (*MsgRepayAsset) Marshal

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

func (*MsgRepayAsset) MarshalTo

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

func (*MsgRepayAsset) MarshalToSizedBuffer

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

func (*MsgRepayAsset) ProtoMessage

func (*MsgRepayAsset) ProtoMessage()

func (*MsgRepayAsset) Reset

func (m *MsgRepayAsset) Reset()

func (*MsgRepayAsset) Size

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

func (*MsgRepayAsset) String

func (m *MsgRepayAsset) String() string

func (*MsgRepayAsset) Unmarshal

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

func (*MsgRepayAsset) ValidateBasic

func (msg *MsgRepayAsset) ValidateBasic() error

func (*MsgRepayAsset) XXX_DiscardUnknown

func (m *MsgRepayAsset) XXX_DiscardUnknown()

func (*MsgRepayAsset) XXX_Marshal

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

func (*MsgRepayAsset) XXX_Merge

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

func (*MsgRepayAsset) XXX_Size

func (m *MsgRepayAsset) XXX_Size() int

func (*MsgRepayAsset) XXX_Unmarshal

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

type MsgRepayAssetResponse

type MsgRepayAssetResponse struct {
}

MsgRepayAssetResponse defines the Msg/RepayAsset response type.

func (*MsgRepayAssetResponse) Descriptor

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

func (*MsgRepayAssetResponse) Marshal

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

func (*MsgRepayAssetResponse) MarshalTo

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

func (*MsgRepayAssetResponse) MarshalToSizedBuffer

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

func (*MsgRepayAssetResponse) ProtoMessage

func (*MsgRepayAssetResponse) ProtoMessage()

func (*MsgRepayAssetResponse) Reset

func (m *MsgRepayAssetResponse) Reset()

func (*MsgRepayAssetResponse) Size

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

func (*MsgRepayAssetResponse) String

func (m *MsgRepayAssetResponse) String() string

func (*MsgRepayAssetResponse) Unmarshal

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

func (*MsgRepayAssetResponse) XXX_DiscardUnknown

func (m *MsgRepayAssetResponse) XXX_DiscardUnknown()

func (*MsgRepayAssetResponse) XXX_Marshal

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

func (*MsgRepayAssetResponse) XXX_Merge

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

func (*MsgRepayAssetResponse) XXX_Size

func (m *MsgRepayAssetResponse) XXX_Size() int

func (*MsgRepayAssetResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// LendAsset defines a method for lending coins to the capital facility.
	LendAsset(context.Context, *MsgLendAsset) (*MsgLendAssetResponse, error)
	// WithdrawAsset defines a method for withdrawing previously lent coins from
	// the capital facility.
	WithdrawAsset(context.Context, *MsgWithdrawAsset) (*MsgWithdrawAssetResponse, error)
	// SetCollateral defines a method for users to enable or disable a uToken
	// denomination in their wallet for use as collateral.
	SetCollateral(context.Context, *MsgSetCollateral) (*MsgSetCollateralResponse, error)
	// BorrowAsset defines a method for borrowing coins from the capital facility.
	BorrowAsset(context.Context, *MsgBorrowAsset) (*MsgBorrowAssetResponse, error)
	// RepayAsset defines a method for repaying borrowed coins to the capital facility.
	RepayAsset(context.Context, *MsgRepayAsset) (*MsgRepayAssetResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSetCollateral

type MsgSetCollateral struct {
	Borrower string `protobuf:"bytes,1,opt,name=borrower,proto3" json:"borrower,omitempty"`
	Denom    string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"`
	Enable   bool   `protobuf:"varint,3,opt,name=enable,proto3" json:"enable,omitempty"`
}

MsgSetCollateral represents a lender's request to enable or disable a uToken type in their possession as collateral.

func (*MsgSetCollateral) Descriptor

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

func (*MsgSetCollateral) GetBorrower

func (m *MsgSetCollateral) GetBorrower() string

func (*MsgSetCollateral) GetDenom

func (m *MsgSetCollateral) GetDenom() string

func (*MsgSetCollateral) GetEnable

func (m *MsgSetCollateral) GetEnable() bool

func (*MsgSetCollateral) GetSigners

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

func (*MsgSetCollateral) Marshal

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

func (*MsgSetCollateral) MarshalTo

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

func (*MsgSetCollateral) MarshalToSizedBuffer

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

func (*MsgSetCollateral) ProtoMessage

func (*MsgSetCollateral) ProtoMessage()

func (*MsgSetCollateral) Reset

func (m *MsgSetCollateral) Reset()

func (*MsgSetCollateral) Size

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

func (*MsgSetCollateral) String

func (m *MsgSetCollateral) String() string

func (*MsgSetCollateral) Unmarshal

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

func (*MsgSetCollateral) ValidateBasic

func (msg *MsgSetCollateral) ValidateBasic() error

func (*MsgSetCollateral) XXX_DiscardUnknown

func (m *MsgSetCollateral) XXX_DiscardUnknown()

func (*MsgSetCollateral) XXX_Marshal

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

func (*MsgSetCollateral) XXX_Merge

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

func (*MsgSetCollateral) XXX_Size

func (m *MsgSetCollateral) XXX_Size() int

func (*MsgSetCollateral) XXX_Unmarshal

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

type MsgSetCollateralResponse

type MsgSetCollateralResponse struct {
}

MsgSetCollateralResponse defines the Msg/SetCollateral response type.

func (*MsgSetCollateralResponse) Descriptor

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

func (*MsgSetCollateralResponse) Marshal

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

func (*MsgSetCollateralResponse) MarshalTo

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

func (*MsgSetCollateralResponse) MarshalToSizedBuffer

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

func (*MsgSetCollateralResponse) ProtoMessage

func (*MsgSetCollateralResponse) ProtoMessage()

func (*MsgSetCollateralResponse) Reset

func (m *MsgSetCollateralResponse) Reset()

func (*MsgSetCollateralResponse) Size

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

func (*MsgSetCollateralResponse) String

func (m *MsgSetCollateralResponse) String() string

func (*MsgSetCollateralResponse) Unmarshal

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

func (*MsgSetCollateralResponse) XXX_DiscardUnknown

func (m *MsgSetCollateralResponse) XXX_DiscardUnknown()

func (*MsgSetCollateralResponse) XXX_Marshal

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

func (*MsgSetCollateralResponse) XXX_Merge

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

func (*MsgSetCollateralResponse) XXX_Size

func (m *MsgSetCollateralResponse) XXX_Size() int

func (*MsgSetCollateralResponse) XXX_Unmarshal

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

type MsgWithdrawAsset

type MsgWithdrawAsset struct {
	Lender string     `protobuf:"bytes,1,opt,name=lender,proto3" json:"lender,omitempty"`
	Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
}

MsgWithdrawAsset represents a lender's request to withdraw a previously lent base asset type from the module

func (*MsgWithdrawAsset) Descriptor

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

func (*MsgWithdrawAsset) GetAmount

func (m *MsgWithdrawAsset) GetAmount() types.Coin

func (*MsgWithdrawAsset) GetLender

func (m *MsgWithdrawAsset) GetLender() string

func (*MsgWithdrawAsset) GetSigners

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

func (*MsgWithdrawAsset) Marshal

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

func (*MsgWithdrawAsset) MarshalTo

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

func (*MsgWithdrawAsset) MarshalToSizedBuffer

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

func (*MsgWithdrawAsset) ProtoMessage

func (*MsgWithdrawAsset) ProtoMessage()

func (*MsgWithdrawAsset) Reset

func (m *MsgWithdrawAsset) Reset()

func (*MsgWithdrawAsset) Size

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

func (*MsgWithdrawAsset) String

func (m *MsgWithdrawAsset) String() string

func (*MsgWithdrawAsset) Unmarshal

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

func (*MsgWithdrawAsset) ValidateBasic

func (msg *MsgWithdrawAsset) ValidateBasic() error

func (*MsgWithdrawAsset) XXX_DiscardUnknown

func (m *MsgWithdrawAsset) XXX_DiscardUnknown()

func (*MsgWithdrawAsset) XXX_Marshal

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

func (*MsgWithdrawAsset) XXX_Merge

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

func (*MsgWithdrawAsset) XXX_Size

func (m *MsgWithdrawAsset) XXX_Size() int

func (*MsgWithdrawAsset) XXX_Unmarshal

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

type MsgWithdrawAssetResponse

type MsgWithdrawAssetResponse struct {
}

MsgWithdrawAssetResponse defines the Msg/WithdrawAsset response type.

func (*MsgWithdrawAssetResponse) Descriptor

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

func (*MsgWithdrawAssetResponse) Marshal

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

func (*MsgWithdrawAssetResponse) MarshalTo

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

func (*MsgWithdrawAssetResponse) MarshalToSizedBuffer

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

func (*MsgWithdrawAssetResponse) ProtoMessage

func (*MsgWithdrawAssetResponse) ProtoMessage()

func (*MsgWithdrawAssetResponse) Reset

func (m *MsgWithdrawAssetResponse) Reset()

func (*MsgWithdrawAssetResponse) Size

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

func (*MsgWithdrawAssetResponse) String

func (m *MsgWithdrawAssetResponse) String() string

func (*MsgWithdrawAssetResponse) Unmarshal

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

func (*MsgWithdrawAssetResponse) XXX_DiscardUnknown

func (m *MsgWithdrawAssetResponse) XXX_DiscardUnknown()

func (*MsgWithdrawAssetResponse) XXX_Marshal

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

func (*MsgWithdrawAssetResponse) XXX_Merge

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

func (*MsgWithdrawAssetResponse) XXX_Size

func (m *MsgWithdrawAssetResponse) XXX_Size() int

func (*MsgWithdrawAssetResponse) XXX_Unmarshal

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

type Params

type Params struct {
}

Params defines the parameters for the leverage module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams

func NewParams() Params

func (*Params) Descriptor

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

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 the ParamSet interface and returns all the key/value pairs pairs of x/leverage module's parameters.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (Params) String

func (p Params) String() string

String implements the Stringer interface.

func (*Params) Unmarshal

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

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 QueryClient

type QueryClient interface {
}

QueryClient is the client API for Query service.

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

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
}

QueryServer is the server API for Query service.

type Token

type Token struct {
	// The base_denom defines the denomination of the underlying base token.
	BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty" yaml:"base_denom"`
	// The exchange_rate rate defines the rate which this asset can be exchanged
	// for the asset's uToken.
	ExchangeRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 158-byte string literal not displayed */
	// The collateral_weight defines what amount of the total value of the asset
	// can contribute to a users bowering power. If the collateral_weight is zero,
	// using this asset as collateral against borrowing will be disabled.
	CollateralWeight github_com_cosmos_cosmos_sdk_types.Dec `` /* 174-byte string literal not displayed */
	// The base_borrow_rate defines the base interest rate for borrowing this
	// asset.
	BaseBorrowRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */
}

Token defines a token, along with its capital metadata, in the Hilo capital facility that can be loaned and borrowed.

TODO: Determine what additional parameters might be needed.

func (*Token) Descriptor

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

func (*Token) Equal

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

func (*Token) GetBaseDenom

func (m *Token) GetBaseDenom() string

func (*Token) Marshal

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

func (*Token) MarshalTo

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

func (*Token) MarshalToSizedBuffer

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

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) Reset

func (m *Token) Reset()

func (*Token) Size

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

func (*Token) String

func (m *Token) String() string

func (*Token) Unmarshal

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

func (Token) Validate

func (t Token) Validate() error

Validate performs validation on an Token type returning an error if the Token is invalid.

func (*Token) XXX_DiscardUnknown

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal

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

func (*Token) XXX_Merge

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

func (*Token) XXX_Size

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) BorrowAsset

func (*UnimplementedMsgServer) LendAsset

func (*UnimplementedMsgServer) RepayAsset

func (*UnimplementedMsgServer) SetCollateral

func (*UnimplementedMsgServer) WithdrawAsset

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

type UpdateRegistryProposal

type UpdateRegistryProposal struct {
	Title       string  `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string  `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Registry    []Token `protobuf:"bytes,3,rep,name=registry,proto3" json:"registry"`
}

UpdateRegistryProposal defines a governance proposal type where the token registry can be updated in the Hilo capital facility. Note, the registry defined in the proposal replaces the current registry in its entirety.

func NewUpdateRegistryProposal

func NewUpdateRegistryProposal(title, description string, tokens []Token) *UpdateRegistryProposal

func (*UpdateRegistryProposal) Descriptor

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

func (*UpdateRegistryProposal) Equal

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

func (*UpdateRegistryProposal) GetDescription

func (p *UpdateRegistryProposal) GetDescription() string

GetDescription returns the description of the proposal.

func (*UpdateRegistryProposal) GetTitle

func (p *UpdateRegistryProposal) GetTitle() string

GetTitle returns the title of the proposal.

func (*UpdateRegistryProposal) Marshal

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

func (*UpdateRegistryProposal) MarshalTo

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

func (*UpdateRegistryProposal) MarshalToSizedBuffer

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

func (*UpdateRegistryProposal) ProposalRoute

func (p *UpdateRegistryProposal) ProposalRoute() string

ProposalRoute returns the x/gov routing key of the proposal.

func (*UpdateRegistryProposal) ProposalType

func (p *UpdateRegistryProposal) ProposalType() string

ProposalType returns the x/gov type of the proposal.

func (*UpdateRegistryProposal) ProtoMessage

func (*UpdateRegistryProposal) ProtoMessage()

func (*UpdateRegistryProposal) Reset

func (m *UpdateRegistryProposal) Reset()

func (*UpdateRegistryProposal) Size

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

func (UpdateRegistryProposal) String

func (p UpdateRegistryProposal) String() string

String implements the Stringer interface.

func (*UpdateRegistryProposal) Unmarshal

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

func (*UpdateRegistryProposal) ValidateBasic

func (p *UpdateRegistryProposal) ValidateBasic() error

ValidateBasic validates the proposal returning an error if invalid.

func (*UpdateRegistryProposal) XXX_DiscardUnknown

func (m *UpdateRegistryProposal) XXX_DiscardUnknown()

func (*UpdateRegistryProposal) XXX_Marshal

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

func (*UpdateRegistryProposal) XXX_Merge

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

func (*UpdateRegistryProposal) XXX_Size

func (m *UpdateRegistryProposal) XXX_Size() int

func (*UpdateRegistryProposal) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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