Documentation ¶
Index ¶
- Constants
- func AddrKey() (key []byte)
- func GetName() string
- func Init(name string, cfg *types.TuringchainConfig, 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) GetCloseReceiptLog(issuance *pty.Issuance) *types.ReceiptLog
- func (action *Action) GetCreateReceiptLog(issuance *pty.Issuance) *types.ReceiptLog
- func (action *Action) GetDebtReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog
- func (action *Action) GetFeedReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog
- func (action *Action) GetIndex() int64
- func (action *Action) GetRepayReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog
- func (action *Action) IssuanceClose(close *pty.IssuanceClose) (*types.Receipt, error)
- func (action *Action) IssuanceCreate(create *pty.IssuanceCreate) (*types.Receipt, error)
- func (action *Action) IssuanceDebt(debt *pty.IssuanceDebt) (*types.Receipt, error)
- func (action *Action) IssuanceFeed(feed *pty.IssuanceFeed) (*types.Receipt, error)
- func (action *Action) IssuanceManage(manage *pty.IssuanceManage) (*types.Receipt, error)
- func (action *Action) IssuanceRepay(repay *pty.IssuanceRepay) (*types.Receipt, error)
- type Issuance
- func (c *Issuance) CheckReceiptExecOk() bool
- func (c *Issuance) ExecDelLocal_Close(payload *pty.IssuanceClose, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecDelLocal_Create(payload *pty.IssuanceCreate, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecDelLocal_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecDelLocal_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecDelLocal_Manage(payload *pty.IssuanceManage, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecDelLocal_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecLocal_Close(payload *pty.IssuanceClose, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecLocal_Create(payload *pty.IssuanceCreate, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecLocal_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecLocal_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecLocal_Manage(payload *pty.IssuanceManage, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) ExecLocal_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Issuance) Exec_Close(payload *pty.IssuanceClose, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Issuance) Exec_Create(payload *pty.IssuanceCreate, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Issuance) Exec_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Issuance) Exec_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Issuance) Exec_Manage(payload *pty.IssuanceManage, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Issuance) Exec_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Issuance) ExecutorOrder() int64
- func (c *Issuance) GetDriverName() string
- func (c *Issuance) Query_IssuanceByStatus(req *pty.ReqIssuanceByStatus) (types.Message, error)
- func (c *Issuance) Query_IssuanceInfoByID(req *pty.ReqIssuanceInfo) (types.Message, error)
- func (c *Issuance) Query_IssuanceInfoByIDs(req *pty.ReqIssuanceInfos) (types.Message, error)
- func (c *Issuance) Query_IssuancePrice(req *pty.ReqIssuanceRecords) (types.Message, error)
- func (c *Issuance) Query_IssuanceRecordByID(req *pty.ReqIssuanceRecords) (types.Message, error)
- func (c *Issuance) Query_IssuanceRecordsByAddr(req *pty.ReqIssuanceRecords) (types.Message, error)
- func (c *Issuance) Query_IssuanceRecordsByStatus(req *pty.ReqIssuanceRecords) (types.Message, error)
- func (c *Issuance) Query_IssuanceUserBalance(req *pty.ReqIssuanceRecords) (types.Message, error)
- type IssuanceDB
Constants ¶
const ( ListDESC = int32(0) // list降序 ListASC = int32(1) // list升序 DefaultCount = int32(20) // 默认一次取多少条记录 MaxCount = int32(100) // 最多取100条 )
List control
const ( Coin = types.Coin // 1e8 DefaultDebtCeiling = 100000 * Coin // 默认借贷限额 DefaultLiquidationRatio = 0.25 * 1e4 // 默认质押比 DefaultPeriod = 3600 * 24 * 365 // 默认合约限期 PriceWarningRate = 1.3 * 1e4 // 价格提前预警率 ExpireWarningTime = 3600 * 24 * 10 // 提前10天超时预警 )
setting
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { Issuance *Issuance // contains filtered or unexported fields }
Action struct
func NewIssuanceAction ¶
func NewIssuanceAction(c *Issuance, tx *types.Transaction, index int) *Action
NewIssuanceAction generate New Action
func (*Action) CheckExecAccountBalance ¶
CheckExecAccountBalance 检查账户抵押物余额
func (*Action) CheckExecTokenAccount ¶
CheckExecTokenAccount 检查账户token余额
func (*Action) GetCloseReceiptLog ¶
func (action *Action) GetCloseReceiptLog(issuance *pty.Issuance) *types.ReceiptLog
GetCloseReceiptLog generate logs for Issuance close action
func (*Action) GetCreateReceiptLog ¶
func (action *Action) GetCreateReceiptLog(issuance *pty.Issuance) *types.ReceiptLog
GetCreateReceiptLog generate logs for Issuance create action
func (*Action) GetDebtReceiptLog ¶
func (action *Action) GetDebtReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog
GetDebtReceiptLog generate logs for Issuance debt action
func (*Action) GetFeedReceiptLog ¶
func (action *Action) GetFeedReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog
GetFeedReceiptLog generate logs for Issuance price feed action
func (*Action) GetRepayReceiptLog ¶
func (action *Action) GetRepayReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog
GetRepayReceiptLog generate logs for Issuance Repay action
func (*Action) IssuanceClose ¶
IssuanceClose 终止借贷
func (*Action) IssuanceCreate ¶
IssuanceCreate 创建借贷,持有一定数量ccny的用户可创建借贷,提供给其他用户借贷
func (*Action) IssuanceDebt ¶
IssuanceDebt 大户质押trc借出ccny
func (*Action) IssuanceFeed ¶
IssuanceFeed 喂价
func (*Action) IssuanceManage ¶
IssuanceManage 设置全局借贷参数(管理员权限)
func (*Action) IssuanceRepay ¶
IssuanceRepay 用户主动清算
type Issuance ¶
type Issuance struct {
drivers.DriverBase
}
Issuance driver
func (*Issuance) CheckReceiptExecOk ¶
CheckReceiptExecOk return true to check if receipt ty is ok
func (*Issuance) ExecDelLocal_Close ¶
func (c *Issuance) ExecDelLocal_Close(payload *pty.IssuanceClose, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Close Action
func (*Issuance) ExecDelLocal_Create ¶
func (c *Issuance) ExecDelLocal_Create(payload *pty.IssuanceCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Create Action
func (*Issuance) ExecDelLocal_Debt ¶
func (c *Issuance) ExecDelLocal_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Debt Action
func (*Issuance) ExecDelLocal_Feed ¶
func (c *Issuance) ExecDelLocal_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Feed Action
func (*Issuance) ExecDelLocal_Manage ¶
func (c *Issuance) ExecDelLocal_Manage(payload *pty.IssuanceManage, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Manage Action
func (*Issuance) ExecDelLocal_Repay ¶
func (c *Issuance) ExecDelLocal_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal_Repay Action
func (*Issuance) ExecLocal_Close ¶
func (c *Issuance) ExecLocal_Close(payload *pty.IssuanceClose, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Close Action
func (*Issuance) ExecLocal_Create ¶
func (c *Issuance) ExecLocal_Create(payload *pty.IssuanceCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Create Action
func (*Issuance) ExecLocal_Debt ¶
func (c *Issuance) ExecLocal_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Debt Action
func (*Issuance) ExecLocal_Feed ¶
func (c *Issuance) ExecLocal_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Feed Action
func (*Issuance) ExecLocal_Manage ¶
func (c *Issuance) ExecLocal_Manage(payload *pty.IssuanceManage, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Manage Action
func (*Issuance) ExecLocal_Repay ¶
func (c *Issuance) ExecLocal_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Repay Action
func (*Issuance) Exec_Close ¶
func (c *Issuance) Exec_Close(payload *pty.IssuanceClose, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Close Action
func (*Issuance) Exec_Create ¶
func (c *Issuance) Exec_Create(payload *pty.IssuanceCreate, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Create Action
func (*Issuance) Exec_Debt ¶
func (c *Issuance) Exec_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Debt Action
func (*Issuance) Exec_Feed ¶
func (c *Issuance) Exec_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Feed Action
func (*Issuance) Exec_Manage ¶
func (c *Issuance) Exec_Manage(payload *pty.IssuanceManage, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Manage Action
func (*Issuance) Exec_Repay ¶
func (c *Issuance) Exec_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Repay Action
func (*Issuance) ExecutorOrder ¶
ExecutorOrder 设置localdb的EnableRead
func (*Issuance) GetDriverName ¶
GetDriverName for Issuance
func (*Issuance) Query_IssuanceByStatus ¶
Query_IssuanceByStatus ...
func (*Issuance) Query_IssuanceInfoByID ¶
Query_IssuanceInfoByID ...
func (*Issuance) Query_IssuanceInfoByIDs ¶
Query_IssuanceInfoByIDs ...
func (*Issuance) Query_IssuancePrice ¶
Query_IssuancePrice ...
func (*Issuance) Query_IssuanceRecordByID ¶
Query_IssuanceRecordByID ...
func (*Issuance) Query_IssuanceRecordsByAddr ¶
Query_IssuanceRecordsByAddr ...
func (*Issuance) Query_IssuanceRecordsByStatus ¶
func (c *Issuance) Query_IssuanceRecordsByStatus(req *pty.ReqIssuanceRecords) (types.Message, error)
Query_IssuanceRecordsByStatus ...
func (*Issuance) Query_IssuanceUserBalance ¶
Query_IssuanceUserBalance ...
type IssuanceDB ¶
IssuanceDB def
func (*IssuanceDB) GetKVSet ¶
func (issu *IssuanceDB) GetKVSet() (kvset []*types.KeyValue)
GetKVSet for IssuanceDB