This example shows how the Portal Provider interacts with the blockchain.
address
of our MPC wallet. The Provider then proxies the request for balance to the configured RPC url and returns the result.
eip155:11155111
).BuildTransactionParam
struct is used to define the transaction details:
to
: The recipient’s address.token
: The token to send (in this case, USDC
).amount
: The amount of the token to send (e.g., 1
USDC).portal.buildEip155Transaction
method constructs the transaction object using the specified parameters.portal.request
method is used to sign and send the transaction. The method takes the chain ID, the eth_sendTransaction
method, and the transaction details as parameters.PortalRequestMethod
s available for you to use, which you can find in the SDK.
gas
property in a transaction
object if the property is undefined
.
To estimate the gas
value manually, you’ll want to use the eth_estimateGas
RPC call and pass in your transaction as the parameter.
eip155:11155111
).portal.getAddress
method retrieves the user’s wallet address for the specified chain.from
: The sender’s address.to
: The recipient’s address.value
: The amount of native token (ETH) to send, specified in WEI.portal.request
method is used to call the eth_estimateGas
method, which estimates the gas required for the transaction.solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
).BuildTransactionParam
struct is used to define the transaction details:
to
: The recipient’s address.token
: The token to send (in this case, USDC
).amount
: The amount of the token to send (e.g., 1
USDC).portal.buildSolanaTransaction
method constructs the transaction object using the specified parameters.portal.request
method is used to sign and send the transaction. The method takes the chain ID, the sol_signAndSendTransaction
method, and the transaction details as parameters.SECP256K1
or ED25519
.
useEnclaveMpcApi
feature flag the client key share will be transmitted from the user device, but it is never stored.useEnclaveMPCApi
to true
, the Portal instance will use the Enclave MPC API for signing transactions, ensuring faster computation and consistent performance across client devices.