Make all API fields camelCase
parent
9642e306ac
commit
064170c871
67
api/types.go
67
api/types.go
|
@ -170,22 +170,22 @@ type TokenTransfer struct {
|
||||||
type EthereumSpecific struct {
|
type EthereumSpecific struct {
|
||||||
Status int `json:"status"` // 1 OK, 0 Fail, -1 pending
|
Status int `json:"status"` // 1 OK, 0 Fail, -1 pending
|
||||||
Nonce uint64 `json:"nonce"`
|
Nonce uint64 `json:"nonce"`
|
||||||
GasLimit *big.Int `json:"gaslimit"`
|
GasLimit *big.Int `json:"gasLimit"`
|
||||||
GasUsed *big.Int `json:"gasused"`
|
GasUsed *big.Int `json:"gasUsed"`
|
||||||
GasPrice *Amount `json:"gasprice"`
|
GasPrice *Amount `json:"gasPrice"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tx holds information about a transaction
|
// Tx holds information about a transaction
|
||||||
type Tx struct {
|
type Tx struct {
|
||||||
Txid string `json:"txid"`
|
Txid string `json:"txid"`
|
||||||
Version int32 `json:"version,omitempty"`
|
Version int32 `json:"version,omitempty"`
|
||||||
Locktime uint32 `json:"locktime,omitempty"`
|
Locktime uint32 `json:"lockTime,omitempty"`
|
||||||
Vin []Vin `json:"vin"`
|
Vin []Vin `json:"vin"`
|
||||||
Vout []Vout `json:"vout"`
|
Vout []Vout `json:"vout"`
|
||||||
Blockhash string `json:"blockhash,omitempty"`
|
Blockhash string `json:"blockHash,omitempty"`
|
||||||
Blockheight int `json:"blockheight"`
|
Blockheight int `json:"blockHeight"`
|
||||||
Confirmations uint32 `json:"confirmations"`
|
Confirmations uint32 `json:"confirmations"`
|
||||||
Blocktime int64 `json:"blocktime"`
|
Blocktime int64 `json:"blockTime"`
|
||||||
Size int `json:"size,omitempty"`
|
Size int `json:"size,omitempty"`
|
||||||
ValueOutSat *Amount `json:"value"`
|
ValueOutSat *Amount `json:"value"`
|
||||||
ValueInSat *Amount `json:"valueIn,omitempty"`
|
ValueInSat *Amount `json:"valueIn,omitempty"`
|
||||||
|
@ -193,8 +193,8 @@ type Tx struct {
|
||||||
Hex string `json:"hex,omitempty"`
|
Hex string `json:"hex,omitempty"`
|
||||||
CoinSpecificData interface{} `json:"-"`
|
CoinSpecificData interface{} `json:"-"`
|
||||||
CoinSpecificJSON json.RawMessage `json:"-"`
|
CoinSpecificJSON json.RawMessage `json:"-"`
|
||||||
TokenTransfers []TokenTransfer `json:"tokentransfers,omitempty"`
|
TokenTransfers []TokenTransfer `json:"tokenTransfers,omitempty"`
|
||||||
EthereumSpecific *EthereumSpecific `json:"ethereumspecific,omitempty"`
|
EthereumSpecific *EthereumSpecific `json:"ethereumSpecific,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paging contains information about paging for address, blocks and block
|
// Paging contains information about paging for address, blocks and block
|
||||||
|
@ -244,13 +244,13 @@ type Address struct {
|
||||||
UnconfirmedBalanceSat *Amount `json:"unconfirmedBalance"`
|
UnconfirmedBalanceSat *Amount `json:"unconfirmedBalance"`
|
||||||
UnconfirmedTxs int `json:"unconfirmedTxs"`
|
UnconfirmedTxs int `json:"unconfirmedTxs"`
|
||||||
Txs int `json:"txs"`
|
Txs int `json:"txs"`
|
||||||
NonTokenTxs int `json:"nontokenTxs,omitempty"`
|
NonTokenTxs int `json:"nonTokenTxs,omitempty"`
|
||||||
Transactions []*Tx `json:"transactions,omitempty"`
|
Transactions []*Tx `json:"transactions,omitempty"`
|
||||||
Txids []string `json:"txids,omitempty"`
|
Txids []string `json:"txids,omitempty"`
|
||||||
Nonce string `json:"nonce,omitempty"`
|
Nonce string `json:"nonce,omitempty"`
|
||||||
TotalTokens int `json:"totalTokens,omitempty"`
|
TotalTokens int `json:"totalTokens,omitempty"`
|
||||||
Tokens []Token `json:"tokens,omitempty"`
|
Tokens []Token `json:"tokens,omitempty"`
|
||||||
Erc20Contract *bchain.Erc20Contract `json:"erc20contract,omitempty"`
|
Erc20Contract *bchain.Erc20Contract `json:"erc20Contract,omitempty"`
|
||||||
// helpers for explorer
|
// helpers for explorer
|
||||||
Filter string `json:"-"`
|
Filter string `json:"-"`
|
||||||
XPubAddresses map[string]struct{} `json:"-"`
|
XPubAddresses map[string]struct{} `json:"-"`
|
||||||
|
@ -293,13 +293,19 @@ type Blocks struct {
|
||||||
|
|
||||||
// BlockInfo contains extended block header data and a list of block txids
|
// BlockInfo contains extended block header data and a list of block txids
|
||||||
type BlockInfo struct {
|
type BlockInfo struct {
|
||||||
bchain.BlockHeader
|
Hash string `json:"hash"`
|
||||||
Version json.Number `json:"version"`
|
Prev string `json:"previousBlockHash,omitempty"`
|
||||||
MerkleRoot string `json:"merkleroot"`
|
Next string `json:"nextBlockHash,omitempty"`
|
||||||
Nonce string `json:"nonce"`
|
Height uint32 `json:"height"`
|
||||||
Bits string `json:"bits"`
|
Confirmations int `json:"confirmations"`
|
||||||
Difficulty string `json:"difficulty"`
|
Size int `json:"size"`
|
||||||
Txids []string `json:"tx,omitempty"`
|
Time int64 `json:"time,omitempty"`
|
||||||
|
Version json.Number `json:"version"`
|
||||||
|
MerkleRoot string `json:"merkleRoot"`
|
||||||
|
Nonce string `json:"nonce"`
|
||||||
|
Bits string `json:"bits"`
|
||||||
|
Difficulty string `json:"difficulty"`
|
||||||
|
Txids []string `json:"tx,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Block contains information about block
|
// Block contains information about block
|
||||||
|
@ -315,10 +321,10 @@ type BlockbookInfo struct {
|
||||||
Coin string `json:"coin"`
|
Coin string `json:"coin"`
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
GitCommit string `json:"gitcommit"`
|
GitCommit string `json:"gitCommit"`
|
||||||
BuildTime string `json:"buildtime"`
|
BuildTime string `json:"buildTime"`
|
||||||
SyncMode bool `json:"syncMode"`
|
SyncMode bool `json:"syncMode"`
|
||||||
InitialSync bool `json:"initialsync"`
|
InitialSync bool `json:"initialSync"`
|
||||||
InSync bool `json:"inSync"`
|
InSync bool `json:"inSync"`
|
||||||
BestHeight uint32 `json:"bestHeight"`
|
BestHeight uint32 `json:"bestHeight"`
|
||||||
LastBlockTime time.Time `json:"lastBlockTime"`
|
LastBlockTime time.Time `json:"lastBlockTime"`
|
||||||
|
@ -332,10 +338,25 @@ type BlockbookInfo struct {
|
||||||
About string `json:"about"`
|
About string `json:"about"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BackendInfo is used to get information about blockchain
|
||||||
|
type BackendInfo struct {
|
||||||
|
Chain string `json:"chain"`
|
||||||
|
Blocks int `json:"blocks"`
|
||||||
|
Headers int `json:"headers"`
|
||||||
|
Bestblockhash string `json:"bestBlockHash"`
|
||||||
|
Difficulty string `json:"difficulty"`
|
||||||
|
SizeOnDisk int64 `json:"sizeOnDisk"`
|
||||||
|
Version string `json:"version"`
|
||||||
|
Subversion string `json:"subversion"`
|
||||||
|
ProtocolVersion string `json:"protocolVersion"`
|
||||||
|
Timeoffset float64 `json:"timeOffset"`
|
||||||
|
Warnings string `json:"warnings"`
|
||||||
|
}
|
||||||
|
|
||||||
// SystemInfo contains information about the running blockbook and backend instance
|
// SystemInfo contains information about the running blockbook and backend instance
|
||||||
type SystemInfo struct {
|
type SystemInfo struct {
|
||||||
Blockbook *BlockbookInfo `json:"blockbook"`
|
Blockbook *BlockbookInfo `json:"blockbook"`
|
||||||
Backend *bchain.ChainInfo `json:"backend"`
|
Backend *BackendInfo `json:"backend"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MempoolTxid contains information about a transaction in mempool
|
// MempoolTxid contains information about a transaction in mempool
|
||||||
|
|
|
@ -1022,13 +1022,19 @@ func (w *Worker) GetBlock(bid string, page int, txsOnPage int) (*Block, error) {
|
||||||
return &Block{
|
return &Block{
|
||||||
Paging: pg,
|
Paging: pg,
|
||||||
BlockInfo: BlockInfo{
|
BlockInfo: BlockInfo{
|
||||||
BlockHeader: bi.BlockHeader,
|
Hash: bi.Hash,
|
||||||
Bits: bi.Bits,
|
Prev: bi.Prev,
|
||||||
Difficulty: string(bi.Difficulty),
|
Next: bi.Next,
|
||||||
MerkleRoot: bi.MerkleRoot,
|
Height: bi.Height,
|
||||||
Nonce: string(bi.Nonce),
|
Confirmations: bi.Confirmations,
|
||||||
Txids: bi.Txids,
|
Size: bi.Size,
|
||||||
Version: bi.Version,
|
Time: bi.Time,
|
||||||
|
Bits: bi.Bits,
|
||||||
|
Difficulty: string(bi.Difficulty),
|
||||||
|
MerkleRoot: bi.MerkleRoot,
|
||||||
|
Nonce: string(bi.Nonce),
|
||||||
|
Txids: bi.Txids,
|
||||||
|
Version: bi.Version,
|
||||||
},
|
},
|
||||||
TxCount: txCount,
|
TxCount: txCount,
|
||||||
Transactions: txs,
|
Transactions: txs,
|
||||||
|
@ -1043,15 +1049,15 @@ func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error) {
|
||||||
return nil, errors.Annotatef(err, "GetChainInfo")
|
return nil, errors.Annotatef(err, "GetChainInfo")
|
||||||
}
|
}
|
||||||
vi := common.GetVersionInfo()
|
vi := common.GetVersionInfo()
|
||||||
ss, bh, st := w.is.GetSyncState()
|
inSync, bestHeight, lastBlockTime := w.is.GetSyncState()
|
||||||
ms, mt, msz := w.is.GetMempoolSyncState()
|
inSyncMempool, lastMempoolTime, mempoolSize := w.is.GetMempoolSyncState()
|
||||||
var dbc []common.InternalStateColumn
|
var columnStats []common.InternalStateColumn
|
||||||
var dbs int64
|
var internalDBSize int64
|
||||||
if internal {
|
if internal {
|
||||||
dbc = w.is.GetAllDBColumnStats()
|
columnStats = w.is.GetAllDBColumnStats()
|
||||||
dbs = w.is.DBSizeTotal()
|
internalDBSize = w.is.DBSizeTotal()
|
||||||
}
|
}
|
||||||
bi := &BlockbookInfo{
|
blockbookInfo := &BlockbookInfo{
|
||||||
Coin: w.is.Coin,
|
Coin: w.is.Coin,
|
||||||
Host: w.is.Host,
|
Host: w.is.Host,
|
||||||
Version: vi.Version,
|
Version: vi.Version,
|
||||||
|
@ -1059,20 +1065,33 @@ func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error) {
|
||||||
BuildTime: vi.BuildTime,
|
BuildTime: vi.BuildTime,
|
||||||
SyncMode: w.is.SyncMode,
|
SyncMode: w.is.SyncMode,
|
||||||
InitialSync: w.is.InitialSync,
|
InitialSync: w.is.InitialSync,
|
||||||
InSync: ss,
|
InSync: inSync,
|
||||||
BestHeight: bh,
|
BestHeight: bestHeight,
|
||||||
LastBlockTime: st,
|
LastBlockTime: lastBlockTime,
|
||||||
InSyncMempool: ms,
|
InSyncMempool: inSyncMempool,
|
||||||
LastMempoolTime: mt,
|
LastMempoolTime: lastMempoolTime,
|
||||||
MempoolSize: msz,
|
MempoolSize: mempoolSize,
|
||||||
Decimals: w.chainParser.AmountDecimals(),
|
Decimals: w.chainParser.AmountDecimals(),
|
||||||
DbSize: w.db.DatabaseSizeOnDisk(),
|
DbSize: w.db.DatabaseSizeOnDisk(),
|
||||||
DbSizeFromColumns: dbs,
|
DbSizeFromColumns: internalDBSize,
|
||||||
DbColumns: dbc,
|
DbColumns: columnStats,
|
||||||
About: Text.BlockbookAbout,
|
About: Text.BlockbookAbout,
|
||||||
}
|
}
|
||||||
|
backendInfo := &BackendInfo{
|
||||||
|
Bestblockhash: ci.Bestblockhash,
|
||||||
|
Blocks: ci.Blocks,
|
||||||
|
Chain: ci.Chain,
|
||||||
|
Difficulty: ci.Difficulty,
|
||||||
|
Headers: ci.Headers,
|
||||||
|
ProtocolVersion: ci.ProtocolVersion,
|
||||||
|
SizeOnDisk: ci.SizeOnDisk,
|
||||||
|
Subversion: ci.Subversion,
|
||||||
|
Timeoffset: ci.Timeoffset,
|
||||||
|
Version: ci.Version,
|
||||||
|
Warnings: ci.Warnings,
|
||||||
|
}
|
||||||
glog.Info("GetSystemInfo finished in ", time.Since(start))
|
glog.Info("GetSystemInfo finished in ", time.Since(start))
|
||||||
return &SystemInfo{bi, ci}, nil
|
return &SystemInfo{blockbookInfo, backendInfo}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMempool returns a page of mempool txids
|
// GetMempool returns a page of mempool txids
|
||||||
|
|
|
@ -389,7 +389,7 @@ func httpTests_BitcoinType(t *testing.T, ts *httptest.Server) {
|
||||||
`{"blockbook":{"coin":"Fakecoin"`,
|
`{"blockbook":{"coin":"Fakecoin"`,
|
||||||
`"bestHeight":225494`,
|
`"bestHeight":225494`,
|
||||||
`"decimals":8`,
|
`"decimals":8`,
|
||||||
`"backend":{"chain":"fakecoin","blocks":2,"headers":2,"bestblockhash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6"`,
|
`"backend":{"chain":"fakecoin","blocks":2,"headers":2,"bestBlockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6"`,
|
||||||
`"version":"001001","subversion":"/Fakecoin:0.0.1/"`,
|
`"version":"001001","subversion":"/Fakecoin:0.0.1/"`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -426,7 +426,7 @@ func httpTests_BitcoinType(t *testing.T, ts *httptest.Server) {
|
||||||
status: http.StatusOK,
|
status: http.StatusOK,
|
||||||
contentType: "application/json; charset=utf-8",
|
contentType: "application/json; charset=utf-8",
|
||||||
body: []string{
|
body: []string{
|
||||||
`{"txid":"05e2e48aeabdd9b75def7b48d756ba304713c2aba7b522bf9dbc893fc4231b07","vin":[{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":2,"n":0,"addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"],"value":"9876"}],"vout":[{"value":"9000","n":0,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"]}],"blockhash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockheight":225494,"confirmations":1,"blocktime":22549400002,"value":"9000","valueIn":"9876","fees":"876"}`,
|
`{"txid":"05e2e48aeabdd9b75def7b48d756ba304713c2aba7b522bf9dbc893fc4231b07","vin":[{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":2,"n":0,"addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"],"value":"9876"}],"vout":[{"value":"9000","n":0,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"]}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":22549400002,"value":"9000","valueIn":"9876","fees":"876"}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -480,7 +480,7 @@ func httpTests_BitcoinType(t *testing.T, ts *httptest.Server) {
|
||||||
status: http.StatusOK,
|
status: http.StatusOK,
|
||||||
contentType: "application/json; charset=utf-8",
|
contentType: "application/json; charset=utf-8",
|
||||||
body: []string{
|
body: []string{
|
||||||
`{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw","balance":"0","totalReceived":"1234567890123","totalSent":"1234567890123","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"transactions":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","vin":[{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","n":0,"addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"],"value":"1234567890123"},{"txid":"00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840","vout":1,"n":1,"addresses":["mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz"],"value":"12345"}],"vout":[{"value":"317283951061","n":0,"spent":true,"hex":"76a914ccaaaf374e1b06cb83118453d102587b4273d09588ac","addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"]},{"value":"917283951061","n":1,"hex":"76a9148d802c045445df49613f6a70ddd2e48526f3701f88ac","addresses":["mtR97eM2HPWVM6c8FGLGcukgaHHQv7THoL"]}],"blockhash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockheight":225494,"confirmations":1,"blocktime":22549400000,"value":"1234567902122","valueIn":"1234567902468","fees":"346"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"hex":"76a914a08eae93007f22668ab5e4a9c83c8cd1c325e3e088ac","addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"]},{"value":"1","n":1,"spent":true,"hex":"a91452724c5178682f70e0ba31c6ec0633755a3b41d987","addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"]},{"value":"9876","n":2,"spent":true,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"]}],"blockhash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockheight":225493,"confirmations":2,"blocktime":22549300001,"value":"1234567900000","valueIn":"0","fees":"0"}]}`,
|
`{"page":1,"totalPages":1,"itemsOnPage":1000,"address":"mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw","balance":"0","totalReceived":"1234567890123","totalSent":"1234567890123","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"transactions":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","vin":[{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","n":0,"addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"],"value":"1234567890123"},{"txid":"00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840","vout":1,"n":1,"addresses":["mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz"],"value":"12345"}],"vout":[{"value":"317283951061","n":0,"spent":true,"hex":"76a914ccaaaf374e1b06cb83118453d102587b4273d09588ac","addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"]},{"value":"917283951061","n":1,"hex":"76a9148d802c045445df49613f6a70ddd2e48526f3701f88ac","addresses":["mtR97eM2HPWVM6c8FGLGcukgaHHQv7THoL"]}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":22549400000,"value":"1234567902122","valueIn":"1234567902468","fees":"346"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"hex":"76a914a08eae93007f22668ab5e4a9c83c8cd1c325e3e088ac","addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"]},{"value":"1","n":1,"spent":true,"hex":"a91452724c5178682f70e0ba31c6ec0633755a3b41d987","addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"]},{"value":"9876","n":2,"spent":true,"hex":"a914e921fc4912a315078f370d959f2c4f7b6d2a683c87","addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"]}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":22549300001,"value":"1234567900000","valueIn":"0","fees":"0"}]}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -552,7 +552,7 @@ func httpTests_BitcoinType(t *testing.T, ts *httptest.Server) {
|
||||||
status: http.StatusOK,
|
status: http.StatusOK,
|
||||||
contentType: "application/json; charset=utf-8",
|
contentType: "application/json; charset=utf-8",
|
||||||
body: []string{
|
body: []string{
|
||||||
`{"page":1,"totalPages":1,"itemsOnPage":3,"address":"upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q","balance":"118641975500","totalReceived":"118641975501","totalSent":"1","unconfirmedBalance":"0","unconfirmedTxs":0,"txs":2,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"]},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"]}],"blockhash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockheight":225494,"confirmations":1,"blocktime":22549400001,"value":"317283951000","valueIn":"317283951062","fees":"62"}],"totalTokens":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,"transactions":[{"txid":"3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71","vin":[{"txid":"7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25","n":0,"addresses":["mzB8cYrfRwFRFAGTDzV8LkUQy5BQicxGhX"],"value":"317283951061"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vout":1,"n":1,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"],"value":"1"}],"vout":[{"value":"118641975500","n":0,"hex":"a91495e9fbe306449c991d314afe3c3567d5bf78efd287","addresses":["2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu"]},{"value":"198641975500","n":1,"hex":"76a9143f8ba3fda3ba7b69f5818086e12223c6dd25e3c888ac","addresses":["mmJx9Y8ayz9h14yd9fgCW1bUKoEpkBAquP"]}],"blockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","blockHeight":225494,"confirmations":1,"blockTime":22549400001,"value":"317283951000","valueIn":"317283951062","fees":"62"}],"totalTokens":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}]}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -633,7 +633,7 @@ func httpTests_BitcoinType(t *testing.T, ts *httptest.Server) {
|
||||||
status: http.StatusOK,
|
status: http.StatusOK,
|
||||||
contentType: "application/json; charset=utf-8",
|
contentType: "application/json; charset=utf-8",
|
||||||
body: []string{
|
body: []string{
|
||||||
`{"page":1,"totalPages":1,"itemsOnPage":1000,"hash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","previousblockhash":"","nextblockhash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","height":225493,"confirmations":2,"size":1234567,"time":1534858021,"version":0,"merkleroot":"","nonce":"","bits":"","difficulty":"","txCount":2,"txs":[{"txid":"00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840","vin":[],"vout":[{"value":"100000000","n":0,"addresses":["mfcWp7DB6NuaZsExybTTXpVgWz559Np4Ti"]},{"value":"12345","n":1,"spent":true,"addresses":["mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz"]}],"blockhash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockheight":225493,"confirmations":2,"blocktime":1534858021,"value":"100012345","valueIn":"0","fees":"0"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"]},{"value":"1","n":1,"spent":true,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"]},{"value":"9876","n":2,"spent":true,"addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"]}],"blockhash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockheight":225493,"confirmations":2,"blocktime":1534858021,"value":"1234567900000","valueIn":"0","fees":"0"}]}`,
|
`{"page":1,"totalPages":1,"itemsOnPage":1000,"hash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","nextBlockHash":"00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6","height":225493,"confirmations":2,"size":1234567,"time":1534858021,"version":0,"merkleRoot":"","nonce":"","bits":"","difficulty":"","txCount":2,"txs":[{"txid":"00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840","vin":[],"vout":[{"value":"100000000","n":0,"addresses":["mfcWp7DB6NuaZsExybTTXpVgWz559Np4Ti"]},{"value":"12345","n":1,"spent":true,"addresses":["mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz"]}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":1534858021,"value":"100012345","valueIn":"0","fees":"0"},{"txid":"effd9ef509383d536b1c8af5bf434c8efbf521a4f2befd4022bbd68694b4ac75","vin":[],"vout":[{"value":"1234567890123","n":0,"spent":true,"addresses":["mv9uLThosiEnGRbVPS7Vhyw6VssbVRsiAw"]},{"value":"1","n":1,"spent":true,"addresses":["2MzmAKayJmja784jyHvRUW1bXPget1csRRG"]},{"value":"9876","n":2,"spent":true,"addresses":["2NEVv9LJmAnY99W1pFoc5UJjVdypBqdnvu1"]}],"blockHash":"0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997","blockHeight":225493,"confirmations":2,"blockTime":1534858021,"value":"1234567900000","valueIn":"0","fees":"0"}]}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue