module

package
v0.0.0-...-8dfe50c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DB_ALL_CTK = "all_ctk"
View Source
const DB_ALL_MORT_USDT = "all_mrot_usdt"
View Source
const DB_ALL_NODES_FEE = "all_nodes_fee"
View Source
const DB_ALL_POOL_FEE = "all_pool_fee"
View Source
const DB_ALL_SUPER_FEE = "all_super_fee"
View Source
const DB_ALL_WITHDRAW_CTK = "all_withdraw_ctk"
View Source
const DB_TRANSACTIONS = "transactions"
View Source
const DB_TRANS_FROM = "from"
View Source
const DB_TRANS_TO = "to"

Variables

This section is empty.

Functions

func AddCTK

func AddCTK(stub shim.ChaincodeStubInterface, fee string)

add ctk fee

func AddMortUSDT

func AddMortUSDT(stub shim.ChaincodeStubInterface, fee string)

add usdt fee

func AddNodesFee

func AddNodesFee(stub shim.ChaincodeStubInterface, fee string)

add nodes fee

func AddPoolFee

func AddPoolFee(stub shim.ChaincodeStubInterface, fee string)

add pool fee

func AddSuperFee

func AddSuperFee(stub shim.ChaincodeStubInterface, fee string)

add pool fee

func AddWithdrawCTK

func AddWithdrawCTK(stub shim.ChaincodeStubInterface, fee string)

add withdraw ctk fee

func GetAllCTK

func GetAllCTK(stub shim.ChaincodeStubInterface) string

get all usdt fee

func GetAllNodesFee

func GetAllNodesFee(stub shim.ChaincodeStubInterface) string

get all nodes fee

func GetAllPoolFee

func GetAllPoolFee(stub shim.ChaincodeStubInterface) string

get all pool fee

func GetAllSuperFee

func GetAllSuperFee(stub shim.ChaincodeStubInterface) string

get all pool fee

func GetAllUSDT

func GetAllUSDT(stub shim.ChaincodeStubInterface) string

get all usdt fee

func GetAllWithdrawCTK

func GetAllWithdrawCTK(stub shim.ChaincodeStubInterface) string

get all usdt fee

func GetTokenAccountKey

func GetTokenAccountKey(token, address string) string

func ReduceCTK

func ReduceCTK(stub shim.ChaincodeStubInterface, fee string)

reduce usdt fee

func ReduceMortUSDT

func ReduceMortUSDT(stub shim.ChaincodeStubInterface, fee string)

reduce usdt fee

Types

type Account

type Account struct {
	Address string `json:"address"`

	Balance string `json:"balance"`

	Role int `json:"role"`

	PoolAddr string `json:"pool_addr"`

	Withdraw string `json:"withdraw"`

	Recharge string `json:"recharge"`
}

func GetTokenAccountInfo

func GetTokenAccountInfo(stub shim.ChaincodeStubInterface, token, address string) *Account

func (*Account) Bytes

func (this *Account) Bytes() []byte

func (*Account) Save

func (this *Account) Save(stub shim.ChaincodeStubInterface, token string)

type AccountInfo

type AccountInfo struct {
	Account string `json:"account"`
	Token   string `json:"token"`
}

type AppendSuperParam

type AppendSuperParam struct {
	Amount  string `json:"amount"`
	Account string `json:"account"`
	Sign    string `json:"sign"`
}

type BindPoolParam

type BindPoolParam struct {
	Account string `json:"account"`
	Pool    string `json:"pool"`
	Sign    string `json:"sign"`
}

type BlockAwardLog

type BlockAwardLog struct {
	StartHeight  int           `json:"start_height"`
	EndHeight    int           `json:"end_height"`
	Transactions []Transaction `json:"transactions"`
	CreateTime   int64         `json:"create_time"`
}

block award

func (*BlockAwardLog) Bytes

func (this *BlockAwardLog) Bytes() []byte

func (*BlockAwardLog) Save

func (this *BlockAwardLog) Save(stub shim.ChaincodeStubInterface, token string)

type BlockAwardParam

type BlockAwardParam struct {
	StartHeight int     `json:"start_height"`
	EndHeight   int     `json:"end_height"`
	Sign        string  `json:"sign"`
	Fee         float64 `json:"fee"`
}

