Documentation ¶
Overview ¶
Package store provides interface to interact with herdius blockchain transaction without connect to herdius blockchain server.
Index ¶
Constants ¶
View Source
const StatusPending = "pending"
StatusPending indicates a TX is in pending state
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Storer ¶
type Storer interface { Save(*Tx) error Update(*Tx) error Get(id string) (*Tx, error) GetBySender(address string) ([]*Tx, error) GetByAssetAndSender(asset, address string) ([]*Tx, error) GetByStatus(status string) ([]*Tx, error) GetTxByTypeBlockHeight(txType string, height uint64) ([]*Tx, error) GetLatestBlockID() (uint64, error) GetLastSyncBlockID() uint64 SaveLastSyncBlockID(blockID uint64) error }
Storer is the interface to manipulate blockchain transaction.
type Tx ¶
type Tx struct { ID string `db:"id"` SenderAddress string `db:"sender_address"` SenderPubKey string `db:"sender_pubkey"` ReceiverAddress string `db:"receiver_address"` Category string `db:"category"` Symbol string `db:"symbol"` Network string `db:"network"` Value uint64 `db:"value"` LockedAmount uint64 `db:"locked_amount"` Nonce uint64 `db:"nonce"` Message string `db:"message"` Sign string `db:"sign"` Status string `db:"status"` BlockID uint64 `db:"block_id"` CreationDT time.Time `db:"created_date"` Type string `db:"type"` Data string `db:"data"` EthAddress string `db:"eth_address"` BtcAddress string `db:"btc_address"` LtcAddress string `db:"ltc_address"` XtzAddress string `db:"xtz_address"` BnbAddress string `db:"bnb_address"` }
Tx ...
func FromTxDetailResponse ¶
func FromTxDetailResponse(txDetail *protobuf.TxDetailResponse) *Tx
FromTxDetailResponse creates a Tx from TxDetailResponse
func (*Tx) ToTxDetailResponse ¶
func (tx *Tx) ToTxDetailResponse() *protobuf.TxDetailResponse
ToTxDetailResponse converts a Tx to TxDetailResponse.
Click to show internal directories.
Click to hide internal directories.