Documentation
¶
Index ¶
- func BlockHeaderFromHeader(header *types.Header) rpcclient.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 CreateTableDB
- type DB
- type Deposits
- type DepositsDB
- type DepositsView
- type Internals
- type InternalsDB
- type InternalsView
- type TokenBalance
- type Tokens
- type TokensDB
- type TokensView
- type Transactions
- type TransactionsDB
- type TransactionsView
- type Withdraws
- type WithdrawsDB
- type WithdrawsView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockHeaderFromHeader ¶
func BlockHeaderFromHeader(header *types.Header) rpcclient.BlockHeader
Types ¶
type AddressesDB ¶
type AddressesDB interface {
AddressesView
StoreAddresses(string, []Addresses) error
}
func NewAddressesDB ¶
func NewAddressesDB(db *gorm.DB) AddressesDB
type AddressesView ¶
type AddressesView interface {
QueryAddressesByToAddress(string, *common.Address) (*Addresses, error)
QueryHotWalletInfo(string) (*Addresses, error)
QueryColdWalletInfo(string) (*Addresses, error)
GetAllAddresses(string) ([]*Addresses, error)
AddressExist(requestId string, address *common.Address) (bool, uint8)
}
type Balances ¶
type Balances struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
Address common.Address `json:"address" gorm:"serializer:bytes"`
TokenAddress common.Address `json:"token_address" gorm:"serializer:bytes"`
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, bool) error
}
func NewBalancesDB ¶
func NewBalancesDB(db *gorm.DB) BalancesDB
type BalancesView ¶
type BalancesView interface {
QueryWalletBalanceByTokenAndAddress(requestId string, address, tokenAddress common.Address) (*Balances, error)
UnCollectionList(requestId string, amount *big.Int) ([]Balances, error)
QueryHotWalletBalances(requestId string, amount *big.Int) ([]Balances, error)
QueryBalancesByToAddress(requestId string, address *common.Address) (*Balances, error)
}
type BlocksDB ¶
type BlocksDB interface {
BlocksView
StoreBlockss([]Blocks) error
}
func NewBlocksDB ¶
type BlocksView ¶
type BlocksView interface {
LatestBlocks() (*rpcclient.BlockHeader, error)
}
type BusinessDB ¶
type BusinessDB interface {
BusinessView
StoreBusiness(*Business) error
}
func NewBusinessDB ¶
func NewBusinessDB(db *gorm.DB) BusinessDB
type BusinessView ¶
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
Addresses AddressesDB
Balances BalancesDB
Deposits DepositsDB
Withdraws WithdrawsDB
Transactions TransactionsDB
Tokens TokensDB
Business BusinessDB
Internals InternalsDB
// contains filtered or unexported fields
}
func (*DB) ExecuteSQLMigration ¶
type Deposits ¶
type Deposits struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash common.Hash `gorm:"column:block_hash;serializer:bytes" db:"block_hash" json:"block_hash"`
BlockNumber *big.Int `gorm:"serializer:u256;column:block_number" db:"block_number" json:"BlockNumber" form:"block_number"`
Hash common.Hash `gorm:"column:hash;serializer:bytes" db:"hash" json:"hash"`
FromAddress common.Address `json:"from_address" gorm:"serializer:bytes;column:from_address"`
ToAddress common.Address `json:"to_address" gorm:"serializer:bytes;column:to_address"`
TokenAddress common.Address `json:"token_address" gorm:"serializer:bytes;column:token_address"`
TokenId string `json:"token_id" gorm:"column:token_id"`
TokenMeta string `json:"token_meta" gorm:"column:token_meta"`
Fee *big.Int `gorm:"serializer:u256;column:fee" db:"fee" json:"Fee" form:"fee"`
Amount *big.Int `gorm:"serializer:u256;column:amount" db:"amount" json:"Amount" form:"amount"`
Confirms uint8 `json:"confirms"` // 交易确认位
Status uint8 `json:"status"` // 0:充值确认中,1:充值钱包层已到账;2:充值已通知业务层;3:充值完成;
Timestamp uint64
}
type DepositsDB ¶
type DepositsDB interface {
DepositsView
StoreDeposits(string, []Deposits, uint64) error
UpdateDepositsNotifyStatus(requestId string, status uint8, depositList []Deposits) error
UpdateDepositsComfirms(requestId string, blockNumber uint64, confirms uint64) error
}
func NewDepositsDB ¶
func NewDepositsDB(db *gorm.DB) DepositsDB
type DepositsView ¶
type Internals ¶
type Internals struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash common.Hash `gorm:"column:block_hash;serializer:bytes" db:"block_hash" json:"block_hash"`
BlockNumber *big.Int `gorm:"serializer:u256;column:block_number" db:"block_number" json:"BlockNumber" form:"block_number"`
Hash common.Hash `gorm:"column:hash;serializer:bytes" db:"hash" json:"hash"`
FromAddress common.Address `json:"from_address" gorm:"serializer:bytes;column:from_address"`
ToAddress common.Address `json:"to_address" gorm:"serializer:bytes;column:to_address"`
TokenAddress common.Address `json:"token_address" gorm:"serializer:bytes;column:token_address"`
TokenId string `json:"token_id" gorm:"column:token_id"`
TokenMeta string `json:"token_meta" gorm:"column:token_meta"`
Fee *big.Int `gorm:"serializer:u256;column:fee" db:"fee" json:"Fee" form:"fee"`
Amount *big.Int `gorm:"serializer:u256;column:amount" db:"amount" json:"Amount" form:"amount"`
Status uint8 `json:"status"` // 0:交易未签名, 1:交易已签名, 2:交易已经发送到区块链网络;3:交易在钱包层已完成;4:已通知业务;5:成功
TxType string `json:"tx_type"`
TxSignHex string `json:"tx_sign_hex" gorm:"column:tx_sign_hex"`
Timestamp uint64
}
type InternalsDB ¶
type InternalsDB interface {
InternalsView
StoreInternal(string, *Internals) error
UpdateInternalTx(requestId string, transactionId string, signedTx string, fee *big.Int, status uint8) error
UpdateInternalstatus(requestId string, status uint8, InternalsList []Internals) error
}
func NewInternalsDB ¶
func NewInternalsDB(db *gorm.DB) InternalsDB
type InternalsView ¶
type TokenBalance ¶
type Tokens ¶
type Tokens struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
TokenAddress common.Address `gorm:"serializer:bytes" json:"token_address"`
Decimals uint8 `json:"uint"`
TokenName string `json:"tokens_name"`
CollectAmount *big.Int `gorm:"serializer:u256" json:"collect_amount"`
ColdAmount *big.Int `gorm:"serializer:u256" json:"cold_amount"`
Timestamp uint64 `json:"timestamp"`
}
type TokensDB ¶
type TokensDB interface {
TokensView
StoreTokens(string, []Tokens) error
}
func NewTokensDB ¶
type TokensView ¶
type Transactions ¶
type Transactions struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash common.Hash `gorm:"column:block_hash;serializer:bytes" db:"block_hash" json:"block_hash"`
BlockNumber *big.Int `gorm:"serializer:u256;column:block_number" db:"block_number" json:"BlockNumber" form:"block_number"`
Hash common.Hash `gorm:"column:hash;serializer:bytes" db:"hash" json:"hash"`
FromAddress common.Address `json:"from_address" gorm:"serializer:bytes"`
ToAddress common.Address `json:"to_address" gorm:"serializer:bytes"`
TokenAddress common.Address `json:"token_address" gorm:"serializer:bytes"`
TokenId string `json:"token_id" gorm:"column:token_id"`
TokenMeta string `json:"token_meta" gorm:"column:token_meta"`
Fee *big.Int `gorm:"serializer:u256;column:fee" db:"fee" json:"Fee" form:"fee"`
Amount *big.Int `gorm:"serializer:u256;column:amount" db:"amount" json:"Amount" form:"amount"`
Status uint8 `json:"status"` // 0:交易确认中,1:钱包交易已到账;2:交易已通知业务层;3:交易完成
TxType uint8 `json:"tx_type"` // 0:充值;1:提现;2:归集;3:热转冷;4:冷转热
TransactionIndex *big.Int `gorm:"serializer:u256;column:transaction_index" db:"transaction_index" json:"TransactionIndex" form:"transaction_index"`
Timestamp uint64
}
type TransactionsDB ¶
type TransactionsDB interface {
TransactionsView
StoreTransactions(string, []Transactions, uint64) error
UpdateTransactionsStatus(requestId string, blockNumber *big.Int) error
UpdateTransactionStatus(requestId string, txList []Transactions) error
}
func NewTransactionsDB ¶
func NewTransactionsDB(db *gorm.DB) TransactionsDB
type TransactionsView ¶
type TransactionsView interface {
QueryTransactionByHash(requestId string, hash common.Hash) (*Transactions, error)
}
type Withdraws ¶
type Withdraws struct {
GUID uuid.UUID `gorm:"primaryKey" json:"guid"`
BlockHash common.Hash `gorm:"column:block_hash;serializer:bytes" db:"block_hash" json:"block_hash"`
BlockNumber *big.Int `gorm:"serializer:u256;column:block_number" db:"block_number" json:"BlockNumber" form:"block_number"`
Hash common.Hash `gorm:"column:hash;serializer:bytes" db:"hash" json:"hash"`
FromAddress common.Address `json:"from_address" gorm:"serializer:bytes;column:from_address"`
ToAddress common.Address `json:"to_address" gorm:"serializer:bytes;column:to_address"`
TokenAddress common.Address `json:"token_address" gorm:"serializer:bytes;column:token_address"`
TokenId string `json:"token_id" gorm:"column:token_id"`
TokenMeta string `json:"token_meta" gorm:"column:token_meta"`
Fee *big.Int `gorm:"serializer:u256;column:fee" db:"fee" json:"Fee" form:"fee"`
Amount *big.Int `gorm:"serializer:u256;column:amount" db:"amount" json:"Amount" form:"amount"`
Status uint8 `json:"status"` // 0:提现未签名, 1:提现交易已签名, 2:提现已经发送到区块链网络;3:提现在钱包层已完成;4:提现已通知业务;5:提现成功
TxSignHex string `json:"tx_sign_hex" gorm:"column:tx_sign_hex"`
Timestamp uint64
}
type WithdrawsDB ¶
type WithdrawsDB interface {
WithdrawsView
StoreWithdraw(string, *Withdraws) error
UpdateWithdrawTx(requestId string, transactionId string, signedTx string, fee *big.Int, status uint8) error
UpdateWithdrawStatus(requestId string, status uint8, withdrawsList []Withdraws) error
}
func NewWithdrawsDB ¶
func NewWithdrawsDB(db *gorm.DB) WithdrawsDB
type WithdrawsView ¶
type WithdrawsView interface {
QueryWithdrawsByHash(requestId string, txId string) (*Withdraws, error)
UnSendWithdrawsList(requestId string) ([]Withdraws, error)
QueryNotifyWithdraws(string) ([]Withdraws, error)
SubmitWithdrawFromBusiness(requestId string, fromAddress common.Address, toAddress common.Address, TokenAddress common.Address, amount *big.Int) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.