SDK Reference
react
getPortfolio

getPortfolio Method

This method is used to get all the token assets in the user's portfolio.

Parameters

None

getPortfolio(): Promise<Portfolio[]>;

Example

import { useOkto, type OktoContextType, type Portfolio} from 'okto-sdk-react';
 
const { getPortfolio } = useOkto() as OktoContextType;
 
getPortfolio()
  .then((result) => {
          console.log(portfolio)
      })
      .catch((error) => {
          console.error(`error:`, error);
      });
});