This quick start guide will get you up and running with any of the Portal SDKs.
Settings
-> Test Client API Keys
section. Simply click the New +
button.
A modal will then be presented, allowing you to copy your test Client API Key. You can repeat this process as many times as you need to.
Portal
in your application, create a new instance of the Portal
class included in the package dependency you added. You can provide your new test Client API Key as the apiKey
argument during initialization. rpcConfig
is a map of CAIP-2 Chain IDs to their respective RPC URLs.
Portal offers custom approval flows during the signing process, but for now, we can auto-approve all signatures with the autoApprove
argument.
portal.createWallet()
function. You can optionally provide a callback to receive status updates during wallet creation.
portal.receiveTestnetAsset
. If you are looking for a greater variety of test tokens, we recommend exploring our faucets page.
portal.sendAsset()
- A simple method for sending tokens from your Portal wallet.portal.request()
- Direct access to the underlying web3 provider for custom transactions. (You can learn more about this method here.)portal.sendAsset()
as shown in the examples below.
txHash
is actually a User Operation hash. You can manually look up the user operation hash here.SOL
to submit a Solana transaction, which is not currently supported by portal.receiveTestnetAsset
. You can find a faucet to get test SOL
tokens here.