portal.api

The api property contains an instance of the PortalApi class, which has a number of helper methods to facilitate the retrieval of relevant application data from the Portal REST API.

portal.api.getNFTs

Fetches a list of non-fungible tokens (NFTs). The response is an array of objects where each object represents a unique NFT.
val nftAssets = portal.api.getNftAssets(chainId)

portal.api.getAssets

This endpoint retrieves the asset balances (native and token balances) for a specified blockchain. It provides detailed information on the native balance and token balances held by a given address on the specified chain.
val assets = portal.api.getAssets(chainId)

portal.api.getTransactions

Fetches a list of the client’s transaction history ordered by blockTimestamp descending (latest transactions will come first). This includes both inbound and outbound transactions.
val transactions = portal.api.getTransactions(chainId = "CHAIN_ID")
Optional arguments can also be provided:
  • limit: (Optional) The maximum number of transactions to return.
  • offset: (Optional) The number of transactions to skip before starting to return.
  • order: (Optional) Order in which to return the transactions. Either "asc" or "desc".
  • chainId: (Optional) ID of the chain to retrieve transactions from. Defaults to your Portal instance’s chainId if not provided.

portal.api.getBackupShareMetadata

Fetches a list of the client’s backup shares’ metadata, such as the backup method, when it was created, and the backup share’s id.
val backupSharePairs = portal.api.getBackupShareMetadata()