Steps
- In order to send your first transaction, you’ll first need to fund your wallet. You can get some test MON tokens by using the Client API Fund Wallet endpoint.
- Next, we’ll need to format a transaction object.
- Now that we some testnet ETH, let’s send a transaction! We will send our test funds to a Portal test wallet using a single API request to
https://mpc-client.portalhq.io/v1/sign
.- You can learn more about Ethereum transactions here, but for this example you only need to know about a few fields:
method
: this defines which Ethereum RPC signer method we want to use.params
: these are the parameters of your transaction.value
: this is the amount of MON measured in wei and hex encoded.from
: this is the address of the sender - your wallet in this case.to
: this is the address you’re sending to - our test wallet in this case.data
: this is used for interacting with smart contracts - we can ignore it.
- You can learn more about Ethereum transactions here, but for this example you only need to know about a few fields:
eth_sendTransaction
Ethereum RPC method to instruct the Portal API to both sign and submit a transaction to the blockchain.
If your wallet is not funded, you will receive a RPC error on this step.