finish up coins api
This commit is contained in:
parent
8032918639
commit
364e9fa6ca
3 changed files with 10 additions and 5 deletions
|
@ -115,16 +115,17 @@ func (s *AccountAPIService) AccountCoins(
|
|||
BlockIdentifier: block,
|
||||
Coins: coins,
|
||||
}
|
||||
//@Todo include_mempool query
|
||||
|
||||
//@Todo include_mempool query unsupported
|
||||
//https://github.com/coinbase/rosetta-bitcoin/issues/36#issuecomment-724992022
|
||||
//Once mempoolcoins are supported also change the bool service/types.go:MempoolCoins to true
|
||||
|
||||
if len(request.Currencies) > 0 {
|
||||
filtered := []*types.Coin{}
|
||||
|
||||
for _, curr := range request.Currencies {
|
||||
if curr == nil {
|
||||
continue
|
||||
}
|
||||
for _, coin := range coins {
|
||||
if coin.Amount.Currency.Symbol == curr.Symbol {
|
||||
if types.Hash(curr) == types.Hash(coin.Amount.Currency) {
|
||||
filtered = append(filtered, coin)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ func (s *NetworkAPIService) NetworkOptions(
|
|||
OperationTypes: bitcoin.OperationTypes,
|
||||
Errors: Errors,
|
||||
HistoricalBalanceLookup: HistoricalBalanceLookup,
|
||||
MempoolCoins: MempoolCoins,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ const (
|
|||
// that historical balance lookup is supported.
|
||||
HistoricalBalanceLookup = true
|
||||
|
||||
//Include mempool coins when fetching account coints
|
||||
MempoolCoins = false
|
||||
|
||||
// inlineFetchLimit is the maximum number
|
||||
// of transactions to fetch inline.
|
||||
inlineFetchLimit = 100
|
||||
|
|
Loading…
Reference in a new issue