ethers.js backed by portal.provider.
portal.updateChain is used to bind portal.provider to a specific EVM chain. It takes the chain’s CAIP-2 reference, for example 11155111 for Sepolia, as argument.
portal.provider is then supplied to ethers.js BrowserProvider. The returned object is an ethers.js Provider and supports read-only requests to the chain. To be able to send a transaction we need a Signer which ethersProvider.getSigner returns.
The next bit of code is ethers.js specific and uses ethersSigner.sendTransaction to send 0.001 ETH to the address specified. The code also waits for the transaction to be mined.
That’s all! We’ve successfully used portal.provider and ethers.js to send a transaction!