Documentation
¶
Index ¶
- func BlockHeaderFromHeader(header *types.Header) syncclient.BlockHeader
- func ReorgBlockHeaderFromHeader(header *types.Header) syncclient.BlockHeader
- type Addresses
- type AddressesDB
- type AddressesView
- type Balances
- type BalancesDB
- type BalancesView
- type Blocks
- type BlocksDB
- type BlocksView
- type Business
- type BusinessDB
- type BusinessView
- type ChildTxs
- type ChildTxsDB
- type ChildTxsView
- type CreateTableDB
- type DB
- type Deposits
- type DepositsDB
- type DepositsView
- type Internals
- type InternalsDB
- type InternalsView
- type ReorgBlocks
- type ReorgBlocksDB
- type ReorgBlocksView
- type TokenBalance
- type Transactions
- type TransactionsDB
- type TransactionsView
- type TxStatus
- type Vins
- type VinsDB
- type VinsView
- type Vouts
- type VoutsDB
- type VoutsView
- type Withdraws
- type WithdrawsDB
- type WithdrawsView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockHeaderFromHeader ¶
func BlockHeaderFromHeader(header *types.Header) syncclient.BlockHeader
func ReorgBlockHeaderFromHeader ¶
func ReorgBlockHeaderFromHeader(header *types.Header) syncclient.BlockHeader
Types ¶
type AddressesDB ¶
type AddressesDB interface {
AddressesView
StoreAddresses(string, []Addresses) error
}
func NewAddressesDB ¶
func NewAddressesDB(db *gorm.DB) AddressesDB
type AddressesView ¶
type Balances ¶
type Balances struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
Address string `json:"address"`
AddressType uint8 `json:"address_type"` //0:用户地址;1:热钱包地址(归集地址);2:冷钱包地址
Balance *big.Int `gorm:"serializer:u256;column:balance" db:"balance" json:"Balance" form:"balance"`
LockBalance *big.Int `gorm:"serializer:u256;column:lock_balance" db:"lock_balance" json:"LockBalance" form:"lock_balance"`
Timestamp uint64
}
type BalancesDB ¶
type BalancesDB interface {
BalancesView
UpdateOrCreate(string, []TokenBalance) error
StoreBalances(string, []Balances) error
UpdateBalances(string, []Balances) error
}
func NewBalancesDB ¶
func NewBalancesDB(db *gorm.DB) BalancesDB
type BalancesView ¶
type BlocksDB ¶
type BlocksDB interface {
BlocksView
StoreBlockss([]Blocks) error
}
func NewBlocksDB ¶
type BlocksView ¶
type BlocksView interface {
LatestBlocks() (*syncclient.BlockHeader, error)
}
type BusinessDB ¶
type BusinessDB interface {
BusinessView
StoreBusiness(*Business) error
}
func NewBusinessDB ¶
func NewBusinessDB(db *gorm.DB) BusinessDB
type BusinessView ¶
type ChildTxs ¶
type ChildTxs struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
Hash string `json:"hash"`
TxId string `json:"tx_id"`
TxIndex *big.Int `gorm:"serializer:u256" json:"tx_index"`
TxType string `json:"tx_type"`
FromAddress string `json:"from_address"`
ToAddress string `json:"to_address"`
Amount string `json:"amount"`
Timestamp uint64 `json:"timestamp"`
}
type ChildTxsDB ¶
type ChildTxsDB interface {
ChildTxsView
StoreChildTxs(string, []ChildTxs) error
}
func NewChildTxsDB ¶
func NewChildTxsDB(db *gorm.DB) ChildTxsDB
type ChildTxsView ¶
type CreateTableDB ¶
type CreateTableDB interface {
CreateTable(tableName, realTableName string)
}
func NewCreateTableDB ¶
func NewCreateTableDB(db *gorm.DB) CreateTableDB
type DB ¶
type DB struct {
CreateTable CreateTableDB
Blocks BlocksDB
ReorgBlocks ReorgBlocksDB
Addresses AddressesDB
Balances BalancesDB
Business BusinessDB
Deposits DepositsDB
Withdraws WithdrawsDB
Internals InternalsDB
Transactions TransactionsDB
Vins VinsDB
Vouts VoutsDB
ChildTxs ChildTxsDB
// contains filtered or unexported fields
}
func (*DB) ExecuteSQLMigration ¶
type Deposits ¶
type Deposits struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash string
BlockNumber *big.Int `gorm:"serializer:u256"`
Hash string `json:"hash"`
Fee *big.Int `gorm:"serializer:u256"`
LockTime *big.Int `gorm:"serializer:u256"`
Version string `json:"version"`
Confirms uint8 `json:"confirms"`
Status TxStatus `json:"status"`
Timestamp uint64 `json:"timestamp"`
}
type DepositsDB ¶
type DepositsDB interface {
DepositsView
StoreDeposits(string, []Deposits) error
UpdateDepositsComfirms(requestId string, blockNumber uint64, confirms uint64) error
UpdateDepositsNotifyStatus(requestId string, status uint8, depositList []Deposits) error
}
func NewDepositsDB ¶
func NewDepositsDB(db *gorm.DB) DepositsDB
type DepositsView ¶
type Internals ¶
type Internals struct {
Guid uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash string `json:"block_hash"`
BlockNumber *big.Int `gorm:"serializer:u256;check:block_number > 0" json:"block_number"`
Hash string `json:"hash"`
Fee *big.Int `gorm:"serializer:u256" json:"fee"`
LockTime *big.Int `gorm:"serializer:u256" json:"lock_time"`
Version string `json:"version"`
TxType string `json:"tx_type"`
TxSignHex string `json:"tx_sign_hex"`
Status TxStatus `json:"status"`
Timestamp uint64 `json:"timestamp"`
}
type InternalsDB ¶
type InternalsDB interface {
InternalsView
StoreInternal(string, *Internals) error
UpdateInternalTx(requestId string, transactionId string, signedTx string, status TxStatus) error
UpdateInternalStatus(requestId string, status TxStatus, internalsList []Internals) error
}
func NewInternalsDB ¶
func NewInternalsDB(db *gorm.DB) InternalsDB
type InternalsView ¶
type ReorgBlocks ¶
type ReorgBlocksDB ¶
type ReorgBlocksDB interface {
ReorgBlocksView
StoreReorgBlocks([]ReorgBlocks) error
}
func NewReorgBlocksDB ¶
func NewReorgBlocksDB(db *gorm.DB) ReorgBlocksDB
type ReorgBlocksView ¶
type ReorgBlocksView interface {
LatestReorgBlocks() (*syncclient.BlockHeader, error)
}
type TokenBalance ¶
type Transactions ¶
type Transactions struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash string
BlockNumber *big.Int `gorm:"serializer:u256"`
Hash string `json:"hash"`
Fee *big.Int `gorm:"serializer:u256"`
LockTime *big.Int `gorm:"serializer:u256"`
TxType string `json:"tx_type"`
Version string `json:"version"`
Status TxStatus `json:"status"`
Timestamp uint64 `json:"timestamp"`
}
type TransactionsDB ¶
type TransactionsDB interface {
TransactionsView
StoreTransactions(string, []Transactions) error
}
func NewTransactionsDB ¶
func NewTransactionsDB(db *gorm.DB) TransactionsDB
type TransactionsView ¶
type TransactionsView interface {
}
type TxStatus ¶
type TxStatus string
const ( //====================父交易的状态========================== TxStatusWaitSign TxStatus = "wait_sign" // 交易等待签名 TxStatusUnSent TxStatus = "unsend" // 交易未发送 TxStatusSent TxStatus = "sent" // 交易已发送 TxStatusSentNotify TxStatus = "sent_notify_success" // 交易以广播通知 TxStatusSentNotifyFail TxStatus = "sent_notify_fail" // 交易以广播失败通知 TxStatusWithdrawed TxStatus = "withdrawed" // 交易已发送 TxStatusWithdrawedNotify TxStatus = "withdrawed_notify_success" TxStatusWithdrawedNotifyFail TxStatus = "withdrawed_notify_fail" TxStatusUnSafe TxStatus = "unsafe" // 链上扫到交易 TxStatusSafe TxStatus = "safe" // 交易过了安全确认位 TxStatusFinalized TxStatus = "finalized" // 交易已完成,可以提现 TxStatusUnSafeNotify TxStatus = "unsafe_notify_success" // 链上扫到交易已通知 TxStatusSafeNotify TxStatus = "safe_notify_success" // 交易过了安全确认位已通知 TxStatusFinalizedNotify TxStatus = "finalized_notify_success" // 交易完成已通知 TxStatusUnSafeNotifyFail TxStatus = "unsafe_notify_fail" // 链上扫到交易通知失败 TxStatusSafeNotifyFail TxStatus = "safe_notify_fail" // 交易过了安全确认位通知失败 TxStatusFinalizedNotifyFail TxStatus = "finalized_notify_fail" // 交易完成通知失败 TxStatusSuccess TxStatus = "done_success" TxStatusFail TxStatus = "done_fail" TxStatusFailNotify TxStatus = "done_fail_notify_success" TxStatusFailNotifyFail TxStatus = "done_fail_notify_fail" TxStatusFallback TxStatus = "fallback" // 交易回滚状态 TxStatusFallbackNotify TxStatus = "fallback_notify_success" // 交易回滚通知成功 TxStatusFallbackNotifyFail TxStatus = "fallback_notify_fail" // 交易回滚通知失败 TxStatusFallbackDone TxStatus = "done_fallback" // 交易回滚状态 TxStatusInternalCallBack TxStatus = "send_to_business_for_sign" )
提现是没有确认位的
type Vins ¶
type Vins struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
Address string `json:"address"`
TxId string `json:"tx_id"`
Vout uint8 `json:"vout"`
Script string `json:"script"`
Witness string `json:"witness"`
Amount *big.Int `gorm:"serializer:u256" json:"amount"`
SpendTxHash string `json:"spend_tx_hash"`
SpendBlockHeight *big.Int `gorm:"serializer:u256" json:"spend_block_height"`
IsSpend bool `json:"is_spend"`
Timestamp uint64 `json:"timestamp"`
}
type VinsDB ¶
type VoutsDB ¶
func NewVoutsDB ¶
type Withdraws ¶
type Withdraws struct {
Guid uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash string `json:"block_hash"`
BlockNumber *big.Int `gorm:"serializer:u256;check:block_number > 0" json:"block_number"`
Hash string `json:"hash"`
Fee *big.Int `gorm:"serializer:u256" json:"fee"`
LockTime *big.Int `gorm:"serializer:u256" json:"lock_time"`
Version string `json:"version"`
TxSignHex string `json:"tx_sign_hex"`
Status TxStatus `json:"status"`
Timestamp uint64 `json:"timestamp"`
}
type WithdrawsDB ¶
type WithdrawsDB interface {
WithdrawsView
StoreWithdraws(string, *Withdraws) error
UpdateWithdrawStatus(requestId string, status TxStatus, withdrawsList []Withdraws) error
UpdateWithdrawByGuuid(requestId string, transactionId string, txSignedHex string) error
}
func NewWithdrawsDB ¶
func NewWithdrawsDB(db *gorm.DB) WithdrawsDB
Source Files
¶
Click to show internal directories.
Click to hide internal directories.