type ExchangeParam

type ExchangeParam struct {
	Account string `json:"account"`
	Sign    string `json:"sign"`
	Amount  string `json:"amount"`
}

type MortageToken

type MortageToken map[string]string

func (*MortageToken) Bytes

func (this *MortageToken) Bytes() []byte

type NodeAccounts

type NodeAccounts []string

func GetNormalNodeAccounts

func GetNormalNodeAccounts(stub shim.ChaincodeStubInterface) NodeAccounts

func GetSuperNodeAccounts

func GetSuperNodeAccounts(stub shim.ChaincodeStubInterface) NodeAccounts

func (*NodeAccounts) Add

func (this *NodeAccounts) Add(addr string)

func (*NodeAccounts) Bytes

func (this *NodeAccounts) Bytes() []byte

func (*NodeAccounts) Has

func (this *NodeAccounts) Has(addr string) bool

func (*NodeAccounts) Remove

func (this *NodeAccounts) Remove(addr string)

type QuitSuperParam

type QuitSuperParam struct {
	Account string `json:"account"`
	Sign    string `json:"sign"`
}

type RegisterParam

type RegisterParam struct {
	Account string `json:"account"`
	Role    int    `json:"role"`
	Sign    string `json:"sign"`
	Token   string `json:"token"`
}

type Super17Param

type Super17Param struct {
	Accounts NodeAccounts `json:"accounts"`
	Sign     string       `json:"sign"`
}

type TokenConfig

type TokenConfig struct {
	OriginatorAccount   string `json:"originator_account"`
	Name                string `json:"name"`
	Title               string `json:"title"`
	Precision           int64  `json:"precision"`
	Site                string `json:"site"`
	Email               string `json:"email"`
	CreateTime          string `json:"create_time"`
	TokenCharge         int    `json:"token_charge"` //publish token need the ctk count
	NormalNodeFreezeCTK int    `json:"normal_node_freeze_ctk"`
	SuperNodeFreezeCTK  int    `json:"super_node_freeze_ctk"`
	PoolNodeFreezeCTK   int    `json:"pool_node_freeze_ctk"`
	AllCostFee          string `json:"all_cost_fee"`
	AllCount            string `json:"all_count"`
}

func GetTokenInfo

func GetTokenInfo(stub shim.ChaincodeStubInterface, token string) *TokenConfig

func (*TokenConfig) Byte

func (this *TokenConfig) Byte() []byte

func (*TokenConfig) Save

func (this *TokenConfig) Save(stub shim.ChaincodeStubInterface)

type TokenInfo

type TokenInfo struct {
	Creator     string `json:"creator"`
	CC          string `json:"cc"`
	Name        string `json:"name"`
	Desc        string `json:"desc"`
	Total       string `json:"total"`
	Award       string `json:"award"`
	Balance     string `json:"balance"`
	Decimal     string `json:"decimal"`
	Mineral     string `json:"mineral"`
	Url         string `json:"url"`
	Email       string `json:"email"`
	PublishTime string `json:"publish_time"`
}

type Transaction

type Transaction struct {
	Type       int    `json:"type"`
	From       string `json:"from"`
	To         string `json:"to"`
	Fee        string `json:"fee"`
	Amount     string `json:"amount"`
	CreateTime int64  `json:"create_time"`
	Memo       string `json:"memo"`
	Token      string `json:"token"`
	TxID       string `json:"tx_id"`
}

transaction

func NodeBonus

func NodeBonus(stub shim.ChaincodeStubInterface, freezeMoney decimal.Decimal, token string, from string, isRegister bool) (txs []Transaction)

node bonus when normal node register or pool node register

func (*Transaction) Bytes

func (this *Transaction) Bytes() []byte

func (*Transaction) Save

func (this *Transaction) Save(stub shim.ChaincodeStubInterface, token string)

type TransactionsParam

type TransactionsParam struct {
	Offset  int    `json:"offset"`
	Limit   int    `json:"limit"`
	Token   string `json:"token"`
	Account string `json:"account"`
}

type TransferParam

type TransferParam struct {
	From   string `json:"from"`
	To     string `json:"to"`
	Fee    string `json:"fee"`
	Amount string `json:"amount"`
	Token  string `json:"token"`
	Sign   string `json:"sign"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL