Skip to main content

Send a transaction request

This guide explains how to send a transaction request from your app to Ronin Wallet using the window.ronin.provider provider object.

Prerequisites

Before requesting a transaction, your app must know which wallet address the user is using. To retrieve the user's addresses, see Get user’s wallet addresses.

Request a send RON transaction

To request a transaction, call the eth_requestTransaction method with a valid transaction object. For example, the following script requests a send RON transaction:

const sendRON = async () => {
const userAddresses = await getUserAddresses()

try {
await window.ronin.provider.request({
method: "eth_sendTransaction",
params: [{
to: "0xaddress",
from: userAddresses[0],
value: "0xDE0B6B3A7640000", // 1000000000000000000, 1 RON
gas: "0x5208",
data: "",
}],
})
} catch (error) {
console.error(error)
}
}
Was this helpful?
Happy React is loading...