Skip to main content
This example shows how the Portal Provider interacts with the blockchain.

Signing Messages

Personal Sign

The signMessage method uses the personal_sign RPC method which prepends the standard Ethereum message prefix before signing.
Ensure you have set the gateway URL correctly with Infura or Alchemy when you initialize the portal class.

Typed Data Signing (EIP-712)

For signing structured data according to the EIP-712 standard:

Raw Sign

For signing raw data without any prefix:
Raw sign does not add any prefix to the message. Use this for signing raw data or when working with chains that don’t use Ethereum’s message prefix.

Sending Transactions

Using sendTransaction

For full control over transaction parameters:

EIP-1559 Transactions

For EIP-1559 style transactions with priority fees:

Idempotency Keys

To make a transaction send safe to retry after a timeout, pass an idempotencyKey to sendTransaction, or to request for eth_sendTransaction, sol_signAndSendTransaction or sol_signAndConfirmTransaction. Portal broadcasts a key at most once while it remembers the key (at least 24 hours), so a retry with the same key within that time cannot send the transaction twice. See Idempotency keys for generating keys, retrying, and handling a rejected retry.

Generic Provider Requests

For any JSON-RPC method, use the request method:

Estimating Gas

Solana Signing

For Solana message signing, use the Solana chain ID:
Related Documentation