NAV Navigation
cURL JavaScript GO Ruby Python Java

XinFin APIs v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Happy to code XinFin APIs

License: Github

XinFin JSON-RPC v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

A collection holding all the XinFin JSON​ RPC API calls

Base URLs:

web3

API for web3 request

clientRequest

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/clientVersion \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "web3_clientVersion",
  "params": [],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//clientVersion");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/clientVersion"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/clientVersion")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//clientVersion", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/clientVersion")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":1}")
  .asString();

POST /clientVersion

Returns the current client version.

Parameters

none

Returns

String - The current client version

Body parameter

{
  "jsonrpc": "2.0",
  "method": "web3_clientVersion",
  "params": [],
  "id": 1
}

Parameters

Name In Type Required Description
body body clientVersionRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

sha3Request

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/sha3 \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":64}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "web3_sha3",
  "params": [
    "0x68656c6c6f20776f726c64"
  ],
  "id": 64
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//sha3");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/sha3"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"web3_sha3\",\"params\":[\"0x68656c6c6f20776f726c64\"],\"id\":64}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/sha3")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"web3_sha3\",\"params\":[\"0x68656c6c6f20776f726c64\"],\"id\":64}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"web3_sha3\",\"params\":[\"0x68656c6c6f20776f726c64\"],\"id\":64}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//sha3", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/sha3")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"web3_sha3\",\"params\":[\"0x68656c6c6f20776f726c64\"],\"id\":64}")
  .asString();

POST /sha3

Returns Keccak-256 (not the standardized SHA3-256) of the given data.

Parameters

params: [ "0x68656c6c6f20776f726c64" ]

Returns

DATA - The SHA3 result of the given string.

Body parameter

{
  "jsonrpc": "2.0",
  "method": "web3_sha3",
  "params": [
    "0x68656c6c6f20776f726c64"
  ],
  "id": 64
}

Parameters

Name In Type Required Description
body body sha3request true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

net

API for network request

versionRequest

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/version \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 67
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//version");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/version"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"net_version\",\"params\":[],\"id\":67}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/version")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"net_version\",\"params\":[],\"id\":67}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"net_version\",\"params\":[],\"id\":67}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//version", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/version")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"net_version\",\"params\":[],\"id\":67}")
  .asString();

POST /version

Returns the current network id.

Parameters

none

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 67
}

Parameters

Name In Type Required Description
body body versionrequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

listeningRequest

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/listening \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":67}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": [],
  "id": 67
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//listening");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/listening"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"net_listening\",\"params\":[],\"id\":67}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/listening")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"net_listening\",\"params\":[],\"id\":67}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"net_listening\",\"params\":[],\"id\":67}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//listening", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/listening")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"net_listening\",\"params\":[],\"id\":67}")
  .asString();

POST /listening

Returns true if client is actively listening for network connections.

Parameters

none

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": [],
  "id": 67
}

Parameters

Name In Type Required Description
body body listeningrequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

peerCountRequest

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/peerCount \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":74}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "net_peerCount",
  "params": [],
  "id": 74
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//peerCount");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/peerCount"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"net_peerCount\",\"params\":[],\"id\":74}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/peerCount")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"net_peerCount\",\"params\":[],\"id\":74}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"net_peerCount\",\"params\":[],\"id\":74}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//peerCount", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/peerCount")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"net_peerCount\",\"params\":[],\"id\":74}")
  .asString();

POST /peerCount

Returns number of peers currently connected to the client.

Parameters

none

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "net_peerCount",
  "params": [],
  "id": 74
}

Parameters

Name In Type Required Description
body body peerCountRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

eth

API for eth information

protocolVersionRequest

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/protocolVersion \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[],"id":67}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_protocolVersion",
  "params": [],
  "id": 67
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//protocolVersion");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/protocolVersion"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_protocolVersion\",\"params\":[],\"id\":67}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/protocolVersion")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_protocolVersion\",\"params\":[],\"id\":67}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_protocolVersion\",\"params\":[],\"id\":67}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//protocolVersion", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/protocolVersion")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_protocolVersion\",\"params\":[],\"id\":67}")
  .asString();

