diff --git a/api/types.go b/api/types.go
index c283989354..547bbafd4c 100644
--- a/api/types.go
+++ b/api/types.go
@@ -158,21 +158,23 @@ type MultiTokenValue struct {
// Token contains info about tokens held by an address
type Token struct {
- Type bchain.TokenTypeName `json:"type" ts_type:"'XPUBAddress' | 'ERC20' | 'ERC721' | 'ERC1155'"`
- Name string `json:"name"`
- Path string `json:"path,omitempty"`
- Contract string `json:"contract,omitempty"`
- Transfers int `json:"transfers"`
- Symbol string `json:"symbol,omitempty"`
- Decimals int `json:"decimals,omitempty"`
- BalanceSat *Amount `json:"balance,omitempty"`
- BaseValue float64 `json:"baseValue,omitempty"` // value in the base currency (ETH for Ethereum)
- SecondaryValue float64 `json:"secondaryValue,omitempty"` // value in secondary (fiat) currency, if specified
- Ids []Amount `json:"ids,omitempty"` // multiple ERC721 tokens
- MultiTokenValues []MultiTokenValue `json:"multiTokenValues,omitempty"` // multiple ERC1155 tokens
- TotalReceivedSat *Amount `json:"totalReceived,omitempty"`
- TotalSentSat *Amount `json:"totalSent,omitempty"`
- ContractIndex string `json:"-"`
+ // Deprecated: Use Standard instead.
+ Type bchain.TokenStandardName `json:"type" ts_type:"'XPUBAddress' | 'ERC20' | 'ERC721' | 'ERC1155'"`
+ Standard bchain.TokenStandardName `json:"standard" ts_type:"'XPUBAddress' | 'ERC20' | 'ERC721' | 'ERC1155'"`
+ Name string `json:"name"`
+ Path string `json:"path,omitempty"`
+ Contract string `json:"contract,omitempty"`
+ Transfers int `json:"transfers"`
+ Symbol string `json:"symbol,omitempty"`
+ Decimals int `json:"decimals,omitempty"`
+ BalanceSat *Amount `json:"balance,omitempty"`
+ BaseValue float64 `json:"baseValue,omitempty"` // value in the base currency (ETH for Ethereum)
+ SecondaryValue float64 `json:"secondaryValue,omitempty"` // value in secondary (fiat) currency, if specified
+ Ids []Amount `json:"ids,omitempty"` // multiple ERC721 tokens
+ MultiTokenValues []MultiTokenValue `json:"multiTokenValues,omitempty"` // multiple ERC1155 tokens
+ TotalReceivedSat *Amount `json:"totalReceived,omitempty"`
+ TotalSentSat *Amount `json:"totalSent,omitempty"`
+ ContractIndex string `json:"-"`
}
// Tokens is array of Token
@@ -204,15 +206,17 @@ func (a Tokens) Less(i, j int) bool {
// TokenTransfer contains info about a token transfer done in a transaction
type TokenTransfer struct {
- Type bchain.TokenTypeName `json:"type"`
- From string `json:"from"`
- To string `json:"to"`
- Contract string `json:"contract"`
- Name string `json:"name,omitempty"`
- Symbol string `json:"symbol,omitempty"`
- Decimals int `json:"decimals,omitempty"`
- Value *Amount `json:"value,omitempty"`
- MultiTokenValues []MultiTokenValue `json:"multiTokenValues,omitempty"`
+ // Deprecated: Use Standard instead.
+ Type bchain.TokenStandardName `json:"type"`
+ Standard bchain.TokenStandardName `json:"standard"`
+ From string `json:"from"`
+ To string `json:"to"`
+ Contract string `json:"contract"`
+ Name string `json:"name,omitempty"`
+ Symbol string `json:"symbol,omitempty"`
+ Decimals int `json:"decimals,omitempty"`
+ Value *Amount `json:"value,omitempty"`
+ MultiTokenValues []MultiTokenValue `json:"multiTokenValues,omitempty"`
}
type EthereumInternalTransfer struct {
@@ -357,9 +361,10 @@ type Address struct {
TotalBaseValue float64 `json:"totalBaseValue,omitempty"` // value including tokens in base currency
TotalSecondaryValue float64 `json:"totalSecondaryValue,omitempty"` // value including tokens in secondary currency
ContractInfo *bchain.ContractInfo `json:"contractInfo,omitempty"`
- Erc20Contract *bchain.ContractInfo `json:"erc20Contract,omitempty"` // deprecated
- AddressAliases AddressAliasesMap `json:"addressAliases,omitempty"`
- StakingPools []StakingPool `json:"stakingPools,omitempty"`
+ // Deprecated: replaced by ContractInfo
+ Erc20Contract *bchain.ContractInfo `json:"erc20Contract,omitempty"`
+ AddressAliases AddressAliasesMap `json:"addressAliases,omitempty"`
+ StakingPools []StakingPool `json:"stakingPools,omitempty"`
// helpers for explorer
Filter string `json:"-"`
XPubAddresses map[string]struct{} `json:"-"`
diff --git a/api/worker.go b/api/worker.go
index d478f85c23..73628d5766 100644
--- a/api/worker.go
+++ b/api/worker.go
@@ -176,10 +176,10 @@ func (w *Worker) getAddressAliases(addresses map[string]struct{}) AddressAliases
if err != nil || addrDesc == nil {
continue
}
- ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType)
+ ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenStandard)
if err == nil && ci != nil {
- if ci.Type == bchain.UnhandledTokenType {
- ci, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenType)
+ if ci.Standard == bchain.UnhandledTokenStandard {
+ ci, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenStandard)
}
if err == nil && ci != nil && ci.Name != "" {
aliases[a] = AddressAlias{Type: "Contract", Alias: ci.Name}
@@ -622,32 +622,32 @@ func (w *Worker) GetTransactionFromMempoolTx(mempoolTx *bchain.MempoolTx) (*Tx,
return r, nil
}
-func (w *Worker) GetContractInfo(contract string, typeFromContext bchain.TokenTypeName) (*bchain.ContractInfo, bool, error) {
+func (w *Worker) GetContractInfo(contract string, standardFromContext bchain.TokenStandardName) (*bchain.ContractInfo, bool, error) {
cd, err := w.chainParser.GetAddrDescFromAddress(contract)
if err != nil {
return nil, false, err
}
- return w.getContractDescriptorInfo(cd, typeFromContext)
+ return w.getContractDescriptorInfo(cd, standardFromContext)
}
-func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFromContext bchain.TokenTypeName) (*bchain.ContractInfo, bool, error) {
+func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, standardFromContext bchain.TokenStandardName) (*bchain.ContractInfo, bool, error) {
var err error
validContract := true
- contractInfo, err := w.db.GetContractInfo(cd, typeFromContext)
+ contractInfo, err := w.db.GetContractInfo(cd, standardFromContext)
if err != nil {
return nil, false, err
}
if contractInfo == nil {
// log warning only if the contract should have been known from processing of the internal data
if eth.ProcessInternalTransactions {
- glog.Warningf("Contract %v %v not found in DB", cd, typeFromContext)
+ glog.Warningf("Contract %v %v not found in DB", cd, standardFromContext)
}
contractInfo, err = w.chain.GetContractInfo(cd)
if err != nil {
glog.Errorf("GetContractInfo from chain error %v, contract %v", err, cd)
}
if contractInfo == nil {
- contractInfo = &bchain.ContractInfo{Type: bchain.UnknownTokenType, Decimals: w.chainParser.AmountDecimals()}
+ contractInfo = &bchain.ContractInfo{Standard: bchain.UnknownTokenStandard, Decimals: w.chainParser.AmountDecimals()}
addresses, _, _ := w.chainParser.GetAddressesFromAddrDesc(cd)
if len(addresses) > 0 {
contractInfo.Contract = addresses[0]
@@ -655,14 +655,14 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom
validContract = false
} else {
- if typeFromContext != bchain.UnknownTokenType && contractInfo.Type == bchain.UnknownTokenType {
- contractInfo.Type = typeFromContext
+ if standardFromContext != bchain.UnknownTokenStandard && contractInfo.Standard == bchain.UnknownTokenStandard {
+ contractInfo.Standard = standardFromContext
}
if err = w.db.StoreContractInfo(contractInfo); err != nil {
glog.Errorf("StoreContractInfo error %v, contract %v", err, cd)
}
}
- } else if (contractInfo.Type == bchain.UnhandledTokenType || len(contractInfo.Name) > 0 && contractInfo.Name[0] == 0) || (len(contractInfo.Symbol) > 0 && contractInfo.Symbol[0] == 0) {
+ } else if (contractInfo.Standard == bchain.UnhandledTokenStandard || len(contractInfo.Name) > 0 && contractInfo.Name[0] == 0) || (len(contractInfo.Symbol) > 0 && contractInfo.Symbol[0] == 0) {
// fix contract name/symbol that was parsed as a string consisting of zeroes
blockchainContractInfo, err := w.chain.GetContractInfo(cd)
if err != nil {
@@ -681,9 +681,9 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom
if blockchainContractInfo != nil {
contractInfo.Decimals = blockchainContractInfo.Decimals
}
- if contractInfo.Type == bchain.UnhandledTokenType {
- glog.Infof("Contract %v %v [%s] handled", cd, typeFromContext, contractInfo.Name)
- contractInfo.Type = typeFromContext
+ if contractInfo.Standard == bchain.UnhandledTokenStandard {
+ glog.Infof("Contract %v %v [%s] handled", cd, standardFromContext, contractInfo.Name)
+ contractInfo.Standard = standardFromContext
}
if err = w.db.StoreContractInfo(contractInfo); err != nil {
glog.Errorf("StoreContractInfo error %v, contract %v", err, cd)
@@ -700,12 +700,12 @@ func (w *Worker) getEthereumTokensTransfers(transfers bchain.TokenTransfers, add
contractCache := make(contractInfoCache)
for i := range transfers {
t := transfers[i]
- typeName := bchain.EthereumTokenTypeMap[t.Type]
+ standard := bchain.EthereumTokenStandardMap[t.Standard]
var contractInfo *bchain.ContractInfo
if info, ok := contractCache[t.Contract]; ok {
contractInfo = info
} else {
- info, _, err := w.GetContractInfo(t.Contract, typeName)
+ info, _, err := w.GetContractInfo(t.Contract, standard)
if err != nil {
glog.Errorf("getContractInfo error %v, contract %v", err, t.Contract)
continue
@@ -715,7 +715,7 @@ func (w *Worker) getEthereumTokensTransfers(transfers bchain.TokenTransfers, add
}
var value *Amount
var values []MultiTokenValue
- if t.Type == bchain.MultiToken {
+ if t.Standard == bchain.MultiToken {
values = make([]MultiTokenValue, len(t.MultiTokenValues))
for j := range values {
values[j].Id = (*Amount)(&t.MultiTokenValues[j].Id)
@@ -727,7 +727,8 @@ func (w *Worker) getEthereumTokensTransfers(transfers bchain.TokenTransfers, add
aggregateAddress(addresses, t.From)
aggregateAddress(addresses, t.To)
tokens[i] = TokenTransfer{
- Type: typeName,
+ Type: standard,
+ Standard: standard,
Contract: t.Contract,
From: t.From,
To: t.To,
@@ -755,7 +756,7 @@ func (w *Worker) GetEthereumTokenURI(contract string, id string) (string, *bchai
if err != nil {
return "", nil, err
}
- ci, _, err := w.getContractDescriptorInfo(cd, bchain.UnknownTokenType)
+ ci, _, err := w.getContractDescriptorInfo(cd, bchain.UnknownTokenStandard)
if err != nil {
return "", nil, err
}
@@ -957,8 +958,8 @@ func computePaging(count, page, itemsOnPage int) (Paging, int, int, int) {
}
func (w *Worker) getEthereumContractBalance(addrDesc bchain.AddressDescriptor, index int, c *db.AddrContract, details AccountDetails, ticker *common.CurrencyRatesTicker, secondaryCoin string) (*Token, error) {
- typeName := bchain.EthereumTokenTypeMap[c.Type]
- ci, validContract, err := w.getContractDescriptorInfo(c.Contract, typeName)
+ standard := bchain.EthereumTokenStandardMap[c.Standard]
+ ci, validContract, err := w.getContractDescriptorInfo(c.Contract, standard)
if err != nil {
return nil, errors.Annotatef(err, "getEthereumContractBalance %v", c.Contract)
}
@@ -966,14 +967,15 @@ func (w *Worker) getEthereumContractBalance(addrDesc bchain.AddressDescriptor, i
Contract: ci.Contract,
Name: ci.Name,
Symbol: ci.Symbol,
- Type: typeName,
+ Type: standard,
+ Standard: standard,
Transfers: int(c.Txs),
Decimals: ci.Decimals,
ContractIndex: strconv.Itoa(index),
}
// return contract balances/values only at or above AccountDetailsTokenBalances
if details >= AccountDetailsTokenBalances && validContract {
- if c.Type == bchain.FungibleToken {
+ if c.Standard == bchain.FungibleToken {
// get Erc20 Contract Balance from blockchain, balance obtained from adding and subtracting transfers is not correct
b, err := w.chain.EthereumTypeGetErc20ContractBalance(addrDesc, c.Contract)
if err != nil {
@@ -1022,7 +1024,7 @@ func (w *Worker) getEthereumContractBalance(addrDesc bchain.AddressDescriptor, i
// a fallback method in case internal transactions are not processed and there is no indexed info about contract balance for an address
func (w *Worker) getEthereumContractBalanceFromBlockchain(addrDesc, contract bchain.AddressDescriptor, details AccountDetails) (*Token, error) {
var b *big.Int
- ci, validContract, err := w.getContractDescriptorInfo(contract, bchain.UnknownTokenType)
+ ci, validContract, err := w.getContractDescriptorInfo(contract, bchain.UnknownTokenStandard)
if err != nil {
return nil, errors.Annotatef(err, "GetContractInfo %v", contract)
}
@@ -1037,7 +1039,8 @@ func (w *Worker) getEthereumContractBalanceFromBlockchain(addrDesc, contract bch
b = nil
}
return &Token{
- Type: ci.Type,
+ Type: ci.Standard,
+ Standard: ci.Standard,
BalanceSat: (*Amount)(b),
Contract: ci.Contract,
Name: ci.Name,
@@ -1142,12 +1145,12 @@ func (w *Worker) getEthereumTypeAddressBalances(addrDesc bchain.AddressDescripto
d.tokens = d.tokens[:j]
sort.Sort(d.tokens)
}
- d.contractInfo, err = w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType)
+ d.contractInfo, err = w.db.GetContractInfo(addrDesc, bchain.UnknownTokenStandard)
if err != nil {
return nil, nil, err
}
- if d.contractInfo != nil && d.contractInfo.Type == bchain.UnhandledTokenType {
- d.contractInfo, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenType)
+ if d.contractInfo != nil && d.contractInfo.Standard == bchain.UnhandledTokenStandard {
+ d.contractInfo, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenStandard)
if err != nil {
return nil, nil, err
}
@@ -1467,9 +1470,14 @@ func (w *Worker) GetAddress(address string, page int, txsOnPage int, option Acco
AddressAliases: w.getAddressAliases(addresses),
StakingPools: ed.stakingPools,
}
- // keep address backward compatible, set deprecated Erc20Contract value if ERC20 token
- if ed.contractInfo != nil && ed.contractInfo.Type == bchain.ERC20TokenType {
- r.Erc20Contract = ed.contractInfo
+ // keep address backward compatible
+ if ed.contractInfo != nil {
+ // set deprecated Type value
+ ed.contractInfo.Type = ed.contractInfo.Standard
+ // set deprecated Erc20Contract value if ERC20 token
+ if ed.contractInfo.Standard == bchain.ERC20TokenStandard {
+ r.Erc20Contract = ed.contractInfo
+ }
}
glog.Info("GetAddress-", option, " ", address, ", ", time.Since(start))
return r, nil
@@ -1683,7 +1691,7 @@ func (w *Worker) GetBalanceHistory(address string, fromTimestamp, toTimestamp in
}
// do not get balance history for contracts
if w.chainType == bchain.ChainEthereumType {
- ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType)
+ ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenStandard)
if err != nil {
return nil, err
}
diff --git a/api/xpub.go b/api/xpub.go
index 3a0a6d642f..ca1c4c009c 100644
--- a/api/xpub.go
+++ b/api/xpub.go
@@ -267,7 +267,9 @@ func (w *Worker) tokenFromXpubAddress(data *xpubData, ad *xpubAddress, changeInd
}
}
return Token{
- Type: bchain.XPUBAddressTokenType,
+ // Deprecated: Use Standard instead.
+ Type: bchain.XPUBAddressStandard,
+ Standard: bchain.XPUBAddressStandard,
Name: address,
Decimals: w.chainParser.AmountDecimals(),
BalanceSat: (*Amount)(balance),
diff --git a/bchain/coins/base/baserpc.go b/bchain/coins/base/baserpc.go
new file mode 100644
index 0000000000..116f82efa6
--- /dev/null
+++ b/bchain/coins/base/baserpc.go
@@ -0,0 +1,73 @@
+package base
+
+import (
+ "context"
+ "encoding/json"
+
+ "github.com/golang/glog"
+ "github.com/juju/errors"
+ "github.com/trezor/blockbook/bchain"
+ "github.com/trezor/blockbook/bchain/coins/eth"
+)
+
+const (
+ // MainNet is production network
+ MainNet eth.Network = 8453
+)
+
+// BaseRPC is an interface to JSON-RPC base service.
+type BaseRPC struct {
+ *eth.EthereumRPC
+}
+
+// NewBaseRPC returns new BaseRPC instance.
+func NewBaseRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) {
+ c, err := eth.NewEthereumRPC(config, pushHandler)
+ if err != nil {
+ return nil, err
+ }
+
+ s := &BaseRPC{
+ EthereumRPC: c.(*eth.EthereumRPC),
+ }
+
+ return s, nil
+}
+
+// Initialize base rpc interface
+func (b *BaseRPC) Initialize() error {
+ b.OpenRPC = eth.OpenRPC
+
+ rc, ec, err := b.OpenRPC(b.ChainConfig.RPCURL)
+ if err != nil {
+ return err
+ }
+
+ // set chain specific
+ b.Client = ec
+ b.RPC = rc
+ b.MainNetChainID = MainNet
+ b.NewBlock = eth.NewEthereumNewBlock()
+ b.NewTx = eth.NewEthereumNewTx()
+
+ ctx, cancel := context.WithTimeout(context.Background(), b.Timeout)
+ defer cancel()
+
+ id, err := b.Client.NetworkID(ctx)
+ if err != nil {
+ return err
+ }
+
+ // parameters for getInfo request
+ switch eth.Network(id.Uint64()) {
+ case MainNet:
+ b.Testnet = false
+ b.Network = "livenet"
+ default:
+ return errors.Errorf("Unknown network id %v", id)
+ }
+
+ glog.Info("rpc: block chain ", b.Network)
+
+ return nil
+}
diff --git a/bchain/coins/blockchain.go b/bchain/coins/blockchain.go
index e694dafca8..c81620a2c8 100644
--- a/bchain/coins/blockchain.go
+++ b/bchain/coins/blockchain.go
@@ -13,6 +13,7 @@ import (
"github.com/trezor/blockbook/bchain"
"github.com/trezor/blockbook/bchain/coins/arbitrum"
"github.com/trezor/blockbook/bchain/coins/avalanche"
+ "github.com/trezor/blockbook/bchain/coins/base"
"github.com/trezor/blockbook/bchain/coins/bch"
"github.com/trezor/blockbook/bchain/coins/bellcoin"
"github.com/trezor/blockbook/bchain/coins/bitcore"
@@ -147,6 +148,8 @@ func init() {
BlockChainFactories["Arbitrum Archive"] = arbitrum.NewArbitrumRPC
BlockChainFactories["Arbitrum Nova"] = arbitrum.NewArbitrumRPC
BlockChainFactories["Arbitrum Nova Archive"] = arbitrum.NewArbitrumRPC
+ BlockChainFactories["Base"] = base.NewBaseRPC
+ BlockChainFactories["Base Archive"] = base.NewBaseRPC
}
// NewBlockChain creates bchain.BlockChain and bchain.Mempool for the coin passed by the parameter coin
diff --git a/bchain/coins/bsc/bscrpc.go b/bchain/coins/bsc/bscrpc.go
index a1fb649cd8..96fb648144 100644
--- a/bchain/coins/bsc/bscrpc.go
+++ b/bchain/coins/bsc/bscrpc.go
@@ -14,10 +14,10 @@ const (
// MainNet is production network
MainNet eth.Network = 56
- // bsc token type names
- BEP20TokenType bchain.TokenTypeName = "BEP20"
- BEP721TokenType bchain.TokenTypeName = "BEP721"
- BEP1155TokenType bchain.TokenTypeName = "BEP1155"
+ // bsc token standard names
+ BEP20TokenStandard bchain.TokenStandardName = "BEP20"
+ BEP721TokenStandard bchain.TokenStandardName = "BEP721"
+ BEP1155TokenStandard bchain.TokenStandardName = "BEP1155"
)
// BNBSmartChainRPC is an interface to JSON-RPC bsc service.
@@ -32,8 +32,8 @@ func NewBNBSmartChainRPC(config json.RawMessage, pushHandler func(bchain.Notific
return nil, err
}
- // overwrite EthereumTokenTypeMap with bsc specific token type names
- bchain.EthereumTokenTypeMap = []bchain.TokenTypeName{BEP20TokenType, BEP721TokenType, BEP1155TokenType}
+ // overwrite EthereumTokenStandardMap with bsc specific token standard names
+ bchain.EthereumTokenStandardMap = []bchain.TokenStandardName{BEP20TokenStandard, BEP721TokenStandard, BEP1155TokenStandard}
s := &BNBSmartChainRPC{
EthereumRPC: c.(*eth.EthereumRPC),
diff --git a/bchain/coins/eth/contract.go b/bchain/coins/eth/contract.go
index 6dbca33e3a..08149c085b 100644
--- a/bchain/coins/eth/contract.go
+++ b/bchain/coins/eth/contract.go
@@ -51,16 +51,16 @@ func processTransferEvent(l *bchain.RpcLog) (transfer *bchain.TokenTransfer, err
}
}()
tl := len(l.Topics)
- var ttt bchain.TokenType
+ var standard bchain.TokenStandard
var value big.Int
if tl == 3 {
- ttt = bchain.FungibleToken
+ standard = bchain.FungibleToken
_, ok := value.SetString(l.Data, 0)
if !ok {
return nil, errors.New("ERC20 log Data is not a number")
}
} else if tl == 4 {
- ttt = bchain.NonFungibleToken
+ standard = bchain.NonFungibleToken
_, ok := value.SetString(l.Topics[3], 0)
if !ok {
return nil, errors.New("ERC721 log Topics[3] is not a number")
@@ -78,7 +78,7 @@ func processTransferEvent(l *bchain.RpcLog) (transfer *bchain.TokenTransfer, err
return nil, err
}
return &bchain.TokenTransfer{
- Type: ttt,
+ Standard: standard,
Contract: EIP55AddressFromAddress(l.Address),
From: EIP55AddressFromAddress(from),
To: EIP55AddressFromAddress(to),
@@ -119,7 +119,7 @@ func processERC1155TransferSingleEvent(l *bchain.RpcLog) (transfer *bchain.Token
return nil, errors.New("ERC1155 log Data value is not a number")
}
return &bchain.TokenTransfer{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: EIP55AddressFromAddress(l.Address),
From: EIP55AddressFromAddress(from),
To: EIP55AddressFromAddress(to),
@@ -190,7 +190,7 @@ func processERC1155TransferBatchEvent(l *bchain.RpcLog) (transfer *bchain.TokenT
idValues[i] = bchain.MultiTokenValue{Id: id, Value: value}
}
return &bchain.TokenTransfer{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: EIP55AddressFromAddress(l.Address),
From: EIP55AddressFromAddress(from),
To: EIP55AddressFromAddress(to),
@@ -239,7 +239,7 @@ func contractGetTransfersFromTx(tx *bchain.RpcTransaction) (bchain.TokenTransfer
return nil, errors.New("Data is not a number")
}
r = append(r, &bchain.TokenTransfer{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: EIP55AddressFromAddress(tx.To),
From: EIP55AddressFromAddress(tx.From),
To: EIP55AddressFromAddress(to),
@@ -263,7 +263,7 @@ func contractGetTransfersFromTx(tx *bchain.RpcTransaction) (bchain.TokenTransfer
return nil, errors.New("Data is not a number")
}
r = append(r, &bchain.TokenTransfer{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: EIP55AddressFromAddress(tx.To),
From: EIP55AddressFromAddress(from),
To: EIP55AddressFromAddress(to),
diff --git a/bchain/coins/eth/contract_test.go b/bchain/coins/eth/contract_test.go
index 587d98a774..ca70c85878 100644
--- a/bchain/coins/eth/contract_test.go
+++ b/bchain/coins/eth/contract_test.go
@@ -133,7 +133,7 @@ func Test_contractGetTransfersFromLog(t *testing.T) {
},
want: bchain.TokenTransfers{
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: "0x5689b918D34C038901870105A6C7fc24744D31eB",
From: "0x0a206d4d5ff79cb5069def7fe3598421cff09391",
To: "0x6a016d7eec560549ffa0fbdb7f15c2b27302087f",
@@ -171,7 +171,7 @@ func Test_contractGetTransfersFromLog(t *testing.T) {
},
want: bchain.TokenTransfers{
{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: "0x6Fd712E3A5B556654044608F9129040A4839E36c",
From: "0xa3950b823cb063dd9afc0d27f35008b805b3ed53",
To: "0x4392faf3bb96b5694ecc6ef64726f61cdd4bb0ec",
@@ -195,7 +195,7 @@ func Test_contractGetTransfersFromLog(t *testing.T) {
},
want: bchain.TokenTransfers{
{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: "0x6c42c26a081c2f509f8bb68fb7ac3062311ccfb7",
From: "0x0000000000000000000000000000000000000000",
To: "0x5dc6288b35e0807a3d6feb89b3a2ff4ab773168e",
@@ -247,7 +247,7 @@ func Test_contractGetTransfersFromTx(t *testing.T) {
args: (b1.Txs[1].CoinSpecificData.(bchain.EthereumSpecificData)).Tx,
want: bchain.TokenTransfers{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: "0x4af4114f73d1c1c903ac9e0361b379d1291808a2",
From: "0x20cd153de35d469ba46127a0c8f18626b59a256a",
To: "0x555ee11fbddc0e49a9bab358a8941ad95ffdb48f",
@@ -260,7 +260,7 @@ func Test_contractGetTransfersFromTx(t *testing.T) {
args: (b2.Txs[2].CoinSpecificData.(bchain.EthereumSpecificData)).Tx,
want: bchain.TokenTransfers{
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: "0xcda9fc258358ecaa88845f19af595e908bb7efe9",
From: "0x837e3f699d85a4b0b99894567e9233dfb1dcb081",
To: "0x7b62eb7fe80350dc7ec945c0b73242cb9877fb1b",
diff --git a/bchain/coins/eth/ethaddrcontracts.pb.go b/bchain/coins/eth/ethaddrcontracts.pb.go
new file mode 100644
index 0000000000..7d24ac84ad
--- /dev/null
+++ b/bchain/coins/eth/ethaddrcontracts.pb.go
@@ -0,0 +1,365 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v5.28.3
+// source: bchain/coins/eth/ethaddrcontracts.proto
+
+package eth
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type ProtoAddrContracts struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ TotalTxs uint64 `protobuf:"varint,1,opt,name=TotalTxs,proto3" json:"TotalTxs,omitempty"`
+ NonContractTxs uint64 `protobuf:"varint,2,opt,name=NonContractTxs,proto3" json:"NonContractTxs,omitempty"`
+ InternalTxs uint64 `protobuf:"varint,3,opt,name=InternalTxs,proto3" json:"InternalTxs,omitempty"`
+ Contracts []*ProtoAddrContracts_AddrContract `protobuf:"bytes,4,rep,name=Contracts,proto3" json:"Contracts,omitempty"`
+}
+
+func (x *ProtoAddrContracts) Reset() {
+ *x = ProtoAddrContracts{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ProtoAddrContracts) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ProtoAddrContracts) ProtoMessage() {}
+
+func (x *ProtoAddrContracts) ProtoReflect() protoreflect.Message {
+ mi := &file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[0]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ProtoAddrContracts.ProtoReflect.Descriptor instead.
+func (*ProtoAddrContracts) Descriptor() ([]byte, []int) {
+ return file_bchain_coins_eth_ethaddrcontracts_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *ProtoAddrContracts) GetTotalTxs() uint64 {
+ if x != nil {
+ return x.TotalTxs
+ }
+ return 0
+}
+
+func (x *ProtoAddrContracts) GetNonContractTxs() uint64 {
+ if x != nil {
+ return x.NonContractTxs
+ }
+ return 0
+}
+
+func (x *ProtoAddrContracts) GetInternalTxs() uint64 {
+ if x != nil {
+ return x.InternalTxs
+ }
+ return 0
+}
+
+func (x *ProtoAddrContracts) GetContracts() []*ProtoAddrContracts_AddrContract {
+ if x != nil {
+ return x.Contracts
+ }
+ return nil
+}
+
+type ProtoAddrContracts_MultiTokenValue struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Id []byte `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`
+ Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"`
+}
+
+func (x *ProtoAddrContracts_MultiTokenValue) Reset() {
+ *x = ProtoAddrContracts_MultiTokenValue{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ProtoAddrContracts_MultiTokenValue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ProtoAddrContracts_MultiTokenValue) ProtoMessage() {}
+
+func (x *ProtoAddrContracts_MultiTokenValue) ProtoReflect() protoreflect.Message {
+ mi := &file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ProtoAddrContracts_MultiTokenValue.ProtoReflect.Descriptor instead.
+func (*ProtoAddrContracts_MultiTokenValue) Descriptor() ([]byte, []int) {
+ return file_bchain_coins_eth_ethaddrcontracts_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *ProtoAddrContracts_MultiTokenValue) GetId() []byte {
+ if x != nil {
+ return x.Id
+ }
+ return nil
+}
+
+func (x *ProtoAddrContracts_MultiTokenValue) GetValue() []byte {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+type ProtoAddrContracts_AddrContract struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Standard int64 `protobuf:"varint,1,opt,name=Standard,proto3" json:"Standard,omitempty"`
+ Contract []byte `protobuf:"bytes,2,opt,name=Contract,proto3" json:"Contract,omitempty"`
+ Txs uint64 `protobuf:"varint,3,opt,name=Txs,proto3" json:"Txs,omitempty"`
+ Value []byte `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"`
+ Ids [][]byte `protobuf:"bytes,5,rep,name=Ids,proto3" json:"Ids,omitempty"`
+ MultiTokenValues []*ProtoAddrContracts_MultiTokenValue `protobuf:"bytes,6,rep,name=MultiTokenValues,proto3" json:"MultiTokenValues,omitempty"`
+}
+
+func (x *ProtoAddrContracts_AddrContract) Reset() {
+ *x = ProtoAddrContracts_AddrContract{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ProtoAddrContracts_AddrContract) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ProtoAddrContracts_AddrContract) ProtoMessage() {}
+
+func (x *ProtoAddrContracts_AddrContract) ProtoReflect() protoreflect.Message {
+ mi := &file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ProtoAddrContracts_AddrContract.ProtoReflect.Descriptor instead.
+func (*ProtoAddrContracts_AddrContract) Descriptor() ([]byte, []int) {
+ return file_bchain_coins_eth_ethaddrcontracts_proto_rawDescGZIP(), []int{0, 1}
+}
+
+func (x *ProtoAddrContracts_AddrContract) GetStandard() int64 {
+ if x != nil {
+ return x.Standard
+ }
+ return 0
+}
+
+func (x *ProtoAddrContracts_AddrContract) GetContract() []byte {
+ if x != nil {
+ return x.Contract
+ }
+ return nil
+}
+
+func (x *ProtoAddrContracts_AddrContract) GetTxs() uint64 {
+ if x != nil {
+ return x.Txs
+ }
+ return 0
+}
+
+func (x *ProtoAddrContracts_AddrContract) GetValue() []byte {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+func (x *ProtoAddrContracts_AddrContract) GetIds() [][]byte {
+ if x != nil {
+ return x.Ids
+ }
+ return nil
+}
+
+func (x *ProtoAddrContracts_AddrContract) GetMultiTokenValues() []*ProtoAddrContracts_MultiTokenValue {
+ if x != nil {
+ return x.MultiTokenValues
+ }
+ return nil
+}
+
+var File_bchain_coins_eth_ethaddrcontracts_proto protoreflect.FileDescriptor
+
+var file_bchain_coins_eth_ethaddrcontracts_proto_rawDesc = []byte{
+ 0x0a, 0x27, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x65,
+ 0x74, 0x68, 0x2f, 0x65, 0x74, 0x68, 0x61, 0x64, 0x64, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61,
+ 0x63, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x03, 0x0a, 0x12, 0x50, 0x72,
+ 0x6f, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73,
+ 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x04, 0x52, 0x08, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x12, 0x26, 0x0a, 0x0e,
+ 0x4e, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x73, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x4e, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63,
+ 0x74, 0x54, 0x78, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x54, 0x78, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x49, 0x6e, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x12, 0x3e, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61,
+ 0x63, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x50, 0x72, 0x6f, 0x74,
+ 0x6f, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2e, 0x41,
+ 0x64, 0x64, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x09, 0x43, 0x6f, 0x6e,
+ 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x1a, 0x37, 0x0a, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a,
+ 0xd1, 0x01, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74,
+ 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x03, 0x52, 0x08, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08,
+ 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08,
+ 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x78, 0x73, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x54, 0x78, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x12, 0x10, 0x0a, 0x03, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x03, 0x49,
+ 0x64, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x50,
+ 0x72, 0x6f, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74,
+ 0x73, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x52, 0x10, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x74, 0x72, 0x65, 0x7a, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x62, 0x6f,
+ 0x6f, 0x6b, 0x2f, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f,
+ 0x65, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_bchain_coins_eth_ethaddrcontracts_proto_rawDescOnce sync.Once
+ file_bchain_coins_eth_ethaddrcontracts_proto_rawDescData = file_bchain_coins_eth_ethaddrcontracts_proto_rawDesc
+)
+
+func file_bchain_coins_eth_ethaddrcontracts_proto_rawDescGZIP() []byte {
+ file_bchain_coins_eth_ethaddrcontracts_proto_rawDescOnce.Do(func() {
+ file_bchain_coins_eth_ethaddrcontracts_proto_rawDescData = protoimpl.X.CompressGZIP(file_bchain_coins_eth_ethaddrcontracts_proto_rawDescData)
+ })
+ return file_bchain_coins_eth_ethaddrcontracts_proto_rawDescData
+}
+
+var file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_bchain_coins_eth_ethaddrcontracts_proto_goTypes = []interface{}{
+ (*ProtoAddrContracts)(nil), // 0: ProtoAddrContracts
+ (*ProtoAddrContracts_MultiTokenValue)(nil), // 1: ProtoAddrContracts.MultiTokenValue
+ (*ProtoAddrContracts_AddrContract)(nil), // 2: ProtoAddrContracts.AddrContract
+}
+var file_bchain_coins_eth_ethaddrcontracts_proto_depIdxs = []int32{
+ 2, // 0: ProtoAddrContracts.Contracts:type_name -> ProtoAddrContracts.AddrContract
+ 1, // 1: ProtoAddrContracts.AddrContract.MultiTokenValues:type_name -> ProtoAddrContracts.MultiTokenValue
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_bchain_coins_eth_ethaddrcontracts_proto_init() }
+func file_bchain_coins_eth_ethaddrcontracts_proto_init() {
+ if File_bchain_coins_eth_ethaddrcontracts_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ProtoAddrContracts); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ProtoAddrContracts_MultiTokenValue); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ProtoAddrContracts_AddrContract); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_bchain_coins_eth_ethaddrcontracts_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 3,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_bchain_coins_eth_ethaddrcontracts_proto_goTypes,
+ DependencyIndexes: file_bchain_coins_eth_ethaddrcontracts_proto_depIdxs,
+ MessageInfos: file_bchain_coins_eth_ethaddrcontracts_proto_msgTypes,
+ }.Build()
+ File_bchain_coins_eth_ethaddrcontracts_proto = out.File
+ file_bchain_coins_eth_ethaddrcontracts_proto_rawDesc = nil
+ file_bchain_coins_eth_ethaddrcontracts_proto_goTypes = nil
+ file_bchain_coins_eth_ethaddrcontracts_proto_depIdxs = nil
+}
diff --git a/bchain/coins/eth/ethaddrcontracts.proto b/bchain/coins/eth/ethaddrcontracts.proto
new file mode 100644
index 0000000000..cd2fecb431
--- /dev/null
+++ b/bchain/coins/eth/ethaddrcontracts.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+
+option go_package = "github.com/trezor/blockbook/bchain/coins/eth";
+
+message ProtoAddrContracts {
+ message MultiTokenValue {
+ bytes Id = 1;
+ bytes Value = 2;
+ }
+ message AddrContract {
+ int64 Standard = 1;
+ bytes Contract = 2;
+ uint64 Txs = 3;
+ bytes Value = 4;
+ repeated bytes Ids = 5;
+ repeated MultiTokenValue MultiTokenValues = 6;
+ }
+ uint64 TotalTxs = 1;
+ uint64 NonContractTxs = 2;
+ uint64 InternalTxs = 3;
+ repeated AddrContract Contracts = 4;
+}
\ No newline at end of file
diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go
index 67b9a28931..4dfffc73b7 100644
--- a/bchain/coins/eth/ethrpc.go
+++ b/bchain/coins/eth/ethrpc.go
@@ -622,7 +622,7 @@ func (b *EthereumRPC) getCreationContractInfo(contract string, height uint32) *b
Contract: contract,
}
// }
- ci.Type = bchain.UnhandledTokenType
+ ci.Standard = bchain.UnhandledTokenStandard
ci.CreatedInBlock = height
return ci
}
diff --git a/bchain/coins/eth/ethtx.pb.go b/bchain/coins/eth/ethtx.pb.go
index 0174ab9b0a..83971a1a77 100644
--- a/bchain/coins/eth/ethtx.pb.go
+++ b/bchain/coins/eth/ethtx.pb.go
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.28.1
-// protoc v3.21.12
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
// source: bchain/coins/eth/ethtx.proto
package eth
diff --git a/bchain/types.go b/bchain/types.go
index 8f1c25435f..8b5d107487 100644
--- a/bchain/types.go
+++ b/bchain/types.go
@@ -116,26 +116,26 @@ type MempoolTx struct {
CoinSpecificData interface{} `json:"-"`
}
-// TokenType - type of token
-type TokenType int
+// TokenStandard - standard of token
+type TokenStandard int
-// TokenType enumeration
+// TokenStandard enumeration
const (
- FungibleToken = TokenType(iota) // ERC20/BEP20
- NonFungibleToken // ERC721/BEP721
- MultiToken // ERC1155/BEP1155
+ FungibleToken = TokenStandard(iota) // ERC20/BEP20
+ NonFungibleToken // ERC721/BEP721
+ MultiToken // ERC1155/BEP1155
)
-// TokenTypeName specifies type of token
-type TokenTypeName string
+// TokenStandardName specifies standard of token
+type TokenStandardName string
-// Token types
+// Token standards
const (
- UnknownTokenType TokenTypeName = ""
- UnhandledTokenType TokenTypeName = "-"
+ UnknownTokenStandard TokenStandardName = ""
+ UnhandledTokenStandard TokenStandardName = "-"
- // XPUBAddressTokenType is address derived from xpub
- XPUBAddressTokenType TokenTypeName = "XPUBAddress"
+ // XPUBAddressStandard is address derived from xpub
+ XPUBAddressStandard TokenStandardName = "XPUBAddress"
)
// TokenTransfers is array of TokenTransfer
@@ -144,7 +144,7 @@ type TokenTransfers []*TokenTransfer
func (a TokenTransfers) Len() int { return len(a) }
func (a TokenTransfers) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a TokenTransfers) Less(i, j int) bool {
- return a[i].Type < a[j].Type
+ return a[i].Standard < a[j].Standard
}
// Block is block header and list of transactions
diff --git a/bchain/types_ethereum_type.go b/bchain/types_ethereum_type.go
index 652a9edd52..f16bdd070b 100644
--- a/bchain/types_ethereum_type.go
+++ b/bchain/types_ethereum_type.go
@@ -59,25 +59,27 @@ type EthereumInternalData struct {
// ContractInfo contains info about a contract
type ContractInfo struct {
- Type TokenTypeName `json:"type"`
- Contract string `json:"contract"`
- Name string `json:"name"`
- Symbol string `json:"symbol"`
- Decimals int `json:"decimals"`
- CreatedInBlock uint32 `json:"createdInBlock,omitempty"`
- DestructedInBlock uint32 `json:"destructedInBlock,omitempty"`
+ // Deprecated: Use Standard instead.
+ Type TokenStandardName `json:"type"`
+ Standard TokenStandardName `json:"standard"`
+ Contract string `json:"contract"`
+ Name string `json:"name"`
+ Symbol string `json:"symbol"`
+ Decimals int `json:"decimals"`
+ CreatedInBlock uint32 `json:"createdInBlock,omitempty"`
+ DestructedInBlock uint32 `json:"destructedInBlock,omitempty"`
}
-// Ethereum token type names
+// Ethereum token standard names
const (
- ERC20TokenType TokenTypeName = "ERC20"
- ERC771TokenType TokenTypeName = "ERC721"
- ERC1155TokenType TokenTypeName = "ERC1155"
+ ERC20TokenStandard TokenStandardName = "ERC20"
+ ERC771TokenStandard TokenStandardName = "ERC721"
+ ERC1155TokenStandard TokenStandardName = "ERC1155"
)
-// EthereumTokenTypeMap maps bchain.TokenType to TokenTypeName
-// the map must match all bchain.TokenType to avoid index out of range panic
-var EthereumTokenTypeMap = []TokenTypeName{ERC20TokenType, ERC771TokenType, ERC1155TokenType}
+// EthereumTokenStandardMap maps bchain.TokenStandard to TokenStandardName
+// the map must match all bchain.TokenStandard to avoid index out of range panic
+var EthereumTokenStandardMap = []TokenStandardName{ERC20TokenStandard, ERC771TokenStandard, ERC1155TokenStandard}
type MultiTokenValue struct {
Id big.Int
@@ -86,7 +88,7 @@ type MultiTokenValue struct {
// TokenTransfer contains a single token transfer
type TokenTransfer struct {
- Type TokenType
+ Standard TokenStandard
Contract string
From string
To string
diff --git a/blockbook-api.ts b/blockbook-api.ts
index 295acff9d7..1179999756 100644
--- a/blockbook-api.ts
+++ b/blockbook-api.ts
@@ -47,6 +47,7 @@ export interface MultiTokenValue {
}
export interface TokenTransfer {
type: string;
+ standard: string;
from: string;
to: string;
contract: string;
@@ -126,6 +127,7 @@ export interface StakingPool {
}
export interface ContractInfo {
type: string;
+ standard: string;
contract: string;
name: string;
symbol: string;
@@ -135,6 +137,7 @@ export interface ContractInfo {
}
export interface Token {
type: 'XPUBAddress' | 'ERC20' | 'ERC721' | 'ERC1155';
+ standard: 'XPUBAddress' | 'ERC20' | 'ERC721' | 'ERC1155';
name: string;
path?: string;
contract?: string;
diff --git a/blockbook.go b/blockbook.go
index 6675aec32d..ad0aa1efb7 100644
--- a/blockbook.go
+++ b/blockbook.go
@@ -43,9 +43,11 @@ const exitCodeFatal = 255
var (
configFile = flag.String("blockchaincfg", "", "path to blockchain RPC service configuration json file")
- dbPath = flag.String("datadir", "./data", "path to database directory")
- dbCache = flag.Int("dbcache", 1<<29, "size of the rocksdb cache")
- dbMaxOpenFiles = flag.Int("dbmaxopenfiles", 1<<14, "max open files by rocksdb")
+ dbPath = flag.String("datadir", "./data", "path to database directory")
+ dbCache = flag.Int("dbcache", 1<<29, "size of the rocksdb cache")
+ dbMaxOpenFiles = flag.Int("dbmaxopenfiles", 1<<14, "max open files by rocksdb")
+ dbMaxAddrContracts = flag.Int("dbmaxaddrcontracts", 0, "max size of the address contracts cache (default bulk mode cache only at static size of 1200000)")
+ dbProtoAddrContracts = flag.Bool("dbprotoaddrcontracts", false, "use protobuf encoding for addrContracts (also migrates legacy format to protobuf if applicable in existing databases)")
blockFrom = flag.Int("blockheight", -1, "height of the starting block")
blockUntil = flag.Int("blockuntil", -1, "height of the final block")
@@ -169,7 +171,7 @@ func mainWithExitCode() int {
return exitCodeFatal
}
- index, err = db.NewRocksDB(*dbPath, *dbCache, *dbMaxOpenFiles, chain.GetChainParser(), metrics, *extendedIndex)
+ index, err = db.NewRocksDB(*dbPath, *dbCache, *dbMaxOpenFiles, chain.GetChainParser(), metrics, *extendedIndex, *dbMaxAddrContracts, *dbProtoAddrContracts)
if err != nil {
glog.Error("rocksDB: ", err)
return exitCodeFatal
diff --git a/build/templates/backend/scripts/base.sh b/build/templates/backend/scripts/base.sh
new file mode 100644
index 0000000000..1b9305644b
--- /dev/null
+++ b/build/templates/backend/scripts/base.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+{{define "main" -}}
+
+set -e
+
+GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth
+DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend
+
+CHAINDATA_DIR=$DATA_DIR/geth/chaindata
+SNAPSHOT=https://mainnet-full-snapshots.base.org/$(curl https://mainnet-full-snapshots.base.org/latest)
+
+if [ ! -d "$CHAINDATA_DIR" ]; then
+ wget -c $SNAPSHOT -O - | zstd -cd | tar xf - --strip-components=1 -C $DATA_DIR
+fi
+
+$GETH_BIN \
+ --op-network base-mainnet \
+ --datadir $DATA_DIR \
+ --authrpc.jwtsecret $DATA_DIR/jwtsecret \
+ --authrpc.addr 127.0.0.1 \
+ --authrpc.port {{.Ports.BackendAuthRpc}} \
+ --authrpc.vhosts "*" \
+ --port {{.Ports.BackendP2P}} \
+ --http \
+ --http.port {{.Ports.BackendHttp}} \
+ --http.addr 127.0.0.1 \
+ --http.api eth,net,web3,debug,txpool,engine \
+ --http.vhosts "*" \
+ --http.corsdomain "*" \
+ --ws \
+ --ws.port {{.Ports.BackendRPC}} \
+ --ws.addr 127.0.0.1 \
+ --ws.api eth,net,web3,debug,txpool,engine \
+ --ws.origins "*" \
+ --rollup.disabletxpoolgossip=true \
+ --rollup.sequencerhttp https://mainnet-sequencer.base.io \
+ --state.scheme hash \
+ --history.transactions 0 \
+ --cache 4096 \
+ --syncmode full \
+ --maxpeers 0 \
+ --nodiscover
+
+{{end}}
diff --git a/build/templates/backend/scripts/base_archive.sh b/build/templates/backend/scripts/base_archive.sh
new file mode 100644
index 0000000000..a4bf1444fe
--- /dev/null
+++ b/build/templates/backend/scripts/base_archive.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+{{define "main" -}}
+
+set -e
+
+GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth
+DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend
+
+CHAINDATA_DIR=$DATA_DIR/geth/chaindata
+SNAPSHOT=https://mainnet-archive-snapshots.base.org/$(curl https://mainnet-archive-snapshots.base.org/latest)
+
+if [ ! -d "$CHAINDATA_DIR" ]; then
+ wget -c $SNAPSHOT -O - | zstd -cd | tar xf - --strip-components=1 -C $DATA_DIR
+fi
+
+$GETH_BIN \
+ --op-network base-mainnet \
+ --datadir $DATA_DIR \
+ --authrpc.jwtsecret $DATA_DIR/jwtsecret \
+ --authrpc.addr 127.0.0.1 \
+ --authrpc.port {{.Ports.BackendAuthRpc}} \
+ --authrpc.vhosts "*" \
+ --port {{.Ports.BackendP2P}} \
+ --http \
+ --http.port {{.Ports.BackendHttp}} \
+ --http.addr 127.0.0.1 \
+ --http.api eth,net,web3,debug,txpool,engine \
+ --http.vhosts "*" \
+ --http.corsdomain "*" \
+ --ws \
+ --ws.port {{.Ports.BackendRPC}} \
+ --ws.addr 127.0.0.1 \
+ --ws.api eth,net,web3,debug,txpool,engine \
+ --ws.origins "*" \
+ --rollup.disabletxpoolgossip=true \
+ --rollup.sequencerhttp https://mainnet.sequencer.optimism.io \
+ --cache 4096 \
+ --cache.gc 0 \
+ --cache.trie 30 \
+ --cache.snapshot 20 \
+ --syncmode full \
+ --gcmode archive \
+ --maxpeers 0 \
+ --nodiscover
+
+{{end}}
diff --git a/build/templates/backend/scripts/base_archive_op_node.sh b/build/templates/backend/scripts/base_archive_op_node.sh
new file mode 100644
index 0000000000..75e122da8e
--- /dev/null
+++ b/build/templates/backend/scripts/base_archive_op_node.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+{{define "main" -}}
+
+set -e
+
+BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node
+
+$BIN \
+ --network base-mainnet \
+ --l1 http://127.0.0.1:8116 \
+ --l1.beacon http://127.0.0.1:7516 \
+ --l1.trustrpc \
+ --l1.rpckind=debug_geth \
+ --l2 http://127.0.0.1:8411 \
+ --rpc.addr 127.0.0.1 \
+ --rpc.port {{.Ports.BackendRPC}} \
+ --l2.jwt-secret {{.Env.BackendDataPath}}/base_archive/backend/jwtsecret \
+ --p2p.bootnodes enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG,enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG,enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG,enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG,enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG \
+ --p2p.useragent base \
+ --rollup.load-protocol-versions=true \
+ --verifier.l1-confs 4
+
+{{end}}
diff --git a/build/templates/backend/scripts/base_op_node.sh b/build/templates/backend/scripts/base_op_node.sh
new file mode 100644
index 0000000000..4254b8972e
--- /dev/null
+++ b/build/templates/backend/scripts/base_op_node.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+{{define "main" -}}
+
+set -e
+
+BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node
+
+$BIN \
+ --network base-mainnet \
+ --l1 http://127.0.0.1:8136 \
+ --l1.beacon http://127.0.0.1:7536 \
+ --l1.trustrpc \
+ --l1.rpckind debug_geth \
+ --l2 http://127.0.0.1:8409 \
+ --rpc.addr 127.0.0.1 \
+ --rpc.port {{.Ports.BackendRPC}} \
+ --l2.jwt-secret {{.Env.BackendDataPath}}/base/backend/jwtsecret \
+ --p2p.bootnodes enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG,enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG,enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG,enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG,enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG \
+ --p2p.useragent base \
+ --rollup.load-protocol-versions=true \
+ --verifier.l1-confs 4
+
+{{end}}
diff --git a/configs/coins/base.json b/configs/coins/base.json
new file mode 100644
index 0000000000..54d0df983e
--- /dev/null
+++ b/configs/coins/base.json
@@ -0,0 +1,67 @@
+{
+ "coin": {
+ "name": "Base",
+ "shortcut": "ETH",
+ "network": "BASE",
+ "label": "Base",
+ "alias": "base"
+ },
+ "ports": {
+ "backend_rpc": 8309,
+ "backend_p2p": 38409,
+ "backend_http": 8209,
+ "backend_authrpc": 8409,
+ "blockbook_internal": 9209,
+ "blockbook_public": 9309
+ },
+ "ipc": {
+ "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}",
+ "rpc_timeout": 25
+ },
+ "backend": {
+ "package_name": "backend-base",
+ "package_revision": "satoshilabs-1",
+ "system_user": "base",
+ "version": "1.101411.3",
+ "docker_image": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101411.3",
+ "verification_type": "docker",
+ "verification_source": "aefecdb139d8e3ed3128e7e3c87abb71198dc6a44ef21f012f391af52679e2c5",
+ "extract_command": "docker cp extract:/usr/local/bin/geth backend/geth",
+ "exclude_files": [],
+ "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/base_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
+ "exec_script": "base.sh",
+ "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
+ "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret",
+ "service_type": "simple",
+ "service_additional_params_template": "",
+ "protect_memory": true,
+ "mainnet": true,
+ "server_config_file": "",
+ "client_config_file": ""
+ },
+ "blockbook": {
+ "package_name": "blockbook-base",
+ "system_user": "blockbook-base",
+ "internal_binding_template": ":{{.Ports.BlockbookInternal}}",
+ "public_binding_template": ":{{.Ports.BlockbookPublic}}",
+ "explorer_url": "",
+ "additional_params": "-dbprotoaddrcontracts",
+ "block_chain": {
+ "parse": true,
+ "mempool_workers": 8,
+ "mempool_sub_workers": 2,
+ "block_addresses_to_keep": 300,
+ "additional_params": {
+ "mempoolTxTimeoutHours": 48,
+ "queryBackendOnMempoolResync": false,
+ "fiat_rates": "coingecko",
+ "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH",
+ "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"base\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}"
+ }
+ }
+ },
+ "meta": {
+ "package_maintainer": "IT",
+ "package_maintainer_email": "it@satoshilabs.com"
+ }
+}
\ No newline at end of file
diff --git a/configs/coins/base_archive.json b/configs/coins/base_archive.json
new file mode 100644
index 0000000000..98c0b5df53
--- /dev/null
+++ b/configs/coins/base_archive.json
@@ -0,0 +1,70 @@
+{
+ "coin": {
+ "name": "Base Archive",
+ "shortcut": "ETH",
+ "network": "BASE",
+ "label": "Base",
+ "alias": "base_archive"
+ },
+ "ports": {
+ "backend_rpc": 8211,
+ "backend_p2p": 38411,
+ "backend_http": 8311,
+ "backend_authrpc": 8411,
+ "blockbook_internal": 9211,
+ "blockbook_public": 9311
+ },
+ "ipc": {
+ "rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}",
+ "rpc_timeout": 25
+ },
+ "backend": {
+ "package_name": "backend-base-archive",
+ "package_revision": "satoshilabs-1",
+ "system_user": "base",
+ "version": "1.101411.3",
+ "docker_image": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101411.3",
+ "verification_type": "docker",
+ "verification_source": "aefecdb139d8e3ed3128e7e3c87abb71198dc6a44ef21f012f391af52679e2c5",
+ "extract_command": "docker cp extract:/usr/local/bin/geth backend/geth",
+ "exclude_files": [],
+ "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/base_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
+ "exec_script": "base_archive.sh",
+ "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
+ "postinst_script_template": "openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret",
+ "service_type": "simple",
+ "service_additional_params_template": "",
+ "protect_memory": true,
+ "mainnet": true,
+ "server_config_file": "",
+ "client_config_file": ""
+ },
+ "blockbook": {
+ "package_name": "blockbook-base-archive",
+ "system_user": "blockbook-base",
+ "internal_binding_template": ":{{.Ports.BlockbookInternal}}",
+ "public_binding_template": ":{{.Ports.BlockbookPublic}}",
+ "explorer_url": "",
+ "additional_params": "-workers=16 -dbprotoaddrcontracts",
+ "block_chain": {
+ "parse": true,
+ "mempool_workers": 8,
+ "mempool_sub_workers": 2,
+ "block_addresses_to_keep": 600,
+ "additional_params": {
+ "address_aliases": true,
+ "mempoolTxTimeoutHours": 48,
+ "processInternalTransactions": true,
+ "queryBackendOnMempoolResync": false,
+ "fiat_rates": "coingecko",
+ "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH",
+ "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"base\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}",
+ "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/"
+ }
+ }
+ },
+ "meta": {
+ "package_maintainer": "IT",
+ "package_maintainer_email": "it@satoshilabs.com"
+ }
+}
\ No newline at end of file
diff --git a/configs/coins/base_archive_op_node.json b/configs/coins/base_archive_op_node.json
new file mode 100644
index 0000000000..85a4c5dbe1
--- /dev/null
+++ b/configs/coins/base_archive_op_node.json
@@ -0,0 +1,38 @@
+{
+ "coin": {
+ "name": "Base Archive Op-Node",
+ "shortcut": "ETH",
+ "label": "Base",
+ "alias": "base_archive_op_node"
+ },
+ "ports": {
+ "backend_rpc": 8212,
+ "blockbook_internal": 9212,
+ "blockbook_public": 9312
+ },
+ "backend": {
+ "package_name": "backend-base-archive-op-node",
+ "package_revision": "satoshilabs-1",
+ "system_user": "base",
+ "version": "1.10.1",
+ "docker_image": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.10.1",
+ "verification_type": "docker",
+ "verification_source": "8f40714868fbdc788f67251383a0c0b78a3a937f07b2303bc7d33df5df6297d9",
+ "extract_command": "docker cp extract:/usr/local/bin/op-node backend/op-node",
+ "exclude_files": [],
+ "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/base_archive_op_node_exec.sh 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
+ "exec_script": "base_archive_op_node.sh",
+ "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
+ "postinst_script_template": "",
+ "service_type": "simple",
+ "service_additional_params_template": "",
+ "protect_memory": true,
+ "mainnet": true,
+ "server_config_file": "",
+ "client_config_file": ""
+ },
+ "meta": {
+ "package_maintainer": "IT",
+ "package_maintainer_email": "it@satoshilabs.com"
+ }
+}
\ No newline at end of file
diff --git a/configs/coins/base_op_node.json b/configs/coins/base_op_node.json
new file mode 100644
index 0000000000..426d718069
--- /dev/null
+++ b/configs/coins/base_op_node.json
@@ -0,0 +1,38 @@
+{
+ "coin": {
+ "name": "Base Op-Node",
+ "shortcut": "ETH",
+ "label": "Base",
+ "alias": "base_op_node"
+ },
+ "ports": {
+ "backend_rpc": 8210,
+ "blockbook_internal": 9210,
+ "blockbook_public": 9310
+ },
+ "backend": {
+ "package_name": "backend-base-op-node",
+ "package_revision": "satoshilabs-1",
+ "system_user": "base",
+ "version": "1.10.1",
+ "docker_image": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.10.1",
+ "verification_type": "docker",
+ "verification_source": "8f40714868fbdc788f67251383a0c0b78a3a937f07b2303bc7d33df5df6297d9",
+ "extract_command": "docker cp extract:/usr/local/bin/op-node backend/op-node",
+ "exclude_files": [],
+ "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/base_op_node_exec.sh 2>&1 >> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
+ "exec_script": "base_op_node.sh",
+ "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
+ "postinst_script_template": "",
+ "service_type": "simple",
+ "service_additional_params_template": "",
+ "protect_memory": true,
+ "mainnet": true,
+ "server_config_file": "",
+ "client_config_file": ""
+ },
+ "meta": {
+ "package_maintainer": "IT",
+ "package_maintainer_email": "it@satoshilabs.com"
+ }
+}
\ No newline at end of file
diff --git a/db/bulkconnect.go b/db/bulkconnect.go
index 8c2095bf7e..dba52d86bc 100644
--- a/db/bulkconnect.go
+++ b/db/bulkconnect.go
@@ -21,38 +21,40 @@ type bulkAddresses struct {
// BulkConnect is used to connect blocks in bulk, faster but if interrupted inconsistent way
type BulkConnect struct {
- d *RocksDB
- chainType bchain.ChainType
- bulkAddresses []bulkAddresses
- bulkAddressesCount int
- ethBlockTxs []ethBlockTx
- txAddressesMap map[string]*TxAddresses
- blockFilters map[string][]byte
- balances map[string]*AddrBalance
- addressContracts map[string]*AddrContracts
- height uint32
+ d *RocksDB
+ chainType bchain.ChainType
+ bulkAddresses []bulkAddresses
+ bulkAddressesCount int
+ ethBlockTxs []ethBlockTx
+ txAddressesMap map[string]*TxAddresses
+ blockFilters map[string][]byte
+ balances map[string]*AddrBalance
+ height uint32
+ maxBulkAddrContracts int
}
const (
- maxBulkAddresses = 80000
- maxBulkTxAddresses = 500000
- partialStoreAddresses = maxBulkTxAddresses / 10
- maxBulkBalances = 700000
- partialStoreBalances = maxBulkBalances / 10
- maxBulkAddrContracts = 1200000
- partialStoreAddrContracts = maxBulkAddrContracts / 10
- maxBlockFilters = 1000
+ maxBulkAddresses = 80000
+ maxBulkTxAddresses = 500000
+ partialStoreAddresses = maxBulkTxAddresses / 10
+ maxBulkBalances = 700000
+ partialStoreBalances = maxBulkBalances / 10
+ maxBlockFilters = 1000
)
// InitBulkConnect initializes bulk connect and switches DB to inconsistent state
func (d *RocksDB) InitBulkConnect() (*BulkConnect, error) {
+ maxBulkAddrContracts := 1200000
+ if d.maxAddrContracts != 0 {
+ maxBulkAddrContracts = d.maxAddrContracts
+ }
b := &BulkConnect{
- d: d,
- chainType: d.chainParser.GetChainType(),
- txAddressesMap: make(map[string]*TxAddresses),
- balances: make(map[string]*AddrBalance),
- addressContracts: make(map[string]*AddrContracts),
- blockFilters: make(map[string][]byte),
+ d: d,
+ chainType: d.chainParser.GetChainType(),
+ txAddressesMap: make(map[string]*TxAddresses),
+ balances: make(map[string]*AddrBalance),
+ blockFilters: make(map[string][]byte),
+ maxBulkAddrContracts: maxBulkAddrContracts,
}
if err := d.SetInconsistentState(true); err != nil {
return nil, err
@@ -266,15 +268,15 @@ func (b *BulkConnect) connectBlockBitcoinType(block *bchain.Block, storeBlockTxs
func (b *BulkConnect) storeAddressContracts(wb *grocksdb.WriteBatch, all bool) (int, error) {
var ac map[string]*AddrContracts
if all {
- ac = b.addressContracts
- b.addressContracts = make(map[string]*AddrContracts)
+ ac = b.d.addressContracts
+ b.d.addressContracts = make(map[string]*AddrContracts)
} else {
ac = make(map[string]*AddrContracts)
// store some random address contracts
- for k, a := range b.addressContracts {
+ for k, a := range b.d.addressContracts {
ac[k] = a
- delete(b.addressContracts, k)
- if len(ac) >= partialStoreAddrContracts {
+ delete(b.d.addressContracts, k)
+ if len(ac) >= (b.maxBulkAddrContracts / 10) {
break
}
}
@@ -299,20 +301,20 @@ func (b *BulkConnect) parallelStoreAddressContracts(c chan error, all bool) {
c <- err
return
}
- glog.Info("rocksdb: height ", b.height, ", stored ", count, " addressContracts, ", len(b.addressContracts), " remaining, done in ", time.Since(start))
+ glog.Info("rocksdb: height ", b.height, ", stored ", count, " addressContracts, ", len(b.d.addressContracts), " remaining, done in ", time.Since(start))
c <- nil
}
func (b *BulkConnect) connectBlockEthereumType(block *bchain.Block, storeBlockTxs bool) error {
addresses := make(addressesMap)
- blockTxs, err := b.d.processAddressesEthereumType(block, addresses, b.addressContracts)
+ blockTxs, err := b.d.processAddressesEthereumType(block, addresses, nil)
if err != nil {
return err
}
b.ethBlockTxs = append(b.ethBlockTxs, blockTxs...)
var storeAddrContracts chan error
var sa bool
- if len(b.addressContracts) > maxBulkAddrContracts {
+ if len(b.d.addressContracts) > b.maxBulkAddrContracts {
sa = true
storeAddrContracts = make(chan error)
go b.parallelStoreAddressContracts(storeAddrContracts, false)
diff --git a/db/rocksdb.go b/db/rocksdb.go
index 58e269d743..b82847125c 100644
--- a/db/rocksdb.go
+++ b/db/rocksdb.go
@@ -5,6 +5,7 @@ import (
"encoding/binary"
"encoding/hex"
"fmt"
+ "math"
"math/big"
"os"
"path/filepath"
@@ -59,18 +60,21 @@ const (
// RocksDB handle
type RocksDB struct {
- path string
- db *grocksdb.DB
- wo *grocksdb.WriteOptions
- ro *grocksdb.ReadOptions
- cfh []*grocksdb.ColumnFamilyHandle
- chainParser bchain.BlockChainParser
- is *common.InternalState
- metrics *common.Metrics
- cache *grocksdb.Cache
- maxOpenFiles int
- cbs connectBlockStats
- extendedIndex bool
+ path string
+ db *grocksdb.DB
+ wo *grocksdb.WriteOptions
+ ro *grocksdb.ReadOptions
+ cfh []*grocksdb.ColumnFamilyHandle
+ chainParser bchain.BlockChainParser
+ is *common.InternalState
+ metrics *common.Metrics
+ cache *grocksdb.Cache
+ maxOpenFiles int
+ cbs connectBlockStats
+ extendedIndex bool
+ maxAddrContracts int
+ addressContracts map[string]*AddrContracts
+ protoAddrContracts bool
}
const (
@@ -128,7 +132,7 @@ func openDB(path string, c *grocksdb.Cache, openFiles int) (*grocksdb.DB, []*gro
// NewRocksDB opens an internal handle to RocksDB environment. Close
// needs to be called to release it.
-func NewRocksDB(path string, cacheSize, maxOpenFiles int, parser bchain.BlockChainParser, metrics *common.Metrics, extendedIndex bool) (d *RocksDB, err error) {
+func NewRocksDB(path string, cacheSize, maxOpenFiles int, parser bchain.BlockChainParser, metrics *common.Metrics, extendedIndex bool, maxAddrContracts int, protoAddrContracts bool) (*RocksDB, error) {
glog.Infof("rocksdb: opening %s, required data version %v, cache size %v, max open files %v", path, dbVersion, cacheSize, maxOpenFiles)
cfNames = append([]string{}, cfBaseNames...)
@@ -147,9 +151,24 @@ func NewRocksDB(path string, cacheSize, maxOpenFiles int, parser bchain.BlockCha
if err != nil {
return nil, err
}
- wo := grocksdb.NewDefaultWriteOptions()
- ro := grocksdb.NewDefaultReadOptions()
- return &RocksDB{path, db, wo, ro, cfh, parser, nil, metrics, c, maxOpenFiles, connectBlockStats{}, extendedIndex}, nil
+ d := &RocksDB{
+ path: path,
+ db: db,
+ wo: grocksdb.NewDefaultWriteOptions(),
+ ro: grocksdb.NewDefaultReadOptions(),
+ cfh: cfh,
+ chainParser: parser,
+ is: nil,
+ metrics: metrics,
+ cache: c,
+ maxOpenFiles: maxOpenFiles,
+ cbs: connectBlockStats{},
+ extendedIndex: extendedIndex,
+ maxAddrContracts: maxAddrContracts,
+ addressContracts: make(map[string]*AddrContracts),
+ protoAddrContracts: protoAddrContracts,
+ }
+ return d, nil
}
func (d *RocksDB) closeDB() error {
@@ -331,6 +350,22 @@ const (
opDelete = 1
)
+func (d *RocksDB) pruneAddressContracts(attempt float64) {
+ desiredSize := d.maxAddrContracts / 2
+ threshold := math.Pow(10, attempt)
+ for k, v := range d.addressContracts {
+ if len(d.addressContracts) == desiredSize {
+ break
+ }
+ if len(v.Contracts) < int(threshold) {
+ delete(d.addressContracts, k)
+ }
+ }
+ if len(d.addressContracts) > desiredSize {
+ d.pruneAddressContracts(attempt + 1)
+ }
+}
+
// ConnectBlock indexes addresses in the block and stores them in db
func (d *RocksDB) ConnectBlock(block *bchain.Block) error {
wb := grocksdb.NewWriteBatch()
@@ -375,6 +410,9 @@ func (d *RocksDB) ConnectBlock(block *bchain.Block) error {
}
}
} else if chainType == bchain.ChainEthereumType {
+ if d.maxAddrContracts > 0 && len(d.addressContracts) > d.maxAddrContracts {
+ d.pruneAddressContracts(1)
+ }
addressContracts := make(map[string]*AddrContracts)
blockTxs, err := d.processAddressesEthereumType(block, addresses, addressContracts)
if err != nil {
diff --git a/db/rocksdb_ethereumtype.go b/db/rocksdb_ethereumtype.go
index 11371a7914..2f68b8a65c 100644
--- a/db/rocksdb_ethereumtype.go
+++ b/db/rocksdb_ethereumtype.go
@@ -14,6 +14,7 @@ import (
"github.com/linxGnu/grocksdb"
"github.com/trezor/blockbook/bchain"
"github.com/trezor/blockbook/bchain/coins/eth"
+ "google.golang.org/protobuf/proto"
)
const InternalTxIndexOffset = 1
@@ -108,7 +109,7 @@ func (s *MultiTokenValues) upsert(m bchain.MultiTokenValue, index int32, aggrega
// AddrContract is Contract address with number of transactions done by given address
type AddrContract struct {
- Type bchain.TokenType
+ Standard bchain.TokenStandard
Contract bchain.AddressDescriptor
Txs uint
Value big.Int // single value of ERC20
@@ -124,8 +125,41 @@ type AddrContracts struct {
Contracts []AddrContract
}
-// packAddrContracts packs AddrContracts into a byte buffer
-func packAddrContracts(acs *AddrContracts) []byte {
+// packAddrContract packs AddrContracts into a protobuf encoded byte slice
+func packAddrContracts(acs *AddrContracts) ([]byte, error) {
+ ptContracts := make([]*eth.ProtoAddrContracts_AddrContract, len(acs.Contracts))
+ for i, c := range acs.Contracts {
+ ptIds := make([][]byte, len(c.Ids))
+ for j, id := range c.Ids {
+ ptIds[j] = id.Bytes()
+ }
+ ptMultiTokenValues := make([]*eth.ProtoAddrContracts_MultiTokenValue, len(c.MultiTokenValues))
+ for k, mtv := range c.MultiTokenValues {
+ ptMultiTokenValues[k] = ð.ProtoAddrContracts_MultiTokenValue{
+ Id: mtv.Id.Bytes(),
+ Value: mtv.Value.Bytes(),
+ }
+ }
+ ptContracts[i] = ð.ProtoAddrContracts_AddrContract{
+ Contract: c.Contract,
+ Ids: ptIds,
+ MultiTokenValues: ptMultiTokenValues,
+ Standard: int64(c.Standard),
+ Txs: uint64(c.Txs),
+ Value: c.Value.Bytes(),
+ }
+ }
+ pt := ð.ProtoAddrContracts{
+ TotalTxs: uint64(acs.TotalTxs),
+ InternalTxs: uint64(acs.InternalTxs),
+ NonContractTxs: uint64(acs.NonContractTxs),
+ Contracts: ptContracts,
+ }
+ return proto.Marshal(pt)
+}
+
+// packAddrContractsLegacy packs AddrContracts into a legacy manual byte slice
+func packAddrContractsLegacy(acs *AddrContracts) []byte {
buf := make([]byte, 0, 128)
varBuf := make([]byte, maxPackedBigintBytes)
l := packVaruint(acs.TotalTxs, varBuf)
@@ -136,12 +170,12 @@ func packAddrContracts(acs *AddrContracts) []byte {
buf = append(buf, varBuf[:l]...)
for _, ac := range acs.Contracts {
buf = append(buf, ac.Contract...)
- l = packVaruint(uint(ac.Type)+ac.Txs<<2, varBuf)
+ l = packVaruint(uint(ac.Standard)+ac.Txs<<2, varBuf)
buf = append(buf, varBuf[:l]...)
- if ac.Type == bchain.FungibleToken {
+ if ac.Standard == bchain.FungibleToken {
l = packBigint(&ac.Value, varBuf)
buf = append(buf, varBuf[:l]...)
- } else if ac.Type == bchain.NonFungibleToken {
+ } else if ac.Standard == bchain.NonFungibleToken {
l = packVaruint(uint(len(ac.Ids)), varBuf)
buf = append(buf, varBuf[:l]...)
for i := range ac.Ids {
@@ -162,7 +196,50 @@ func packAddrContracts(acs *AddrContracts) []byte {
return buf
}
+// unpackAddrContract unpacks the protobuf encoded byte slice into AddrContracts
func unpackAddrContracts(buf []byte, addrDesc bchain.AddressDescriptor) (*AddrContracts, error) {
+ pt := ð.ProtoAddrContracts{}
+ err := proto.Unmarshal(buf, pt)
+ if err != nil {
+ return unpackAddrContractsLegacy(buf, addrDesc)
+ }
+ contracts := make([]AddrContract, len(pt.Contracts))
+ for i, c := range pt.Contracts {
+ var ids []big.Int
+ if len(c.Ids) > 0 {
+ ids = make([]big.Int, len(c.Ids))
+ for j, id := range c.Ids {
+ ids[j].SetBytes(id)
+ }
+ }
+ var multiTokenValues MultiTokenValues
+ if len(c.MultiTokenValues) > 0 {
+ multiTokenValues = make(MultiTokenValues, len(c.MultiTokenValues))
+ for k, mtv := range c.MultiTokenValues {
+ multiTokenValues[k].Id.SetBytes(mtv.Id)
+ multiTokenValues[k].Value.SetBytes(mtv.Value)
+ }
+ }
+ contracts[i] = AddrContract{
+ Standard: bchain.TokenStandard(c.Standard),
+ Contract: c.Contract,
+ Txs: uint(c.Txs),
+ Value: *new(big.Int).SetBytes(c.Value),
+ Ids: ids,
+ MultiTokenValues: multiTokenValues,
+ }
+ }
+ acs := &AddrContracts{
+ TotalTxs: uint(pt.TotalTxs),
+ NonContractTxs: uint(pt.NonContractTxs),
+ InternalTxs: uint(pt.InternalTxs),
+ Contracts: contracts,
+ }
+ return acs, nil
+}
+
+// unpackAddrContractsLegacy unpacks AddrContracts from legacy manual packed byte slice
+func unpackAddrContractsLegacy(buf []byte, addrDesc bchain.AddressDescriptor) (*AddrContracts, error) {
tt, l := unpackVaruint(buf)
buf = buf[l:]
nct, l := unpackVaruint(buf)
@@ -177,21 +254,21 @@ func unpackAddrContracts(buf []byte, addrDesc bchain.AddressDescriptor) (*AddrCo
contract := append(bchain.AddressDescriptor(nil), buf[:eth.EthereumTypeAddressDescriptorLen]...)
txs, l := unpackVaruint(buf[eth.EthereumTypeAddressDescriptorLen:])
buf = buf[eth.EthereumTypeAddressDescriptorLen+l:]
- ttt := bchain.TokenType(txs & 3)
+ standard := bchain.TokenStandard(txs & 3)
txs >>= 2
ac := AddrContract{
- Type: ttt,
+ Standard: standard,
Contract: contract,
Txs: txs,
}
- if ttt == bchain.FungibleToken {
+ if standard == bchain.FungibleToken {
b, ll := unpackBigint(buf)
buf = buf[ll:]
ac.Value = b
} else {
len, ll := unpackVaruint(buf)
buf = buf[ll:]
- if ttt == bchain.NonFungibleToken {
+ if standard == bchain.NonFungibleToken {
ac.Ids = make(Ids, len)
for i := uint(0); i < len; i++ {
b, ll := unpackBigint(buf)
@@ -221,13 +298,26 @@ func unpackAddrContracts(buf []byte, addrDesc bchain.AddressDescriptor) (*AddrCo
}
func (d *RocksDB) storeAddressContracts(wb *grocksdb.WriteBatch, acm map[string]*AddrContracts) error {
+ defer func() {
+ if d.maxAddrContracts == 0 {
+ d.addressContracts = make(map[string]*AddrContracts)
+ }
+ }()
for addrDesc, acs := range acm {
// address with 0 contracts is removed from db - happens on disconnect
if acs == nil || (acs.NonContractTxs == 0 && acs.InternalTxs == 0 && len(acs.Contracts) == 0) {
wb.DeleteCF(d.cfh[cfAddressContracts], bchain.AddressDescriptor(addrDesc))
} else {
- buf := packAddrContracts(acs)
- wb.PutCF(d.cfh[cfAddressContracts], bchain.AddressDescriptor(addrDesc), buf)
+ if d.protoAddrContracts {
+ buf, err := packAddrContracts(acs)
+ if err != nil {
+ return err
+ }
+ wb.PutCF(d.cfh[cfAddressContracts], bchain.AddressDescriptor(addrDesc), buf)
+ } else {
+ buf := packAddrContractsLegacy(acs)
+ wb.PutCF(d.cfh[cfAddressContracts], bchain.AddressDescriptor(addrDesc), buf)
+ }
}
}
return nil
@@ -244,7 +334,11 @@ func (d *RocksDB) GetAddrDescContracts(addrDesc bchain.AddressDescriptor) (*Addr
if len(buf) == 0 {
return nil, nil
}
- return unpackAddrContracts(buf, addrDesc)
+ if d.protoAddrContracts {
+ return unpackAddrContracts(buf, addrDesc)
+ } else {
+ return unpackAddrContractsLegacy(buf, addrDesc)
+ }
}
func findContractInAddressContracts(contract bchain.AddressDescriptor, contracts []AddrContract) (int, bool) {
@@ -316,9 +410,9 @@ func addToContract(c *AddrContract, contractIndex int, index int32, contract bch
s.Add(s, v)
}
}
- if transfer.Type == bchain.FungibleToken {
+ if transfer.Standard == bchain.FungibleToken {
aggregate(&c.Value, &transfer.Value)
- } else if transfer.Type == bchain.NonFungibleToken {
+ } else if transfer.Standard == bchain.NonFungibleToken {
if index < 0 {
c.Ids.remove(transfer.Value)
} else {
@@ -338,7 +432,7 @@ func addToContract(c *AddrContract, contractIndex int, index int32, contract bch
func (d *RocksDB) addToAddressesAndContractsEthereumType(addrDesc bchain.AddressDescriptor, btxID []byte, index int32, contract bchain.AddressDescriptor, transfer *bchain.TokenTransfer, addTxCount bool, addresses addressesMap, addressContracts map[string]*AddrContracts) error {
var err error
strAddrDesc := string(addrDesc)
- ac, e := addressContracts[strAddrDesc]
+ ac, e := d.addressContracts[strAddrDesc]
if !e {
ac, err = d.GetAddrDescContracts(addrDesc)
if err != nil {
@@ -347,9 +441,15 @@ func (d *RocksDB) addToAddressesAndContractsEthereumType(addrDesc bchain.Address
if ac == nil {
ac = &AddrContracts{}
}
- addressContracts[strAddrDesc] = ac
+ if addressContracts != nil {
+ addressContracts[strAddrDesc] = ac
+ }
+ d.addressContracts[strAddrDesc] = ac
d.cbs.balancesMiss++
} else {
+ if addressContracts != nil {
+ addressContracts[strAddrDesc] = ac
+ }
d.cbs.balancesHit++
}
if contract == nil {
@@ -369,7 +469,7 @@ func (d *RocksDB) addToAddressesAndContractsEthereumType(addrDesc bchain.Address
contractIndex = len(ac.Contracts)
ac.Contracts = append(ac.Contracts, AddrContract{
Contract: contract,
- Type: transfer.Type,
+ Standard: transfer.Standard,
})
}
c := &ac.Contracts[contractIndex]
@@ -391,7 +491,7 @@ func (d *RocksDB) addToAddressesAndContractsEthereumType(addrDesc bchain.Address
type ethBlockTxContract struct {
from, to, contract bchain.AddressDescriptor
- transferType bchain.TokenType
+ transferStandard bchain.TokenStandard
value big.Int
idValues []bchain.MultiTokenValue
}
@@ -566,7 +666,7 @@ func (d *RocksDB) processContractTransfers(blockTx *ethBlockTx, tx *bchain.Tx, a
return err
}
bc := &blockTx.contracts[i]
- bc.transferType = t.Type
+ bc.transferStandard = t.Standard
bc.from = from
bc.to = to
bc.contract = contract
@@ -847,7 +947,7 @@ var cachedContractsMux sync.Mutex
func packContractInfo(contractInfo *bchain.ContractInfo) []byte {
buf := packString(contractInfo.Name)
buf = append(buf, packString(contractInfo.Symbol)...)
- buf = append(buf, packString(string(contractInfo.Type))...)
+ buf = append(buf, packString(string(contractInfo.Standard))...)
varBuf := make([]byte, vlq.MaxLen64)
l := packVaruint(uint(contractInfo.Decimals), varBuf)
buf = append(buf, varBuf[:l]...)
@@ -868,7 +968,7 @@ func unpackContractInfo(buf []byte) (*bchain.ContractInfo, error) {
contractInfo.Symbol, l = unpackString(buf)
buf = buf[l:]
s, l = unpackString(buf)
- contractInfo.Type = bchain.TokenTypeName(s)
+ contractInfo.Standard = bchain.TokenStandardName(s)
buf = buf[l:]
ui, l = unpackVaruint(buf)
contractInfo.Decimals = int(ui)
@@ -889,9 +989,9 @@ func (d *RocksDB) GetContractInfoForAddress(address string) (*bchain.ContractInf
return d.GetContractInfo(contract, "")
}
-// GetContractInfo gets contract from cache or DB and possibly updates the type from typeFromContext
-// it is hard to guess the type of the contract using API, it is easier to set it the first time the contract is processed in a tx
-func (d *RocksDB) GetContractInfo(contract bchain.AddressDescriptor, typeFromContext bchain.TokenTypeName) (*bchain.ContractInfo, error) {
+// GetContractInfo gets contract from cache or DB and possibly updates the standard from standardFromContext
+// it is hard to guess the standard of the contract using API, it is easier to set it the first time the contract is processed in a tx
+func (d *RocksDB) GetContractInfo(contract bchain.AddressDescriptor, standardFromContext bchain.TokenStandardName) (*bchain.ContractInfo, error) {
cacheKey := string(contract)
cachedContractsMux.Lock()
contractInfo, found := cachedContracts[cacheKey]
@@ -911,9 +1011,9 @@ func (d *RocksDB) GetContractInfo(contract bchain.AddressDescriptor, typeFromCon
if len(addresses) > 0 {
contractInfo.Contract = addresses[0]
}
- // if the type is specified and stored contractInfo has unknown type, set and store it
- if typeFromContext != bchain.UnknownTokenType && contractInfo.Type == bchain.UnknownTokenType {
- contractInfo.Type = typeFromContext
+ // if the standard is specified and stored contractInfo has unknown standard, set and store it
+ if standardFromContext != bchain.UnknownTokenStandard && contractInfo.Standard == bchain.UnknownTokenStandard {
+ contractInfo.Standard = standardFromContext
err = d.db.PutCF(d.wo, d.cfh[cfContracts], contract, packContractInfo(contractInfo))
if err != nil {
return nil, err
@@ -978,9 +1078,9 @@ func packBlockTx(buf []byte, blockTx *ethBlockTx) []byte {
buf = appendAddress(buf, c.from)
buf = appendAddress(buf, c.to)
buf = appendAddress(buf, c.contract)
- l = packVaruint(uint(c.transferType), varBuf)
+ l = packVaruint(uint(c.transferStandard), varBuf)
buf = append(buf, varBuf[:l]...)
- if c.transferType == bchain.MultiToken {
+ if c.transferStandard == bchain.MultiToken {
l = packVaruint(uint(len(c.idValues)), varBuf)
buf = append(buf, varBuf[:l]...)
for i := range c.idValues {
@@ -1142,9 +1242,9 @@ func unpackBlockTx(buf []byte, pos int) (*ethBlockTx, int, error) {
return nil, 0, err
}
cc, l = unpackVaruint(buf[pos:])
- c.transferType = bchain.TokenType(cc)
+ c.transferStandard = bchain.TokenStandard(cc)
pos += l
- if c.transferType == bchain.MultiToken {
+ if c.transferStandard == bchain.MultiToken {
cc, l = unpackVaruint(buf[pos:])
pos += l
c.idValues = make([]bchain.MultiTokenValue, cc)
@@ -1257,7 +1357,7 @@ func (d *RocksDB) disconnectAddress(btxID []byte, internal bool, addrDesc bchain
index = transferTo
}
addToContract(addrContract, contractIndex, index, btxContract.contract, &bchain.TokenTransfer{
- Type: btxContract.transferType,
+ Standard: btxContract.transferStandard,
Value: btxContract.value,
MultiTokenValues: btxContract.idValues,
}, false)
@@ -1387,7 +1487,9 @@ func (d *RocksDB) DisconnectBlockRangeEthereumType(lower uint32, higher uint32)
wb.DeleteCF(d.cfh[cfHeight], key)
wb.DeleteCF(d.cfh[cfBlockInternalDataErrors], key)
}
- d.storeAddressContracts(wb, contracts)
+ if err := d.storeAddressContracts(wb, contracts); err != nil {
+ return err
+ }
err := d.WriteBatch(wb)
if err == nil {
d.is.RemoveLastBlockTimes(int(higher-lower) + 1)
@@ -1418,7 +1520,13 @@ func (d *RocksDB) SortAddressContracts(stop chan os.Signal) error {
addrDesc := it.Key().Data()
buf := it.Value().Data()
if len(buf) > 0 {
- ca, err := unpackAddrContracts(buf, addrDesc)
+ var ca *AddrContracts
+ var err error
+ if d.protoAddrContracts {
+ ca, err = unpackAddrContracts(buf, addrDesc)
+ } else {
+ ca, err = unpackAddrContractsLegacy(buf, addrDesc)
+ }
if err != nil {
glog.Error("failed to unpack AddrContracts for: ", hex.EncodeToString(addrDesc))
}
@@ -1438,8 +1546,16 @@ func (d *RocksDB) SortAddressContracts(stop chan os.Signal) error {
if err := func() error {
wb := grocksdb.NewWriteBatch()
defer wb.Destroy()
- buf := packAddrContracts(ca)
- wb.PutCF(d.cfh[cfAddressContracts], addrDesc, buf)
+ if d.protoAddrContracts {
+ buf, err := packAddrContracts(ca)
+ if err != nil {
+ return err
+ }
+ wb.PutCF(d.cfh[cfAddressContracts], addrDesc, buf)
+ } else {
+ buf := packAddrContractsLegacy(ca)
+ wb.PutCF(d.cfh[cfAddressContracts], addrDesc, buf)
+ }
return d.WriteBatch(wb)
}(); err != nil {
return errors.Errorf("failed to write cfAddressContracts for: %v: %v", addrDesc, err)
diff --git a/db/rocksdb_ethereumtype_test.go b/db/rocksdb_ethereumtype_test.go
index c08c5e3eaa..45039a05d5 100644
--- a/db/rocksdb_ethereumtype_test.go
+++ b/db/rocksdb_ethereumtype_test.go
@@ -729,6 +729,84 @@ func Test_packUnpackEthInternalData(t *testing.T) {
}
}
+func Test_packUnpackAddrContractsLegacy(t *testing.T) {
+ parser := ethereumTestnetParser()
+ type args struct {
+ buf []byte
+ addrDesc bchain.AddressDescriptor
+ }
+ tests := []struct {
+ name string
+ data AddrContracts
+ }{
+ {
+ name: "1",
+ data: AddrContracts{
+ TotalTxs: 30,
+ NonContractTxs: 20,
+ InternalTxs: 10,
+ Contracts: []AddrContract{},
+ },
+ },
+ {
+ name: "2",
+ data: AddrContracts{
+ TotalTxs: 12345,
+ NonContractTxs: 444,
+ InternalTxs: 8873,
+ Contracts: []AddrContract{
+ {
+ Standard: bchain.FungibleToken,
+ Contract: addressToAddrDesc(dbtestdata.EthAddrContract0d, parser),
+ Txs: 8,
+ Value: *big.NewInt(793201132),
+ },
+ {
+ Standard: bchain.NonFungibleToken,
+ Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
+ Txs: 41235,
+ Ids: Ids{
+ *big.NewInt(1),
+ *big.NewInt(2),
+ *big.NewInt(3),
+ *big.NewInt(3144223412344123),
+ *big.NewInt(5),
+ },
+ },
+ {
+ Standard: bchain.MultiToken,
+ Contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
+ Txs: 64,
+ MultiTokenValues: MultiTokenValues{
+ {
+ Id: *big.NewInt(1),
+ Value: *big.NewInt(1412341234),
+ },
+ {
+ Id: *big.NewInt(123412341234),
+ Value: *big.NewInt(3),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ packed := packAddrContractsLegacy(&tt.data)
+ got, err := unpackAddrContractsLegacy(packed, nil)
+ if err != nil {
+ t.Errorf("unpackAddrContractsLegacy() error = %v", err)
+ return
+ }
+ if !reflect.DeepEqual(got, &tt.data) {
+ t.Errorf("unpackAddrContractsLegacy() = %v, want %v", got, &tt.data)
+ }
+ })
+ }
+}
+
func Test_packUnpackAddrContracts(t *testing.T) {
parser := ethereumTestnetParser()
type args struct {
@@ -756,13 +834,13 @@ func Test_packUnpackAddrContracts(t *testing.T) {
InternalTxs: 8873,
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract0d, parser),
Txs: 8,
Value: *big.NewInt(793201132),
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Txs: 41235,
Ids: Ids{
@@ -774,7 +852,7 @@ func Test_packUnpackAddrContracts(t *testing.T) {
},
},
{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
Txs: 64,
MultiTokenValues: MultiTokenValues{
@@ -794,14 +872,18 @@ func Test_packUnpackAddrContracts(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- packed := packAddrContracts(&tt.data)
+ packed, err := packAddrContracts(&tt.data)
+ if err != nil {
+ t.Errorf("packAddrContracts() error = %v", err)
+ return
+ }
got, err := unpackAddrContracts(packed, nil)
if err != nil {
t.Errorf("unpackAddrContracts() error = %v", err)
return
}
if !reflect.DeepEqual(got, &tt.data) {
- t.Errorf("unpackAddrContracts() = %v, want %v", got, tt.data)
+ t.Errorf("unpackAddrContracts() = %+v, want %+v", got, &tt.data)
}
})
}
@@ -830,8 +912,8 @@ func Test_addToContracts(t *testing.T) {
index: 1,
contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.FungibleToken,
- Value: *big.NewInt(123456),
+ Standard: bchain.FungibleToken,
+ Value: *big.NewInt(123456),
},
addTxCount: true,
},
@@ -839,7 +921,7 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Txs: 1,
Value: *big.NewInt(123456),
@@ -853,8 +935,8 @@ func Test_addToContracts(t *testing.T) {
index: ^1,
contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.FungibleToken,
- Value: *big.NewInt(23456),
+ Standard: bchain.FungibleToken,
+ Value: *big.NewInt(23456),
},
addTxCount: true,
},
@@ -862,7 +944,7 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
@@ -876,8 +958,8 @@ func Test_addToContracts(t *testing.T) {
index: 1,
contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.NonFungibleToken,
- Value: *big.NewInt(1),
+ Standard: bchain.NonFungibleToken,
+ Value: *big.NewInt(1),
},
addTxCount: true,
},
@@ -885,13 +967,13 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
Txs: 1,
Ids: Ids{*big.NewInt(1)},
@@ -905,8 +987,8 @@ func Test_addToContracts(t *testing.T) {
index: 1,
contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.NonFungibleToken,
- Value: *big.NewInt(2),
+ Standard: bchain.NonFungibleToken,
+ Value: *big.NewInt(2),
},
addTxCount: true,
},
@@ -914,13 +996,13 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
Txs: 2,
Ids: Ids{*big.NewInt(1), *big.NewInt(2)},
@@ -934,8 +1016,8 @@ func Test_addToContracts(t *testing.T) {
index: ^1,
contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.NonFungibleToken,
- Value: *big.NewInt(1),
+ Standard: bchain.NonFungibleToken,
+ Value: *big.NewInt(1),
},
addTxCount: false,
},
@@ -943,13 +1025,13 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
Txs: 2,
Ids: Ids{*big.NewInt(2)},
@@ -963,7 +1045,7 @@ func Test_addToContracts(t *testing.T) {
index: 1,
contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
MultiTokenValues: []bchain.MultiTokenValue{
{
Id: *big.NewInt(11),
@@ -977,19 +1059,19 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
Txs: 2,
Ids: Ids{*big.NewInt(2)},
},
{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
Txs: 1,
MultiTokenValues: MultiTokenValues{
@@ -1008,7 +1090,7 @@ func Test_addToContracts(t *testing.T) {
index: 1,
contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
MultiTokenValues: []bchain.MultiTokenValue{
{
Id: *big.NewInt(11),
@@ -1026,19 +1108,19 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
Txs: 2,
Ids: Ids{*big.NewInt(2)},
},
{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
Txs: 2,
MultiTokenValues: MultiTokenValues{
@@ -1061,7 +1143,7 @@ func Test_addToContracts(t *testing.T) {
index: ^1,
contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
transfer: &bchain.TokenTransfer{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
MultiTokenValues: []bchain.MultiTokenValue{
{
Id: *big.NewInt(11),
@@ -1079,19 +1161,19 @@ func Test_addToContracts(t *testing.T) {
wantAddrContracts: &AddrContracts{
Contracts: []AddrContract{
{
- Type: bchain.FungibleToken,
+ Standard: bchain.FungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
Value: *big.NewInt(100000),
Txs: 2,
},
{
- Type: bchain.NonFungibleToken,
+ Standard: bchain.NonFungibleToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
Txs: 2,
Ids: Ids{*big.NewInt(2)},
},
{
- Type: bchain.MultiToken,
+ Standard: bchain.MultiToken,
Contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
Txs: 3,
MultiTokenValues: MultiTokenValues{
@@ -1112,7 +1194,7 @@ func Test_addToContracts(t *testing.T) {
contractIndex = len(addrContracts.Contracts)
addrContracts.Contracts = append(addrContracts.Contracts, AddrContract{
Contract: tt.args.contract,
- Type: tt.args.transfer.Type,
+ Standard: tt.args.transfer.Standard,
})
}
if got := addToContract(&addrContracts.Contracts[contractIndex], contractIndex, tt.args.index, tt.args.contract, tt.args.transfer, tt.args.addTxCount); got != tt.wantIndex {
@@ -1150,11 +1232,11 @@ func Test_packUnpackBlockTx(t *testing.T) {
to: addressToAddrDesc(dbtestdata.EthAddr55, parser),
contracts: []ethBlockTxContract{
{
- from: addressToAddrDesc(dbtestdata.EthAddr20, parser),
- to: addressToAddrDesc(dbtestdata.EthAddr5d, parser),
- contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
- transferType: bchain.FungibleToken,
- value: *big.NewInt(10000),
+ from: addressToAddrDesc(dbtestdata.EthAddr20, parser),
+ to: addressToAddrDesc(dbtestdata.EthAddr5d, parser),
+ contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
+ transferStandard: bchain.FungibleToken,
+ value: *big.NewInt(10000),
},
},
},
@@ -1168,24 +1250,24 @@ func Test_packUnpackBlockTx(t *testing.T) {
to: addressToAddrDesc(dbtestdata.EthAddr55, parser),
contracts: []ethBlockTxContract{
{
- from: addressToAddrDesc(dbtestdata.EthAddr20, parser),
- to: addressToAddrDesc(dbtestdata.EthAddr3e, parser),
- contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
- transferType: bchain.FungibleToken,
- value: *big.NewInt(987654321),
+ from: addressToAddrDesc(dbtestdata.EthAddr20, parser),
+ to: addressToAddrDesc(dbtestdata.EthAddr3e, parser),
+ contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
+ transferStandard: bchain.FungibleToken,
+ value: *big.NewInt(987654321),
},
{
- from: addressToAddrDesc(dbtestdata.EthAddr4b, parser),
- to: addressToAddrDesc(dbtestdata.EthAddr55, parser),
- contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
- transferType: bchain.NonFungibleToken,
- value: *big.NewInt(13),
+ from: addressToAddrDesc(dbtestdata.EthAddr4b, parser),
+ to: addressToAddrDesc(dbtestdata.EthAddr55, parser),
+ contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
+ transferStandard: bchain.NonFungibleToken,
+ value: *big.NewInt(13),
},
{
- from: addressToAddrDesc(dbtestdata.EthAddr5d, parser),
- to: addressToAddrDesc(dbtestdata.EthAddr7b, parser),
- contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
- transferType: bchain.MultiToken,
+ from: addressToAddrDesc(dbtestdata.EthAddr5d, parser),
+ to: addressToAddrDesc(dbtestdata.EthAddr7b, parser),
+ contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
+ transferStandard: bchain.MultiToken,
idValues: []bchain.MultiTokenValue{
{
Id: *big.NewInt(1234),
@@ -1269,7 +1351,7 @@ func Test_packUnpackContractInfo(t *testing.T) {
{
name: "unknown",
contractInfo: bchain.ContractInfo{
- Type: bchain.UnknownTokenType,
+ Standard: bchain.UnknownTokenStandard,
Name: "Test contract",
Symbol: "TCT",
Decimals: 18,
@@ -1280,7 +1362,7 @@ func Test_packUnpackContractInfo(t *testing.T) {
{
name: "ERC20",
contractInfo: bchain.ContractInfo{
- Type: bchain.ERC20TokenType,
+ Standard: bchain.ERC20TokenStandard,
Name: "GreenContract🟢",
Symbol: "🟢",
Decimals: 0,
diff --git a/db/rocksdb_test.go b/db/rocksdb_test.go
index 1204b0c3c0..b2d5e5aff7 100644
--- a/db/rocksdb_test.go
+++ b/db/rocksdb_test.go
@@ -47,7 +47,7 @@ func setupRocksDB(t *testing.T, p bchain.BlockChainParser) *RocksDB {
if err != nil {
t.Fatal(err)
}
- d, err := NewRocksDB(tmp, 100000, -1, p, nil, false)
+ d, err := NewRocksDB(tmp, 100000, -1, p, nil, false, 0, false)
if err != nil {
t.Fatal(err)
}
diff --git a/docs/ports.md b/docs/ports.md
index fe51bbb8ef..b99743c669 100644
--- a/docs/ports.md
+++ b/docs/ports.md
@@ -1,7 +1,7 @@
# Registry of ports
| coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) |
-| -------------------------------- | ---------------- | ------------------ | ----------- | --------------------------------------------------- |
+|----------------------------------|------------------|--------------------|-------------|-----------------------------------------------------|
| Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc |
| Bitcoin | 9130 | 9030 | 8030 | 38330 |
| Bitcoin Cash | 9131 | 9031 | 8031 | 38331 |
@@ -59,6 +59,8 @@
| Arbitrum Archive | 9306 | 9206 | 8306 | 38406 p2p |
| Arbitrum Nova | 9307 | 9207 | 8207 | 38407 p2p, 8307 http |
| Arbitrum Nova Archive | 9308 | 9208 | 8308 | 38408 p2p |
+| Base | 9309 | 9209 | 8309 | 38409 p2p, 8209 http, 8409 authrpc |
+| Base Archive | 9311 | 9211 | 8211 | 38411 p2p, 8311 http, 8411 authrpc |
| Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p |
| Bitcoin Signet | 19120 | 19020 | 18020 | 48320 |
| Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 |
diff --git a/fiat/fiat_rates_test.go b/fiat/fiat_rates_test.go
index fad58acfca..b9e02b1113 100644
--- a/fiat/fiat_rates_test.go
+++ b/fiat/fiat_rates_test.go
@@ -35,7 +35,7 @@ func setupRocksDB(t *testing.T, parser bchain.BlockChainParser, config *common.C
if err != nil {
t.Fatal(err)
}
- d, err := db.NewRocksDB(tmp, 100000, -1, parser, nil, false)
+ d, err := db.NewRocksDB(tmp, 100000, -1, parser, nil, false, 0, false)
if err != nil {
t.Fatal(err)
}
diff --git a/server/internal.go b/server/internal.go
index 2544c05bd9..e440fbd8e6 100644
--- a/server/internal.go
+++ b/server/internal.go
@@ -242,7 +242,7 @@ func (s *InternalServer) apiContractInfo(r *http.Request, apiVersion int) (inter
return nil, api.NewAPIError("Missing contract address", true)
}
- contractInfo, valid, err := s.api.GetContractInfo(contractAddress, bchain.UnknownTokenType)
+ contractInfo, valid, err := s.api.GetContractInfo(contractAddress, bchain.UnknownTokenStandard)
if err != nil {
return nil, api.NewAPIError(err.Error(), true)
}
diff --git a/server/public.go b/server/public.go
index e2d8c11903..0c81f41cc9 100644
--- a/server/public.go
+++ b/server/public.go
@@ -299,9 +299,9 @@ func (s *PublicServer) newTemplateData(r *http.Request) *TemplateData {
TOSLink: api.Text.TOSLink,
}
if t.ChainType == bchain.ChainEthereumType {
- t.FungibleTokenName = bchain.EthereumTokenTypeMap[bchain.FungibleToken]
- t.NonFungibleTokenName = bchain.EthereumTokenTypeMap[bchain.NonFungibleToken]
- t.MultiTokenName = bchain.EthereumTokenTypeMap[bchain.MultiToken]
+ t.FungibleTokenName = bchain.EthereumTokenStandardMap[bchain.FungibleToken]
+ t.NonFungibleTokenName = bchain.EthereumTokenStandardMap[bchain.NonFungibleToken]
+ t.MultiTokenName = bchain.EthereumTokenStandardMap[bchain.MultiToken]
}
if !s.debug {
t.Minified = ".min.4"
@@ -378,9 +378,9 @@ type TemplateData struct {
CoinLabel string
InternalExplorer bool
ChainType bchain.ChainType
- FungibleTokenName bchain.TokenTypeName
- NonFungibleTokenName bchain.TokenTypeName
- MultiTokenName bchain.TokenTypeName
+ FungibleTokenName bchain.TokenStandardName
+ NonFungibleTokenName bchain.TokenStandardName
+ MultiTokenName bchain.TokenStandardName
Address *api.Address
AddrStr string
Tx *api.Tx
@@ -742,10 +742,10 @@ func isOwnAddress(td *TemplateData, a string) bool {
}
// called from template, returns count of token transfers of given type in a tx
-func tokenTransfersCount(tx *api.Tx, t bchain.TokenTypeName) int {
+func tokenTransfersCount(tx *api.Tx, s bchain.TokenStandardName) int {
count := 0
for i := range tx.TokenTransfers {
- if tx.TokenTransfers[i].Type == t {
+ if tx.TokenTransfers[i].Standard == s {
count++
}
}
@@ -753,10 +753,10 @@ func tokenTransfersCount(tx *api.Tx, t bchain.TokenTypeName) int {
}
// called from template, returns count of tokens in array of given type
-func tokenCount(tokens []api.Token, t bchain.TokenTypeName) int {
+func tokenCount(tokens []api.Token, s bchain.TokenStandardName) int {
count := 0
for i := range tokens {
- if tokens[i].Type == t {
+ if tokens[i].Standard == s {
count++
}
}
diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go
index a0714f4706..89ca59e6db 100644
--- a/server/public_ethereumtype_test.go
+++ b/server/public_ethereumtype_test.go
@@ -51,7 +51,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) {
r: newGetRequest(ts.URL + "/nft/" + dbtestdata.EthAddrContractCd + "/" + "1"),
status: http.StatusOK,
contentType: "text/html; charset=utf-8",
- body: []string{`
Trezor Fake Coin Explorer`},
+ body: []string{`Trezor Fake Coin Explorer`},
},
{
name: "apiIndex",
@@ -72,7 +72,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","balance":"123450075","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":1,"nonTokenTxs":1,"internalTxs":1,"txids":["0xc92919ad24ffd58f760b18df7949f06e1190cf54a50a0e3745a385608ed3cbf2"],"nonce":"75","tokens":[{"type":"ERC20","name":"Contract 13","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","transfers":2,"symbol":"S13","decimals":18,"balance":"1000075013"},{"type":"ERC20","name":"Contract 74","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","transfers":2,"symbol":"S74","decimals":12,"balance":"1000075074"}]}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","balance":"123450075","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":1,"nonTokenTxs":1,"internalTxs":1,"txids":["0xc92919ad24ffd58f760b18df7949f06e1190cf54a50a0e3745a385608ed3cbf2"],"nonce":"75","tokens":[{"type":"ERC20","standard":"ERC20","name":"Contract 13","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","transfers":2,"symbol":"S13","decimals":18,"balance":"1000075013"},{"type":"ERC20","standard":"ERC20","name":"Contract 74","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","transfers":2,"symbol":"S74","decimals":12,"balance":"1000075074"}]}`,
},
},
{
@@ -81,7 +81,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","balance":"123450123","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"transactions":[{"txid":"0xca7628be5c80cda77163729ec63d218ee868a399d827a4682a478c6f48a6e22a","vin":[{"n":0,"addresses":["0x837E3f699d85a4b0B99894567e9233dFB1DcB081"],"isAddress":true}],"vout":[{"value":"0","n":0,"addresses":["0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9"],"isAddress":true}],"blockHeight":-1,"confirmations":0,"blockTime":0,"value":"0","fees":"87945000410410","rbf":true,"coinSpecificData":{"tx":{"nonce":"0x2","gasPrice":"0x59682f07","gas":"0x173a9","to":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","value":"0x0","input":"0x23b872dd000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb0810000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000000000000000000000000000000000000000000001","hash":"0xca7628be5c80cda77163729ec63d218ee868a399d827a4682a478c6f48a6e22a","blockNumber":"0xb33b9f","from":"0x837E3f699d85a4b0B99894567e9233dFB1DcB081","transactionIndex":"0x1"},"receipt":{"gasUsed":"0xe506","status":"0x1","logs":[{"address":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","topics":["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925","0x000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb081","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001"],"data":"0x"},{"address":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb081","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b","0x0000000000000000000000000000000000000000000000000000000000000001"],"data":"0x"}]}},"tokenTransfers":[{"type":"ERC721","from":"0x837E3f699d85a4b0B99894567e9233dFB1DcB081","to":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","contract":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","name":"Contract 205","symbol":"S205","decimals":18,"value":"1"}],"ethereumSpecific":{"status":1,"nonce":2,"gasLimit":95145,"gasUsed":58630,"gasPrice":"1500000007","data":"0x23b872dd000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb0810000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000000000000000000000000000000000000000000001","parsedData":{"methodId":"0x23b872dd","name":""}}},{"txid":"0xc92919ad24ffd58f760b18df7949f06e1190cf54a50a0e3745a385608ed3cbf2","vin":[{"n":0,"addresses":["0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D"],"isAddress":true}],"vout":[{"value":"0","n":0,"addresses":["0x479CC461fEcd078F766eCc58533D6F69580CF3AC"],"isAddress":true}],"blockHeight":-1,"confirmations":0,"blockTime":0,"value":"0","fees":"216368000000000","rbf":true,"coinSpecificData":{"tx":{"nonce":"0x1df76","gasPrice":"0x3b9aca00","gas":"0x3d090","to":"0x479CC461fEcd078F766eCc58533D6F69580CF3AC","value":"0x0","input":"0x4f15078700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a200000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000a5ef5a7656bfb0000000000000000000000000000000000000000000000000000004ba78398d5c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfe0b9579b4ecf7a2801880f644009a324671a79754ea57c3a103c6e70d3dbef6ba69a08000000000000000000000000000000000000000000000000004f937d86afb90000000000000000000000000000000000000000000000000ab280fd8037d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfb784b7c1f3fbe8b75484603ab8adc58aaee3a46245a6579fac7077b5570018b4e0d4eb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000308fd0e798ac00000000000000000000000000000000000000000000000006a8313d60b1f606b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000029de0ccec59e8948e3d905b40e5542335ebc1eb4674db517d2f6392ec7fdeb3d45f3449d313ee2589819c6c79eb1c1b047adae68565c1608e3a1d1d70823febb0000000000000000000000000000000000000000000000000000000000000000234d06fe17f1202e8b07177a30eb64d14adc08cdb3fa1b3e3e0bea0f9672c02175b77c01c51d3c7e460723b27ecbc7801fd6482559a8c9999593f9a4d149c7384","hash":"0xc92919ad24ffd58f760b18df7949f06e1190cf54a50a0e3745a385608ed3cbf2","blockNumber":"0x41eee9","from":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","transactionIndex":"0x24"},"internalData":{"type":1,"contract":"0d0f936ee4c93e25944694d6c121de94d9760f11","transfers":[{"type":0,"from":"4bda106325c335df99eab7fe363cac8a0ba2a24d","to":"9f4981531fda132e83c44680787dfa7ee31e4f8d","value":1000010},{"type":2,"from":"4af4114f73d1c1c903ac9e0361b379d1291808a2","to":"9f4981531fda132e83c44680787dfa7ee31e4f8d","value":1000011}],"Error":""},"receipt":{"gasUsed":"0x34d30","status":"0x1","logs":[{"address":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d"],"data":"0x0000000000000000000000000000000000000000000000006a8313d60b1f8001"},{"address":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f"],"data":"0x000000000000000000000000000000000000000000000000000308fd0e798ac0"},{"address":"0x479CC461fEcd078F766eCc58533D6F69580CF3AC","topics":["0x0d0b9391970d9a25552f37d436d2aae2925e2bfe1b2a923754bada030c498cb3","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f","0x0000000000000000000000000000000000000000000000000000000000000000","0x5af266c0a89a07c1917deaa024414577e6c3c31c8907d079e13eb448c082594f"],"data":"0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000000000000000000000000006a8313d60b1f8001000000000000000000000000000000000000000000000000000308fd0e798ac0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e083a16f4b092c5729a49f9c3ed3cc171bb3d3d0c22e20b1de6063c32f399ac"},{"address":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d"],"data":"0x00000000000000000000000000000000000000000000000000031855667df7a8"},{"address":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b"],"data":"0x0000000000000000000000000000000000000000000000006a8313d60b1f606b"},{"address":"0x479CC461fEcd078F766eCc58533D6F69580CF3AC","topics":["0x0d0b9391970d9a25552f37d436d2aae2925e2bfe1b2a923754bada030c498cb3","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b","0x0000000000000000000000000000000000000000000000000000000000000000","0xb0b69dad58df6032c3b266e19b1045b19c87acd2c06fb0c598090f44b8e263aa"],"data":"0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f1100000000000000000000000000000000000000000000000000031855667df7a80000000000000000000000000000000000000000000000006a8313d60b1f606b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2b0d62c44ed08f2a5adef40c875d20310a42a9d4f488bd26323256fe01c7f48"}]}},"tokenTransfers":[{"type":"ERC20","from":"0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f","to":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","name":"Contract 13","symbol":"S13","decimals":18,"value":"7675000000000000001"},{"type":"ERC20","from":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","to":"0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","name":"Contract 74","symbol":"S74","decimals":12,"value":"854307892726464"},{"type":"ERC20","from":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","to":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","name":"Contract 74","symbol":"S74","decimals":12,"value":"871180000950184"},{"type":"ERC20","from":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","to":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","name":"Contract 13","symbol":"S13","decimals":18,"value":"7674999999999991915"}],"ethereumSpecific":{"status":1,"nonce":122742,"gasLimit":250000,"gasUsed":216368,"gasPrice":"1000000000","data":"0x4f15078700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a200000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000a5ef5a7656bfb0000000000000000000000000000000000000000000000000000004ba78398d5c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfe0b9579b4ecf7a2801880f644009a324671a79754ea57c3a103c6e70d3dbef6ba69a08000000000000000000000000000000000000000000000000004f937d86afb90000000000000000000000000000000000000000000000000ab280fd8037d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfb784b7c1f3fbe8b75484603ab8adc58aaee3a46245a6579fac7077b5570018b4e0d4eb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000308fd0e798ac00000000000000000000000000000000000000000000000006a8313d60b1f606b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000029de0ccec59e8948e3d905b40e5542335ebc1eb4674db517d2f6392ec7fdeb3d45f3449d313ee2589819c6c79eb1c1b047adae68565c1608e3a1d1d70823febb0000000000000000000000000000000000000000000000000000000000000000234d06fe17f1202e8b07177a30eb64d14adc08cdb3fa1b3e3e0bea0f9672c02175b77c01c51d3c7e460723b27ecbc7801fd6482559a8c9999593f9a4d149c7384","parsedData":{"methodId":"0x4f150787","name":""}}}],"nonce":"123","tokens":[{"type":"ERC20","name":"Contract 13","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","transfers":1,"symbol":"S13","decimals":18,"balance":"1000123013"},{"type":"ERC721","name":"Contract 205","contract":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","transfers":1,"symbol":"S205","decimals":18,"ids":["1"]},{"type":"ERC20","name":"Contract 74","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","transfers":1,"symbol":"S74","decimals":12,"balance":"1000123074"}],"addressAliases":{"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b":{"Type":"ENS","Alias":"address7b.eth"},"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9":{"Type":"Contract","Alias":"Contract 205"}}}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","balance":"123450123","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"transactions":[{"txid":"0xca7628be5c80cda77163729ec63d218ee868a399d827a4682a478c6f48a6e22a","vin":[{"n":0,"addresses":["0x837E3f699d85a4b0B99894567e9233dFB1DcB081"],"isAddress":true}],"vout":[{"value":"0","n":0,"addresses":["0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9"],"isAddress":true}],"blockHeight":-1,"confirmations":0,"blockTime":0,"value":"0","fees":"87945000410410","rbf":true,"coinSpecificData":{"tx":{"nonce":"0x2","gasPrice":"0x59682f07","gas":"0x173a9","to":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","value":"0x0","input":"0x23b872dd000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb0810000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000000000000000000000000000000000000000000001","hash":"0xca7628be5c80cda77163729ec63d218ee868a399d827a4682a478c6f48a6e22a","blockNumber":"0xb33b9f","from":"0x837E3f699d85a4b0B99894567e9233dFB1DcB081","transactionIndex":"0x1"},"receipt":{"gasUsed":"0xe506","status":"0x1","logs":[{"address":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","topics":["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925","0x000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb081","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001"],"data":"0x"},{"address":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb081","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b","0x0000000000000000000000000000000000000000000000000000000000000001"],"data":"0x"}]}},"tokenTransfers":[{"type":"ERC721","standard":"ERC721","from":"0x837E3f699d85a4b0B99894567e9233dFB1DcB081","to":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","contract":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","name":"Contract 205","symbol":"S205","decimals":18,"value":"1"}],"ethereumSpecific":{"status":1,"nonce":2,"gasLimit":95145,"gasUsed":58630,"gasPrice":"1500000007","data":"0x23b872dd000000000000000000000000837e3f699d85a4b0b99894567e9233dfb1dcb0810000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000000000000000000000000000000000000000000001","parsedData":{"methodId":"0x23b872dd","name":""}}},{"txid":"0xc92919ad24ffd58f760b18df7949f06e1190cf54a50a0e3745a385608ed3cbf2","vin":[{"n":0,"addresses":["0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D"],"isAddress":true}],"vout":[{"value":"0","n":0,"addresses":["0x479CC461fEcd078F766eCc58533D6F69580CF3AC"],"isAddress":true}],"blockHeight":-1,"confirmations":0,"blockTime":0,"value":"0","fees":"216368000000000","rbf":true,"coinSpecificData":{"tx":{"nonce":"0x1df76","gasPrice":"0x3b9aca00","gas":"0x3d090","to":"0x479CC461fEcd078F766eCc58533D6F69580CF3AC","value":"0x0","input":"0x4f15078700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a200000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000a5ef5a7656bfb0000000000000000000000000000000000000000000000000000004ba78398d5c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfe0b9579b4ecf7a2801880f644009a324671a79754ea57c3a103c6e70d3dbef6ba69a08000000000000000000000000000000000000000000000000004f937d86afb90000000000000000000000000000000000000000000000000ab280fd8037d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfb784b7c1f3fbe8b75484603ab8adc58aaee3a46245a6579fac7077b5570018b4e0d4eb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000308fd0e798ac00000000000000000000000000000000000000000000000006a8313d60b1f606b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000029de0ccec59e8948e3d905b40e5542335ebc1eb4674db517d2f6392ec7fdeb3d45f3449d313ee2589819c6c79eb1c1b047adae68565c1608e3a1d1d70823febb0000000000000000000000000000000000000000000000000000000000000000234d06fe17f1202e8b07177a30eb64d14adc08cdb3fa1b3e3e0bea0f9672c02175b77c01c51d3c7e460723b27ecbc7801fd6482559a8c9999593f9a4d149c7384","hash":"0xc92919ad24ffd58f760b18df7949f06e1190cf54a50a0e3745a385608ed3cbf2","blockNumber":"0x41eee9","from":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","transactionIndex":"0x24"},"internalData":{"type":1,"contract":"0d0f936ee4c93e25944694d6c121de94d9760f11","transfers":[{"type":0,"from":"4bda106325c335df99eab7fe363cac8a0ba2a24d","to":"9f4981531fda132e83c44680787dfa7ee31e4f8d","value":1000010},{"type":2,"from":"4af4114f73d1c1c903ac9e0361b379d1291808a2","to":"9f4981531fda132e83c44680787dfa7ee31e4f8d","value":1000011}],"Error":""},"receipt":{"gasUsed":"0x34d30","status":"0x1","logs":[{"address":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d"],"data":"0x0000000000000000000000000000000000000000000000006a8313d60b1f8001"},{"address":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f"],"data":"0x000000000000000000000000000000000000000000000000000308fd0e798ac0"},{"address":"0x479CC461fEcd078F766eCc58533D6F69580CF3AC","topics":["0x0d0b9391970d9a25552f37d436d2aae2925e2bfe1b2a923754bada030c498cb3","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f","0x0000000000000000000000000000000000000000000000000000000000000000","0x5af266c0a89a07c1917deaa024414577e6c3c31c8907d079e13eb448c082594f"],"data":"0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000000000000000000000000006a8313d60b1f8001000000000000000000000000000000000000000000000000000308fd0e798ac0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e083a16f4b092c5729a49f9c3ed3cc171bb3d3d0c22e20b1de6063c32f399ac"},{"address":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d"],"data":"0x00000000000000000000000000000000000000000000000000031855667df7a8"},{"address":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b"],"data":"0x0000000000000000000000000000000000000000000000006a8313d60b1f606b"},{"address":"0x479CC461fEcd078F766eCc58533D6F69580CF3AC","topics":["0x0d0b9391970d9a25552f37d436d2aae2925e2bfe1b2a923754bada030c498cb3","0x0000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b","0x0000000000000000000000000000000000000000000000000000000000000000","0xb0b69dad58df6032c3b266e19b1045b19c87acd2c06fb0c598090f44b8e263aa"],"data":"0x0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f1100000000000000000000000000000000000000000000000000031855667df7a80000000000000000000000000000000000000000000000006a8313d60b1f606b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2b0d62c44ed08f2a5adef40c875d20310a42a9d4f488bd26323256fe01c7f48"}]}},"tokenTransfers":[{"type":"ERC20","standard":"ERC20","from":"0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f","to":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","name":"Contract 13","symbol":"S13","decimals":18,"value":"7675000000000000001"},{"type":"ERC20","standard":"ERC20","from":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","to":"0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","name":"Contract 74","symbol":"S74","decimals":12,"value":"854307892726464"},{"type":"ERC20","standard":"ERC20","from":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","to":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","name":"Contract 74","symbol":"S74","decimals":12,"value":"871180000950184"},{"type":"ERC20","standard":"ERC20","from":"0x4Bda106325C335dF99eab7fE363cAC8A0ba2a24D","to":"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","name":"Contract 13","symbol":"S13","decimals":18,"value":"7674999999999991915"}],"ethereumSpecific":{"status":1,"nonce":122742,"gasLimit":250000,"gasUsed":216368,"gasPrice":"1000000000","data":"0x4f15078700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a200000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b62eb7fe80350dc7ec945c0b73242cb9877fb1b0000000000000000000000004bda106325c335df99eab7fe363cac8a0ba2a24d0000000000000000000000004af4114f73d1c1c903ac9e0361b379d1291808a20000000000000000000000000d0f936ee4c93e25944694d6c121de94d9760f110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000a5ef5a7656bfb0000000000000000000000000000000000000000000000000000004ba78398d5c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfe0b9579b4ecf7a2801880f644009a324671a79754ea57c3a103c6e70d3dbef6ba69a08000000000000000000000000000000000000000000000000004f937d86afb90000000000000000000000000000000000000000000000000ab280fd8037d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166cfb784b7c1f3fbe8b75484603ab8adc58aaee3a46245a6579fac7077b5570018b4e0d4eb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000308fd0e798ac00000000000000000000000000000000000000000000000006a8313d60b1f606b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000029de0ccec59e8948e3d905b40e5542335ebc1eb4674db517d2f6392ec7fdeb3d45f3449d313ee2589819c6c79eb1c1b047adae68565c1608e3a1d1d70823febb0000000000000000000000000000000000000000000000000000000000000000234d06fe17f1202e8b07177a30eb64d14adc08cdb3fa1b3e3e0bea0f9672c02175b77c01c51d3c7e460723b27ecbc7801fd6482559a8c9999593f9a4d149c7384","parsedData":{"methodId":"0x4f150787","name":""}}}],"nonce":"123","tokens":[{"type":"ERC20","standard":"ERC20","name":"Contract 13","contract":"0x0d0F936Ee4c93e25944694D6C121de94D9760F11","transfers":1,"symbol":"S13","decimals":18,"balance":"1000123013"},{"type":"ERC721","standard":"ERC721","name":"Contract 205","contract":"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9","transfers":1,"symbol":"S205","decimals":18,"ids":["1"]},{"type":"ERC20","standard":"ERC20","name":"Contract 74","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","transfers":1,"symbol":"S74","decimals":12,"balance":"1000123074"}],"addressAliases":{"0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b":{"Type":"ENS","Alias":"address7b.eth"},"0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9":{"Type":"Contract","Alias":"Contract 205"}}}`,
},
},
{
@@ -90,7 +90,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"txid":"0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101","vin":[{"n":0,"addresses":["0x20cD153de35D469BA46127A0C8F18626b59a256A"],"isAddress":true}],"vout":[{"value":"0","n":0,"addresses":["0x4af4114F73d1c1C903aC9E0361b379D1291808A2"],"isAddress":true}],"blockHeight":-1,"confirmations":0,"blockTime":0,"value":"0","fees":"2081000000000000","rbf":true,"coinSpecificData":{"tx":{"nonce":"0xd0","gasPrice":"0x9502f9000","gas":"0x130d5","to":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","value":"0x0","input":"0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000","hash":"0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101","blockNumber":"0x41eee8","from":"0x20cD153de35D469BA46127A0C8F18626b59a256A","transactionIndex":"0x0"},"internalData":{"type":0,"transfers":[{"type":1,"from":"9f4981531fda132e83c44680787dfa7ee31e4f8d","to":"4af4114f73d1c1c903ac9e0361b379d1291808a2","value":1000000},{"type":0,"from":"3e3a3d69dc66ba10737f531ed088954a9ec89d97","to":"9f4981531fda132e83c44680787dfa7ee31e4f8d","value":1000001},{"type":0,"from":"3e3a3d69dc66ba10737f531ed088954a9ec89d97","to":"3e3a3d69dc66ba10737f531ed088954a9ec89d97","value":1000002}],"Error":""},"receipt":{"gasUsed":"0xcb39","status":"0x1","logs":[{"address":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x00000000000000000000000020cd153de35d469ba46127a0c8f18626b59a256a","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f"],"data":"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000"}]}},"tokenTransfers":[{"type":"ERC20","from":"0x20cD153de35D469BA46127A0C8F18626b59a256A","to":"0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","name":"Contract 74","symbol":"S74","decimals":12,"value":"10000000000000000000000"}],"ethereumSpecific":{"status":1,"nonce":208,"gasLimit":78037,"gasUsed":52025,"gasPrice":"40000000000","data":"0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000","parsedData":{"methodId":"0xa9059cbb","name":"Transfer","function":"transfer(address, uint256)","params":[{"type":"address","values":["0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f"]},{"type":"uint256","values":["10000000000000000000000"]}]}},"addressAliases":{"0x20cD153de35D469BA46127A0C8F18626b59a256A":{"Type":"ENS","Alias":"address20.eth"},"0x4af4114F73d1c1C903aC9E0361b379D1291808A2":{"Type":"Contract","Alias":"Contract 74"}}}`,
+ `{"txid":"0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101","vin":[{"n":0,"addresses":["0x20cD153de35D469BA46127A0C8F18626b59a256A"],"isAddress":true}],"vout":[{"value":"0","n":0,"addresses":["0x4af4114F73d1c1C903aC9E0361b379D1291808A2"],"isAddress":true}],"blockHeight":-1,"confirmations":0,"blockTime":0,"value":"0","fees":"2081000000000000","rbf":true,"coinSpecificData":{"tx":{"nonce":"0xd0","gasPrice":"0x9502f9000","gas":"0x130d5","to":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","value":"0x0","input":"0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000","hash":"0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101","blockNumber":"0x41eee8","from":"0x20cD153de35D469BA46127A0C8F18626b59a256A","transactionIndex":"0x0"},"internalData":{"type":0,"transfers":[{"type":1,"from":"9f4981531fda132e83c44680787dfa7ee31e4f8d","to":"4af4114f73d1c1c903ac9e0361b379d1291808a2","value":1000000},{"type":0,"from":"3e3a3d69dc66ba10737f531ed088954a9ec89d97","to":"9f4981531fda132e83c44680787dfa7ee31e4f8d","value":1000001},{"type":0,"from":"3e3a3d69dc66ba10737f531ed088954a9ec89d97","to":"3e3a3d69dc66ba10737f531ed088954a9ec89d97","value":1000002}],"Error":""},"receipt":{"gasUsed":"0xcb39","status":"0x1","logs":[{"address":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x00000000000000000000000020cd153de35d469ba46127a0c8f18626b59a256a","0x000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f"],"data":"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000"}]}},"tokenTransfers":[{"type":"ERC20","standard":"ERC20","from":"0x20cD153de35D469BA46127A0C8F18626b59a256A","to":"0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f","contract":"0x4af4114F73d1c1C903aC9E0361b379D1291808A2","name":"Contract 74","symbol":"S74","decimals":12,"value":"10000000000000000000000"}],"ethereumSpecific":{"status":1,"nonce":208,"gasLimit":78037,"gasUsed":52025,"gasPrice":"40000000000","data":"0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000","parsedData":{"methodId":"0xa9059cbb","name":"Transfer","function":"transfer(address, uint256)","params":[{"type":"address","values":["0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f"]},{"type":"uint256","values":["10000000000000000000000"]}]}},"addressAliases":{"0x20cD153de35D469BA46127A0C8F18626b59a256A":{"Type":"ENS","Alias":"address20.eth"},"0x4af4114F73d1c1C903aC9E0361b379D1291808A2":{"Type":"Contract","Alias":"Contract 74"}}}`,
},
},
{
diff --git a/server/public_test.go b/server/public_test.go
index 550afefe52..a808b80203 100644
--- a/server/public_test.go
+++ b/server/public_test.go
@@ -43,7 +43,7 @@ func setupRocksDB(parser bchain.BlockChainParser, chain bchain.BlockChain, t *te
if err != nil {
t.Fatal(err)
}
- d, err := db.NewRocksDB(tmp, 100000, -1, parser, nil, extendedIndex)
+ d, err := db.NewRocksDB(tmp, 100000, -1, parser, nil, extendedIndex, 0, false)
if err != nil {
t.Fatal(err)
}
@@ -676,7 +676,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"txids":["3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75"],"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"}]}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"txids":["3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75"],"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"}]}`,
},
},
{
@@ -685,7 +685,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"txids":["3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75"],"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"}]}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"txids":["3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75"],"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"}]}`,
},
},
{
@@ -694,7 +694,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"txids":["3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75"],"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7NdeuAMgL57WE7QCeV2gTWi2Um8iAu5dA","path":"m/49'/1'/33'/0/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8JQEP6DSHEZHNsSDPA1gHMUq9YFndhkfV","path":"m/49'/1'/33'/0/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mvbn3YXqKZVpQKugaoQrfjSYPvz76RwZkC","path":"m/49'/1'/33'/0/13","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8MRNxCfwUY9TSW27X9ooGYtqgrGCfLRHx","path":"m/49'/1'/33'/0/14","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6HvwrHC113KYZAmCtJ9XJNWgaTcnFunCM","path":"m/49'/1'/33'/0/15","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEo3oNyHUoi7rmRWee7wki37jxPWsWCopJ","path":"m/49'/1'/33'/0/16","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mzm5KY8qdFbDHsQfy4akXbFvbR3FAwDuVo","path":"m/49'/1'/33'/0/17","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NGMwftmQCogp6XZNGvgiybz3WZysvsJzqC","path":"m/49'/1'/33'/0/18","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3fJrrefndYjLGycvFFfYgevpZtcRKCkRD","path":"m/49'/1'/33'/0/19","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1T7TnHBwfdpBoyw53EGUL7vuJmb2mU6jF","path":"m/49'/1'/33'/0/20","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5kBNMB8qgxE4Y4f8J19fScsE49J4aNvoJ","path":"m/49'/1'/33'/1/14","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NANWCaefhCKdXMcW8NbZnnrFRDvhJN2wPy","path":"m/49'/1'/33'/1/15","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFHw7Yo2Bz8D2wGAYHW9qidbZFLpfJ72qB","path":"m/49'/1'/33'/1/16","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBDSsBgy5PpFniLCb1eAFHcSxgxwPSDsZa","path":"m/49'/1'/33'/1/17","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NDWCSQHogc7sCuc2WoYt9PX2i2i6a5k6dX","path":"m/49'/1'/33'/1/18","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8vNyDP7iSDjm3BKpXrbDjAxyphqfvnJz8","path":"m/49'/1'/33'/1/19","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4tFKLurSbMusAyq1tv4tzymVjveAFV1Vb","path":"m/49'/1'/33'/1/20","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBx5WwjAr2cH6Yqrp3Vsf957HtRKwDUVdX","path":"m/49'/1'/33'/1/21","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBu1seHTaFhQxbcW5L5BkZzqFLGmZqpxsa","path":"m/49'/1'/33'/1/22","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NCDLoea22jGsXuarfT1n2QyCUh6RFhAPnT","path":"m/49'/1'/33'/1/23","transfers":0,"decimals":8}]}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"txids":["3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75"],"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7NdeuAMgL57WE7QCeV2gTWi2Um8iAu5dA","path":"m/49'/1'/33'/0/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8JQEP6DSHEZHNsSDPA1gHMUq9YFndhkfV","path":"m/49'/1'/33'/0/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mvbn3YXqKZVpQKugaoQrfjSYPvz76RwZkC","path":"m/49'/1'/33'/0/13","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8MRNxCfwUY9TSW27X9ooGYtqgrGCfLRHx","path":"m/49'/1'/33'/0/14","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6HvwrHC113KYZAmCtJ9XJNWgaTcnFunCM","path":"m/49'/1'/33'/0/15","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEo3oNyHUoi7rmRWee7wki37jxPWsWCopJ","path":"m/49'/1'/33'/0/16","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mzm5KY8qdFbDHsQfy4akXbFvbR3FAwDuVo","path":"m/49'/1'/33'/0/17","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NGMwftmQCogp6XZNGvgiybz3WZysvsJzqC","path":"m/49'/1'/33'/0/18","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3fJrrefndYjLGycvFFfYgevpZtcRKCkRD","path":"m/49'/1'/33'/0/19","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1T7TnHBwfdpBoyw53EGUL7vuJmb2mU6jF","path":"m/49'/1'/33'/0/20","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5kBNMB8qgxE4Y4f8J19fScsE49J4aNvoJ","path":"m/49'/1'/33'/1/14","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NANWCaefhCKdXMcW8NbZnnrFRDvhJN2wPy","path":"m/49'/1'/33'/1/15","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFHw7Yo2Bz8D2wGAYHW9qidbZFLpfJ72qB","path":"m/49'/1'/33'/1/16","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBDSsBgy5PpFniLCb1eAFHcSxgxwPSDsZa","path":"m/49'/1'/33'/1/17","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NDWCSQHogc7sCuc2WoYt9PX2i2i6a5k6dX","path":"m/49'/1'/33'/1/18","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8vNyDP7iSDjm3BKpXrbDjAxyphqfvnJz8","path":"m/49'/1'/33'/1/19","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4tFKLurSbMusAyq1tv4tzymVjveAFV1Vb","path":"m/49'/1'/33'/1/20","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBx5WwjAr2cH6Yqrp3Vsf957HtRKwDUVdX","path":"m/49'/1'/33'/1/21","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBu1seHTaFhQxbcW5L5BkZzqFLGmZqpxsa","path":"m/49'/1'/33'/1/22","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NCDLoea22jGsXuarfT1n2QyCUh6RFhAPnT","path":"m/49'/1'/33'/1/23","transfers":0,"decimals":8}]}`,
},
},
{
@@ -703,7 +703,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"tr([5c9e228d/86'/1'/0']tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/{0,1}/*)#4rqwxvej","balance":"0","totalReceived":"0","totalSent":"0","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":0,"tokens":[{"type":"XPUBAddress","name":"tb1pswrqtykue8r89t9u4rprjs0gt4qzkdfuursfnvqaa3f2yql07zmq8s8a5u","path":"m/86'/1'/0'/0/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"tb1p8tvmvsvhsee73rhym86wt435qrqm92psfsyhy6a3n5gw455znnpqm8wald","path":"m/86'/1'/0'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"tb1p537ddhyuydg5c2v75xxmn6ac64yz4xns2x0gpdcwj5vzzzgrywlqlqwk43","path":"m/86'/1'/0'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"tb1pn2d0yjeedavnkd8z8lhm566p0f2utm3lgvxrsdehnl94y34txmts5s7t4c","path":"m/86'/1'/0'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"tb1p0pnd6ue5vryymvd28aeq3kdz6rmsdjqrq6eespgtg8wdgnxjzjksujhq4u","path":"m/86'/1'/0'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"tb1p29gpmd96hhgf7wj2vs03ca7x2xx39g8t6e0p55h2d5ssqs4fsj8qtx00wc","path":"m/86'/1'/0'/1/2","transfers":0,"decimals":8}]}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"tr([5c9e228d/86'/1'/0']tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/{0,1}/*)#4rqwxvej","balance":"0","totalReceived":"0","totalSent":"0","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":0,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"tb1pswrqtykue8r89t9u4rprjs0gt4qzkdfuursfnvqaa3f2yql07zmq8s8a5u","path":"m/86'/1'/0'/0/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"tb1p8tvmvsvhsee73rhym86wt435qrqm92psfsyhy6a3n5gw455znnpqm8wald","path":"m/86'/1'/0'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"tb1p537ddhyuydg5c2v75xxmn6ac64yz4xns2x0gpdcwj5vzzzgrywlqlqwk43","path":"m/86'/1'/0'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"tb1pn2d0yjeedavnkd8z8lhm566p0f2utm3lgvxrsdehnl94y34txmts5s7t4c","path":"m/86'/1'/0'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"tb1p0pnd6ue5vryymvd28aeq3kdz6rmsdjqrq6eespgtg8wdgnxjzjksujhq4u","path":"m/86'/1'/0'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"tb1p29gpmd96hhgf7wj2vs03ca7x2xx39g8t6e0p55h2d5ssqs4fsj8qtx00wc","path":"m/86'/1'/0'/1/2","transfers":0,"decimals":8}]}`,
},
},
{
@@ -721,7 +721,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":3,"addrTxCount":3,"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8}]}`,
+ `{"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":3,"addrTxCount":3,"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8}]}`,
},
},
{
@@ -730,7 +730,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":3,"addrTxCount":3,"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"}]}`,
+ `{"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":3,"addrTxCount":3,"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"}]}`,
},
},
{
@@ -739,7 +739,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) {
status: http.StatusOK,
contentType: "application/json; charset=utf-8",
body: []string{
- `{"page":1,"totalPages":1,"itemsOnPage":3,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"isAddress":true,"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true,"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"],"isAddress":true,"isOwn":true},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"],"isAddress":true}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":1521595678,"value":"317283951000","valueIn":"317283951062","fees":"62"}],"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8}]}`,
+ `{"page":1,"totalPages":1,"itemsOnPage":3,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"isAddress":true,"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true,"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"],"isAddress":true,"isOwn":true},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"],"isAddress":true}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":1521595678,"value":"317283951000","valueIn":"317283951062","fees":"62"}],"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8}]}`,
},
},
{
@@ -1060,7 +1060,7 @@ var websocketTestsBitcoinType = []websocketTest{
"details": "txs",
},
},
- want: `{"id":"2","data":{"page":1,"totalPages":1,"itemsOnPage":25,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"isAddress":true,"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true,"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"],"isAddress":true,"isOwn":true},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"],"isAddress":true}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":1521595678,"value":"317283951000","valueIn":"317283951062","fees":"62"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"hex":"76a914a08eae93007f22668ab5e4a9c83c8cd1c325e3e088ac","addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"],"isAddress":true},{"value":"1","n":1,"spent":true,"hex":"a91452724c5178682f70e0ba31c6ec0633755a3b41d987","addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true},{"value":"9876","n":2,"spent":true,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"],"isAddress":true}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":1521515026,"value":"1234567900000","valueIn":"0","fees":"0"}],"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7NdeuAMgL57WE7QCeV2gTWi2Um8iAu5dA","path":"m/49'/1'/33'/0/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8JQEP6DSHEZHNsSDPA1gHMUq9YFndhkfV","path":"m/49'/1'/33'/0/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mvbn3YXqKZVpQKugaoQrfjSYPvz76RwZkC","path":"m/49'/1'/33'/0/13","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8MRNxCfwUY9TSW27X9ooGYtqgrGCfLRHx","path":"m/49'/1'/33'/0/14","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6HvwrHC113KYZAmCtJ9XJNWgaTcnFunCM","path":"m/49'/1'/33'/0/15","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEo3oNyHUoi7rmRWee7wki37jxPWsWCopJ","path":"m/49'/1'/33'/0/16","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mzm5KY8qdFbDHsQfy4akXbFvbR3FAwDuVo","path":"m/49'/1'/33'/0/17","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NGMwftmQCogp6XZNGvgiybz3WZysvsJzqC","path":"m/49'/1'/33'/0/18","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3fJrrefndYjLGycvFFfYgevpZtcRKCkRD","path":"m/49'/1'/33'/0/19","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1T7TnHBwfdpBoyw53EGUL7vuJmb2mU6jF","path":"m/49'/1'/33'/0/20","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5kBNMB8qgxE4Y4f8J19fScsE49J4aNvoJ","path":"m/49'/1'/33'/1/14","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NANWCaefhCKdXMcW8NbZnnrFRDvhJN2wPy","path":"m/49'/1'/33'/1/15","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFHw7Yo2Bz8D2wGAYHW9qidbZFLpfJ72qB","path":"m/49'/1'/33'/1/16","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBDSsBgy5PpFniLCb1eAFHcSxgxwPSDsZa","path":"m/49'/1'/33'/1/17","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NDWCSQHogc7sCuc2WoYt9PX2i2i6a5k6dX","path":"m/49'/1'/33'/1/18","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8vNyDP7iSDjm3BKpXrbDjAxyphqfvnJz8","path":"m/49'/1'/33'/1/19","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4tFKLurSbMusAyq1tv4tzymVjveAFV1Vb","path":"m/49'/1'/33'/1/20","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBx5WwjAr2cH6Yqrp3Vsf957HtRKwDUVdX","path":"m/49'/1'/33'/1/21","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBu1seHTaFhQxbcW5L5BkZzqFLGmZqpxsa","path":"m/49'/1'/33'/1/22","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NCDLoea22jGsXuarfT1n2QyCUh6RFhAPnT","path":"m/49'/1'/33'/1/23","transfers":0,"decimals":8}]}}`,
+ want: `{"id":"2","data":{"page":1,"totalPages":1,"itemsOnPage":25,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"isAddress":true,"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true,"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"],"isAddress":true,"isOwn":true},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"],"isAddress":true}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":1521595678,"value":"317283951000","valueIn":"317283951062","fees":"62"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"hex":"76a914a08eae93007f22668ab5e4a9c83c8cd1c325e3e088ac","addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"],"isAddress":true},{"value":"1","n":1,"spent":true,"hex":"a91452724c5178682f70e0ba31c6ec0633755a3b41d987","addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true},{"value":"9876","n":2,"spent":true,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"],"isAddress":true}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":1521515026,"value":"1234567900000","valueIn":"0","fees":"0"}],"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7NdeuAMgL57WE7QCeV2gTWi2Um8iAu5dA","path":"m/49'/1'/33'/0/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8JQEP6DSHEZHNsSDPA1gHMUq9YFndhkfV","path":"m/49'/1'/33'/0/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mvbn3YXqKZVpQKugaoQrfjSYPvz76RwZkC","path":"m/49'/1'/33'/0/13","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8MRNxCfwUY9TSW27X9ooGYtqgrGCfLRHx","path":"m/49'/1'/33'/0/14","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6HvwrHC113KYZAmCtJ9XJNWgaTcnFunCM","path":"m/49'/1'/33'/0/15","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEo3oNyHUoi7rmRWee7wki37jxPWsWCopJ","path":"m/49'/1'/33'/0/16","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mzm5KY8qdFbDHsQfy4akXbFvbR3FAwDuVo","path":"m/49'/1'/33'/0/17","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NGMwftmQCogp6XZNGvgiybz3WZysvsJzqC","path":"m/49'/1'/33'/0/18","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3fJrrefndYjLGycvFFfYgevpZtcRKCkRD","path":"m/49'/1'/33'/0/19","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1T7TnHBwfdpBoyw53EGUL7vuJmb2mU6jF","path":"m/49'/1'/33'/0/20","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5kBNMB8qgxE4Y4f8J19fScsE49J4aNvoJ","path":"m/49'/1'/33'/1/14","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NANWCaefhCKdXMcW8NbZnnrFRDvhJN2wPy","path":"m/49'/1'/33'/1/15","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFHw7Yo2Bz8D2wGAYHW9qidbZFLpfJ72qB","path":"m/49'/1'/33'/1/16","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBDSsBgy5PpFniLCb1eAFHcSxgxwPSDsZa","path":"m/49'/1'/33'/1/17","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NDWCSQHogc7sCuc2WoYt9PX2i2i6a5k6dX","path":"m/49'/1'/33'/1/18","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8vNyDP7iSDjm3BKpXrbDjAxyphqfvnJz8","path":"m/49'/1'/33'/1/19","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4tFKLurSbMusAyq1tv4tzymVjveAFV1Vb","path":"m/49'/1'/33'/1/20","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBx5WwjAr2cH6Yqrp3Vsf957HtRKwDUVdX","path":"m/49'/1'/33'/1/21","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBu1seHTaFhQxbcW5L5BkZzqFLGmZqpxsa","path":"m/49'/1'/33'/1/22","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NCDLoea22jGsXuarfT1n2QyCUh6RFhAPnT","path":"m/49'/1'/33'/1/23","transfers":0,"decimals":8}]}}`,
},
{
name: "websocket getAccountInfo address",
@@ -1084,7 +1084,7 @@ var websocketTestsBitcoinType = []websocketTest{
"gap": 10,
},
},
- want: `{"id":"4","data":{"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":3,"addrTxCount":3,"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8},{"type":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8},{"type":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8}]}}`,
+ want: `{"id":"4","data":{"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":3,"addrTxCount":3,"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8}]}}`,
},
{
name: "websocket getAccountUtxo",
@@ -1713,7 +1713,7 @@ var websocketTestsBitcoinTypeExtendedIndex = []websocketTest{
"details": "txs",
},
},
- want: `{"id":"2","data":{"page":1,"totalPages":1,"itemsOnPage":25,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"isAddress":true,"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true,"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"],"isAddress":true,"isOwn":true},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"],"isAddress":true}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":1521595678,"value":"317283951000","valueIn":"317283951062","fees":"62"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"spentTxId":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","spentHeight":225494,"hex":"76a914a08eae93007f22668ab5e4a9c83c8cd1c325e3e088ac","addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"],"isAddress":true},{"value":"1","n":1,"spent":true,"spentTxId":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","spentIndex":1,"spentHeight":225494,"hex":"a91452724c5178682f70e0ba31c6ec0633755a3b41d987","addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true},{"value":"9876","n":2,"spent":true,"spentTxId":"05e2e48aeabdd9b75def7b48d756ba304713c2aba7b522bf9dbc893fc4231b07","spentHeight":225494,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"],"isAddress":true}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":1521515026,"value":"1234567900000","valueIn":"0","fees":"0"}],"usedTokens":2,"tokens":[{"type":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7NdeuAMgL57WE7QCeV2gTWi2Um8iAu5dA","path":"m/49'/1'/33'/0/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8JQEP6DSHEZHNsSDPA1gHMUq9YFndhkfV","path":"m/49'/1'/33'/0/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mvbn3YXqKZVpQKugaoQrfjSYPvz76RwZkC","path":"m/49'/1'/33'/0/13","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8MRNxCfwUY9TSW27X9ooGYtqgrGCfLRHx","path":"m/49'/1'/33'/0/14","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6HvwrHC113KYZAmCtJ9XJNWgaTcnFunCM","path":"m/49'/1'/33'/0/15","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NEo3oNyHUoi7rmRWee7wki37jxPWsWCopJ","path":"m/49'/1'/33'/0/16","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mzm5KY8qdFbDHsQfy4akXbFvbR3FAwDuVo","path":"m/49'/1'/33'/0/17","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NGMwftmQCogp6XZNGvgiybz3WZysvsJzqC","path":"m/49'/1'/33'/0/18","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3fJrrefndYjLGycvFFfYgevpZtcRKCkRD","path":"m/49'/1'/33'/0/19","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N1T7TnHBwfdpBoyw53EGUL7vuJmb2mU6jF","path":"m/49'/1'/33'/0/20","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N5kBNMB8qgxE4Y4f8J19fScsE49J4aNvoJ","path":"m/49'/1'/33'/1/14","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NANWCaefhCKdXMcW8NbZnnrFRDvhJN2wPy","path":"m/49'/1'/33'/1/15","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NFHw7Yo2Bz8D2wGAYHW9qidbZFLpfJ72qB","path":"m/49'/1'/33'/1/16","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBDSsBgy5PpFniLCb1eAFHcSxgxwPSDsZa","path":"m/49'/1'/33'/1/17","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NDWCSQHogc7sCuc2WoYt9PX2i2i6a5k6dX","path":"m/49'/1'/33'/1/18","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N8vNyDP7iSDjm3BKpXrbDjAxyphqfvnJz8","path":"m/49'/1'/33'/1/19","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2N4tFKLurSbMusAyq1tv4tzymVjveAFV1Vb","path":"m/49'/1'/33'/1/20","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBx5WwjAr2cH6Yqrp3Vsf957HtRKwDUVdX","path":"m/49'/1'/33'/1/21","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NBu1seHTaFhQxbcW5L5BkZzqFLGmZqpxsa","path":"m/49'/1'/33'/1/22","transfers":0,"decimals":8},{"type":"XPUBAddress","name":"2NCDLoea22jGsXuarfT1n2QyCUh6RFhAPnT","path":"m/49'/1'/33'/1/23","transfers":0,"decimals":8}]}}`,
+ want: `{"id":"2","data":{"page":1,"totalPages":1,"itemsOnPage":25,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"addrTxCount":3,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"isAddress":true,"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true,"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"],"isAddress":true,"isOwn":true},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"],"isAddress":true}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":1521595678,"value":"317283951000","valueIn":"317283951062","fees":"62"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"spentTxId":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","spentHeight":225494,"hex":"76a914a08eae93007f22668ab5e4a9c83c8cd1c325e3e088ac","addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"],"isAddress":true},{"value":"1","n":1,"spent":true,"spentTxId":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","spentIndex":1,"spentHeight":225494,"hex":"a91452724c5178682f70e0ba31c6ec0633755a3b41d987","addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"isAddress":true,"isOwn":true},{"value":"9876","n":2,"spent":true,"spentTxId":"05e2e48aeabdd9b75def7b48d756ba304713c2aba7b522bf9dbc893fc4231b07","spentHeight":225494,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"],"isAddress":true}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":1521515026,"value":"1234567900000","valueIn":"0","fees":"0"}],"usedTokens":2,"tokens":[{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzmAKayJmja784jyHvRUW1bXPget1csRRG","path":"m/49'/1'/33'/0/0","transfers":2,"decimals":8,"balance":"0","totalReceived":"1","totalSent":"1"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MsYfbi6ZdVXLDNrYAQ11ja9Sd3otMk4Pmj","path":"m/49'/1'/33'/0/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuAZNAjLSo6RLFad2fvHSfgqBD7BoEVy4T","path":"m/49'/1'/33'/0/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEqKzw3BosGnBE9by5uaDy5QgwjHac4Zbg","path":"m/49'/1'/33'/0/3","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mw7vJNC8zUK6VNN4CEjtoTYmuNPLewxZzV","path":"m/49'/1'/33'/0/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1kvo97NFASPXiwephZUxE9PRXunjTxEc4","path":"m/49'/1'/33'/0/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuWrWMzoBt8VDFNvPmpJf42M1GTUs85fPx","path":"m/49'/1'/33'/0/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MuVZ2Ca6Da9zmYynt49Rx7uikAgubGcymF","path":"m/49'/1'/33'/0/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzRGWDUmrPP9HwYu4B43QGCTLwoop5cExa","path":"m/49'/1'/33'/0/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5C9EEWJzyBXhpyPHqa3UNed73Amsi5b3L","path":"m/49'/1'/33'/0/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzNawz2zjwq1L85GDE3YydEJGJYfXxaWkk","path":"m/49'/1'/33'/0/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7NdeuAMgL57WE7QCeV2gTWi2Um8iAu5dA","path":"m/49'/1'/33'/0/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8JQEP6DSHEZHNsSDPA1gHMUq9YFndhkfV","path":"m/49'/1'/33'/0/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mvbn3YXqKZVpQKugaoQrfjSYPvz76RwZkC","path":"m/49'/1'/33'/0/13","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8MRNxCfwUY9TSW27X9ooGYtqgrGCfLRHx","path":"m/49'/1'/33'/0/14","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6HvwrHC113KYZAmCtJ9XJNWgaTcnFunCM","path":"m/49'/1'/33'/0/15","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEo3oNyHUoi7rmRWee7wki37jxPWsWCopJ","path":"m/49'/1'/33'/0/16","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mzm5KY8qdFbDHsQfy4akXbFvbR3FAwDuVo","path":"m/49'/1'/33'/0/17","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NGMwftmQCogp6XZNGvgiybz3WZysvsJzqC","path":"m/49'/1'/33'/0/18","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3fJrrefndYjLGycvFFfYgevpZtcRKCkRD","path":"m/49'/1'/33'/0/19","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N1T7TnHBwfdpBoyw53EGUL7vuJmb2mU6jF","path":"m/49'/1'/33'/0/20","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MzSBtRWHbBjeUcu3H5VRDqkvz5sfmDxJKo","path":"m/49'/1'/33'/1/0","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MtShtAJYb1afWduUTwF1SixJjan7urZKke","path":"m/49'/1'/33'/1/1","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N3cP668SeqyBEr9gnB4yQEmU3VyxeRYith","path":"m/49'/1'/33'/1/2","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu","path":"m/49'/1'/33'/1/3","transfers":1,"decimals":8,"balance":"118641975500","totalReceived":"118641975500","totalSent":"0"},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NEzatauNhf9kPTwwj6ZfYKjUdy52j4hVUL","path":"m/49'/1'/33'/1/4","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4RjsDp4LBpkNqyF91aNjgpF9CwDwBkJZq","path":"m/49'/1'/33'/1/5","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8XygTmQc4NoBBPEy3yybnfCYhsxFtzPDY","path":"m/49'/1'/33'/1/6","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5BjBomZvb48sccK2vwLMiQ5ETKp1fdPVn","path":"m/49'/1'/33'/1/7","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2MybMwbZRPCGU3SMWPwQCpDkbcQFw5Hbwen","path":"m/49'/1'/33'/1/8","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N7HexL4dyAQc7Th4iqcCW4hZuyiZsLWf74","path":"m/49'/1'/33'/1/9","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NF6X5FDGWrQj4nQrfP6hA77zB5WAc1DGup","path":"m/49'/1'/33'/1/10","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4ZRPdvc7BVioBTohy4F6QtxreqcjNj26b","path":"m/49'/1'/33'/1/11","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2Mtfho1rLmevh4qTnkYWxZEFCWteDMtTcUF","path":"m/49'/1'/33'/1/12","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFUCphKYvmMcNZRZrF261mRX6iADVB9Qms","path":"m/49'/1'/33'/1/13","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N5kBNMB8qgxE4Y4f8J19fScsE49J4aNvoJ","path":"m/49'/1'/33'/1/14","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NANWCaefhCKdXMcW8NbZnnrFRDvhJN2wPy","path":"m/49'/1'/33'/1/15","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NFHw7Yo2Bz8D2wGAYHW9qidbZFLpfJ72qB","path":"m/49'/1'/33'/1/16","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBDSsBgy5PpFniLCb1eAFHcSxgxwPSDsZa","path":"m/49'/1'/33'/1/17","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NDWCSQHogc7sCuc2WoYt9PX2i2i6a5k6dX","path":"m/49'/1'/33'/1/18","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N8vNyDP7iSDjm3BKpXrbDjAxyphqfvnJz8","path":"m/49'/1'/33'/1/19","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2N4tFKLurSbMusAyq1tv4tzymVjveAFV1Vb","path":"m/49'/1'/33'/1/20","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBx5WwjAr2cH6Yqrp3Vsf957HtRKwDUVdX","path":"m/49'/1'/33'/1/21","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NBu1seHTaFhQxbcW5L5BkZzqFLGmZqpxsa","path":"m/49'/1'/33'/1/22","transfers":0,"decimals":8},{"type":"XPUBAddress","standard":"XPUBAddress","name":"2NCDLoea22jGsXuarfT1n2QyCUh6RFhAPnT","path":"m/49'/1'/33'/1/23","transfers":0,"decimals":8}]}}`,
},
{
name: "websocket getBlockFilter",
diff --git a/static/templates/address.html b/static/templates/address.html
index 6549c37728..d2bc9772e6 100644
--- a/static/templates/address.html
+++ b/static/templates/address.html
@@ -51,10 +51,10 @@
{{$addr.Nonce}} |
{{if $addr.ContractInfo}}
- {{if $addr.ContractInfo.Type}}
+ {{if $addr.ContractInfo.Standard}}
- Contract type |
- {{$addr.ContractInfo.Type}} |
+ Standard |
+ {{$addr.ContractInfo.Standard}} |
{{end}}
{{if $addr.ContractInfo.CreatedInBlock}}
@@ -131,7 +131,7 @@ {{summaryValuesSpa
Transfers# |
{{range $t := $addr.Tokens}}
- {{if eq $t.Type $.FungibleTokenName}}
+ {{if eq $t.Standard $.FungibleTokenName}}
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} |
{{formattedAmountSpan $t.BalanceSat $t.Decimals $t.Symbol $data "copyable"}} |
@@ -167,7 +167,7 @@ {{.NonFungibleTokenName}} Tokens Transfers#
{{range $t := $addr.Tokens}}
- {{if eq $t.Type $.NonFungibleTokenName}}
+ {{if eq $t.Standard $.NonFungibleTokenName}}
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} |
@@ -204,7 +204,7 @@ {{.MultiTokenName}} Tokens Transfers#
|
{{range $t := $addr.Tokens}}
- {{if eq $t.Type $.MultiTokenName}}
+ {{if eq $t.Standard $.MultiTokenName}}
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} |
@@ -288,17 +288,17 @@ Transactions
{{range $t := $addr.Tokens}}
- {{if eq $t.Type $.FungibleTokenName}}
+ {{if eq $t.Standard $.FungibleTokenName}}
{{end}}
{{end}}
{{range $t := $addr.Tokens}}
- {{if eq $t.Type $.NonFungibleTokenName}}
+ {{if eq $t.Standard $.NonFungibleTokenName}}
{{end}}
{{end}}
{{range $t := $addr.Tokens}}
- {{if eq $t.Type $.MultiTokenName}}
+ {{if eq $t.Standard $.MultiTokenName}}
{{end}}
{{end}}
diff --git a/static/templates/tokenDetail.html b/static/templates/tokenDetail.html
index 2bcd02672c..9eec908b4e 100644
--- a/static/templates/tokenDetail.html
+++ b/static/templates/tokenDetail.html
@@ -21,8 +21,8 @@ NFT Token Detail
| {{$data.ContractInfo.Contract}} {{$data.ContractInfo.Name}} |
- Contract type |
- {{$data.ContractInfo.Type}} |
+ Standard |
+ {{$data.ContractInfo.Standard}} |
diff --git a/static/templates/txdetail_ethereumtype.html b/static/templates/txdetail_ethereumtype.html
index e2acaa60dc..7c003e5db7 100644
--- a/static/templates/txdetail_ethereumtype.html
+++ b/static/templates/txdetail_ethereumtype.html
@@ -100,7 +100,7 @@
{{.FungibleTokenName}} Token Transfers
{{range $tt := $tx.TokenTransfers}}
- {{if eq $tt.Type $.FungibleTokenName}}
+ {{if eq $tt.Standard $.FungibleTokenName}}
@@ -128,7 +128,7 @@
{{.NonFungibleTokenName}} Token Transfers
{{range $tt := $tx.TokenTransfers}}
- {{if eq $tt.Type $.NonFungibleTokenName}}
+ {{if eq $tt.Standard $.NonFungibleTokenName}}
@@ -156,7 +156,7 @@
{{.MultiTokenName}} Token Transfers
{{range $tt := $tx.TokenTransfers}}
- {{if eq $tt.Type $.MultiTokenName}}
+ {{if eq $tt.Standard $.MultiTokenName}}
diff --git a/tests/dbtestdata/dbtestdata_ethereumtype.go b/tests/dbtestdata/dbtestdata_ethereumtype.go
index 41cfac5761..b16b60e34b 100644
--- a/tests/dbtestdata/dbtestdata_ethereumtype.go
+++ b/tests/dbtestdata/dbtestdata_ethereumtype.go
@@ -132,7 +132,7 @@ var Block1SpecificData = &bchain.EthereumBlockSpecificData{
Contracts: []bchain.ContractInfo{
{
Contract: EthAddrContract4a,
- Type: bchain.ERC20TokenType,
+ Standard: bchain.ERC20TokenStandard,
Name: "Contract 74",
Symbol: "S74",
Decimals: 12,
diff --git a/tests/dbtestdata/fakechain_ethereumtype.go b/tests/dbtestdata/fakechain_ethereumtype.go
index 3722ef416a..2b87602795 100644
--- a/tests/dbtestdata/fakechain_ethereumtype.go
+++ b/tests/dbtestdata/fakechain_ethereumtype.go
@@ -120,7 +120,7 @@ func (c *fakeBlockChainEthereumType) EthereumTypeGetNonce(addrDesc bchain.Addres
func (c *fakeBlockChainEthereumType) GetContractInfo(contractDesc bchain.AddressDescriptor) (*bchain.ContractInfo, error) {
addresses, _, _ := c.Parser.GetAddressesFromAddrDesc(contractDesc)
return &bchain.ContractInfo{
- Type: bchain.ERC20TokenType,
+ Standard: bchain.ERC20TokenStandard,
Contract: addresses[0],
Name: "Contract " + strconv.Itoa(int(contractDesc[0])),
Symbol: "S" + strconv.Itoa(int(contractDesc[0])),
diff --git a/tests/sync/sync.go b/tests/sync/sync.go
index b3e1642187..47c21a8adc 100644
--- a/tests/sync/sync.go
+++ b/tests/sync/sync.go
@@ -145,7 +145,7 @@ func makeRocksDB(parser bchain.BlockChainParser, m *common.Metrics, is *common.I
return nil, nil, err
}
- d, err := db.NewRocksDB(p, 1<<17, 1<<14, parser, m, false)
+ d, err := db.NewRocksDB(p, 1<<17, 1<<14, parser, m, false, 0, false)
if err != nil {
return nil, nil, err
}