|
|
@ -134,7 +134,6 @@ class PrivateBalanceFetcher: PrivateBalanceFetcherType { |
|
|
|
|
|
|
|
|
|
|
|
private func refreshBalanceForNonErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> { |
|
|
|
private func refreshBalanceForNonErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> { |
|
|
|
assert(!tokens.contains { $0.isERC721Or1155AndNotForTickets }) |
|
|
|
assert(!tokens.contains { $0.isERC721Or1155AndNotForTickets }) |
|
|
|
guard !tokens.isEmpty else { return .value([]) } |
|
|
|
|
|
|
|
let promises = tokens.map { getBalanceForNonErc721Or1155Tokens(forToken: $0) } |
|
|
|
let promises = tokens.map { getBalanceForNonErc721Or1155Tokens(forToken: $0) } |
|
|
|
return when(resolved: promises).map { values -> [PrivateBalanceFetcher.TokenBatchOperation] in |
|
|
|
return when(resolved: promises).map { values -> [PrivateBalanceFetcher.TokenBatchOperation] in |
|
|
|
return values.compactMap { $0.optionalValue }.compactMap { $0 } |
|
|
|
return values.compactMap { $0.optionalValue }.compactMap { $0 } |
|
|
@ -250,7 +249,6 @@ class PrivateBalanceFetcher: PrivateBalanceFetcherType { |
|
|
|
|
|
|
|
|
|
|
|
private func refreshBalanceForErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> { |
|
|
|
private func refreshBalanceForErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> { |
|
|
|
assert(!tokens.contains { !$0.isERC721Or1155AndNotForTickets }) |
|
|
|
assert(!tokens.contains { !$0.isERC721Or1155AndNotForTickets }) |
|
|
|
guard !tokens.isEmpty else { return .value([]) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let tokensFromOpenSeaPromise = getTokensFromOpenSea() |
|
|
|
let tokensFromOpenSeaPromise = getTokensFromOpenSea() |
|
|
|
let enjinTokensPromise = getTokensFromEnjin() |
|
|
|
let enjinTokensPromise = getTokensFromEnjin() |
|
|
|