POST /protocolVersion

Returns the current ethereum protocol version.

Parameters

none

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_protocolVersion",
  "params": [],
  "id": 67
}

Parameters

Name In Type Required Description
body body protocolVersionRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

syncingrequest

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/syncing \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_syncing",
  "params": [],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//syncing");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/syncing"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_syncing\",\"params\":[],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/syncing")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_syncing\",\"params\":[],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_syncing\",\"params\":[],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//syncing", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/syncing")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_syncing\",\"params\":[],\"id\":1}")
  .asString();

POST /syncing

Returns an object with data about the sync status or false.

Parameters

none

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_syncing",
  "params": [],
  "id": 1
}

Parameters

Name In Type Required Description
body body syncingrequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

coinbase

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/coinbase \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":64}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_coinbase",
  "params": [],
  "id": 64
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//coinbase");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/coinbase"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_coinbase\",\"params\":[],\"id\":64}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/coinbase")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_coinbase\",\"params\":[],\"id\":64}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_coinbase\",\"params\":[],\"id\":64}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//coinbase", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/coinbase")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_coinbase\",\"params\":[],\"id\":64}")
  .asString();

POST /coinbase

Returns the client coinbase address. Parameters none Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_coinbase",
  "params": [],
  "id": 64
}

Parameters

Name In Type Required Description
body body coinbaserequest true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
500 Internal Server Error Internal Server Error None

gasPrice

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/gasPrice \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":73}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 73
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//gasPrice");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/gasPrice"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_gasPrice\",\"params\":[],\"id\":73}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/gasPrice")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_gasPrice\",\"params\":[],\"id\":73}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_gasPrice\",\"params\":[],\"id\":73}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//gasPrice", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/gasPrice")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_gasPrice\",\"params\":[],\"id\":73}")
  .asString();

POST /gasPrice

Returns the current price per gas in wei. Parameters none Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 73
}

Parameters

Name In Type Required Description
body body gasPriceRequest true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
500 Internal Server Error Internal Server Error None

accounts

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/accounts \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_accounts",
  "params": [],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//accounts");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/accounts"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_accounts\",\"params\":[],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/accounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_accounts\",\"params\":[],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_accounts\",\"params\":[],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//accounts", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/accounts")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_accounts\",\"params\":[],\"id\":1}")
  .asString();

POST /accounts

Returns a list of addresses owned by client.

Parameters

none

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_accounts",
  "params": [],
  "id": 1
}

Parameters

Name In Type Required Description
body body accountsrequest true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
500 Internal Server Error Internal Server Error None

blockNumber

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/blockNumber \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 83
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//blockNumber");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/blockNumber"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":83}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/blockNumber")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":83}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":83}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//blockNumber", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/blockNumber")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":83}")
  .asString();

POST /blockNumber

Returns the number of most recent block. Parameters none Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 83
}

Parameters

Name In Type Required Description
body body blockNumberRequest true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
500 Internal Server Error Internal Server Error None

getBalance

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/getBalance \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x2b5634c42055806a59e9107ed44d43c426e58258","latest"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": [
    "0x2b5634c42055806a59e9107ed44d43c426e58258",
    "latest"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBalance");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/getBalance"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"0x2b5634c42055806a59e9107ed44d43c426e58258\",\"latest\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/getBalance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"0x2b5634c42055806a59e9107ed44d43c426e58258\",\"latest\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"0x2b5634c42055806a59e9107ed44d43c426e58258\",\"latest\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBalance", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/getBalance")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"0x2b5634c42055806a59e9107ed44d43c426e58258\",\"latest\"],\"id\":1}")
  .asString();

POST /getBalance

Returns the balance of the account of given address.

Parameters

   ' 0x2b5634c42055806a59e9107ed44d43c426e58258',
   'latest'
] ```

**Returns**
- `QUANTITY` - integer of the current balance in wei.

> Body parameter

```json
{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": [
    "0x2b5634c42055806a59e9107ed44d43c426e58258",
    "latest"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBalanceRequest true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
500 Internal Server Error Internal Server Error None

getStorageAt

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/getStorageAt \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x295a70b2de5e3953354a6a8344e616ed314d7251","0x0","latest"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getStorageAt",
  "params": [
    "0x295a70b2de5e3953354a6a8344e616ed314d7251",
    "0x0",
    "latest"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getStorageAt");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/getStorageAt"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getStorageAt\",\"params\":[\"0x295a70b2de5e3953354a6a8344e616ed314d7251\",\"0x0\",\"latest\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/getStorageAt")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getStorageAt\",\"params\":[\"0x295a70b2de5e3953354a6a8344e616ed314d7251\",\"0x0\",\"latest\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getStorageAt\",\"params\":[\"0x295a70b2de5e3953354a6a8344e616ed314d7251\",\"0x0\",\"latest\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getStorageAt", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/getStorageAt")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getStorageAt\",\"params\":[\"0x295a70b2de5e3953354a6a8344e616ed314d7251\",\"0x0\",\"latest\"],\"id\":1}")
  .asString();

POST /getStorageAt

Returns the balance of the account of given address.

Parameters


params: [
      '0x2b5634c42055806a59e9107ed44d43c426e58258',
      'latest'
      ]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getStorageAt",
  "params": [
    "0x295a70b2de5e3953354a6a8344e616ed314d7251",
    "0x0",
    "latest"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getStorageAtRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getTransactionCount

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/getTransactionCount \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0xbf1dcb735e512b731abd3404c15df6431bd03d42","latest"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0xbf1dcb735e512b731abd3404c15df6431bd03d42",
    "latest"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getTransactionCount");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/getTransactionCount"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionCount\",\"params\":[\"0xbf1dcb735e512b731abd3404c15df6431bd03d42\",\"latest\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/getTransactionCount")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionCount\",\"params\":[\"0xbf1dcb735e512b731abd3404c15df6431bd03d42\",\"latest\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionCount\",\"params\":[\"0xbf1dcb735e512b731abd3404c15df6431bd03d42\",\"latest\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getTransactionCount", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/getTransactionCount")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionCount\",\"params\":[\"0xbf1dcb735e512b731abd3404c15df6431bd03d42\",\"latest\"],\"id\":1}")
  .asString();

POST /getTransactionCount

Returns the number of transactions sent from an address.

Parameters


params: [
  '0x407d73d8a49eeb85d32cf465507dd71d507100c1',
  'latest' // state at the latest block
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0xbf1dcb735e512b731abd3404c15df6431bd03d42",
    "latest"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getTransactionCountRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockTransactionCountByHash

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/getBlockTransactionCountByHash \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockTransactionCountByHash");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/getBlockTransactionCountByHash"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByHash\",\"params\":[\"0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/getBlockTransactionCountByHash")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByHash\",\"params\":[\"0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByHash\",\"params\":[\"0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockTransactionCountByHash", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/getBlockTransactionCountByHash")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByHash\",\"params\":[\"0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34\"],\"id\":1}")
  .asString();

POST /getBlockTransactionCountByHash

Returns the number of transactions in a block from a block matching the given block hash.

Parameters


params: [
  '0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockTransactionCountByHashRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockTransactionCountByNumber

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/getBlockTransactionCountByNumber \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["0x52A8CA"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByNumber",
  "params": [
    "0x52A8CA"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockTransactionCountByNumber");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/getBlockTransactionCountByNumber"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByNumber\",\"params\":[\"0x52A8CA\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/getBlockTransactionCountByNumber")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByNumber\",\"params\":[\"0x52A8CA\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByNumber\",\"params\":[\"0x52A8CA\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockTransactionCountByNumber", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/getBlockTransactionCountByNumber")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockTransactionCountByNumber\",\"params\":[\"0x52A8CA\"],\"id\":1}")
  .asString();

POST /getBlockTransactionCountByNumber

Returns the number of transactions in a block matching the given block number.

Parameters

params: [
  '0x85', // 232
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByNumber",
  "params": [
    "0x52A8CA"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockTransactionCountByNumberRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getCode

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/getCode \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","0x2"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": [
    "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
    "0x2"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getCode");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/getCode"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\"0x2\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/getCode")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\"0x2\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\"0x2\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getCode", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/getCode")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\"0x2\"],\"id\":1}")
  .asString();

POST /getCode

Returns code at a given address.

Parameters

params: [
  '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
  '0x2'  // 2
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": [
    "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
    "0x2"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getCodeRequest true none

Responses

Status Meaning Description Schema
200 OK Successful operation None
500 Internal Server Error Internal Server Error None

sign

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/sign \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_sign","params":["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83","0xdeadbeaf"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_sign",
  "params": [
    "0x9b2055d370f73ec7d8a03e965129118dc8f5bf83",
    "0xdeadbeaf"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//sign");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/sign"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_sign\",\"params\":[\"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83\",\"0xdeadbeaf\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/sign")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_sign\",\"params\":[\"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83\",\"0xdeadbeaf\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_sign\",\"params\":[\"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83\",\"0xdeadbeaf\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//sign", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/sign")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_sign\",\"params\":[\"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83\",\"0xdeadbeaf\"],\"id\":1}")
  .asString();

POST /sign

The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).

By adding a prefix to the message makes the calculated signature recognisable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.

Note: the address to sign with must be unlocked.

Parameters

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_sign",
  "params": [
    "0x9b2055d370f73ec7d8a03e965129118dc8f5bf83",
    "0xdeadbeaf"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body signrequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

sendTransaction

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/sendTransaction \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0xb60e8dd61c5d32be8058bb8eb970870f07233155","to":"0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas":"0x76c0","gasPrice":"0x9184e72a000","value":"0x9184e72a","data":"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_sendTransaction",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//sendTransaction");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/sendTransaction"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/sendTransaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//sendTransaction", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/sendTransaction")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}")
  .asString();

POST /sendTransaction

Creates new message call transaction or a contract creation, if the data field contains code.

Parameters

Object - The transaction object

params: [{
  "from": " 0xb60e8dd61c5d32be8058bb8eb970870f07233155",
  "to": " 0xd46e8dd67c5d32be8058bb8eb970870f07244567",
  "gas": "0x76c0", // 30400
  "gasPrice": "0x9184e72a000", // 10000000000000
  "value": "0x9184e72a", // 2441406250
  "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
}]

Returns

Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_sendTransaction",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body sendTransactionRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

sendRawTransaction

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/sendRawTransaction \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransaction",
  "params": [
    "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//sendRawTransaction");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/sendRawTransaction"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/sendRawTransaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

  conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//sendRawTransaction", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//sendRawTransaction")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"],\"id\":1}")
  .asString();

POST /sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions.

Parameters

params: ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"]

Returns

Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransaction",
  "params": [
    "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body sendRawTransactionRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

call

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//call \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0xb60e8dd61c5d32be8058bb8eb970870f07233155","to":"0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas":"0x76c0","gasPrice":"0x9184e72a000","value":"0x9184e72a","data":"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"},"latest"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    },
    "latest"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//call");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//call"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"},\"latest\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/call")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"},\"latest\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"},\"latest\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//call", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network/call")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"},\"latest\"],\"id\":1}")
  .asString();

POST /call

Executes a new message call immediately without creating a transaction on the block chain.

Parameters

Object [required]- The transaction call object

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    },
    "latest"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body callrequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

estimateGas

Code samples

curl --request POST \
  --url https://rpc.xinfin.network/estimateGas \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{"from":"0xb60e8dd61c5d32be8058bb8eb970870f07233155","to":"0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas":"0x76c0","gasPrice":"0x9184e72a000","value":"0x9184e72a","data":"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//estimateGas");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network/estimateGas"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_estimateGas\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network/estimateGas")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_estimateGas\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_estimateGas\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//estimateGas", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//estimateGas")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_estimateGas\",\"params\":[{\"from\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\":\"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\":\"0x76c0\",\"gasPrice\":\"0x9184e72a000\",\"value\":\"0x9184e72a\",\"data\":\"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}],\"id\":1}")
  .asString();

POST /estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.

Parameters

See eth_call parameters, expect that all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit.

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body estimateGasRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockByHash

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getBlockByHash \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624",true],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockByHash",
  "params": [
    "0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624",
    true
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockByHash");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getBlockByHash"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByHash\",\"params\":[\"0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624\",true],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getBlockByHash")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByHash\",\"params\":[\"0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624\",true],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByHash\",\"params\":[\"0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624\",true],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockByHash", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getBlockByHash")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByHash\",\"params\":[\"0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624\",true],\"id\":1}")
  .asString();

POST /getBlockByHash

Returns information about a block by hash.

Parameters

params: [
  '0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624',
  true
]

Returns Object - A block object, or null when no block was found:

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByHash",
  "params": [
    "0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624",
    true
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockByHashRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockByNumber

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getBlockByNumber \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x0",true],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": [
    "0x0",
    true
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockByNumber");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getBlockByNumber"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",true],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getBlockByNumber")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",true],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",true],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockByNumber", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getBlockByNumber")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",true],\"id\":1}")
  .asString();

POST /getBlockByNumber

Returns information about a block by block number.

Parameters

BLOCKNUMBER [required] - a hex code of an integer representing the BLOCKNUMBER or one of the following special params:

FULLTX [required] - a boolean value specified whether you want to get transactions list or not

params: [
  '0x0',
  true
]

Returns

See eth_getBlockByHash

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": [
    "0x0",
    true
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockByNumberRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockSignersByNumber

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getBlockSignersByNumber \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockSignersByNumber","params":["0xA61F98"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockSignersByNumber",
  "params": [
    "0xA61F98"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockSignersByNumber");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getBlockSignersByNumber"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getBlockSignersByNumber")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockSignersByNumber", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getBlockSignersByNumber")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}")
  .asString();

POST /getBlockSignersByNumber

Returns the signers set of the block of given BLOCKNUMBER.

Parameters

BLOCKNUMBER [required] - a hex code of an integer representing the BLOCKNUMBER or one of the following special params:

params: [
  '0xA61F98'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockSignersByNumber",
  "params": [
    "0xA61F98"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockSignersByNumberRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockSignersByHash

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getBlockSignersByHash \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockSignersByHash","params":["0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockSignersByHash",
  "params": [
    "0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockSignersByHash");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getBlockSignersByHash"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getBlockSignersByHash")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockSignersByHash", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getBlockSignersByHash")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockSignersByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}")
  .asString();

POST /getBlockSignersByHash

Returns the signers set of the block of given BLOCKHASH.

Parameters

