Documentation ¶
Index ¶
- Constants
- Variables
- func FromBurnWithProofs(scheme byte, tx *proto.BurnWithProofs) (AssetChange, AccountChange, error)
- func FromBurnWithSig(scheme byte, tx *proto.BurnWithSig) (AssetChange, AccountChange, error)
- func FromIssueWithProofs(scheme byte, tx *proto.IssueWithProofs) (IssueChange, AccountChange, error)
- func FromIssueWithSig(scheme byte, tx *proto.IssueWithSig) (IssueChange, AccountChange, error)
- func FromReissueWithProofs(scheme byte, tx *proto.ReissueWithProofs) (AssetChange, AccountChange, error)
- func FromReissueWithSig(scheme byte, tx *proto.ReissueWithSig) (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 FromExchangeWithProofs(scheme byte, tx *proto.ExchangeWithProofs) ([]AccountChange, error)
- func FromExchangeWithSig(scheme byte, tx *proto.ExchangeWithSig) ([]AccountChange, error)
- func FromMassTransferWithProofs(scheme byte, tx *proto.MassTransferWithProofs) ([]AccountChange, error)
- func FromTransferWithProofs(scheme byte, tx *proto.TransferWithProofs, miner crypto.PublicKey) ([]AccountChange, error)
- func FromTransferWithSig(scheme byte, tx *proto.TransferWithSig, 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 FromBurnWithProofs ¶ added in v0.5.0
func FromBurnWithProofs(scheme byte, tx *proto.BurnWithProofs) (AssetChange, AccountChange, error)
func FromBurnWithSig ¶ added in v0.5.0
func FromBurnWithSig(scheme byte, tx *proto.BurnWithSig) (AssetChange, AccountChange, error)
func FromIssueWithProofs ¶ added in v0.5.0
func FromIssueWithProofs(scheme byte, tx *proto.IssueWithProofs) (IssueChange, AccountChange, error)
func FromIssueWithSig ¶ added in v0.5.0
func FromIssueWithSig(scheme byte, tx *proto.IssueWithSig) (IssueChange, AccountChange, error)
func FromReissueWithProofs ¶ added in v0.5.0
func FromReissueWithProofs(scheme byte, tx *proto.ReissueWithProofs) (AssetChange, AccountChange, error)
func FromReissueWithSig ¶ added in v0.5.0
func FromReissueWithSig(scheme byte, tx *proto.ReissueWithSig) (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 FromExchangeWithProofs ¶ added in v0.5.0
func FromExchangeWithProofs(scheme byte, tx *proto.ExchangeWithProofs) ([]AccountChange, error)
func FromExchangeWithSig ¶ added in v0.5.0
func FromExchangeWithSig(scheme byte, tx *proto.ExchangeWithSig) ([]AccountChange, error)
func FromMassTransferWithProofs ¶ added in v0.5.0
func FromMassTransferWithProofs(scheme byte, tx *proto.MassTransferWithProofs) ([]AccountChange, error)
func FromTransferWithProofs ¶ added in v0.5.0
func FromTransferWithProofs(scheme byte, tx *proto.TransferWithProofs, miner crypto.PublicKey) ([]AccountChange, error)
func FromTransferWithSig ¶ added in v0.5.0
func FromTransferWithSig(scheme byte, tx *proto.TransferWithSig, miner crypto.PublicKey) ([]AccountChange, error)
type AliasBind ¶
func FromCreateAliasWithProofs ¶ added in v0.5.0
func FromCreateAliasWithProofs(scheme byte, tx *proto.CreateAliasWithProofs) (AliasBind, error)
func FromCreateAliasWithSig ¶ added in v0.5.0
func FromCreateAliasWithSig(scheme byte, tx *proto.CreateAliasWithSig) (AliasBind, error)
type AssetChange ¶
type AssetChange struct { AssetID crypto.Digest SetReissuable bool Reissuable bool SetSponsored bool Sponsored bool Issued uint64 Burned uint64 }
func FromSponsorshipWithProofs ¶ added in v0.5.0
func FromSponsorshipWithProofs(tx *proto.SponsorshipWithProofs) 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 NewTradeFromExchangeWithProofs ¶ added in v0.5.0
func NewTradeFromExchangeWithProofs(scheme byte, tx *proto.ExchangeWithProofs) (Trade, error)
func NewTradeFromExchangeWithSig ¶ added in v0.5.0
func NewTradeFromExchangeWithSig(scheme byte, tx *proto.ExchangeWithSig) (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.