Get any Ethereum address's Aave portfolio data
The walletAavePortfolio
data slice provides a re-usable Alpine.js data slice for fetching both Aave market data and a given wallet address’s portfolio on Aave.
Data Slice Structure
fetchStatus
- Type: String
- Description: Represents the status of the bundled read request. Can be
'idle'
,'pending'
, or'success'
. Defaults to'idle'
.
summary
- Type: ExtendedUserSummary | Undefined
- Description: Wallet address portfolio summary + Aave market data summary. Defaults to
undefined
and is updated by thegetSummary()
method.
address
- Type: String | Undefined
- Description: Ethereum address to get the summary of. Defaults to
undefined
. Set or update it in the markup withx-bind
,x-init
, orx-data
.
Methods
The walletAavePortfolio
data slice provides the following method:
getSummary(): Promise<void>
This method fetches market data + Aave portfolio for a given Ethereum address.
Usage:
Put x-data='walletAavePortfolio'
to give the DOM node + its descendants access to this data slice.
Parameters:
- None
Example
The snippet below showcases a simple implementation of a widget that displays the Aave portfolio of a given Ethereum address.