You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's improve the explorer backend load by discussing our current tx fetching/caching strategy in our apps (mobile/desktop/extension wallets & explorer).
There are 2 main UI components where our apps display transactions:
Address transactions list
Aggregated wallet transactions list
1. Address transaction list
Found in:
Explorer "Address page"
Extension wallet "Account Activity" tab
Desktop wallet "Address details modal"
Click to see screenshots
Explorer "Address page"
Extension wallet "Account Activity" tab
Desktop wallet "Address details modal"
2. Aggregated wallet transaction list (txs from all wallet addresses together)
Found in:
Mobile wallet "Transfers tab"
Desktop wallet "Overview page"
Desktop wallet "Transfers page"
Click to see screenshots
Mobile wallet "Transfers tab"
Desktop wallet "Overview page"
Desktop wallet "Transfers page"
Desktop wallet
The DW uses Tanstack for query fetching, retrying, and caching (persistence).
The API data live in 2 places:
Tanstack query memory (RAM)
Persisted cache (HD)
Data fetching strategy overview
User launches the app. Tanstack query memory is empty.
User unlocks a wallet:
App hydrates Tanstack queries memory with the persisted query cache.
Cached data displayed in UI.
For every wallet address the app fires the query GET /address/{addressHash}/transactions?page=1&limit=1 (soon will be updated to GET /address/{addressHash}/latest-transaction)
If any of the responses do not match the cached value, the following endpoints will be called:
GET /address/{addressHash}/balance
GET /addresses/{addressHaash}/tokens-balance
POST /addresses/transactions?page=1&limit=5 (if the user goes/is to the Overview page)
POST /addresses/transactions?page=1 (if the user is in Transfers page and clicks "Click to see new transactions")
GET /addresses/{addressHash}/transactions?page=1 (if the user clicks on the "Click to see new transactions" in the address details modal)
Mobile wallet
TBD
Explorer
TBD
The text was updated successfully, but these errors were encountered:
The POST /addresses/transactions was introduced when we realized that relying on the GET /addresses/{addressHash}/transactions was insufficient. Requesting the 1st page of each address of a wallet might result in gaps in the transaction list.
Click here to see why.
Assuming a wallet with 2 addresses:
GET /addresses/{ADDRESS_1}/transactions might return 20 txs where the oldest is today
GET /addresses/{ADDRESS_2}/transactions might return 20 txs where the oldest is 1 year ago
Merging these 2 lists would create gaps in the aggregated tx list (all txs between today and 1 year ago).
That's when the POST endpoint was introduced. It accepts an array of addresses and returns a paginated array of txs, without gaps.
Let's improve the explorer backend load by discussing our current tx fetching/caching strategy in our apps (mobile/desktop/extension wallets & explorer).
There are 2 main UI components where our apps display transactions:
1. Address transaction list
Found in:
Click to see screenshots
2. Aggregated wallet transaction list (txs from all wallet addresses together)
Found in:
Click to see screenshots
Desktop wallet
The DW uses Tanstack for query fetching, retrying, and caching (persistence).
The API data live in 2 places:
Data fetching strategy overview
GET /address/{addressHash}/transactions?page=1&limit=1
(soon will be updated toGET /address/{addressHash}/latest-transaction
)GET /address/{addressHash}/balance
GET /addresses/{addressHaash}/tokens-balance
POST /addresses/transactions?page=1&limit=5
(if the user goes/is to the Overview page)POST /addresses/transactions?page=1
(if the user is in Transfers page and clicks "Click to see new transactions")GET /addresses/{addressHash}/transactions?page=1
(if the user clicks on the "Click to see new transactions" in the address details modal)Mobile wallet
Explorer
The text was updated successfully, but these errors were encountered: