Learn how to use the paymasterBalance JSON-RPC method.
curl --request POST \
--url 'https://paymaster.particle.network/#pm_paymasterBalance' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_paymasterBalance",
"params": [
"<unknown>"
]
}
'{
"jsonrpc": "2.0",
"id": 0,
"result": {
"balance": "0xBalance"
}
}paymasterBalancepaymasterBalance returns the USD balance (6 decimals) of the Paymaster associated with your projectId (projectUuid) and serverKey (projectKey). It takes no parameters other than the projectUuid and projectKey for authentication.import Axios from "axios";
const projectUuid = "Your project uuid";
const projectKey = "Your project client key or server key";
const paymasterUrl = "https://paymaster.particle.network";
(async () => {
const response = await Axios.post(
paymasterUrl,
{
method: "pm_paymasterBalance",
params: [],
},
{
params: {
projectUuid,
projectKey,
},
}
);
console.log(response.data);
})();
UUID of the project.
Key of the project.
Request to retrieve the balance of the paymaster.
Version of the JSON-RPC protocol, should be 2.0.
"2.0"
The request identifier.
0
API method being called.
pm_paymasterBalance No parameters are needed for this request.
Was this page helpful?
curl --request POST \
--url 'https://paymaster.particle.network/#pm_paymasterBalance' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_paymasterBalance",
"params": [
"<unknown>"
]
}
'{
"jsonrpc": "2.0",
"id": 0,
"result": {
"balance": "0xBalance"
}
}