Explorer
Get Portfolio
Learn how to retrieve a user's portfolio using the Okto SDK.
The getPortfolio
function retrieves the user's complete portfolio, including token holdings across all supported chains.
Method Overview
Method | Description |
---|---|
async getPortfolio | Get user's portfolio data |
Get Portfolio
async getPortfolio(oktoClient: OktoClient)
retrieves the user's portfolio data including token holdings and their values.
Parameters
Parameter | Type | Description |
---|---|---|
oktoClient | OktoClient | Instance of OktoClient obtained from useOkto hook |
Response
Success Response
Field Name | Type | Description |
---|---|---|
portfolio | Promise<UserPortfolioData> | User's portfolio data |
Example
Note
In case of errors, debug the error using the error code and refer to the SDK errors and warnings documentation for more details.