Documentation ¶
Index ¶
Constants ¶
View Source
const ( ModuleName = "commerciomint" StoreKey = ModuleName RouterKey = ModuleName QuerierRoute = ModuleName CdpStorePrefix = ":cdp:" CreditsDenomStoreKey = "creditsDenom" QueryGetCdp = "cdp" QueryGetCdps = "cdps" MsgTypeOpenCdp = "openCdp" MsgTypeCloseCdp = "closeCdp" )
Variables ¶
View Source
var ModuleCdc *codec.Codec
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on wire codec
Types ¶
type Cdp ¶
type Cdp struct { Owner sdk.AccAddress `json:"owner"` DepositedAmount sdk.Coins `json:"deposited_amount"` CreditsAmount sdk.Coins `json:"credits_amount"` Timestamp int64 `json:"timestamp"` // Block height at which the CDP has been created }
Cdp represents a Collateralized Debt position that is open from a user in order to convert any currently priced token into stable Commercio Cash Credits
type Cdps ¶
type Cdps []Cdp
Cdps represents a slice of CDP objects
func (Cdps) AppendIfMissing ¶
AppendIfMissing appends the given cdp to the list of cdps if it does not exist inside it yet, returning also true if the object has been appended successfully
type MsgCloseCdp ¶
type MsgCloseCdp struct { Signer sdk.AccAddress `json:"signer"` Timestamp int64 `json:"cdp_timestamp"` // Block height at which the CDP has been created }
func NewMsgCloseCdp ¶
func NewMsgCloseCdp(signer sdk.AccAddress, timestamp int64) MsgCloseCdp
func (MsgCloseCdp) GetSignBytes ¶
func (msg MsgCloseCdp) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgCloseCdp) GetSigners ¶
func (msg MsgCloseCdp) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgCloseCdp) ValidateBasic ¶
func (msg MsgCloseCdp) ValidateBasic() sdk.Error
type MsgOpenCdp ¶
type MsgOpenCdp struct { Depositor sdk.AccAddress `json:"depositor"` DepositedAmount sdk.Coins `json:"deposit_amount"` }
func NewMsgOpenCdp ¶
func NewMsgOpenCdp(depositAmount sdk.Coins, depositor sdk.AccAddress) MsgOpenCdp
func (MsgOpenCdp) GetSignBytes ¶
func (msg MsgOpenCdp) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgOpenCdp) GetSigners ¶
func (msg MsgOpenCdp) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgOpenCdp) ValidateBasic ¶
func (msg MsgOpenCdp) ValidateBasic() sdk.Error
Click to show internal directories.
Click to hide internal directories.