Documentation
¶
Index ¶
- type Block
- type BlockChain
- type Hydro
- type HydroProtocol
- type MockBlockchain
- func (m *MockBlockchain) GetBlockByNumber(blockNumber uint64) (Block, error)
- func (m *MockBlockchain) GetBlockNumber() (uint64, error)
- func (m *MockBlockchain) GetHotFeeDiscount(address string) decimal.Decimal
- func (m *MockBlockchain) GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal
- func (m *MockBlockchain) GetTokenBalance(tokenAddress string, address string) decimal.Decimal
- func (m *MockBlockchain) GetTransaction(ID string) (Transaction, error)
- func (m *MockBlockchain) GetTransactionAndReceipt(ID string) (Transaction, TransactionReceipt, error)
- func (m *MockBlockchain) GetTransactionReceipt(ID string) (TransactionReceipt, error)
- func (m *MockBlockchain) IsValidSignature(address string, message string, signature string) (bool, error)
- func (m *MockBlockchain) SendRawTransaction(tx interface{}) (string, error)
- func (m *MockBlockchain) SendTransaction(txAttributes map[string]interface{}, privateKey []byte) (transactionHash string, err error)
- type MockHydro
- type MockHydroProtocol
- type Order
- type OrderAddressSet
- type OrderParam
- type OrderSignature
- type Transaction
- type TransactionReceipt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block interface {
Number() uint64
Timestamp() uint64
GetTransactions() []Transaction
}
type BlockChain ¶
type BlockChain interface {
GetTokenBalance(tokenAddress, address string) decimal.Decimal
GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal
GetHotFeeDiscount(address string) decimal.Decimal
GetBlockNumber() (uint64, error)
GetBlockByNumber(blockNumber uint64) (Block, error)
GetTransaction(ID string) (Transaction, error)
GetTransactionReceipt(ID string) (TransactionReceipt, error)
GetTransactionAndReceipt(ID string) (Transaction, TransactionReceipt, error)
IsValidSignature(address string, message string, signature string) (bool, error)
SendTransaction(txAttributes map[string]interface{}, privateKey []byte) (transactionHash string, err error)
SendRawTransaction(tx interface{}) (string, error)
}
type Hydro ¶
type Hydro interface {
HydroProtocol
BlockChain
}
type HydroProtocol ¶
type HydroProtocol interface {
GenerateOrderData(version, expiredAtSeconds, salt int64, asMakerFeeRate, asTakerFeeRate, makerRebateRate decimal.Decimal, isSell, isMarket, isMakerOnly bool) string
GetOrderHash(*Order) []byte
GetMatchOrderCallData(*Order, []*Order, []*big.Int) []byte
IsValidOrderSignature(address string, orderID string, signature string) bool
}
type MockBlockchain ¶
type MockBlockchain struct {
BlockChain
mock.Mock
}
func (*MockBlockchain) GetBlockByNumber ¶
func (m *MockBlockchain) GetBlockByNumber(blockNumber uint64) (Block, error)
func (*MockBlockchain) GetBlockNumber ¶
func (m *MockBlockchain) GetBlockNumber() (uint64, error)
func (*MockBlockchain) GetHotFeeDiscount ¶
func (m *MockBlockchain) GetHotFeeDiscount(address string) decimal.Decimal
func (*MockBlockchain) GetTokenAllowance ¶
func (m *MockBlockchain) GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal
func (*MockBlockchain) GetTokenBalance ¶
func (m *MockBlockchain) GetTokenBalance(tokenAddress string, address string) decimal.Decimal
func (*MockBlockchain) GetTransaction ¶
func (m *MockBlockchain) GetTransaction(ID string) (Transaction, error)
func (*MockBlockchain) GetTransactionAndReceipt ¶
func (m *MockBlockchain) GetTransactionAndReceipt(ID string) (Transaction, TransactionReceipt, error)
func (*MockBlockchain) GetTransactionReceipt ¶
func (m *MockBlockchain) GetTransactionReceipt(ID string) (TransactionReceipt, error)
func (*MockBlockchain) IsValidSignature ¶
func (*MockBlockchain) SendRawTransaction ¶
func (m *MockBlockchain) SendRawTransaction(tx interface{}) (string, error)
func (*MockBlockchain) SendTransaction ¶
func (m *MockBlockchain) SendTransaction(txAttributes map[string]interface{}, privateKey []byte) (transactionHash string, err error)
type MockHydro ¶
type MockHydro struct {
HydroProtocol
BlockChain
}
func NewMockHydro ¶
func NewMockHydro() *MockHydro
type MockHydroProtocol ¶
type MockHydroProtocol struct {
HydroProtocol
mock.Mock
}
func (*MockHydroProtocol) GenerateOrderData ¶
func (*MockHydroProtocol) GetMatchOrderCallData ¶
func (*MockHydroProtocol) GetOrderHash ¶
func (m *MockHydroProtocol) GetOrderHash(order *Order) []byte
type Order ¶
type OrderAddressSet ¶
type OrderParam ¶
type OrderSignature ¶
type Transaction ¶
type Transaction interface {
GetHash() string
}
type TransactionReceipt ¶
Click to show internal directories.
Click to hide internal directories.