Api
The Api class provides an interface for interacting with the backend API.
It handles authentication, network requests, and response parsing for various endpoints related to client management, blockchain data, and analytics.
Parameters
The base URL of the API server.
The API key used for authentication.
An instance of PortalRequests to handle HTTP requests. Defaults to a new instance.
An instance of Provider to access device specific data.
An optional instance of FeatureFlags for feature flag management.
The Enclave MPC API host. Defaults to mpc-client.portalhq.io.
Constructors
Properties
Asynchronously retrieves the client details using a coroutine.
Functions
Builds an EIP-155 compatible transaction for the specified blockchain.
Builds a Solana-compatible transaction for the specified blockchain.
Ejects the client from the system, removing their session.
Evaluates a transaction by validating its parameters.
Prepares the ejection of a wallet by obtaining the necessary share for the operation.
Generates both signing shares via the Enclave MPC API POST /v1/generate endpoint, opting into the pre-generated wallet pool. Returns the decoded response; the caller is responsible for validating the response and transforming the base64 shares into typed MpcShares.
Retrieves the list of fungible assets owned by the client on a specific blockchain.
Retrieves metadata for all stored backup share pairs associated with the client.
Fetches the client details from the API.
Retrieves the encrypted client backup share ciphertext associated with a given backup share pair ID.
Fetches the list of enabled decentralized applications (DApps) from the API.
Retrieves the list of available blockchain networks from the API.
Retrieves the list of NFT assets owned by the client on a specific blockchain.
Retrieves metadata for all stored signing share pairs associated with the client.
Fetches a list of transactions associated with the client on a given blockchain.
Prepares the ejection of a wallet by obtaining the necessary share for the operation.
Refreshes the client details by resetting the cached client and fetching updated information.
Stores the encrypted client backup share ciphertext for a given backup share pair ID.
Marks the client backup share as stored by the organization.
Marks the client backup share key as stored by the organization.
Marks a client signing share as stored by the organization.
Updates the status of a share pair (either signing or backup).