Documentation ¶
Index ¶
- Constants
- Variables
- func CheckBoxType(boxType string) sdk.Error
- func CheckDepositOperation(depositOperation string) sdk.Error
- func CheckInterestOperation(interestOperation string) sdk.Error
- func GetBoxTypeValue(boxType string) (string, error)
- func GetMustBoxTypeValue(boxType string) string
- type AddressDeposit
- type Box
- type BoxDeposit
- type BoxInfo
- func (bi BoxInfo) GetBoxId() string
- func (bi BoxInfo) GetBoxStatus() string
- func (bi BoxInfo) GetBoxType() string
- func (bi BoxInfo) GetCreatedTime() int64
- func (bi BoxInfo) GetDeposit() DepositBox
- func (bi BoxInfo) GetDescription() string
- func (bi BoxInfo) GetFuture() FutureBox
- func (bi BoxInfo) GetLock() LockBox
- func (bi BoxInfo) GetName() string
- func (bi BoxInfo) GetOwner() sdk.AccAddress
- func (bi BoxInfo) GetTotalAmount() BoxToken
- func (bi BoxInfo) IsTradeDisabled() bool
- func (bi *BoxInfo) SetBoxId(boxId string)
- func (bi *BoxInfo) SetBoxStatus(boxStatus string)
- func (bi *BoxInfo) SetBoxType(boxType string)
- func (bi *BoxInfo) SetCreatedTime(createdTime int64)
- func (bi *BoxInfo) SetDeposit(deposit DepositBox)
- func (bi *BoxInfo) SetDescription(description string)
- func (bi *BoxInfo) SetFuture(future FutureBox)
- func (bi *BoxInfo) SetLock(lock LockBox)
- func (bi *BoxInfo) SetName(name string)
- func (bi *BoxInfo) SetOwner(owner sdk.AccAddress)
- func (bi *BoxInfo) SetTotalAmount(totalAmount BoxToken)
- func (bi *BoxInfo) SetTradeDisabled(tradeDisabled bool)
- func (bi BoxInfo) String() string
- type BoxInfos
- type BoxToken
- type DepositBox
- type DepositBoxDepositInterest
- type DepositBoxDepositInterestList
- type FutureBox
- type LockBox
Constants ¶
View Source
const ( Lock = "lock" Deposit = "deposit" Future = "future" )
View Source
const ( // ModuleKey is the name of the module ModuleName = "box" // StoreKey is the store key string for issue StoreKey = ModuleName // RouterKey is the message route for issue RouterKey = ModuleName // QuerierRoute is the querier route for issue QuerierRoute = ModuleName // Parameter store default namestore DefaultParamspace = ModuleName )
View Source
const ( IDPreStr = "box" Custom = "custom" Gard = "gard" Agard = "agard" )
View Source
const ( QueryParams = "params" QueryList = "list" QueryBox = "query" QueryDepositList = "deposit" QueryDepositAmount = "deposit-amount" QuerySearch = "search" )
View Source
const ( BoxCreated = "created" BoxDepositing = "depositing" BoxActived = "actived" BoxClosed = "closed" BoxFinished = "finished" )
box status
View Source
const ( LockBoxLocked = "locked" LockBoxUnlocked = "unlocked" )
lock box status
View Source
const ( Injection = "injection" DepositTo = "deposit-to" Fetch = "fetch" )
View Source
const ( TypeMsgBoxCreateLock = "box_create_lock" TypeMsgBoxCreateDeposit = "box_create_deposit" TypeMsgBoxCreateFuture = "box_create_future" TypeMsgBoxInterest = "box_interest" TypeMsgBoxDeposit = "box_deposit" TypeMsgBoxFuture = "box_future" TypeMsgBoxDescription = "box_description" TypeMsgBoxDisableFeature = "box_disable_feature" )
View Source
const ( KeyDelimiterString = ":" AgardDecimal = uint(1) GardDecimal = uint(18) MaxPrecision = uint(6) CodeInvalidGenesis sdk.CodeType = 102 BoxNameMaxLength = 32 BoxDescriptionMaxLength = 1024 )
View Source
const (
DefaultCodespace sdk.CodespaceType = ModuleName
)
View Source
const (
DepositBoxInterest = "interest"
)
deposit box status
View Source
const (
Trade = "trade"
)
Variables ¶
View Source
var ( BoxMaxId uint64 = 99999999999999 BoxMinId uint64 = 10000000000000 BoxMaxInstalment = 99 BoxMaxInjectionInterest = 100 )
View Source
var DepositOperation = map[string]uint{DepositTo: 1, Fetch: 2}
View Source
var Features = map[string]int{Trade: 1}
View Source
var InterestOperation = map[string]uint{Injection: 1, Fetch: 2}
Functions ¶
func CheckBoxType ¶
func CheckDepositOperation ¶
func CheckInterestOperation ¶
func GetBoxTypeValue ¶
func GetMustBoxTypeValue ¶
Types ¶
type AddressDeposit ¶
type AddressDeposit struct { Address sdk.AccAddress `json:"address"` Amount sdk.Int `json:"amount"` }
func NewAddressDeposit ¶
func NewAddressDeposit(address sdk.AccAddress, amount sdk.Int) AddressDeposit
func (AddressDeposit) String ¶
func (bi AddressDeposit) String() string
type Box ¶
type Box interface { GetBoxId() string SetBoxId(string) GetBoxType() string SetBoxType(string) GetBoxStatus() string SetBoxStatus(string) GetOwner() sdk.AccAddress SetOwner(sdk.AccAddress) GetCreatedTime() int64 SetCreatedTime(int64) GetName() string SetName(string) GetTotalAmount() BoxToken SetTotalAmount(BoxToken) GetDescription() string SetDescription(string) IsTradeDisabled() bool SetTradeDisabled(bool) GetLock() LockBox SetLock(LockBox) GetDeposit() DepositBox SetDeposit(DepositBox) GetFuture() FutureBox SetFuture(FutureBox) String() string }
Box interface
type BoxDeposit ¶
func NewBoxDeposit ¶
func NewBoxDeposit(amount sdk.Int) *BoxDeposit
func NewZeroBoxDeposit ¶
func NewZeroBoxDeposit() *BoxDeposit
type BoxInfo ¶
type BoxInfo struct { BoxId string `json:"box_id"` BoxStatus string `json:"box_status"` Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` BoxType string `json:"type"` CreatedTime int64 `json:"created_time"` TotalAmount BoxToken `json:"total_amount"` Description string `json:"description"` TradeDisabled bool `json:"trade_disabled"` Lock LockBox `json:"lock"` Deposit DepositBox `json:"deposit"` Future FutureBox `json:"future"` }
type BaseBoxInfo struct { }
func (BoxInfo) GetBoxStatus ¶
func (BoxInfo) GetBoxType ¶
func (BoxInfo) GetCreatedTime ¶
func (BoxInfo) GetDeposit ¶
func (bi BoxInfo) GetDeposit() DepositBox
func (BoxInfo) GetDescription ¶
func (BoxInfo) GetOwner ¶
func (bi BoxInfo) GetOwner() sdk.AccAddress
func (BoxInfo) GetTotalAmount ¶
func (BoxInfo) IsTradeDisabled ¶
func (*BoxInfo) SetBoxStatus ¶
func (*BoxInfo) SetBoxType ¶
func (*BoxInfo) SetCreatedTime ¶
func (*BoxInfo) SetDeposit ¶
func (bi *BoxInfo) SetDeposit(deposit DepositBox)
func (*BoxInfo) SetDescription ¶
func (*BoxInfo) SetOwner ¶
func (bi *BoxInfo) SetOwner(owner sdk.AccAddress)
func (*BoxInfo) SetTotalAmount ¶
func (*BoxInfo) SetTradeDisabled ¶
type DepositBox ¶
type DepositBox struct { StartTime int64 `json:"start_time"` EstablishTime int64 `json:"establish_time"` MaturityTime int64 `json:"maturity_time"` BottomLine sdk.Int `json:"bottom_line"` Interest BoxToken `json:"interest"` Price sdk.Int `json:"price"` PerCoupon sdk.Dec `json:"per_coupon"` TotalDeposit sdk.Int `json:"total_deposit"` InterestInjections []AddressDeposit `json:"interest_injections"` }
type DepositBoxDepositInterest ¶
type DepositBoxDepositInterest struct { Address sdk.AccAddress `json:"address"` Amount sdk.Int `json:"amount"` Interest sdk.Int `json:"interest"` }
func NewDepositBoxDepositInterest ¶
func NewDepositBoxDepositInterest(address sdk.AccAddress, amount sdk.Int, interest sdk.Int) DepositBoxDepositInterest
func (DepositBoxDepositInterest) String ¶
func (bi DepositBoxDepositInterest) String() string
nolint
type DepositBoxDepositInterestList ¶
type DepositBoxDepositInterestList []DepositBoxDepositInterest
func (DepositBoxDepositInterestList) String ¶
func (bi DepositBoxDepositInterestList) String() string
nolint
Click to show internal directories.
Click to hide internal directories.