Documentation ¶
Index ¶
- Constants
- func AddrKey() (key []byte)
- func ConfigKey() (key []byte)
- func GetName() string
- func Init(name string, cfg *types.Chain33Config, sub []byte)
- func InitExecType()
- func Key(id string) (key []byte)
- func PriceKey() (key []byte)
- type Action
- func (action *Action) CheckExecAccountBalance(fromAddr string, ToFrozen, ToActive int64) bool
- func (action *Action) CheckExecTokenAccount(addr string, amount int64, isFrozen bool) bool
- func (action *Action) CollateralizeAppend(cAppend *pty.CollateralizeAppend) (*types.Receipt, error)
- func (action *Action) CollateralizeBorrow(borrow *pty.CollateralizeBorrow) (*types.Receipt, error)
- func (action *Action) CollateralizeCreate(create *pty.CollateralizeCreate) (*types.Receipt, error)
- func (action *Action) CollateralizeFeed(feed *pty.CollateralizeFeed) (*types.Receipt, error)
- func (action *Action) CollateralizeManage(manage *pty.CollateralizeManage) (*types.Receipt, error)
- func (action *Action) CollateralizeRepay(repay *pty.CollateralizeRepay) (*types.Receipt, error)
- func (action *Action) CollateralizeRetrieve(retrieve *pty.CollateralizeRetrieve) (*types.Receipt, error)
- func (action *Action) GetAppendReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
- func (action *Action) GetBorrowReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
- func (action *Action) GetCreateReceiptLog(collateralize *pty.Collateralize) *types.ReceiptLog
- func (action *Action) GetFeedReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
- func (action *Action) GetIndex() int64
- func (action *Action) GetRepayReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
- func (action *Action) GetRetrieveReceiptLog(collateralize *pty.Collateralize) *types.ReceiptLog
- type Collateralize
- func (c *Collateralize) CheckReceiptExecOk() bool
- func (c *Collateralize) ExecDelLocal_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecDelLocal_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecDelLocal_Create(payload *pty.CollateralizeCreate, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecDelLocal_Feed(payload *pty.CollateralizeFeed, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecDelLocal_Manage(payload *pty.CollateralizeManage, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecDelLocal_Repay(payload *pty.CollateralizeRepay, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecDelLocal_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Create(payload *pty.CollateralizeCreate, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Feed(payload *pty.CollateralizeFeed, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Manage(payload *pty.CollateralizeManage, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Repay(payload *pty.CollateralizeRepay, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) ExecLocal_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Collateralize) Exec_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) Exec_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) Exec_Create(payload *pty.CollateralizeCreate, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) Exec_Feed(payload *pty.CollateralizeFeed, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) Exec_Manage(payload *pty.CollateralizeManage, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) Exec_Repay(payload *pty.CollateralizeRepay, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) Exec_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Collateralize) ExecutorOrder() int64
- func (c *Collateralize) GetDriverName() string
- func (c *Collateralize) Query_CollateralizeByAddr(req *pty.ReqCollateralizeByAddr) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeByStatus(req *pty.ReqCollateralizeByStatus) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeConfig(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeInfoByID(req *pty.ReqCollateralizeInfo) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeInfoByIDs(req *pty.ReqCollateralizeInfos) (types.Message, error)
- func (c *Collateralize) Query_CollateralizePrice(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeRecordByAddr(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeRecordByID(req *pty.ReqCollateralizeRecord) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeRecordByStatus(req *pty.ReqCollateralizeRecordByStatus) (types.Message, error)
- func (c *Collateralize) Query_CollateralizeUserBalance(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
- type CollateralizeDB
Constants ¶
const ( ListDESC = int32(0) // list降序 ListASC = int32(1) // list升序 DefaultCount = int32(20) // 默认一次取多少条记录 MaxCount = int32(100) // 最多取100条 )
List control
const ( DefaultDebtCeiling = 10000 // 默认借贷限额 DefaultLiquidationRatio = 0.4 * 1e4 // 默认质押比 DefaultStabilityFeeRation = 0.08 * 1e4 // 默认稳定费 DefaultPeriod = 3600 * 24 * 365 // 默认合约限期 DefaultTotalBalance = 0 // 默认放贷总额 PriceWarningRate = 1.3 * 1e4 // 价格提前预警率 ExpireWarningTime = 3600 * 24 * 10 // 提前10天超时预警 )
setting
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { Collateralize *Collateralize // contains filtered or unexported fields }
Action struct
func NewCollateralizeAction ¶
func NewCollateralizeAction(c *Collateralize, tx *types.Transaction, index int) *Action
NewCollateralizeAction generate New Action
func (*Action) CheckExecAccountBalance ¶
CheckExecAccountBalance 检查账户抵押物余额
func (*Action) CheckExecTokenAccount ¶
CheckExecTokenAccount 检查账户token余额
func (*Action) CollateralizeAppend ¶
CollateralizeAppend 追加抵押物
func (*Action) CollateralizeBorrow ¶
CollateralizeBorrow 用户质押bty借出ccny
func (*Action) CollateralizeCreate ¶
CollateralizeCreate 创建借贷,持有一定数量ccny的用户可创建借贷,提供给其他用户借贷
func (*Action) CollateralizeFeed ¶
CollateralizeFeed 喂价
func (*Action) CollateralizeManage ¶
CollateralizeManage 设置全局借贷参数(管理员权限)
func (*Action) CollateralizeRepay ¶
CollateralizeRepay 用户主动清算
func (*Action) CollateralizeRetrieve ¶
func (action *Action) CollateralizeRetrieve(retrieve *pty.CollateralizeRetrieve) (*types.Receipt, error)
CollateralizeRetrieve 收回未放贷
func (*Action) GetAppendReceiptLog ¶
func (action *Action) GetAppendReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
GetAppendReceiptLog generate logs for Collateralize append action
func (*Action) GetBorrowReceiptLog ¶
func (action *Action) GetBorrowReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
GetBorrowReceiptLog generate logs for Collateralize borrow action
func (*Action) GetCreateReceiptLog ¶
func (action *Action) GetCreateReceiptLog(collateralize *pty.Collateralize) *types.ReceiptLog
GetCreateReceiptLog generate logs for Collateralize create action
func (*Action) GetFeedReceiptLog ¶
func (action *Action) GetFeedReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
GetFeedReceiptLog generate logs for Collateralize price feed action
func (*Action) GetRepayReceiptLog ¶
func (action *Action) GetRepayReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog
GetRepayReceiptLog generate logs for Collateralize Repay action
func (*Action) GetRetrieveReceiptLog ¶
func (action *Action) GetRetrieveReceiptLog(collateralize *pty.Collateralize) *types.ReceiptLog
GetRetrieveReceiptLog generate logs for Collateralize close action
type Collateralize ¶
type Collateralize struct {
drivers.DriverBase
}
Collateralize driver
func (*Collateralize) CheckReceiptExecOk ¶
func (c *Collateralize) CheckReceiptExecOk() bool
CheckReceiptExecOk return true to check if receipt ty is ok
func (*Collateralize) ExecDelLocal_Append ¶
func (c *Collateralize) ExecDelLocal_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Append Action
func (*Collateralize) ExecDelLocal_Borrow ¶
func (c *Collateralize) ExecDelLocal_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Borrow Action
func (*Collateralize) ExecDelLocal_Create ¶
func (c *Collateralize) ExecDelLocal_Create(payload *pty.CollateralizeCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Create Action
func (*Collateralize) ExecDelLocal_Feed ¶
func (c *Collateralize) ExecDelLocal_Feed(payload *pty.CollateralizeFeed, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Feed Action
func (*Collateralize) ExecDelLocal_Manage ¶
func (c *Collateralize) ExecDelLocal_Manage(payload *pty.CollateralizeManage, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Manage Action
func (*Collateralize) ExecDelLocal_Repay ¶
func (c *Collateralize) ExecDelLocal_Repay(payload *pty.CollateralizeRepay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Repay Action
func (*Collateralize) ExecDelLocal_Retrieve ¶
func (c *Collateralize) ExecDelLocal_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Retrieve Action
func (*Collateralize) ExecLocal_Append ¶
func (c *Collateralize) ExecLocal_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Append Action
func (*Collateralize) ExecLocal_Borrow ¶
func (c *Collateralize) ExecLocal_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Borrow Action
func (*Collateralize) ExecLocal_Create ¶
func (c *Collateralize) ExecLocal_Create(payload *pty.CollateralizeCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Create Action
func (*Collateralize) ExecLocal_Feed ¶
func (c *Collateralize) ExecLocal_Feed(payload *pty.CollateralizeFeed, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Feed Action
func (*Collateralize) ExecLocal_Manage ¶
func (c *Collateralize) ExecLocal_Manage(payload *pty.CollateralizeManage, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Manage Action
func (*Collateralize) ExecLocal_Repay ¶
func (c *Collateralize) ExecLocal_Repay(payload *pty.CollateralizeRepay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Repay Action
func (*Collateralize) ExecLocal_Retrieve ¶
func (c *Collateralize) ExecLocal_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Retrieve Action
func (*Collateralize) Exec_Append ¶
func (c *Collateralize) Exec_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Append Action
func (*Collateralize) Exec_Borrow ¶
func (c *Collateralize) Exec_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Borrow Action
func (*Collateralize) Exec_Create ¶
func (c *Collateralize) Exec_Create(payload *pty.CollateralizeCreate, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Create Action
func (*Collateralize) Exec_Feed ¶
func (c *Collateralize) Exec_Feed(payload *pty.CollateralizeFeed, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Feed Action
func (*Collateralize) Exec_Manage ¶
func (c *Collateralize) Exec_Manage(payload *pty.CollateralizeManage, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Manage Action
func (*Collateralize) Exec_Repay ¶
func (c *Collateralize) Exec_Repay(payload *pty.CollateralizeRepay, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Repay Action
func (*Collateralize) Exec_Retrieve ¶
func (c *Collateralize) Exec_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Retrieve Action
func (*Collateralize) ExecutorOrder ¶
func (c *Collateralize) ExecutorOrder() int64
ExecutorOrder 设置localdb的EnableRead
func (*Collateralize) GetDriverName ¶
func (c *Collateralize) GetDriverName() string
GetDriverName for Collateralize
func (*Collateralize) Query_CollateralizeByAddr ¶
func (c *Collateralize) Query_CollateralizeByAddr(req *pty.ReqCollateralizeByAddr) (types.Message, error)
Query_CollateralizeByAddr ...
func (*Collateralize) Query_CollateralizeByStatus ¶
func (c *Collateralize) Query_CollateralizeByStatus(req *pty.ReqCollateralizeByStatus) (types.Message, error)
Query_CollateralizeByStatus ...
func (*Collateralize) Query_CollateralizeConfig ¶
func (c *Collateralize) Query_CollateralizeConfig(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
Query_CollateralizeConfig ...
func (*Collateralize) Query_CollateralizeInfoByID ¶
func (c *Collateralize) Query_CollateralizeInfoByID(req *pty.ReqCollateralizeInfo) (types.Message, error)
Query_CollateralizeInfoByID ...
func (*Collateralize) Query_CollateralizeInfoByIDs ¶
func (c *Collateralize) Query_CollateralizeInfoByIDs(req *pty.ReqCollateralizeInfos) (types.Message, error)
Query_CollateralizeInfoByIDs ...
func (*Collateralize) Query_CollateralizePrice ¶
func (c *Collateralize) Query_CollateralizePrice(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
Query_CollateralizePrice ...
func (*Collateralize) Query_CollateralizeRecordByAddr ¶
func (c *Collateralize) Query_CollateralizeRecordByAddr(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
Query_CollateralizeRecordByAddr ...
func (*Collateralize) Query_CollateralizeRecordByID ¶
func (c *Collateralize) Query_CollateralizeRecordByID(req *pty.ReqCollateralizeRecord) (types.Message, error)
Query_CollateralizeRecordByID ...
func (*Collateralize) Query_CollateralizeRecordByStatus ¶
func (c *Collateralize) Query_CollateralizeRecordByStatus(req *pty.ReqCollateralizeRecordByStatus) (types.Message, error)
Query_CollateralizeRecordByStatus ...
func (*Collateralize) Query_CollateralizeUserBalance ¶
func (c *Collateralize) Query_CollateralizeUserBalance(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)
Query_CollateralizeUserBalance ...
type CollateralizeDB ¶
type CollateralizeDB struct {
pty.Collateralize
}
CollateralizeDB def
func (*CollateralizeDB) GetKVSet ¶
func (coll *CollateralizeDB) GetKVSet() (kvset []*types.KeyValue)
GetKVSet for CollateralizeDB
func (*CollateralizeDB) Save ¶
func (coll *CollateralizeDB) Save(db dbm.KV)
Save for CollateralizeDB