Documentation ¶
Index ¶
- func HexStrToBigInt(hexString string) (*big.Int, error)
- func HexStrToBigIntStr(hexString string) (string, error)
- func Trim0x(str string) string
- type AccountTx
- type AccountTxsGroup
- type Block
- type ByteArray
- type DatetimeToJSONUnix
- type JSONObject
- type JSONStringArray
- type LogEntriesGroup
- type LogEntry
- type Tx
- type TxsGroup
- type Uncle
- type UnclesGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexStrToBigInt ¶
HexStrToBigInt transforms a hex sting like "0xff" to a big.Int. Arbitrary length values are possible.
func HexStrToBigIntStr ¶
HexStrToBigIntStr transforms a hex sting like "0xff" to a big int string like "15". Arbitrary length values are possible.
Types ¶
type AccountTx ¶
type AccountTx struct { Address string Counterparty string TxHash string Out bool IncludedInBlock int64 TxIndex int64 }
AccountTx is a type of entity that represents a transaction between two accounts For each transaction, 2 AccountTx entities will be created, one for each direction of the transaction This helps with querying an account's transactions history in a specific order (e.g. chronological) and paginated
type AccountTxsGroup ¶
func NewStorableAccountTxs ¶
func NewStorableAccountTxs(block types.Block) *AccountTxsGroup
type Block ¶
type Block struct { RawBlock types.Block Number int64 BlockHash string ParentBlockHash string BlockCreationTime DatetimeToJSONUnix BlockGasLimit string BlockGasUsed string BlockDifficulty string TotalBlockDifficulty string BlockExtraData ByteArray BlockMixHash ByteArray BlockNonce ByteArray BlockSize int64 BlockLogsBloom ByteArray IncludesUncle JSONStringArray HasBeneficiary ByteArray HasReceiptsTrie ByteArray HasTxTrie ByteArray Sha3Uncles ByteArray NumberOfUncles int32 NumberOfTxs int32 }
func NewStorableBlock ¶
type ByteArray ¶
type ByteArray string
ByteArray is a custom type that maps to a the database `bytea` fields
type DatetimeToJSONUnix ¶
DatetimeToJSONUnix binds a time.Time to a `timestamp` database field when marshaled to JSON, outputs a unix timestamp
func (DatetimeToJSONUnix) MarshalJSON ¶
func (t DatetimeToJSONUnix) MarshalJSON() ([]byte, error)
func (*DatetimeToJSONUnix) Scan ¶
func (t *DatetimeToJSONUnix) Scan(value interface{}) error
func (DatetimeToJSONUnix) String ¶
func (t DatetimeToJSONUnix) String() string
func (*DatetimeToJSONUnix) UnmarshalJSON ¶
func (t *DatetimeToJSONUnix) UnmarshalJSON(data []byte) error
type JSONObject ¶
type JSONObject map[string]interface{}
JSONObject binds a map[string]interface{} to a `jsonb` database field
func (*JSONObject) Scan ¶
func (obj *JSONObject) Scan(value interface{}) error
type JSONStringArray ¶
type JSONStringArray []string
JSONStringArray binds a slice of strings to a `jsonb` database field
func (*JSONStringArray) Scan ¶
func (j *JSONStringArray) Scan(value interface{}) error
type LogEntriesGroup ¶
type LogEntriesGroup struct { RawBlock types.Block RawReceipts []types.Receipt // contains filtered or unexported fields }
func NewStorableLogEntries ¶
func NewStorableLogEntries(block types.Block, receipts []types.Receipt) *LogEntriesGroup
type Tx ¶
type Tx struct { TxHash string IncludedInBlock int64 TxIndex int32 From ByteArray To ByteArray Value string TxNonce int64 MsgGasLimit string TxGasUsed string TxGasPrice string CumulativeGasUsed string MsgPayload ByteArray MsgStatus string Creates ByteArray TxLogsBloom ByteArray BlockCreationTime DatetimeToJSONUnix LogEntriesTriggered int32 }
type TxsGroup ¶
type Uncle ¶
type Uncle struct { BlockHash string IncludedInBlock int64 Number int64 BlockCreationTime DatetimeToJSONUnix UncleIndex int32 BlockGasLimit string BlockGasUsed string HasBeneficiary ByteArray BlockDifficulty string BlockExtraData ByteArray BlockMixHash ByteArray BlockNonce ByteArray Sha3Uncles ByteArray }
type UnclesGroup ¶
type UnclesGroup struct { RawBlock types.Block RawUncles []types.Block // contains filtered or unexported fields }
func NewStorableUncles ¶
func NewStorableUncles(block types.Block, uncles []types.Block) *UnclesGroup