Get ALT20 gas for a block
curl --request POST \
--url https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "alta_getAlt20GasByBlock",
"params": [
"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722"
]
}
'import requests
url = "https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "alta_getAlt20GasByBlock",
"params": ["0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722"]
}
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',
id: 1,
method: 'alta_getAlt20GasByBlock',
params: ['0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722']
})
};
fetch('https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock', 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-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock",
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',
'id' => 1,
'method' => 'alta_getAlt20GasByBlock',
'params' => [
'0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722'
]
]),
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-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"alta_getAlt20GasByBlock\",\n \"params\": [\n \"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722\"\n ]\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-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"alta_getAlt20GasByBlock\",\n \"params\": [\n \"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock")
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 \"id\": 1,\n \"method\": \"alta_getAlt20GasByBlock\",\n \"params\": [\n \"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722",
"gasByToken": [
{
"gasToken": "0x0000000000000000000000000000000000000000",
"transactionCount": "0x1",
"gasUsed": "0x5208",
"gasCost": "0x5208"
}
],
"transactions": [
{
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": "0x0",
"gasUsed": "0x5208",
"gasCost": "0x5208",
"transactionType": "0x7f",
"gasToken": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x5208",
"maxFeePerGas": "0x1",
"maxPriorityFeePerGas": "0x1",
"effectiveGasPrice": "0x1",
"maxGasCost": "0x5208"
}
]
}
}ALT20
Get ALT20 gas for a block
Returns per-token gas totals and 0x7f transaction details for a block. Returns null if the block is unknown.
POST
/
alta_getAlt20GasByBlock
Get ALT20 gas for a block
curl --request POST \
--url https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "alta_getAlt20GasByBlock",
"params": [
"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722"
]
}
'import requests
url = "https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "alta_getAlt20GasByBlock",
"params": ["0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722"]
}
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',
id: 1,
method: 'alta_getAlt20GasByBlock',
params: ['0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722']
})
};
fetch('https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock', 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-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock",
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',
'id' => 1,
'method' => 'alta_getAlt20GasByBlock',
'params' => [
'0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722'
]
]),
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-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"alta_getAlt20GasByBlock\",\n \"params\": [\n \"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722\"\n ]\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-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"alta_getAlt20GasByBlock\",\n \"params\": [\n \"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc-testnet.metalntwx.com/v1/{endpointId}/alta_getAlt20GasByBlock")
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 \"id\": 1,\n \"method\": \"alta_getAlt20GasByBlock\",\n \"params\": [\n \"0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722",
"gasByToken": [
{
"gasToken": "0x0000000000000000000000000000000000000000",
"transactionCount": "0x1",
"gasUsed": "0x5208",
"gasCost": "0x5208"
}
],
"transactions": [
{
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": "0x0",
"gasUsed": "0x5208",
"gasCost": "0x5208",
"transactionType": "0x7f",
"gasToken": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x5208",
"maxFeePerGas": "0x1",
"maxPriorityFeePerGas": "0x1",
"effectiveGasPrice": "0x1",
"maxGasCost": "0x5208"
}
]
}
}Body
application/json