request
Sends a request to the Portal provider.
This function handles various Ethereum JSON-RPC methods and manages the interaction with the underlying blockchain and keychain. It supports both signed and unsigned requests.
Return
A PortalProviderResult containing the response from the provider.
Parameters
The ID of the blockchain network (e.g., "eth", "polygon").
The PortalRequestMethod to be executed (e.g., "eth_accounts", "eth_sendTransaction").
The list of parameters required for the specified method.
Optional PortalConnect object that may be needed for certain interactions, like signing. Defaults to null.
Optional RequestOptions containing request options like signatureApprovalMemo and sponsorGas. Defaults to null.
Throws
if the requested method is not supported by the specified chain.
if the request requires an address and none is found in the keychain for the given chain.
if the gateway returns HTTP 400 (e.g. malformed RPC payload). Sibling, not subclass, of PortalException.Api.RpcError — gateway 400s and JSON-RPC error envelopes are distinct failure categories. Catch them separately (or catch PortalException.Api to handle both).
if the gateway returns 200 with a JSON-RPC error envelope ({"jsonrpc":"2.0","error":{...}}).
if the gateway returns HTTP 401.
if the gateway returns any other non-success HTTP status (4xx ≥ 402, 5xx).
for transport-level failures (DNS resolution, connection timeouts, socket reads) — propagated raw, not wrapped.
if any other error occurs during request processing or signing.
Deprecated
Use request with RequestOptions instead
Replace with
request(chainId, method, params, connect, RequestOptions(signatureApprovalMemo = signatureApprovalMemo))Sends a request to the Portal provider.
This function handles various Ethereum JSON-RPC methods and manages the interaction with the underlying blockchain and keychain. It supports both signed and unsigned requests.
Return
A PortalProviderResult containing the response from the provider.
Parameters
The ID of the blockchain network (e.g., "eth", "polygon").
The PortalRequestMethod to be executed (e.g., "eth_accounts", "eth_sendTransaction").
The list of parameters required for the specified method.
Optional PortalConnect object that may be needed for certain interactions, like signing. Defaults to null.
Optional memo to be displayed during signature approval. Defaults to null.
Throws
if the requested method is not supported by the specified chain.
if the request requires an address and none is found in the keychain for the given chain.
if any other error occurs during request processing or signing.