github.com/cerberus-wallet/blockbook@v0.3.2/bchain/basechain.go (about)

     1  package bchain
     2  
     3  import (
     4  	"errors"
     5  	"math/big"
     6  )
     7  
     8  // BaseChain is base type for bchain.BlockChain
     9  type BaseChain struct {
    10  	Parser  BlockChainParser
    11  	Testnet bool
    12  	Network string
    13  }
    14  
    15  // TODO more bchain.BlockChain methods
    16  
    17  // GetChainParser returns BlockChainParser
    18  func (b *BaseChain) GetChainParser() BlockChainParser {
    19  	return b.Parser
    20  }
    21  
    22  // IsTestnet returns true if the blockchain is testnet
    23  func (b *BaseChain) IsTestnet() bool {
    24  	return b.Testnet
    25  }
    26  
    27  // GetNetworkName returns network name
    28  func (b *BaseChain) GetNetworkName() string {
    29  	return b.Network
    30  }
    31  
    32  // GetMempoolEntry is not supported by default
    33  func (b *BaseChain) GetMempoolEntry(txid string) (*MempoolEntry, error) {
    34  	return nil, errors.New("GetMempoolEntry: not supported")
    35  }
    36  
    37  // EthereumTypeGetBalance is not supported
    38  func (b *BaseChain) EthereumTypeGetBalance(addrDesc AddressDescriptor) (*big.Int, error) {
    39  	return nil, errors.New("Not supported")
    40  }
    41  
    42  // EthereumTypeGetNonce is not supported
    43  func (b *BaseChain) EthereumTypeGetNonce(addrDesc AddressDescriptor) (uint64, error) {
    44  	return 0, errors.New("Not supported")
    45  }
    46  
    47  // EthereumTypeEstimateGas is not supported
    48  func (b *BaseChain) EthereumTypeEstimateGas(params map[string]interface{}) (uint64, error) {
    49  	return 0, errors.New("Not supported")
    50  }
    51  
    52  // EthereumTypeGetErc20ContractInfo is not supported
    53  func (b *BaseChain) EthereumTypeGetErc20ContractInfo(contractDesc AddressDescriptor) (*Erc20Contract, error) {
    54  	return nil, errors.New("Not supported")
    55  }
    56  
    57  // EthereumTypeGetErc20ContractBalance is not supported
    58  func (b *BaseChain) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc AddressDescriptor) (*big.Int, error) {
    59  	return nil, errors.New("Not supported")
    60  }