Versions in this module Expand all Collapse all v0 v0.4.2 May 4, 2024 v0.4.1 May 1, 2024 Changes in this version + const ErrorTy + const EtherAmountDecimalPoint + const EthereumTypeAddressDescriptorLen + const EthereumTypeTxidLen + const TxStatusFailure + const TxStatusOK + const TxStatusPending + const TxStatusUnknown + var ProcessInternalTransactions bool + func EIP55Address(addrDesc bchain.AddressDescriptor) string + func EIP55AddressFromAddress(address string) string + func GetHeightFromTx(tx *bchain.Tx) (uint32, error) + func GetSignatureFromData(data string) uint32 + func GetStringFromMap(p string, params map[string]interface{}) (string, bool) + func NewEthereumRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) + func PackInternalTransactionError(e string) string + func ParseErrorFromOutput(output string) string + func ParseInputData(signatures *[]bchain.FourByteSignature, data string) *bchain.EthereumParsedInputData + func UnpackInternalTransactionError(data []byte) string + type Configuration struct + AddressAliases bool + BlockAddressesToKeep int + CoinName string + CoinShortcut string + ConsensusNodeVersionURL string + MempoolTxTimeoutHours int + ProcessInternalTransactions bool + ProcessZeroInternalTransactions bool + QueryBackendOnMempoolResync bool + RPCTimeout int + RPCURL string + type EthereumClient struct + func (c *EthereumClient) BalanceAt(ctx context.Context, addrDesc bchain.AddressDescriptor, blockNumber *big.Int) (*big.Int, error) + func (c *EthereumClient) EstimateGas(ctx context.Context, msg interface{}) (uint64, error) + func (c *EthereumClient) HeaderByNumber(ctx context.Context, number *big.Int) (bchain.EVMHeader, error) + func (c *EthereumClient) NonceAt(ctx context.Context, addrDesc bchain.AddressDescriptor, blockNumber *big.Int) (uint64, error) + type EthereumClientSubscription struct + type EthereumHash struct + type EthereumHeader struct + func (h *EthereumHeader) Difficulty() *big.Int + func (h *EthereumHeader) Hash() string + func (h *EthereumHeader) Number() *big.Int + type EthereumNewBlock struct + func (s *EthereumNewBlock) Channel() interface{} + func (s *EthereumNewBlock) Close() + func (s *EthereumNewBlock) Read() (bchain.EVMHeader, bool) + type EthereumNewTx struct + func (s *EthereumNewTx) Channel() interface{} + func (s *EthereumNewTx) Close() + func (s *EthereumNewTx) Read() (bchain.EVMHash, bool) + type EthereumParser struct + func NewEthereumParser(b int, addressAliases bool) *EthereumParser + func (p *EthereumParser) EthereumTypeGetTokenTransfersFromTx(tx *bchain.Tx) (bchain.TokenTransfers, error) + func (p *EthereumParser) FormatAddressAlias(address string, name string) string + func (p *EthereumParser) GetAddrDescFromAddress(address string) (bchain.AddressDescriptor, error) + func (p *EthereumParser) GetAddrDescFromVout(output *bchain.Vout) (bchain.AddressDescriptor, error) + func (p *EthereumParser) GetAddressesFromAddrDesc(addrDesc bchain.AddressDescriptor) ([]string, bool, error) + func (p *EthereumParser) GetChainType() bchain.ChainType + func (p *EthereumParser) GetScriptFromAddrDesc(addrDesc bchain.AddressDescriptor) ([]byte, error) + func (p *EthereumParser) PackBlockHash(hash string) ([]byte, error) + func (p *EthereumParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error) + func (p *EthereumParser) PackTxid(txid string) ([]byte, error) + func (p *EthereumParser) PackedTxidLen() int + func (p *EthereumParser) UnpackBlockHash(buf []byte) (string, error) + func (p *EthereumParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) + func (p *EthereumParser) UnpackTxid(buf []byte) (string, error) + type EthereumRPC struct + ChainConfig *Configuration + Client bchain.EVMClient + MainNetChainID Network + Mempool *bchain.MempoolEthereumType + NewBlock bchain.EVMNewBlockSubscriber + NewTx bchain.EVMNewTxSubscriber + OpenRPC func(string) (bchain.EVMRPCClient, bchain.EVMClient, error) + Parser *EthereumParser + PushHandler func(bchain.NotificationType) + RPC bchain.EVMRPCClient + Timeout time.Duration + func (b *EthereumRPC) CreateMempool(chain bchain.BlockChain) (bchain.Mempool, error) + func (b *EthereumRPC) EstimateFee(blocks int) (big.Int, error) + func (b *EthereumRPC) EstimateSmartFee(blocks int, conservative bool) (big.Int, error) + func (b *EthereumRPC) EthereumTypeEstimateGas(params map[string]interface{}) (uint64, error) + func (b *EthereumRPC) EthereumTypeGetBalance(addrDesc bchain.AddressDescriptor) (*big.Int, error) + func (b *EthereumRPC) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc bchain.AddressDescriptor) (*big.Int, error) + func (b *EthereumRPC) EthereumTypeGetNonce(addrDesc bchain.AddressDescriptor) (uint64, error) + func (b *EthereumRPC) GetBestBlockHash() (string, error) + func (b *EthereumRPC) GetBestBlockHeight() (uint32, error) + func (b *EthereumRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) + func (b *EthereumRPC) GetBlockHash(height uint32) (string, error) + func (b *EthereumRPC) GetBlockHeader(hash string) (*bchain.BlockHeader, error) + func (b *EthereumRPC) GetBlockInfo(hash string) (*bchain.BlockInfo, error) + func (b *EthereumRPC) GetChainInfo() (*bchain.ChainInfo, error) + func (b *EthereumRPC) GetChainParser() bchain.BlockChainParser + func (b *EthereumRPC) GetCoinName() string + func (b *EthereumRPC) GetContractInfo(contractDesc bchain.AddressDescriptor) (*bchain.ContractInfo, error) + func (b *EthereumRPC) GetMempoolTransactions() ([]string, error) + func (b *EthereumRPC) GetSubversion() string + func (b *EthereumRPC) GetTokenURI(contractDesc bchain.AddressDescriptor, tokenID *big.Int) (string, error) + func (b *EthereumRPC) GetTransaction(txid string) (*bchain.Tx, error) + func (b *EthereumRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error) + func (b *EthereumRPC) GetTransactionSpecific(tx *bchain.Tx) (json.RawMessage, error) + func (b *EthereumRPC) Initialize() error + func (b *EthereumRPC) InitializeMempool(addrDescForOutpoint bchain.AddrDescForOutpointFunc, ...) error + func (b *EthereumRPC) SendRawTransaction(hex string) (string, error) + func (b *EthereumRPC) Shutdown(ctx context.Context) error + func (b *EthereumRPC) UpdateBestHeader(h bchain.EVMHeader) + type EthereumRPCClient struct + func (c *EthereumRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (bchain.EVMClientSubscription, error) + type EthereumTxData struct + Data string + GasLimit *big.Int + GasPrice *big.Int + GasUsed *big.Int + Nonce uint64 + Status TxStatus + func GetEthereumTxData(tx *bchain.Tx) *EthereumTxData + func GetEthereumTxDataFromSpecificData(coinSpecificData interface{}) *EthereumTxData + type Network uint32 + const MainNet + const TestNet + const TestNetGoerli + const TestNetSepolia + type ProtoCompleteTransaction struct + BlockNumber uint32 + BlockTime uint64 + Receipt *ProtoCompleteTransaction_ReceiptType + Tx *ProtoCompleteTransaction_TxType + func (*ProtoCompleteTransaction) Descriptor() ([]byte, []int) + func (*ProtoCompleteTransaction) ProtoMessage() + func (m *ProtoCompleteTransaction) GetBlockNumber() uint32 + func (m *ProtoCompleteTransaction) GetBlockTime() uint64 + func (m *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType + func (m *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType + func (m *ProtoCompleteTransaction) Reset() + func (m *ProtoCompleteTransaction) String() string + type ProtoCompleteTransaction_ReceiptType struct + GasUsed []byte + Log []*ProtoCompleteTransaction_ReceiptType_LogType + Status []byte + func (*ProtoCompleteTransaction_ReceiptType) Descriptor() ([]byte, []int) + func (*ProtoCompleteTransaction_ReceiptType) ProtoMessage() + func (m *ProtoCompleteTransaction_ReceiptType) GetGasUsed() []byte + func (m *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType + func (m *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte + func (m *ProtoCompleteTransaction_ReceiptType) Reset() + func (m *ProtoCompleteTransaction_ReceiptType) String() string + type ProtoCompleteTransaction_ReceiptType_LogType struct + Address []byte + Data []byte + Topics [][]byte + func (*ProtoCompleteTransaction_ReceiptType_LogType) Descriptor() ([]byte, []int) + func (*ProtoCompleteTransaction_ReceiptType_LogType) ProtoMessage() + func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetAddress() []byte + func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte + func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte + func (m *ProtoCompleteTransaction_ReceiptType_LogType) Reset() + func (m *ProtoCompleteTransaction_ReceiptType_LogType) String() string + type ProtoCompleteTransaction_TxType struct + AccountNonce uint64 + From []byte + GasLimit uint64 + GasPrice []byte + Hash []byte + Payload []byte + To []byte + TransactionIndex uint32 + Value []byte + func (*ProtoCompleteTransaction_TxType) Descriptor() ([]byte, []int) + func (*ProtoCompleteTransaction_TxType) ProtoMessage() + func (m *ProtoCompleteTransaction_TxType) GetAccountNonce() uint64 + func (m *ProtoCompleteTransaction_TxType) GetFrom() []byte + func (m *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 + func (m *ProtoCompleteTransaction_TxType) GetGasPrice() []byte + func (m *ProtoCompleteTransaction_TxType) GetHash() []byte + func (m *ProtoCompleteTransaction_TxType) GetPayload() []byte + func (m *ProtoCompleteTransaction_TxType) GetTo() []byte + func (m *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 + func (m *ProtoCompleteTransaction_TxType) GetValue() []byte + func (m *ProtoCompleteTransaction_TxType) Reset() + func (m *ProtoCompleteTransaction_TxType) String() string + type TxStatus int