Documentation
¶
Index ¶
- Constants
- Variables
- func FromBurnV1(scheme byte, tx proto.BurnV1) (AssetChange, AccountChange, error)
- func FromBurnV2(scheme byte, tx proto.BurnV2) (AssetChange, AccountChange, error)
- func FromIssueV1(scheme byte, tx proto.IssueV1) (IssueChange, AccountChange, error)
- func FromIssueV2(scheme byte, tx proto.IssueV2) (IssueChange, AccountChange, error)
- func FromReissueV1(scheme byte, tx proto.ReissueV1) (AssetChange, AccountChange, error)
- func FromReissueV2(scheme byte, tx proto.ReissueV2) (AssetChange, AccountChange, error)
- func ScaleTimeFrame(tf uint32, scale int) uint32
- func StartOfTheDayMilliseconds(ts uint64) uint64
- func TimeFrameFromTimestampMS(ts uint64) uint32
- func TimeFromMilliseconds(ms uint64) time.Time
- func TimestampMSFromTimeFrame(tf uint32) uint64
- type Account
- type AccountChange
- func FromExchangeV1(scheme byte, tx proto.ExchangeV1) ([]AccountChange, error)
- func FromExchangeV2(scheme byte, tx proto.ExchangeV2) ([]AccountChange, error)
- func FromMassTransferV1(scheme byte, tx proto.MassTransferV1) ([]AccountChange, error)
- func FromTransferV1(scheme byte, tx proto.TransferV1, miner crypto.PublicKey) ([]AccountChange, error)
- func FromTransferV2(scheme byte, tx proto.TransferV2, miner crypto.PublicKey) ([]AccountChange, error)
- type AliasBind
- type AssetChange
- type AssetID
- type AssetInfo
- type ByCandlesTimestampBackward
- type ByMarkets
- type BySymbols
- type ByTickers
- type Candle
- type CandleInfo
- type Decimal
- func (d Decimal) MarshalJSON() ([]byte, error)
- func (d *Decimal) Rescale(scale uint) *Decimal
- func (d *Decimal) Scale() int
- func (d *Decimal) String() string
- func (d *Decimal) ToInfiniteDecimal(infinite bool) InfiniteDecimal
- func (d *Decimal) UnmarshalJSON(value []byte) error
- func (d *Decimal) Value() int
- type InfiniteDecimal
- type IssueChange
- type Market
- type MarketID
- type MarketInfo
- type Substitution
- type Symbols
- type TickerInfo
- type Trade
- type TradeInfo
- type TradesByTimestampBackward
Constants ¶
View Source
const ( CandleSize = 8 * 8 Second = 1000 Minute = 60 * Second DefaultTimeFrame = 5 TimeFrame = DefaultTimeFrame * Minute )
View Source
const PriceConstant = 100000000
View Source
const (
TradeSize = 1 + 3*crypto.DigestSize + 3*crypto.PublicKeySize + 8 + 8 + 8
)
Variables ¶
View Source
var ( WavesID = crypto.Digest{} WavesIssuerAddress = proto.Address{} WavesAssetInfo = AssetInfo{ID: WavesID, Name: "WAVES", IssuerAddress: WavesIssuerAddress, Decimals: 8, Reissuable: false, Supply: 10000000000000000} )
Functions ¶
func FromBurnV1 ¶
func FromBurnV1(scheme byte, tx proto.BurnV1) (AssetChange, AccountChange, error)
func FromBurnV2 ¶
func FromBurnV2(scheme byte, tx proto.BurnV2) (AssetChange, AccountChange, error)
func FromIssueV1 ¶
func FromIssueV1(scheme byte, tx proto.IssueV1) (IssueChange, AccountChange, error)
func FromIssueV2 ¶
func FromIssueV2(scheme byte, tx proto.IssueV2) (IssueChange, AccountChange, error)
func FromReissueV1 ¶
func FromReissueV1(scheme byte, tx proto.ReissueV1) (AssetChange, AccountChange, error)
func FromReissueV2 ¶
func FromReissueV2(scheme byte, tx proto.ReissueV2) (AssetChange, AccountChange, error)
func ScaleTimeFrame ¶
func TimeFromMilliseconds ¶
Types ¶
type Account ¶
func (*Account) SetFromPublicKey ¶
type AccountChange ¶
type AccountChange struct {
Account Account
Asset crypto.Digest
In uint64
Out uint64
MinersReward bool
}
func FromExchangeV1 ¶
func FromExchangeV1(scheme byte, tx proto.ExchangeV1) ([]AccountChange, error)
func FromExchangeV2 ¶
func FromExchangeV2(scheme byte, tx proto.ExchangeV2) ([]AccountChange, error)
func FromMassTransferV1 ¶
func FromMassTransferV1(scheme byte, tx proto.MassTransferV1) ([]AccountChange, error)
func FromTransferV1 ¶
func FromTransferV1(scheme byte, tx proto.TransferV1, miner crypto.PublicKey) ([]AccountChange, error)
func FromTransferV2 ¶
func FromTransferV2(scheme byte, tx proto.TransferV2, miner crypto.PublicKey) ([]AccountChange, error)
type AliasBind ¶
func FromCreateAliasV1 ¶
func FromCreateAliasV1(scheme byte, tx proto.CreateAliasV1) (AliasBind, error)
func FromCreateAliasV2 ¶
func FromCreateAliasV2(scheme byte, tx proto.CreateAliasV2) (AliasBind, error)
type AssetChange ¶
type AssetChange struct {
AssetID crypto.Digest
SetReissuable bool
Reissuable bool
SetSponsored bool
Sponsored bool
Issued uint64
Burned uint64
}
func FromSponsorshipV1 ¶
func FromSponsorshipV1(tx proto.SponsorshipV1) AssetChange
type AssetID ¶
func (AssetID) MarshalJSON ¶
type ByCandlesTimestampBackward ¶
type ByCandlesTimestampBackward []CandleInfo
func (ByCandlesTimestampBackward) Len ¶
func (a ByCandlesTimestampBackward) Len() int
func (ByCandlesTimestampBackward) Less ¶
func (a ByCandlesTimestampBackward) Less(i, j int) bool
func (ByCandlesTimestampBackward) Swap ¶
func (a ByCandlesTimestampBackward) Swap(i, j int)
type ByMarkets ¶
type ByMarkets []MarketInfo
type BySymbols ¶
type BySymbols []Substitution
type ByTickers ¶
type ByTickers []TickerInfo
type Candle ¶
type Candle struct {
Open uint64
High uint64
Low uint64
Close uint64
Average uint64
Volume uint64
MinTimestamp uint64
MaxTimestamp uint64
}
func NewCandleFromTimeFrame ¶
func NewCandleFromTimestamp ¶
func (*Candle) MarshalBinary ¶
func (*Candle) UnmarshalBinary ¶
func (*Candle) UpdateFromTrade ¶
type CandleInfo ¶
type CandleInfo struct {
Timestamp uint64 `json:"timestamp"`
Open Decimal `json:"open"`
High Decimal `json:"high"`
Low Decimal `json:"low"`
Close Decimal `json:"close"`
Average Decimal `json:"vwap"`
Volume Decimal `json:"volume"`
PriceVolume Decimal `json:"priceVolume"`
Confirmed bool `json:"confirmed"`
}
func CandleInfoFromCandle ¶
func CandleInfoFromCandle(candle Candle, amountAssetDecimals, priceAssetDecimals uint, timeFrameScale int) CandleInfo
func EmptyCandleInfo ¶
func EmptyCandleInfo(amountAssetDecimals, priceAssetDecimals uint, timestamp uint64) CandleInfo
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
func NewDecimal ¶
func NewDecimalFromString ¶
func (Decimal) MarshalJSON ¶
func (*Decimal) ToInfiniteDecimal ¶
func (d *Decimal) ToInfiniteDecimal(infinite bool) InfiniteDecimal
func (*Decimal) UnmarshalJSON ¶
type InfiniteDecimal ¶
func (InfiniteDecimal) MarshalJSON ¶
func (d InfiniteDecimal) MarshalJSON() ([]byte, error)
func (*InfiniteDecimal) String ¶
func (d *InfiniteDecimal) String() string
func (*InfiniteDecimal) UnmarshalJSON ¶
func (d *InfiniteDecimal) UnmarshalJSON(value []byte) error
type IssueChange ¶
type Market ¶
func (*Market) MarshalBinary ¶
func (*Market) UnmarshalBinary ¶
func (*Market) UpdateFromTrade ¶
type MarketInfo ¶
type MarketInfo struct {
TickerInfo
TotalTrades int `json:"totalTrades"`
FirstTradeDay uint64 `json:"firstTradeDay"`
LastTradeDay uint64 `json:"lastTradeDay"`
}
func NewMarketInfo ¶
func NewMarketInfo(ticker TickerInfo, md Market) MarketInfo
type Substitution ¶
type Symbols ¶
type Symbols struct {
// contains filtered or unexported fields
}
func NewSymbolsFromFile ¶ added in v0.3.0
func (*Symbols) All ¶
func (s *Symbols) All() []Substitution
func (*Symbols) UpdateFromOracle ¶ added in v0.3.0
func (s *Symbols) UpdateFromOracle(conn *grpc.ClientConn) error
type TickerInfo ¶
type TickerInfo struct {
Symbol string `json:"symbol"`
AmountAssetID AssetID `json:"amountAssetID"`
AmountAssetName string `json:"amountAssetName"`
AmountAssetDecimals byte `json:"amountAssetDecimals"`
AmountAssetTotalSupply Decimal `json:"amountAssetTotalSupply"`
AmountAssetMaxSupply InfiniteDecimal `json:"amountAssetMaxSupply"`
AmountAssetCirculatingSupply Decimal `json:"amountAssetCirculatingSupply"`
PriceAssetID AssetID `json:"priceAssetID"`
PriceAssetName string `json:"priceAssetName"`
PriceAssetDecimals byte `json:"priceAssetDecimals"`
PriceAssetTotalSupply Decimal `json:"priceAssetTotalSupply"`
PriceAssetMaxSupply InfiniteDecimal `json:"priceAssetMaxSupply"`
PriceAssetCirculatingSupply Decimal `json:"priceAssetCirculatingSupply"`
DayOpen Decimal `json:"24h_open"`
DayHigh Decimal `json:"24h_high"`
DayLow Decimal `json:"24h_low"`
DayClose Decimal `json:"24h_close"`
DayVWAP Decimal `json:"24h_vwap"`
DayVolume Decimal `json:"24h_volume"`
DayPriceVolume Decimal `json:"24h_priceVolume"`
Timestamp uint64 `json:"timestamp"`
}
func NewTickerInfo ¶
func NewTickerInfo(symbol string, amountAsset, priceAsset AssetInfo, amountAssetIssuerBalance, priceAssetIssuerBalance uint64, candle Candle) TickerInfo
type Trade ¶
type Trade struct {
AmountAsset crypto.Digest
PriceAsset crypto.Digest
TransactionID crypto.Digest
OrderType proto.OrderType
Buyer proto.Address
Seller proto.Address
Matcher proto.Address
Price uint64
Amount uint64
Timestamp uint64
}
func NewTradeFromExchangeV1 ¶
func NewTradeFromExchangeV1(scheme byte, tx proto.ExchangeV1) (Trade, error)
func NewTradeFromExchangeV2 ¶
func NewTradeFromExchangeV2(scheme byte, tx proto.ExchangeV2) (Trade, error)
func (*Trade) MarshalBinary ¶
func (*Trade) UnmarshalBinary ¶
type TradeInfo ¶
type TradeInfo struct {
Timestamp uint64 `json:"timestamp"`
ID crypto.Digest `json:"id"`
Confirmed bool `json:"confirmed"`
OrderType proto.OrderType `json:"type"`
Price Decimal `json:"price"`
Amount Decimal `json:"amount"`
Buyer proto.Address `json:"buyer"`
Seller proto.Address `json:"seller"`
Matcher proto.Address `json:"matcher"`
}
TradeInfo is an API representation of the Trade
func NewTradeInfo ¶
type TradesByTimestampBackward ¶
type TradesByTimestampBackward []TradeInfo
func (TradesByTimestampBackward) Len ¶
func (a TradesByTimestampBackward) Len() int
func (TradesByTimestampBackward) Less ¶
func (a TradesByTimestampBackward) Less(i, j int) bool
func (TradesByTimestampBackward) Swap ¶
func (a TradesByTimestampBackward) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.