pm_getERC20TokenQuotes
curl --request POST \
--url https://rpc.etherspot.io/paymaster/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "pm_getERC20TokenQuotes",
"params": [
{
"sender": "<string>",
"nonce": "<string>",
"initCode": "<string>",
"callData": "<string>",
"callGasLimit": "<string>",
"verificationGasLimit": "<string>",
"preVerificationGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"maxFeePerGas": "<string>",
"paymasterAndData": "<string>",
"signature": "<string>"
}
],
"id": 123
}
'import requests
url = "https://rpc.etherspot.io/paymaster/"
payload = {
"jsonrpc": "2.0",
"method": "pm_getERC20TokenQuotes",
"params": [
{
"sender": "<string>",
"nonce": "<string>",
"initCode": "<string>",
"callData": "<string>",
"callGasLimit": "<string>",
"verificationGasLimit": "<string>",
"preVerificationGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"maxFeePerGas": "<string>",
"paymasterAndData": "<string>",
"signature": "<string>"
}
],
"id": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'pm_getERC20TokenQuotes',
params: [
{
sender: '<string>',
nonce: '<string>',
initCode: '<string>',
callData: '<string>',
callGasLimit: '<string>',
verificationGasLimit: '<string>',
preVerificationGas: '<string>',
maxPriorityFeePerGas: '<string>',
maxFeePerGas: '<string>',
paymasterAndData: '<string>',
signature: '<string>'
}
],
id: 123
})
};
fetch('https://rpc.etherspot.io/paymaster/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc.etherspot.io/paymaster/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'method' => 'pm_getERC20TokenQuotes',
'params' => [
[
'sender' => '<string>',
'nonce' => '<string>',
'initCode' => '<string>',
'callData' => '<string>',
'callGasLimit' => '<string>',
'verificationGasLimit' => '<string>',
'preVerificationGas' => '<string>',
'maxPriorityFeePerGas' => '<string>',
'maxFeePerGas' => '<string>',
'paymasterAndData' => '<string>',
'signature' => '<string>'
]
],
'id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://rpc.etherspot.io/paymaster/"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"pm_getERC20TokenQuotes\",\n \"params\": [\n {\n \"sender\": \"<string>\",\n \"nonce\": \"<string>\",\n \"initCode\": \"<string>\",\n \"callData\": \"<string>\",\n \"callGasLimit\": \"<string>\",\n \"verificationGasLimit\": \"<string>\",\n \"preVerificationGas\": \"<string>\",\n \"maxPriorityFeePerGas\": \"<string>\",\n \"maxFeePerGas\": \"<string>\",\n \"paymasterAndData\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://rpc.etherspot.io/paymaster/")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"pm_getERC20TokenQuotes\",\n \"params\": [\n {\n \"sender\": \"<string>\",\n \"nonce\": \"<string>\",\n \"initCode\": \"<string>\",\n \"callData\": \"<string>\",\n \"callGasLimit\": \"<string>\",\n \"verificationGasLimit\": \"<string>\",\n \"preVerificationGas\": \"<string>\",\n \"maxPriorityFeePerGas\": \"<string>\",\n \"maxFeePerGas\": \"<string>\",\n \"paymasterAndData\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.etherspot.io/paymaster/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"pm_getERC20TokenQuotes\",\n \"params\": [\n {\n \"sender\": \"<string>\",\n \"nonce\": \"<string>\",\n \"initCode\": \"<string>\",\n \"callData\": \"<string>\",\n \"callGasLimit\": \"<string>\",\n \"verificationGasLimit\": \"<string>\",\n \"preVerificationGas\": \"<string>\",\n \"maxPriorityFeePerGas\": \"<string>\",\n \"maxFeePerGas\": \"<string>\",\n \"paymasterAndData\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"id\": 123\n}"
response = http.request(request)
puts response.read_bodyArka (Paymaster) API calls
pm_getERC20TokenQuotes
get token exchange quotes
POST
/
pm_getERC20TokenQuotes
curl --request POST \
--url https://rpc.etherspot.io/paymaster/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "pm_getERC20TokenQuotes",
"params": [
{
"sender": "<string>",
"nonce": "<string>",
"initCode": "<string>",
"callData": "<string>",
"callGasLimit": "<string>",
"verificationGasLimit": "<string>",
"preVerificationGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"maxFeePerGas": "<string>",
"paymasterAndData": "<string>",
"signature": "<string>"
}
],
"id": 123
}
'import requests
url = "https://rpc.etherspot.io/paymaster/"
payload = {
"jsonrpc": "2.0",
"method": "pm_getERC20TokenQuotes",
"params": [
{
"sender": "<string>",
"nonce": "<string>",
"initCode": "<string>",
"callData": "<string>",
"callGasLimit": "<string>",
"verificationGasLimit": "<string>",
"preVerificationGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"maxFeePerGas": "<string>",
"paymasterAndData": "<string>",
"signature": "<string>"
}
],
"id": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'pm_getERC20TokenQuotes',
params: [
{
sender: '<string>',
nonce: '<string>',
initCode: '<string>',
callData: '<string>',
callGasLimit: '<string>',
verificationGasLimit: '<string>',
preVerificationGas: '<string>',
maxPriorityFeePerGas: '<string>',
maxFeePerGas: '<string>',
paymasterAndData: '<string>',
signature: '<string>'
}
],
id: 123
})
};
fetch('https://rpc.etherspot.io/paymaster/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc.etherspot.io/paymaster/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'method' => 'pm_getERC20TokenQuotes',
'params' => [
[
'sender' => '<string>',
'nonce' => '<string>',
'initCode' => '<string>',
'callData' => '<string>',
'callGasLimit' => '<string>',
'verificationGasLimit' => '<string>',
'preVerificationGas' => '<string>',
'maxPriorityFeePerGas' => '<string>',
'maxFeePerGas' => '<string>',
'paymasterAndData' => '<string>',
'signature' => '<string>'
]
],
'id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://rpc.etherspot.io/paymaster/"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"pm_getERC20TokenQuotes\",\n \"params\": [\n {\n \"sender\": \"<string>\",\n \"nonce\": \"<string>\",\n \"initCode\": \"<string>\",\n \"callData\": \"<string>\",\n \"callGasLimit\": \"<string>\",\n \"verificationGasLimit\": \"<string>\",\n \"preVerificationGas\": \"<string>\",\n \"maxPriorityFeePerGas\": \"<string>\",\n \"maxFeePerGas\": \"<string>\",\n \"paymasterAndData\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://rpc.etherspot.io/paymaster/")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"pm_getERC20TokenQuotes\",\n \"params\": [\n {\n \"sender\": \"<string>\",\n \"nonce\": \"<string>\",\n \"initCode\": \"<string>\",\n \"callData\": \"<string>\",\n \"callGasLimit\": \"<string>\",\n \"verificationGasLimit\": \"<string>\",\n \"preVerificationGas\": \"<string>\",\n \"maxPriorityFeePerGas\": \"<string>\",\n \"maxFeePerGas\": \"<string>\",\n \"paymasterAndData\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc.etherspot.io/paymaster/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"pm_getERC20TokenQuotes\",\n \"params\": [\n {\n \"sender\": \"<string>\",\n \"nonce\": \"<string>\",\n \"initCode\": \"<string>\",\n \"callData\": \"<string>\",\n \"callGasLimit\": \"<string>\",\n \"verificationGasLimit\": \"<string>\",\n \"preVerificationGas\": \"<string>\",\n \"maxPriorityFeePerGas\": \"<string>\",\n \"maxFeePerGas\": \"<string>\",\n \"paymasterAndData\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"id\": 123\n}"
response = http.request(request)
puts response.read_bodyExample values you use to demo the API:
Example response:
{
"jsonrpc": "2.0",
"method": "pm_getERC20TokenQuotes",
"params": [
{
"sender": "0xB3aF6CFDDc444B948132753AD8214a20605692eF",
"nonce": "0x6",
"initCode": "0x",
"callData": "0x47e1da2a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000080a1874e1046b1cc5defdf4d3153838b72ff94ac0000000000000000000000000fd9e8d3af1aaee056eb9e802c3a762a667b1904000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000386ed13ba07e1c409693b299bbb9839d05af20c3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000",
"callGasLimit": "0x88b8",
"verificationGasLimit": "0x186a0",
"maxFeePerGas": "0x8dcac078f",
"maxPriorityFeePerGas": "0x8dcac078f",
"paymasterAndData": "0x0101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000001010101010100000000000000000000000000000000000000000000000000000000000000000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
"signature": "0x",
"preVerificationGas": "0xcb78"
},
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[{ token: "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904" }]
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
etherUSDExchangeRate: "0x1e"
paymasterAddress: "0x386eD13Ba07E1C409693b299BbB9839d05aF20c3"
gasEstimates: {
"preVerificationGas": "0xc01c",
"verificationGasLimit": "0xf4f1",
"callGasLimit": "0x15971"
}
feeEstimates: {
"maxFeePerGas": "0x8dcac078f",
"maxPriorityFeePerGas": "0x8dcac078f"
}
quotes: [
{
"token": "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904",
"symbol": "LINK",
"decimals": 18,
"etherTokenExchangeRate": "0x01a055690d9db80000",
"serviceFeePercent": 15
}
]
unsupportedTokens: []
}
}
Body
application/json
get Token exchange quotes for the supported tokens with fee and gas estimates
Response
200
Successful operation
⌘I

