WalletBalanceProvider

Implements a logic of getting multiple tokens balance for one user address

NOTE: THIS CONTRACT IS NOT USED WITHIN THE ParaSpace PROTOCOL. It's an accessory contract used to reduce the number of calls towards the blockchain from the ParaSpace backend.

MOCK_ETH_ADDRESS

address MOCK_ETH_ADDRESS

receive

receive() external payable

Fallback function, don't accept any ETH

balanceOf

function balanceOf(address user, address token) public view returns (uint256)

_Check the token balance of a wallet in a token contract

Returns the balance of the token for user. Avoids possible errors:
  - return 0 on non-contract address_

batchBalanceOf

function batchBalanceOf(address[] users, address[] tokens) external view returns (uint256[])

Fetches, for a list of _users and _tokens (ETH included with mock address), the balances

Parameters

NameTypeDescription

users

address[]

The list of users

tokens

address[]

The list of tokens

Return Values

NameTypeDescription

[0]

uint256[]

And array with the concatenation of, for each user, his/her balances

getUserWalletBalances

function getUserWalletBalances(address provider, address user) external view returns (address[], uint256[])

provides balances of user wallet for all reserves available on the pool