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.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
.