toAddress for the transaction of sending 0.001 ETH from our MPC wallet. The Provider then receives a signed transaction from our mobile MPC library and submits that to chain using the configured RPC url.
Improving signing performance
You can reduce latency for EVM and otherSECP256K1 signing by enabling presignatures. The SDK will then pre-compute part of the MPC signing flow in the background and use that data when the user signs, without any change to your code. Enable it via the usePresignatures feature flag when creating your Portal instance. See Feature flags for details.
Idempotency keys
Starting from SDK version 5.2.0, you can makeeth_sendTransaction, sol_signAndSendTransaction or sol_signAndConfirmTransaction safe to retry after a timeout by passing an idempotencyKey in RequestOptions. Portal broadcasts a key at most once while it remembers the key (at least 24 hours), so a retry with the same key and the same transaction within that time cannot send the transaction twice. See Idempotency keys for generating keys, retrying, and handling a rejected retry.
Signing a User Operation
If your client uses Account Abstraction, you can sign an ERC-4337 User Operation using theeth_signUserOperation method. This signs the User Operation without submitting it on-chain, returning the signature directly.
You can also pass a signature approval memo and control gas sponsorship:
Signing a Solana Transaction
You can use our provider just like you do with Ethereum with Solana. Simply specify the method and the chainId for Solana. This example usessolana/web3.js to construct a transaction object to sign and pass to the multi-chain provider.
Solana Provider Methods
sol_signMessagesol_signTransactionsol_signAndSendTransactionsol_signAndConfirmTransaction
Raw sign
You can now utilize our SDK to generate raw signatures that are generated using the underlying key share without adding any chain specific formatting to the signature. This lets you produceSECP256K1 or ED25519 raw signatures. The namespace of the chain ID you pass selects the curve. Starting from SDK version 5.2.0, only the namespaces in the table below are supported.
A chain ID without a namespace is treated as
eip155. Starting from SDK version 5.2.0, any other namespace, such as xrpl: or sui:, throws an Error before the approval step and before anything is signed. The same applies to portal.rawSign and to the other signing methods of portal.request. See rawSign for details.
Estimating Gas
By default, Portal will estimate and populate thegas property in a transaction object if the property is undefined.
To estimate the gas value manually use the eth_estimateGas RPC call and pass in your transaction as the parameter.