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.buildTransaction
Creates an unsigned eip155/solana transaction for transferring assets to another address on a specific chain. You can then use this unsigned eip155/solana transaction to sign and submit the eip155/solana transaction.
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.
portal.api.getTransactionHistory
Returns the transaction history for a wallet across supported chains. Replaces the legacy getTransactions method with pagination and extended support for modern transaction types (including ERC-4337 UserOperations on EVM chains). EVM responses use the normalized format documented below, while Solana currently returns its legacy response shape and will be unified in a future update.
Optional parameters:
limit: (Optional) Maximum number of transactions to return (default: 50; max: 1000 for EVM, 15 for Solana).offset: (Optional) Number of transactions to skip for pagination (default: 0).order: (Optional) Sort order by block number:"asc"or"desc"(default:"desc", EVM only).address: (Optional) Address override (EVM only).userOperations: (Optional) Filter ERC-4337 UserOperations on EVM chains (eip155:*) only:"include","only", or"exclude". If omitted on EVM, the SDK sendsuserOperations=onlywhen the client has Account Abstraction enabled; otherwise the parameter is not sent. Non-EVM chains never use this filter.
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.
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.getBalances
Fetches a list of the client’s ERC20 token balances.
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.