File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export type PortfolioLibToken = Pick<
66>
77export type NetworkPortfolioLibResponse = {
88 tokens : PortfolioLibToken [ ]
9+ error ?: string | null
910}
1011
1112export type PortfolioToken = {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 NetworkPortfolioLibResponse ,
1515 PortfolioNetworkInfo
1616} from '../types'
17+ import { stringifyError } from '..'
1718
1819export async function getPortfolioForNetwork (
1920 address : string ,
@@ -28,7 +29,18 @@ export async function getPortfolioForNetwork(
2829 'https://relayer.ambire.com/velcro-v3'
2930 )
3031
31- return portfolio . get ( address , { baseCurrency : 'usd' } )
32+ return portfolio
33+ . get ( address , { baseCurrency : 'usd' } )
34+ . then ( ( data ) => data )
35+ . catch ( ( err ) => {
36+ const error = stringifyError ( err )
37+ console . error ( `Error fetching portfolio for network ${ network . name } : ${ error } ` )
38+
39+ return {
40+ tokens : [ ] ,
41+ error
42+ }
43+ } )
3244}
3345
3446export async function getPortfolioVelcroV3 (
You can’t perform that action at this time.
0 commit comments