Documentation ¶
Index ¶
- type MeshDB
- func (m *MeshDB) Close()
- func (m *MeshDB) FindAllMiniHeadersSortedByNumber() ([]*MiniHeader, error)
- func (m *MeshDB) FindLatestMiniHeader() (*MiniHeader, error)
- func (m *MeshDB) FindOrdersByMakerAddress(makerAddress common.Address) ([]*Order, error)
- func (m *MeshDB) FindOrdersByMakerAddressAndMaxSalt(makerAddress common.Address, salt *big.Int) ([]*Order, error)
- func (m *MeshDB) FindOrdersByMakerAddressTokenAddressAndTokenID(makerAddress, tokenAddress common.Address, tokenID *big.Int) ([]*Order, error)
- func (m *MeshDB) FindOrdersLastUpdatedBefore(lastUpdated time.Time) ([]*Order, error)
- func (m *MeshDB) GetMetadata() (*Metadata, error)
- func (m *MeshDB) SaveMetadata(metadata *Metadata) error
- type Metadata
- type MetadataCollection
- type MiniHeader
- type MiniHeadersCollection
- type Order
- type OrdersCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MeshDB ¶
type MeshDB struct { MiniHeaders *MiniHeadersCollection Orders *OrdersCollection // contains filtered or unexported fields }
MeshDB instantiates the DB connection and creates all the collections used by the application
func (*MeshDB) FindAllMiniHeadersSortedByNumber ¶
func (m *MeshDB) FindAllMiniHeadersSortedByNumber() ([]*MiniHeader, error)
FindAllMiniHeadersSortedByNumber returns all MiniHeaders sorted by block number
func (*MeshDB) FindLatestMiniHeader ¶
func (m *MeshDB) FindLatestMiniHeader() (*MiniHeader, error)
FindLatestMiniHeader returns the latest MiniHeader (i.e. the one with the largest block number), or nil if there are none in the database.
func (*MeshDB) FindOrdersByMakerAddress ¶
FindOrdersByMakerAddress finds all orders belonging to a particular maker address
func (*MeshDB) FindOrdersByMakerAddressAndMaxSalt ¶
func (m *MeshDB) FindOrdersByMakerAddressAndMaxSalt(makerAddress common.Address, salt *big.Int) ([]*Order, error)
FindOrdersByMakerAddressAndMaxSalt finds all orders belonging to a particular maker address that also have a salt value less then or equal to X
func (*MeshDB) FindOrdersByMakerAddressTokenAddressAndTokenID ¶
func (m *MeshDB) FindOrdersByMakerAddressTokenAddressAndTokenID(makerAddress, tokenAddress common.Address, tokenID *big.Int) ([]*Order, error)
FindOrdersByMakerAddressTokenAddressAndTokenID finds all orders belonging to a particular maker address where makerAssetData encodes for a particular token contract and optionally a token ID
func (*MeshDB) FindOrdersLastUpdatedBefore ¶
FindOrdersLastUpdatedBefore finds all orders where the LastUpdated time is less than X
func (*MeshDB) GetMetadata ¶
GetMetadata returns the metadata (or a db.NotFoundError if no metadata has been found).
func (*MeshDB) SaveMetadata ¶
SaveMetadata inserts the metadata into the database.
type Metadata ¶
type Metadata struct {
EthereumNetworkID int
}
Metadata is the database representation of MeshDB instance metadata
type MetadataCollection ¶
type MetadataCollection struct {
*db.Collection
}
MetadataCollection represents a DB collection used to store instance metadata
type MiniHeader ¶
MiniHeader is the database representation of a succinct Ethereum block headers
type MiniHeadersCollection ¶
type MiniHeadersCollection struct { *db.Collection // contains filtered or unexported fields }
MiniHeadersCollection represents a DB collection of mini Ethereum block headers
type Order ¶
type Order struct { Hash common.Hash SignedOrder *zeroex.SignedOrder // When was this order last validated LastUpdated time.Time // How much of this order can still be filled FillableTakerAssetAmount *big.Int // Was this order flagged for removal? Due to the possibility of block-reorgs, instead // of immediately removing an order when FillableTakerAssetAmount becomes 0, we instead // flag it for removal. After this order isn't updated for X time and has IsRemoved = true, // the order can be permanently deleted. IsRemoved bool }
Order is the database representation a 0x order along with some relevant metadata