Documentation ¶
Index ¶
- func BindContract(client *ethclient.Client, addr string, abiPath string) (*bind.BoundContract, error)
- func GetBTCBalance(addr string) (*big.Int, error)
- func GetBTCCurrentHeight() int64
- func GetBTCEvents(addr string, fromHeight *big.Int, toHeight *big.Int) []gobcy.TX
- func GetCFXEvents(cfx *sdk.Client, epoch *big.Int, erc777s []types.Address, ...) ([]types.Log, error)
- func GetCreate2Transactions(client *ethclient.Client, addr string, blockNumber *big.Int, abi ethabi.ABI) []string
- func GetETHBalance(client *ethclient.Client, addr string) (*big.Int, error)
- func GetETHEvents(client *ethclient.Client, blockNumber *big.Int, walletMap map[string]bool) []*types.Transaction
- func GetETHEventsByAPI(addr string, fromHeight *big.Int, toHeight *big.Int) []gobcy.TXRef
- func GetETHLatestBlock(client *ethclient.Client) *big.Int
- func GetUSDTBalance(client *ethclient.Client, addr string, usdt *bind.BoundContract, ...) (*big.Int, error)
- func GetUSDTEvents(client *ethclient.Client, addr string, fromBlock *big.Int, toBlock *big.Int, ...) []types.Log
- func MustGetBTCBalance(addr string) *big.Int
- func MustGetBurnedTx(ethFactory *bind.BoundContract, txHash string, opts *bind.CallOpts) bool
- func MustGetETHBalance(client *ethclient.Client, addr string) *big.Int
- func MustGetUSDTBalance(client *ethclient.Client, addr string, usdt *bind.BoundContract, ...) *big.Int
- func Start(cfxURL string, shuttleURL string, assets []common.Asset, cb *Config, ...)
- type BTCBalance
- type Config
- type DepositInspector
- type LogTransfer
- type TransactionRef
- type WithdrawInspector
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindContract ¶
func BindContract(client *ethclient.Client, addr string, abiPath string) (*bind.BoundContract, error)
BindContract binds a generic wrapper to an already deployed contract.
func GetBTCBalance ¶
GetBTCBalance returns the balance of the address with error code.
func GetBTCCurrentHeight ¶
func GetBTCCurrentHeight() int64
GetBTCCurrentHeight Get BTC current height
func GetBTCEvents ¶
GetBTCEvents Get BTC events
func GetCFXEvents ¶
func GetCFXEvents(cfx *sdk.Client, epoch *big.Int, erc777s []types.Address, topics [][]types.Hash) ([]types.Log, error)
GetCFXEvents ..
func GetCreate2Transactions ¶
func GetCreate2Transactions(client *ethclient.Client, addr string, blockNumber *big.Int, abi ethabi.ABI) []string
GetCreate2Transactions Get create2-generated addresses from Blockcypher
func GetETHBalance ¶
GetETHBalance returns the balance of the address with error code.
func GetETHEvents ¶
func GetETHEvents(client *ethclient.Client, blockNumber *big.Int, walletMap map[string]bool) []*types.Transaction
GetETHEvents Get ETH events
func GetETHEventsByAPI ¶
GetETHEventsByAPI Get ETH events by Blockcypher
func GetETHLatestBlock ¶
GetETHLatestBlock Get the latest ETH block
func GetUSDTBalance ¶
func GetUSDTBalance(client *ethclient.Client, addr string, usdt *bind.BoundContract, opts *bind.CallOpts) (*big.Int, error)
GetUSDTBalance returns the balance of the address with error code.
func GetUSDTEvents ¶
func GetUSDTEvents(client *ethclient.Client, addr string, fromBlock *big.Int, toBlock *big.Int, topics [][]common.Hash) []types.Log
GetUSDTEvents Get USDT events
func MustGetBTCBalance ¶
MustGetBTCBalance the balance of the address.
func MustGetBurnedTx ¶
MustGetBurnedTx ..
func MustGetETHBalance ¶
MustGetETHBalance returns the balance of the address.
Types ¶
type BTCBalance ¶
type BTCBalance struct { Address string `json:"address"` TotalReceived int64 `json:"total_received"` TotalSent int64 `json:"total_sent"` Balance int64 `json:"balance"` UnconfirmedBalance int64 `json:"unconfirmed_balance"` FinalBalance int64 `json:"final_balance"` NTx int64 `json:"n_tx"` UnconfirmedNTx int64 `json:"unconfirmed_n_tx"` FinalNTx int64 `json:"final_n_tx"` TxRefs []TransactionRef `json:"txrefs"` }
BTCBalance balance of BTC address
type Config ¶
type Config struct { TimeoutInMinute int64 TimeoutInSecond int64 ETHDial string LevelDBPath string Create2Sync bool BTCInitialHeight int64 ETHInitialBlock int64 ETHDelayBlock int64 CFXInitialBlock string BTCMinus int64 }
Config configuration for shuttleflow auditor
type DepositInspector ¶
type DepositInspector struct { Client *conflux.Client Timeout time.Duration BTCWallet string Factory string USDT string Custodian *common.Contract Cb *Config }
DepositInspector auditor
type LogTransfer ¶
LogTransfer ..
type TransactionRef ¶
type TransactionRef struct { TxHash string `json:"tx_hash"` BlockHeight int64 `json:"block_height"` TxInputN int64 `json:"tx_input_n"` TxOutputN int64 `json:"tx_output_n"` Value int64 `json:"value"` RefBalance int64 `json:"ref_balance"` Spent bool `json:"spent"` Confirmations int64 `json:"confirmations"` Confirmed string `json:"confirmed"` DoubleSpend bool `json:"double_spend"` }
TransactionRef transaction ref