stake

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PayTime       = 42336
	ExpireTime    = 181440
	ExpirePayTime = 211680
)

每 42336 块一个支付点,支付本金和利息 过期是181,440块,但是需要等211,680块才会返回。

Variables

View Source
var SERO = big.NewFloat(1e18)

Functions

This section is empty.

Types

type Report added in v0.1.0

type Report struct {
	Shares  []ShareReport
	Summary ShareReport
}

func FormatReport added in v0.1.0

func FormatReport(results []Result) (report Report)

type Result

type Result struct {
	Id      string
	ShortId string

	BuyBlock       int
	LastPayBlock   int
	ExpireBlock    int
	ExpirePayBlock int

	// Share Number
	TotalShare int

	MortgageShare       int // Mortagage
	RemainShare         int //   Remaining
	IncomeShare         int //   Income not return
	ExpireNoReturnShare int //   Expire not return

	ReturnedShare         int // Returned
	CheckedShare          int //   Checked
	ExpiredAndReturnShare int //   Expired and return

	// Principle
	TotalPrinciple    float64 // 所有本金
	MortgagePrinciple float64 // 抵押中本金
	ReturnedPrinciple float64 // 已返还本金

	// Interest
	TotalInterest    float64 // 所有本金
	MortgageInterest float64 // 抵押中本金
	ReturnedInterest float64 // 已返还本金
}

func Stat

func Stat(id string) (result Result, err error)

func Sum

func Sum(sd StakeDetail) (r Result)

type ShareReport added in v0.1.0

type ShareReport struct {
	Id string

	// Share Number
	TotalShare    string // 全部票数
	ReturnedShare string // 返还票数
	MortgageShare string // 剩余票数

	// Principle
	TotalPrinciple    string // 所有本金
	ReturnedPrinciple string // 返还本金
	MortgagePrinciple string // 剩余本金

	// Interest
	TotalInterest    string // 所有利润
	ReturnedInterest string // 返还利润
	MortgageInterest string // 剩余利润
}

func FormatShare added in v0.1.0

func FormatShare(r Result) (sr ShareReport)

type StakeDetail

type StakeDetail struct {
	Id        string `json:"id"`
	Company   string `json:"company"`
	Tx        string `json:"tx"`
	At        int    `json:"at"`   // tx's blockNumber
	Addr      string `json:"addr"` // Owner
	Pool      string `json:"pool"`
	VoteAddr  string `json:"voteAddr"`
	Fee       int    `json:"fee"`
	Timestamp int    `json:"timestamp"` // buy time

	Price string `json:"price"`
	Total int    `json:"total"`

	// remaining 和 expired 二选一只有一个
	Remaining int    `json:"remaining"`
	Expired   int    `json:"expired"`
	Missed    int    `json:"missed"`
	Profit    string `json:"profit"` //all profit

	ReturnNum    int    `json:"returnNum"`    // blockNumber
	LastPayTime  int    `json:"lastPayTime"`  // blockNumber
	ReturnProfit string `json:"returnProfit"` // returned profit

	Status int `json:"status"`
}

Jump to

Keyboard shortcuts

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