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 AddressInject
- type Box
- type BoxInfo
- 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) GetId() string
- func (bi BoxInfo) GetLock() LockBox
- func (bi BoxInfo) GetName() string
- func (bi BoxInfo) GetOwner() sdk.AccAddress
- func (bi BoxInfo) GetStatus() string
- func (bi BoxInfo) GetTotalAmount() BoxToken
- func (bi BoxInfo) IsTransferDisabled() bool
- 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) SetId(boxId string)
- func (bi *BoxInfo) SetLock(lock LockBox)
- func (bi *BoxInfo) SetName(name string)
- func (bi *BoxInfo) SetOwner(owner sdk.AccAddress)
- func (bi *BoxInfo) SetStatus(boxStatus string)
- func (bi *BoxInfo) SetTotalAmount(totalAmount BoxToken)
- func (bi *BoxInfo) SetTransferDisabled(transferDisabled bool)
- func (bi BoxInfo) String() string
- type BoxInfos
- type BoxToken
- type DepositBox
- type DepositBoxInjectInterest
- type DepositBoxInjectInterestList
- type FutureBox
- type LockBox
Constants ¶
View Source
const ( Lock = "lock" Deposit = "deposit" Future = "future" )
View Source
const ( Feature = "feature" Transfer = "transfer" )
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" QuerySearch = "search" )
View Source
const ( Create = "create" Inject = "inject" Cancel = "cancel" Withdraw = "withdraw" Describe = "describe" Disable = "disable" )
action
View Source
const ( BoxCreated = "created" BoxInjecting = Inject + "ing" BoxActived = "actived" BoxUndue = "undue" BoxClosed = "closed" BoxFinished = "finished" )
box status
View Source
const ( LockBoxLocked = "locked" LockBoxUnlocked = "unlocked" )
lock box status
View Source
const ( TypeMsgBoxCreate = Create TypeMsgBoxWithdraw = Withdraw TypeMsgBoxInterestInject = DepositBoxInterest + "_" + Inject TypeMsgBoxInterestCancel = DepositBoxInterest + "_" + Cancel TypeMsgBoxInject = Inject TypeMsgBoxCancel = Cancel TypeMsgBoxDescription = Describe TypeMsgBoxDisableFeature = Disable + "_" + Future )
View Source
const ( KeyDelimiterString = ":" AgardDecimals = uint(1) GardDecimals = 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
Variables ¶
View Source
var ( IdLength = 14 BoxMaxId uint64 = 99999999999999 BoxMinId uint64 = 10000000000000 BoxMaxInstalment = 99 BoxMaxInjectInterest = 100 )
View Source
var DepositOperation = map[string]uint{Inject: 1, Cancel: 2}
View Source
var Features = map[string]int{Transfer: 1}
View Source
var InterestOperation = map[string]uint{Inject: 1, Cancel: 2}
Functions ¶
func CheckBoxType ¶
func CheckDepositOperation ¶
func CheckInterestOperation ¶
func GetBoxTypeValue ¶
func GetMustBoxTypeValue ¶
Types ¶
type AddressInject ¶ added in v0.6.0
type AddressInject struct { Address sdk.AccAddress `json:"address"` Amount sdk.Int `json:"amount"` }
func NewAddressInject ¶ added in v0.6.0
func NewAddressInject(address sdk.AccAddress, amount sdk.Int) AddressInject
func (AddressInject) String ¶ added in v0.6.0
func (bi AddressInject) String() string
type Box ¶
type Box interface { GetId() string SetId(string) GetBoxType() string SetBoxType(string) GetStatus() string SetStatus(string) GetOwner() sdk.AccAddress SetOwner(sdk.AccAddress) GetCreatedTime() int64 SetCreatedTime(int64) GetName() string SetName(string) GetTotalAmount() BoxToken SetTotalAmount(BoxToken) GetDescription() string SetDescription(string) IsTransferDisabled() bool SetTransferDisabled(bool) GetLock() LockBox SetLock(LockBox) GetDeposit() DepositBox SetDeposit(DepositBox) GetFuture() FutureBox SetFuture(FutureBox) String() string }
Box interface
type BoxInfo ¶
type BoxInfo struct { Id string `json:"id"` Status string `json:"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"` TransferDisabled bool `json:"transfer_disabled"` Lock LockBox `json:"lock"` Deposit DepositBox `json:"deposit"` Future FutureBox `json:"future"` }
type BaseBoxInfo struct { }
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) IsTransferDisabled ¶ added in v0.6.0
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) SetTransferDisabled ¶ added in v0.6.0
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"` TotalInject sdk.Int `json:"total_inject"` WithdrawalInterest sdk.Int `json:"withdrawal_interest"` InterestInjects []AddressInject `json:"interest_injects"` }
type DepositBoxInjectInterest ¶ added in v0.6.0
type DepositBoxInjectInterest struct { Address sdk.AccAddress `json:"address"` Amount sdk.Int `json:"amount"` Interest sdk.Int `json:"interest"` }
func (DepositBoxInjectInterest) String ¶ added in v0.6.0
func (bi DepositBoxInjectInterest) String() string
nolint
type DepositBoxInjectInterestList ¶ added in v0.6.0
type DepositBoxInjectInterestList []DepositBoxInjectInterest
func (DepositBoxInjectInterestList) String ¶ added in v0.6.0
func (bi DepositBoxInjectInterestList) String() string
nolint
Click to show internal directories.
Click to hide internal directories.