Files
blockbook/bchain/basechain.go
Jiří Musil a4f1730364 Show raw tx hex in UI (#1162)
* Fix Network configuration parameter

* feat: allow for showing raw transaction hex for ETH transactions

* chore: remove comments from JS code to avoid parsing issues in tests

* temp: comment out failing tx template tests

* chore: trim text from copyable before writing it to clipboard

* chore: improve the design of Transaction hex

* chore: add wrap to element showing raw hex data

* fixup! chore: add wrap to element showing raw hex data

* chore: remove redundant style, make HTML prettier

* Revert "temp: comment out failing tx template tests"

This reverts commit f104ebbf5111583b46996d7527a26c08cd9e29b6.

* chore: put rawTx javascript functionality into main.js

* chore: modify the expected HTML for changed tx template

* feat: support the raw transaction hex also for BTC-like coins

* chore: add on-hover effect for active button - make the background white

* Minify javascript and styles

---------

Co-authored-by: Martin Boehm <martin.boehm@1mbsoftware.net>
2024-12-09 11:30:02 +01:00

88 lines
2.5 KiB
Go

package bchain
import (
"errors"
"math/big"
)
// BaseChain is base type for bchain.BlockChain
type BaseChain struct {
Parser BlockChainParser
Testnet bool
Network string
}
// TODO more bchain.BlockChain methods
// GetChainParser returns BlockChainParser
func (b *BaseChain) GetChainParser() BlockChainParser {
return b.Parser
}
// IsTestnet returns true if the blockchain is testnet
func (b *BaseChain) IsTestnet() bool {
return b.Testnet
}
// GetNetworkName returns network name
func (b *BaseChain) GetNetworkName() string {
return b.Network
}
// GetBlockRaw is not supported by default
func (b *BaseChain) GetBlockRaw(hash string) (string, error) {
return "", errors.New("GetBlockRaw: not supported")
}
// GetMempoolEntry is not supported by default
func (b *BaseChain) GetMempoolEntry(txid string) (*MempoolEntry, error) {
return nil, errors.New("GetMempoolEntry: not supported")
}
// EthereumTypeGetBalance is not supported
func (b *BaseChain) EthereumTypeGetBalance(addrDesc AddressDescriptor) (*big.Int, error) {
return nil, errors.New("not supported")
}
// EthereumTypeGetNonce is not supported
func (b *BaseChain) EthereumTypeGetNonce(addrDesc AddressDescriptor) (uint64, error) {
return 0, errors.New("not supported")
}
// EthereumTypeEstimateGas is not supported
func (b *BaseChain) EthereumTypeEstimateGas(params map[string]interface{}) (uint64, error) {
return 0, errors.New("not supported")
}
// GetContractInfo is not supported
func (b *BaseChain) GetContractInfo(contractDesc AddressDescriptor) (*ContractInfo, error) {
return nil, errors.New("not supported")
}
// EthereumTypeGetErc20ContractBalance is not supported
func (b *BaseChain) EthereumTypeGetErc20ContractBalance(addrDesc, contractDesc AddressDescriptor) (*big.Int, error) {
return nil, errors.New("not supported")
}
// GetContractInfo returns URI of non fungible or multi token defined by token id
func (p *BaseChain) GetTokenURI(contractDesc AddressDescriptor, tokenID *big.Int) (string, error) {
return "", errors.New("not supported")
}
func (b *BaseChain) EthereumTypeGetSupportedStakingPools() []string {
return nil
}
func (b *BaseChain) EthereumTypeGetStakingPoolsData(addrDesc AddressDescriptor) ([]StakingPoolData, error) {
return nil, errors.New("not supported")
}
// EthereumTypeRpcCall calls eth_call with given data and to address
func (b *BaseChain) EthereumTypeRpcCall(data, to, from string) (string, error) {
return "", errors.New("not supported")
}
func (b *BaseChain) EthereumTypeGetRawTransaction(txid string) (string, error) {
return "", errors.New("not supported")
}