Documentation
¶
Index ¶
- type ActivityStorage
- type Blockchain
- type ReserveCore
- func (rc ReserveCore) CancelOrder(id common.ActivityID, exchange common.Exchange) error
- func (rc ReserveCore) Deposit(exchange common.Exchange, token common.Token, amount *big.Int, ...) (common.ActivityID, error)
- func (rc ReserveCore) GetSetRateResult(tokens []common.Token, buys, sells, afpMids []*big.Int, block *big.Int) (*types.Transaction, error)
- func (rc ReserveCore) SetRates(tokens []common.Token, buys []*big.Int, sells []*big.Int, block *big.Int, ...) (common.ActivityID, error)
- func (rc ReserveCore) Trade(exchange common.Exchange, tradeType string, base common.Token, ...) (common.ActivityID, float64, float64, bool, error)
- func (rc ReserveCore) Withdraw(exchange common.Exchange, token common.Token, amount *big.Int, ...) (common.ActivityID, error)
- type Setting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityStorage ¶
type ActivityStorage interface {
Record(
action string,
id common.ActivityID,
destination string,
params map[string]interface{},
result map[string]interface{},
estatus string,
mstatus string,
timepoint uint64) error
HasPendingDeposit(
token common.Token, exchange common.Exchange) (bool, error)
GetActivity(id common.ActivityID) (common.ActivityRecord, error)
// PendingSetRate return the last pending set rate and number of pending
// transactions.
PendingSetRate(minedNonce uint64) (*common.ActivityRecord, uint64, error)
}
ActivityStorage is the interface contains all database operations of core.
type Blockchain ¶
type Blockchain interface {
StandardGasPrice() float64
Send(
token common.Token,
amount *big.Int,
address ethereum.Address) (*types.Transaction, error)
SetRates(
tokens []ethereum.Address,
buys []*big.Int,
sells []*big.Int,
block *big.Int,
nonce *big.Int,
gasPrice *big.Int) (*types.Transaction, error)
SetRateMinedNonce() (uint64, error)
}
Blockchain is the interface wraps around all core methods to interact with Ethereum blockchain.
type ReserveCore ¶
type ReserveCore struct {
// contains filtered or unexported fields
}
func NewReserveCore ¶
func NewReserveCore( blockchain Blockchain, storage ActivityStorage, setting Setting) *ReserveCore
func (ReserveCore) CancelOrder ¶
func (rc ReserveCore) CancelOrder(id common.ActivityID, exchange common.Exchange) error
func (ReserveCore) GetSetRateResult ¶ added in v0.1.1
func (rc ReserveCore) GetSetRateResult(tokens []common.Token, buys, sells, afpMids []*big.Int, block *big.Int) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.