-
Notifications
You must be signed in to change notification settings - Fork 26
/
interfaces.go
30 lines (25 loc) · 910 Bytes
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package reserve
import (
"github.com/KyberNetwork/reserve-data/common"
ethereum "github.com/ethereum/go-ethereum/common"
"math/big"
)
// all of the functions must support concurrency
type ReserveData interface {
CurrentPriceVersion() (common.Version, error)
GetAllPrices() (common.AllPriceResponse, error)
GetOnePrice(common.TokenPairID) (common.OnePriceResponse, error)
CurrentBalanceVersion() (common.Version, error)
GetAllBalances() (common.AllBalanceResponse, error)
CurrentEBalanceVersion() (common.Version, error)
GetAllEBalances() (common.AllEBalanceResponse, error)
Run() error
}
type ReserveCore interface {
// withdraw
// place order
// cancel order
// deposit
Deposit(exchange common.Exchange, token common.Token, amount *big.Int) (ethereum.Hash, error)
SetRates(sources []common.Token, dests []common.Token, rates []*big.Int, expiryBlocks []*big.Int) (ethereum.Hash, error)
}