eth

package
v0.0.0-...-590ca12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExtCodeParts extended func hashes and log topics
	ExtCodeParts map[string][]byte
)

Functions

func BuildSwapoutTxInput

func BuildSwapoutTxInput(swapoutVal *big.Int, bindAddr string) ([]byte, error)

BuildSwapoutTxInput build swapout tx input

func InitExtCodeParts

func InitExtCodeParts()

InitExtCodeParts int extended code parts

func PackData

func PackData(args ...interface{}) []byte

PackData pack data

func PackDataWithFuncHash

func PackDataWithFuncHash(funcHash []byte, args ...interface{}) []byte

PackDataWithFuncHash pack data with func hash

Types

type Bridge

type Bridge struct {
	*tokens.CrossChainBridgeBase
	Signer types.Signer
}

Bridge eth bridge

func NewCrossChainBridge

func NewCrossChainBridge(isSrc bool) *Bridge

NewCrossChainBridge new bridge

func (*Bridge) BuildRawTransaction

func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error)

BuildRawTransaction build raw tx

func (*Bridge) BuildSwapoutTx

func (b *Bridge) BuildSwapoutTx(from, contract string, extraArgs *tokens.EthExtraArgs, swapoutVal *big.Int, bindAddr string) (*types.Transaction, error)

BuildSwapoutTx build swapout tx

func (*Bridge) CallContract

func (b *Bridge) CallContract(contract string, data hexutil.Bytes, blockNumber string) (string, error)

CallContract call eth_call

func (*Bridge) ChainID

func (b *Bridge) ChainID() (*big.Int, error)

ChainID call eth_chainId

func (*Bridge) DcrmSignTransaction

func (b *Bridge) DcrmSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signTx interface{}, txHash string, err error)

DcrmSignTransaction dcrm sign raw tx

func (*Bridge) GetBlockByHash

func (b *Bridge) GetBlockByHash(blockHash string) (*types.RPCBlock, error)

GetBlockByHash call eth_getBlockByHash

func (*Bridge) GetBlockByNumber

func (b *Bridge) GetBlockByNumber(number *big.Int) (*types.RPCBlock, error)

GetBlockByNumber call eth_getBlockByNumber

func (*Bridge) GetCode

func (b *Bridge) GetCode(contract string) ([]byte, error)

GetCode call eth_getCode

func (*Bridge) GetContractLogs

func (b *Bridge) GetContractLogs(contractAddress, logTopic string, blockHeight uint64) ([]*types.RPCLog, error)

GetContractLogs get contract logs

func (*Bridge) GetErc20Balance

func (b *Bridge) GetErc20Balance(contract, address string) (*big.Int, error)

GetErc20Balance get erc20 balacne of address

func (*Bridge) GetErc20Decimals

func (b *Bridge) GetErc20Decimals(contract string) (uint8, error)

GetErc20Decimals get erc20 decimals

func (*Bridge) GetLatestBlockNumber

func (b *Bridge) GetLatestBlockNumber() (uint64, error)

GetLatestBlockNumber call eth_blockNumber

func (*Bridge) GetLogs

func (b *Bridge) GetLogs(filterQuery *types.FilterQuery) ([]*types.RPCLog, error)

GetLogs call eth_getLogs

func (*Bridge) GetPendingTransactions

func (b *Bridge) GetPendingTransactions() ([]*types.RPCTransaction, error)

GetPendingTransactions call eth_pendingTransactions

func (*Bridge) GetPoolNonce

func (b *Bridge) GetPoolNonce(address string) (uint64, error)

GetPoolNonce call eth_getTransactionCount

func (*Bridge) GetTransaction

func (b *Bridge) GetTransaction(txHash string) (interface{}, error)

GetTransaction impl

func (*Bridge) GetTransactionByHash

func (b *Bridge) GetTransactionByHash(txHash string) (*types.RPCTransaction, error)

GetTransactionByHash call eth_getTransactionByHash

func (*Bridge) GetTransactionReceipt

func (b *Bridge) GetTransactionReceipt(txHash string) (*types.RPCTxReceipt, error)

GetTransactionReceipt call eth_getTransactionReceipt

func (*Bridge) GetTransactionStatus

func (b *Bridge) GetTransactionStatus(txHash string) *tokens.TxStatus

GetTransactionStatus impl

func (*Bridge) InitLatestBlockNumber

func (b *Bridge) InitLatestBlockNumber()

InitLatestBlockNumber init latest block number

func (*Bridge) IsValidAddress

func (b *Bridge) IsValidAddress(address string) bool

IsValidAddress check address

func (*Bridge) SendSignedTransaction

func (b *Bridge) SendSignedTransaction(tx *types.Transaction) error

SendSignedTransaction call eth_sendRawTransaction

func (*Bridge) SendTransaction

func (b *Bridge) SendTransaction(signedTx interface{}) (txHash string, err error)

SendTransaction send signed tx

func (*Bridge) SetTokenAndGateway

func (b *Bridge) SetTokenAndGateway(tokenCfg *tokens.TokenConfig, gatewayCfg *tokens.GatewayConfig)

SetTokenAndGateway set token and gateway config

func (*Bridge) StartChainTransactionScanJob

func (b *Bridge) StartChainTransactionScanJob()

StartChainTransactionScanJob scan job

func (*Bridge) StartPoolTransactionScanJob

func (b *Bridge) StartPoolTransactionScanJob()

StartPoolTransactionScanJob scan job

func (*Bridge) StartSwapHistoryScanJob

func (b *Bridge) StartSwapHistoryScanJob()

StartSwapHistoryScanJob scan job

func (*Bridge) SuggestPrice

func (b *Bridge) SuggestPrice() (*big.Int, error)

SuggestPrice call eth_gasPrice

func (*Bridge) VerifyChainID

func (b *Bridge) VerifyChainID()

VerifyChainID verify chain id

func (*Bridge) VerifyContractCode

func (b *Bridge) VerifyContractCode(contract string, codePartsSlice ...map[string][]byte) (err error)

VerifyContractCode verify contract code

func (*Bridge) VerifyErc20ContractAddress

func (b *Bridge) VerifyErc20ContractAddress(contract string) (err error)

VerifyErc20ContractAddress verify erc20 contract

func (*Bridge) VerifyMbtcContractAddress

func (b *Bridge) VerifyMbtcContractAddress(contract string) (err error)

VerifyMbtcContractAddress verify mbtc contract

func (*Bridge) VerifyMsgHash

func (b *Bridge) VerifyMsgHash(rawTx interface{}, msgHashes []string, extra interface{}) error

VerifyMsgHash verify msg hash

func (*Bridge) VerifyTokenCofig

func (b *Bridge) VerifyTokenCofig()

VerifyTokenCofig verify token config

func (*Bridge) VerifyTransaction

func (b *Bridge) VerifyTransaction(txHash string, allowUnstable bool) (*tokens.TxSwapInfo, error)

VerifyTransaction impl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL