storage

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenBucketByID          string = "token_by_id"
	TokenBucketByAddress     string = "token_by_addr"
	ExchangeFeeBucket        string = "exchange_fee"
	ExchangeMinDepositBucket string = "exchange_min_deposit"
	ExchangeDepositAddress   string = "exchange_deposit_address"
	ExchangeTokenPairs       string = "exchange_token_pairs"
	ExchangeInfo             string = "exchange_info"
	ExchangeStatus           string = "exchange_status"
	ExchangeNotifications    string = "exchange_notifications"
	PendingTokenRequest      string = "pending_token_request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltSettingStorage

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

func NewBoltSettingStorage

func NewBoltSettingStorage(dbPath string) (*BoltSettingStorage, error)

func (*BoltSettingStorage) AddTokenByAddress

func (s *BoltSettingStorage) AddTokenByAddress(t common.Token, timestamp uint64) error

func (*BoltSettingStorage) AddTokenByID

func (s *BoltSettingStorage) AddTokenByID(t common.Token, timestamp uint64) error

func (*BoltSettingStorage) GetActiveTokenByAddress

func (s *BoltSettingStorage) GetActiveTokenByAddress(addr ethereum.Address) (common.Token, error)

func (*BoltSettingStorage) GetActiveTokenByID

func (s *BoltSettingStorage) GetActiveTokenByID(id string) (common.Token, error)

func (*BoltSettingStorage) GetActiveTokens

func (s *BoltSettingStorage) GetActiveTokens() (result []common.Token, err error)

func (*BoltSettingStorage) GetAllTokens

func (s *BoltSettingStorage) GetAllTokens() (result []common.Token, err error)

func (*BoltSettingStorage) GetDepositAddresses

func (s *BoltSettingStorage) GetDepositAddresses(ex settings.ExchangeName) (common.ExchangeAddresses, error)

GetDepositAddresses returns a map[tokenID]DepositAddress and error if occur

func (*BoltSettingStorage) GetExchangeInfo

func (*BoltSettingStorage) GetExchangeNotifications

func (s *BoltSettingStorage) GetExchangeNotifications() (common.ExchangeNotifications, error)

func (*BoltSettingStorage) GetExchangeStatus

func (s *BoltSettingStorage) GetExchangeStatus() (common.ExchangesStatus, error)

GetExchangeStatus get exchange status to dashboard and analytics

func (*BoltSettingStorage) GetExchangeVersion

func (s *BoltSettingStorage) GetExchangeVersion() (uint64, error)

func (*BoltSettingStorage) GetExternalTokenByAddress

func (s *BoltSettingStorage) GetExternalTokenByAddress(addr ethereum.Address) (common.Token, error)

func (*BoltSettingStorage) GetExternalTokenByID

func (s *BoltSettingStorage) GetExternalTokenByID(id string) (common.Token, error)

func (*BoltSettingStorage) GetExternalTokens

func (s *BoltSettingStorage) GetExternalTokens() (result []common.Token, err error)

func (*BoltSettingStorage) GetFee

GetFee returns a map[tokenID]exchangeFees and error if occur

func (*BoltSettingStorage) GetInternalTokenByAddress

func (s *BoltSettingStorage) GetInternalTokenByAddress(addr ethereum.Address) (common.Token, error)

func (*BoltSettingStorage) GetInternalTokenByID

func (s *BoltSettingStorage) GetInternalTokenByID(id string) (common.Token, error)

func (*BoltSettingStorage) GetInternalTokens

func (s *BoltSettingStorage) GetInternalTokens() (result []common.Token, err error)

func (*BoltSettingStorage) GetMinDeposit

GetMinDeposit returns a map[tokenID]MinDeposit and error if occur

func (*BoltSettingStorage) GetPendingTokenUpdates

func (s *BoltSettingStorage) GetPendingTokenUpdates() (map[string]common.TokenUpdate, error)

func (*BoltSettingStorage) GetTokenByAddress

func (s *BoltSettingStorage) GetTokenByAddress(addr ethereum.Address) (common.Token, error)

func (*BoltSettingStorage) GetTokenByID

func (s *BoltSettingStorage) GetTokenByID(id string) (common.Token, error)

func (*BoltSettingStorage) GetTokenPairs

func (s *BoltSettingStorage) GetTokenPairs(ex settings.ExchangeName) ([]common.TokenPair, error)

GetTokenPairs returns a list of TokenPairs available at current exchange return error if occur

func (*BoltSettingStorage) GetTokenVersion

func (s *BoltSettingStorage) GetTokenVersion() (uint64, error)

func (*BoltSettingStorage) RemovePendingTokenUpdates

func (s *BoltSettingStorage) RemovePendingTokenUpdates() error

func (*BoltSettingStorage) StoreDepositAddress

func (s *BoltSettingStorage) StoreDepositAddress(ex settings.ExchangeName, addrs common.ExchangeAddresses, timestamp uint64) error

StoreDepositAddress stores the depositAddress with exchangeName as key into database and return error if occur

func (*BoltSettingStorage) StoreExchangeInfo

func (s *BoltSettingStorage) StoreExchangeInfo(ex settings.ExchangeName, exInfo common.ExchangeInfo, timestamp uint64) error

func (*BoltSettingStorage) StoreExchangeNotification

func (s *BoltSettingStorage) StoreExchangeNotification(
	exchange, action, token string, fromTime, toTime uint64, isWarning bool, msg string) error

func (*BoltSettingStorage) StoreExchangeStatus

func (s *BoltSettingStorage) StoreExchangeStatus(data common.ExchangesStatus) error

func (*BoltSettingStorage) StoreFee

func (s *BoltSettingStorage) StoreFee(ex settings.ExchangeName, data common.ExchangeFees, timestamp uint64) error

StoreFee stores the fee with exchangeName as key into database and return error if occur

func (*BoltSettingStorage) StoreMinDeposit

func (s *BoltSettingStorage) StoreMinDeposit(ex settings.ExchangeName, data common.ExchangesMinDeposit, timestamp uint64) error

StoreMinDeposit stores the minDeposit with exchangeName as key into database and return error if occur

func (*BoltSettingStorage) StorePendingTokenUpdates

func (s *BoltSettingStorage) StorePendingTokenUpdates(trs map[string]common.TokenUpdate) error

func (*BoltSettingStorage) StoreTokenPairs

func (s *BoltSettingStorage) StoreTokenPairs(ex settings.ExchangeName, data []common.TokenPair, timestamp uint64) error

StoreTokenPairs store the list of TokenPairs with exchangeName as key into database and return error if occur

func (*BoltSettingStorage) UpdateToken

func (s *BoltSettingStorage) UpdateToken(t common.Token, timestamp uint64) error

func (*BoltSettingStorage) UpdateTokenWithExchangeSetting

func (s *BoltSettingStorage) UpdateTokenWithExchangeSetting(tokens []common.Token, exSetting map[settings.ExchangeName]*common.ExchangeSetting, availExs []settings.ExchangeName, timestamp uint64) error

UpdateTokenWithExchangeSetting will attempt to apply all the token and exchange settings as well as remove pending Token listing in one TX. reroll and return err if occur

type FilterFunction

type FilterFunction func(common.Token) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL