exchange

package
v0.7.3-beta.r7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Prefix = []byte("Out")
)

Functions

func AddJob

func AddJob(spec string, run RunFunc) *cron.Cron

func DecOuts

func DecOuts(outs []light_types.Out, skr *keys.PKr) (douts []light_types.DOut)

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

type Exchange

type Exchange struct {
	// contains filtered or unexported fields
}

func CurrentExchange

func CurrentExchange() *Exchange

func NewExchange

func NewExchange(dbpath string, txPool *core.TxPool, accountManager *accounts.Manager, autoMerge bool) (exchange *Exchange)

func (*Exchange) ClearFlag

func (self *Exchange) ClearFlag()

func (*Exchange) GenTx

func (self *Exchange) GenTx(param TxParam) (txParam *light_types.GenTxParam, e error)

func (*Exchange) GenTxWithSign

func (self *Exchange) GenTxWithSign(param TxParam) (*light_types.GTx, error)

func (*Exchange) GetBalances

func (self *Exchange) GetBalances(pk keys.Uint512) (balances map[string]*big.Int)

func (*Exchange) GetCurrencyNumber

func (self *Exchange) GetCurrencyNumber(pk keys.Uint512) uint64

func (*Exchange) GetLockedBalances

func (self *Exchange) GetLockedBalances(pk keys.Uint512) (balances map[string]*big.Int)

func (*Exchange) GetMaxAvailable

func (self *Exchange) GetMaxAvailable(pk keys.Uint512, currency string) (amount *big.Int)

func (*Exchange) GetPkr

func (self *Exchange) GetPkr(pk *keys.Uint512, index *keys.Uint256) (pkr keys.PKr, err error)

func (*Exchange) GetRecords

func (self *Exchange) GetRecords(pkr keys.PKr, begin, end uint64) (records []Utxo, err error)

func (*Exchange) GetUtxoNum

func (self *Exchange) GetUtxoNum(pk keys.Uint512) map[string]uint64

func (*Exchange) Merge

func (self *Exchange) Merge(pk *keys.Uint512, currency string) (count int, txhash keys.Uint256, e error)

type FetchJob

type FetchJob struct {
	// contains filtered or unexported fields
}

type HandleUtxoFunc

type HandleUtxoFunc func(utxo Utxo)

type PkKey

type PkKey struct {
	Pkr keys.PKr
	Num uint64
}

type PkrAccount

type PkrAccount struct {
	Pkr keys.PKr
	// contains filtered or unexported fields
}

type PkrKey

type PkrKey struct {
	// contains filtered or unexported fields
}

type Reception

type Reception struct {
	Addr     keys.PKr
	Currency string
	Value    *big.Int
}

type RunFunc

type RunFunc func()

type RunJob

type RunJob struct {
	// contains filtered or unexported fields
}

func (*RunJob) Run

func (r *RunJob) Run()

type TxParam

type TxParam struct {
	From       keys.Uint512
	Receptions []Reception
	Gas        uint64
	GasPrice   *big.Int
	Roots      []keys.Uint256
}

type Utxo

type Utxo struct {
	Pkr    keys.PKr
	Root   keys.Uint256
	TxHash keys.Uint256
	Nil    keys.Uint256
	Num    uint64
	Asset  assets.Asset
	IsZ    bool
	// contains filtered or unexported fields
}

type UtxoList

type UtxoList []Utxo

func (UtxoList) Len

func (list UtxoList) Len() int

func (UtxoList) Less

func (list UtxoList) Less(i, j int) bool

func (UtxoList) Swap

func (list UtxoList) Swap(i, j int)

Jump to

Keyboard shortcuts

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