Documentation ¶
Index ¶
- Variables
- type Amount
- type AmountUnit
- type BroadcastParams
- type BroadcastResponse
- type Db
- func (d *Db) AddMempoolTxs(addr string, tx Transaction) error
- func (d *Db) GetIdxs(address string, isReceived bool) ([]Index, error)
- func (d *Db) GetMemoTxs(memo string) ([]string, error)
- func (d *Db) GetMempoolTxs(addr string) ([]Transaction, error)
- func (d *Db) GetTx(key string) (*Transaction, error)
- func (d *Db) Start(path string, pruneHours int64) error
- func (d *Db) StoreIdx(id string, tx *Transaction, isReceived bool) error
- func (d *Db) StoreMemoTxs(memo string, txkey string) error
- func (d *Db) StoreMempoolTxs(addr string, txs []Transaction) error
- func (d *Db) StoreTx(key string, tx Transaction) error
- type DynamicAmount
- func NewAmountFromBigInt(i *big.Int) (DynamicAmount, error)
- func NewAmountFromBigIntDirect(val *big.Int) (DynamicAmount, error)
- func NewAmountFromFloat64(f float64) (DynamicAmount, error)
- func NewAmountFromInt64(val int64) (DynamicAmount, error)
- func NewAmountFromString(val string) (DynamicAmount, error)
- func (b DynamicAmount) Add(y Amount) (Amount, error)
- func (b DynamicAmount) BigInt() *big.Int
- func (b DynamicAmount) DecimalCount() int
- func (b DynamicAmount) Equals(y Amount) bool
- func (b DynamicAmount) FloorDecimals(decimals int) Amount
- func (b DynamicAmount) Int() int64
- func (b DynamicAmount) String() string
- func (b DynamicAmount) StringFixedDecs() string
- func (b DynamicAmount) Sub(y Amount) (Amount, error)
- func (b DynamicAmount) Uint() uint64
- type Idxs
- type Index
- type Response
- type Symbol
- type Transaction
- type TxJSON
- type TxResponse
- type Txs
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BTC = NewSymbol("BTC", 8) BNB = NewSymbol("BNB", 8) BTCB1 = NewSymbol("BTC.B", 8) BTCB2 = NewSymbol("BTCB", 8) ETH = NewSymbol("ETH", 18) )
If this list is updated please also update it in data/fees.go
Functions ¶
This section is empty.
Types ¶
type Amount ¶
type Amount interface { fmt.Stringer // Adds another Amount to this one and returns a new Amount Add(Amount) (Amount, error) // Subtracts another Amount from this one and returns a new Amount Sub(Amount) (Amount, error) // Checks for amount equality and returns true if both are equal Equals(Amount) bool // Returns amount as big int BigInt() *big.Int // Returns amount in satoshi unit format Int() int64 Uint() uint64 // Returns the number of decimal precision DecimalCount() int // Floor the last n number of decimals // precision is calculated by Amount.Decimals - n // decimals = 6 & n = 3 | 0.123456 -> 0.123000 FloorDecimals(n int) Amount // Returns a string with the number of decimals fixed to the number of decimals for this Amount (e.g. 0.00010000 if 8 decimals) StringFixedDecs() string }
type AmountUnit ¶
type AmountUnit int
type BroadcastParams ¶
type BroadcastParams struct {
HEX string `json:"hex"`
}
type BroadcastResponse ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
func (*Db) AddMempoolTxs ¶
func (d *Db) AddMempoolTxs(addr string, tx Transaction) error
func (*Db) GetMempoolTxs ¶
func (d *Db) GetMempoolTxs(addr string) ([]Transaction, error)
func (*Db) StoreMempoolTxs ¶
func (d *Db) StoreMempoolTxs(addr string, txs []Transaction) error
type DynamicAmount ¶
type DynamicAmount struct {
// contains filtered or unexported fields
}
func NewAmountFromBigInt ¶
func NewAmountFromBigInt(i *big.Int) (DynamicAmount, error)
func NewAmountFromBigIntDirect ¶
func NewAmountFromBigIntDirect(val *big.Int) (DynamicAmount, error)
func NewAmountFromFloat64 ¶
func NewAmountFromFloat64(f float64) (DynamicAmount, error)
func NewAmountFromInt64 ¶
func NewAmountFromInt64(val int64) (DynamicAmount, error)
func NewAmountFromString ¶
func NewAmountFromString(val string) (DynamicAmount, error)
func (DynamicAmount) BigInt ¶
func (b DynamicAmount) BigInt() *big.Int
func (DynamicAmount) DecimalCount ¶
func (b DynamicAmount) DecimalCount() int
func (DynamicAmount) Equals ¶
func (b DynamicAmount) Equals(y Amount) bool
func (DynamicAmount) FloorDecimals ¶
func (b DynamicAmount) FloorDecimals(decimals int) Amount
func (DynamicAmount) Int ¶
func (b DynamicAmount) Int() int64
func (DynamicAmount) String ¶
func (b DynamicAmount) String() string
func (DynamicAmount) StringFixedDecs ¶
func (b DynamicAmount) StringFixedDecs() string
func (DynamicAmount) Uint ¶
func (b DynamicAmount) Uint() uint64
type Transaction ¶
type Transaction struct { TxID string From string To string Amount Amount Timestamp time.Time Currency Symbol Height int64 Memo string OutputIndex int Spent bool }
func (Transaction) MarshalJSON ¶
func (tx Transaction) MarshalJSON() ([]byte, error)
func (Transaction) Serialize ¶
func (tx Transaction) Serialize() string
type TxJSON ¶
type TxJSON struct { TxID string `json:"txId"` From string `json:"from"` To string `json:"to"` Amount string `json:"amount"` Currency string `json:"currency"` Decimals int `json:"decimals"` Height int64 `json:"height"` Timestamp int64 `json:"time"` Memo string `json:"memo"` OutputIndex int `json:"outputIndex"` Spent bool `json:"spent"` }
func (TxJSON) ToCommTx ¶
func (t TxJSON) ToCommTx() (Transaction, error)
type TxResponse ¶
type TxResponse struct { Response LatestHeight int64 `json:"latestHeight"` InTxsMempool []Transaction `json:"inTxsMempool"` InTxs []Transaction `json:"inTxs"` OutTxsMempool []Transaction `json:"outTxsMempool"` OutTxs []Transaction `json:"outTxs"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.