params: [
  '0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockSignersByHash",
  "params": [
    "0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockSignersByHashRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockFinalityByNumber

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getBlockFinalityByNumber \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockFinalityByNumber","params":["0xA61F98"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockFinalityByNumber",
  "params": [
    "0xA61F98"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockFinalityByNumber");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getBlockFinalityByNumber"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getBlockFinalityByNumber")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockFinalityByNumber", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getBlockFinalityByNumber")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByNumber\",\"params\":[\"0xA61F98\"],\"id\":1}")
  .asString();

POST /getBlockFinalityByNumber

Returns the the finality of the block of given BLOCKNUMBER.

Parameters

params: [
  '0xA61F98'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockFinalityByNumber",
  "params": [
    "0xA61F98"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockFinalityByNumberRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getBlockFinalityByHash

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getBlockFinalityByHash \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getBlockFinalityByHash","params":["0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getBlockFinalityByHash",
  "params": [
    "0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getBlockFinalityByHash");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getBlockFinalityByHash"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getBlockFinalityByHash")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getBlockFinalityByHash", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getBlockFinalityByHash")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockFinalityByHash\",\"params\":[\"0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f\"],\"id\":1}")
  .asString();

POST /getBlockFinalityByHash

Returns the the finality of the block of given BLOCKHASH.

Parameters

BLOCKHASH [required] - a string representing a BLOCKHASH

params: [
  '0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockFinalityByHash",
  "params": [
    "0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getBlockFinalityByHashRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getCandidates

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getCandidates \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getCandidates","params":["latest"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getCandidates",
  "params": [
    "latest"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getCandidates");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getCandidates"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidates\",\"params\":[\"latest\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getCandidates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidates\",\"params\":[\"latest\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidates\",\"params\":[\"latest\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getCandidates", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getCandidates")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidates\",\"params\":[\"latest\"],\"id\":1}")
  .asString();

POST /getCandidates

Returns the statuses of all candidates at a specific epoch

Parameters


params: [
  'latest'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getCandidates",
  "params": [
    "latest"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getCandidatesRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getCandidateStatus

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getCandidateStatus \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getCandidateStatus","params":["0x1d50df657b6dce50bac634bf18e2d986d807e940","latest"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getCandidateStatus",
  "params": [
    "0x1d50df657b6dce50bac634bf18e2d986d807e940",
    "latest"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getCandidateStatus");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getCandidateStatus"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidateStatus\",\"params\":[\"0x1d50df657b6dce50bac634bf18e2d986d807e940\",\"latest\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getCandidateStatus")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidateStatus\",\"params\":[\"0x1d50df657b6dce50bac634bf18e2d986d807e940\",\"latest\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidateStatus\",\"params\":[\"0x1d50df657b6dce50bac634bf18e2d986d807e940\",\"latest\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getCandidateStatus", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getCandidateStatus")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCandidateStatus\",\"params\":[\"0x1d50df657b6dce50bac634bf18e2d986d807e940\",\"latest\"],\"id\":1}")
  .asString();

POST /getCandidateStatus

Returns the status of the candidate of given COINBASE_ADDRESS at a specific epoch

Parameters


params: [
  '0x1d50df657b6dce50bac634bf18e2d986d807e940',
  'latest'
]

Returns

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getCandidateStatus",
  "params": [
    "0x1d50df657b6dce50bac634bf18e2d986d807e940",
    "latest"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getCandidateStatusRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getTransactionByHash

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getTransactionByHash \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByHash",
  "params": [
    "0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getTransactionByHash");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getTransactionByHash"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByHash\",\"params\":[\"0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getTransactionByHash")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByHash\",\"params\":[\"0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByHash\",\"params\":[\"0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getTransactionByHash", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getTransactionByHash")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByHash\",\"params\":[\"0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1\"],\"id\":1}")
  .asString();

POST /getTransactionByHash

Returns the information about a transaction requested by transaction hash.

Parameters

params: [
  "0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1"
]

Returns

Object - A transaction object, or null when no transaction was found:

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByHash",
  "params": [
    "0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getTransactionByHashRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getTransactionByBlockHashAndIndex

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getTransactionByBlockHashAndIndex \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7","0x0"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockHashAndIndex",
  "params": [
    "0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7",
    "0x0"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getTransactionByBlockHashAndIndex");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getTransactionByBlockHashAndIndex"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\":[\"0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7\",\"0x0\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getTransactionByBlockHashAndIndex")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\":[\"0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7\",\"0x0\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\":[\"0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7\",\"0x0\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getTransactionByBlockHashAndIndex", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getTransactionByBlockHashAndIndex")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\":[\"0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7\",\"0x0\"],\"id\":1}")
  .asString();

POST /getTransactionByBlockHashAndIndex

Returns information about a transaction by block hash and transaction index position. Parameters

params: [
  '0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7',
  '0x0' // 0
]

Returns See eth_getTransactionByHash

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockHashAndIndex",
  "params": [
    "0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7",
    "0x0"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getTransactionByBlockHashAndIndexRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getTransactionByBlockNumberAndIndex

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getTransactionByBlockNumberAndIndex \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["0x52A96E","0x1"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockNumberAndIndex",
  "params": [
    "0x52A96E",
    "0x1"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getTransactionByBlockNumberAndIndex");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getTransactionByBlockNumberAndIndex"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockNumberAndIndex\",\"params\":[\"0x52A96E\",\"0x1\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getTransactionByBlockNumberAndIndex")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockNumberAndIndex\",\"params\":[\"0x52A96E\",\"0x1\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockNumberAndIndex\",\"params\":[\"0x52A96E\",\"0x1\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getTransactionByBlockNumberAndIndex", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getTransactionByBlockNumberAndIndex")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockNumberAndIndex\",\"params\":[\"0x52A96E\",\"0x1\"],\"id\":1}")
  .asString();

POST /getTransactionByBlockNumberAndIndex

Returns information about a transaction by block number and transaction index position.

Parameters

params: [
  '0x29c', // 668
  '0x0' // 0
]

Returns

See eth_getTransactionByHash

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockNumberAndIndex",
  "params": [
    "0x52A96E",
    "0x1"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getTransactionByBlockNumberAndIndexRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

getTransactionReceipt

Code samples

curl --request POST \
  --url https://rpc.xinfin.network//getTransactionReceipt \
  --header 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f"],"id":1}'
var data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": [
    "0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f"
  ],
  "id": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rpc.xinfin.network//getTransactionReceipt");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://rpc.xinfin.network//getTransactionReceipt"

	payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f\"],\"id\":1}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://rpc.xinfin.network//getTransactionReceipt")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f\"],\"id\":1}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("rpc.xinfin.network")

payload = "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f\"],\"id\":1}"

headers = { 'content-type': "application/json" }

conn.request("POST", "//getTransactionReceipt", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://rpc.xinfin.network//getTransactionReceipt")
  .header("content-type", "application/json")
  .body("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f\"],\"id\":1}")
  .asString();

POST /getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

Note: That the receipt is not available for pending transactions.

Parameters

Returns

Object - A transaction receipt object, or null when no receipt was found:

It also returns either :

Body parameter

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": [
    "0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f"
  ],
  "id": 1
}

Parameters

Name In Type Required Description
body body getTransactionReceiptRequest true none

Responses

Status Meaning Description Schema
200 OK Successful Operation None
500 Internal Server Error Internal Server Error None

Schemas

clientVersionRequest

{
  "jsonrpc": "2.0",
  "method": "web3_clientVersion",
  "params": [],
  "id": 1
}

clientVersionRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

sha3request

{
  "jsonrpc": "2.0",
  "method": "web3_sha3",
  "params": [
    "0x68656c6c6f20776f726c64"
  ],
  "id": 64
}

sha3request

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

versionrequest

{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 67
}

versionrequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

listeningrequest

{
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": [],
  "id": 67
}

listeningrequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

peerCountRequest

{
  "jsonrpc": "2.0",
  "method": "net_peerCount",
  "params": [],
  "id": 74
}

peerCountRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

protocolVersionRequest

{
  "jsonrpc": "2.0",
  "method": "eth_protocolVersion",
  "params": [],
  "id": 67
}

protocolVersionRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

syncingrequest

{
  "jsonrpc": "2.0",
  "method": "eth_syncing",
  "params": [],
  "id": 1
}

syncingrequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

coinbaserequest

{
  "jsonrpc": "2.0",
  "method": "eth_coinbase",
  "params": [],
  "id": 64
}

coinbaserequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

gasPriceRequest

{
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 73
}

gasPriceRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

accountsrequest

{
  "jsonrpc": "2.0",
  "method": "eth_accounts",
  "params": [],
  "id": 1
}

accountsrequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

blockNumberRequest

{
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 83
}

blockNumberRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBalanceRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": [
    "0x2b5634c42055806a59e9107ed44d43c426e58258",
    "latest"
  ],
  "id": 1
}

getBalanceRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getStorageAtRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getStorageAt",
  "params": [
    "0x295a70b2de5e3953354a6a8344e616ed314d7251",
    "0x0",
    "latest"
  ],
  "id": 1
}

getStorageAtRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getTransactionCountRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0xbf1dcb735e512b731abd3404c15df6431bd03d42",
    "latest"
  ],
  "id": 1
}

getTransactionCountRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockTransactionCountByHashRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0xc8b967161c671ce952a3d50987a78d64157fb5a8e1724804b87d3e9b11e3aa34"
  ],
  "id": 1
}

getBlockTransactionCountByHashRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockTransactionCountByNumberRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByNumber",
  "params": [
    "0x52A8CA"
  ],
  "id": 1
}

getBlockTransactionCountByNumberRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getCodeRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": [
    "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
    "0x2"
  ],
  "id": 1
}

getCodeRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

signrequest

{
  "jsonrpc": "2.0",
  "method": "eth_sign",
  "params": [
    "0x9b2055d370f73ec7d8a03e965129118dc8f5bf83",
    "0xdeadbeaf"
  ],
  "id": 1
}

signrequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

sendTransactionRequest

{
  "jsonrpc": "2.0",
  "method": "eth_sendTransaction",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }
  ],
  "id": 1
}

sendTransactionRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [Param] true none none
id integer(int32) true none none

Param

{
  "from": 1.0393608864131634e+48,
  "to": 1.2127714812045434e+48,
  "gas": 30400,
  "gasPrice": 10000000000000,
  "value": 2441406250,
  "data": 4.537516814050981e+98
}

Param

Properties

Name Type Required Restrictions Description
from string true none none
to string true none none
gas string true none none
gasPrice string true none none
value string true none none
data string true none none

sendRawTransactionRequest

{
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransaction",
  "params": [
    "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
  ],
  "id": 1
}

sendRawTransactionRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

callrequest

{
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    },
    "latest"
  ],
  "id": 1
}

callrequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [Param1] true none none
id integer(int32) true none none

Param1

{
  "from": "",
  "to": "",
  "gas": "",
  "gasPrice": "",
  "value": "",
  "data": ""
}

Param1

Properties

Name Type Required Restrictions Description
from string false none none
to string false none none
gas string false none none
gasPrice string false none none
value string false none none
data string false none none

estimateGasRequest

{
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }
  ],
  "id": 1
}

estimateGasRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockByHashRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByHash",
  "params": [
    "0x9326145f8a2c8c00bbe13afc7d7f3d9c868b5ef39d89f2f4e9390e9720298624",
    true
  ],
  "id": 1
}

getBlockByHashRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockByNumberRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": [
    "0x0",
    true
  ],
  "id": 1
}

getBlockByNumberRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockSignersByNumberRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockSignersByNumber",
  "params": [
    "0xA61F98"
  ],
  "id": 1
}

getBlockSignersByNumberRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockSignersByHashRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockSignersByHash",
  "params": [
    "0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"
  ],
  "id": 1
}

getBlockSignersByHashRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockFinalityByNumberRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockFinalityByNumber",
  "params": [
    "0xA61F98"
  ],
  "id": 1
}

getBlockFinalityByNumberRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getBlockFinalityByHashRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockFinalityByHash",
  "params": [
    "0x605777ee60ef3ccf21e079fa1b091b0196cf1a2c1dd7c088dd5b1ab03f680b6f"
  ],
  "id": 1
}

getBlockFinalityByHashRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getTransactionByHashRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByHash",
  "params": [
    "0xd83b26e101dd6480764bade90fc283407919f60b7e65ff83fbf6cdc92f1138a1"
  ],
  "id": 1
}

getTransactionByHashRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getTransactionByBlockHashAndIndexRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockHashAndIndex",
  "params": [
    "0x3c82bc62179602b67318c013c10f99011037c49cba84e31ffe6e465a21c521a7",
    "0x0"
  ],
  "id": 1
}

getTransactionByBlockHashAndIndexRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getTransactionByBlockNumberAndIndexRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockNumberAndIndex",
  "params": [
    "0x52A96E",
    "0x1"
  ],
  "id": 1
}

getTransactionByBlockNumberAndIndexRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getTransactionReceiptRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": [
    "0xa3ece39ae137617669c6933b7578b94e705e765683f260fcfe30eaa41932610f"
  ],
  "id": 1
}

getTransactionReceiptRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getCandidatesRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getCandidates",
  "params": [
    "latest"
  ],
  "id": 1
}

getCandidateStatusRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none

getCandidateStatusRequest

{
  "jsonrpc": "2.0",
  "method": "eth_getCandidateStatus",
  "params": [
    "0x1d50df657b6dce50bac634bf18e2d986d807e940",
    "latest"
  ],
  "id": 1
}

getCandidateStatusRequest

Properties

Name Type Required Restrictions Description
jsonrpc string true none none
method string true none none
params [string] true none none
id integer(int32) true none none