exchange

package
v1.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: GPL-3.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJob

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

func DecOuts

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

Types

type Account

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

type BlockInfo

type BlockInfo struct {
	Num  uint64
	Hash keys.Uint256
	Ins  []keys.Uint256
	Outs []Utxo
}

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) ClearTxParam

func (self *Exchange) ClearTxParam(txParam *txtool.GTxParam) (count int)

func (*Exchange) ClearUsedFlagForPK

func (self *Exchange) ClearUsedFlagForPK(pk *keys.Uint512) (count int)

func (*Exchange) ClearUsedFlagForRoot

func (self *Exchange) ClearUsedFlagForRoot(root keys.Uint256) (count int)

func (*Exchange) DefaultRefundTo

func (self *Exchange) DefaultRefundTo(from *keys.Uint512) (ret *keys.PKr)

func (*Exchange) FindPkgById

func (self *Exchange) FindPkgById(id *keys.Uint256) (pkg *Pkg)

func (*Exchange) FindPkgs

func (self *Exchange) FindPkgs(pk *keys.Uint512, from bool) (pkgs []Pkg)

func (*Exchange) FindRoots

func (self *Exchange) FindRoots(pk *keys.Uint512, currency string, amount *big.Int) (roots prepare.Utxos, remain big.Int)

func (*Exchange) FindRootsByTicket

func (self *Exchange) FindRootsByTicket(pk *keys.Uint512, tickets map[keys.Uint256]keys.Uint256) (roots prepare.Utxos, remain map[keys.Uint256]keys.Uint256)

func (*Exchange) GenMergeTx

func (self *Exchange) GenMergeTx(mp *MergeParam) (txParam *txtool.GTxParam, e error)

func (*Exchange) GenTx

func (self *Exchange) GenTx(param prepare.PreTxParam) (txParam *txtool.GTxParam, e error)

func (*Exchange) GenTxWithSign

func (self *Exchange) GenTxWithSign(param prepare.PreTxParam) (pretx *txtool.GTxParam, tx *txtool.GTx, e error)

func (*Exchange) GetBalances

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

func (*Exchange) GetBlocksInfo

func (self *Exchange) GetBlocksInfo(start, end uint64) (blocks []BlockInfo, err error)

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) GetRecordsByPk

func (self *Exchange) GetRecordsByPk(PK *keys.Uint512, begin, end uint64) (records []Utxo, err error)

func (*Exchange) GetRecordsByPkr

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

func (*Exchange) GetRecordsByTxHash

func (self *Exchange) GetRecordsByTxHash(txHash keys.Uint256) (records []Utxo, err error)

func (*Exchange) GetRoot

func (self *Exchange) GetRoot(root *keys.Uint256) (utxos *prepare.Utxo)

func (*Exchange) GetRootByNil

func (self *Exchange) GetRootByNil(Nil keys.Uint256) (root *keys.Uint256)

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, force bool) (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 MergeParam

type MergeParam struct {
	From     keys.Uint512
	To       *keys.PKr
	Currency string
	Zcount   uint64
	Left     uint64
}

type MergeUtxos

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

type PkKey

type PkKey struct {
	PK  keys.Uint512
	Num uint64
}

type Pkg

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

type PkrAccount

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

type PkrKey

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

type RunFunc

type RunFunc func()

type RunJob

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

func (*RunJob) Run

func (r *RunJob) Run()

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) Roots

func (list UtxoList) Roots() (roots prepare.Utxos)

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