qan_getProof

post

https://rpc-testnet.qanplatform.com/getProof/

API details

Returns the account and storage values of the specified account including the Merkle-proof.

Request body for "qan_getProof"

AddressstringRequired
BlockNumberstring
Default:latest
StorageKeysarray[string]Required

An array of storage-keys that should be proofed and included

HTTP response status codes for "qan_getProof"

Status Code Description
200 OK
400 Bad Request
404 Not Found
422 Unprocessable Entity
500 Internal Server Error

Code samples for "qan_getProof"

Request examples

post

https://rpc-testnet.qanplatform.com/getProof/

cURLJavaScriptGoPythonJava
curl --request POST \
  --url https://rpc-testnet.qanplatform.com/getProof/ \
  --header 'Accept: application/json, application/problem+json' \
  --header 'Content-Type: application/json' \
  --data '
{
"Address": "string",
"BlockNumber": "string",
"StorageKeys": []
}
'
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json, application/problem+json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({Address: 'string', BlockNumber: 'string', StorageKeys: []})
};

fetch('https://rpc-testnet.qanplatform.com/getProof/', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
package main

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

func main() {

  url := "https://rpc-testnet.qanplatform.com/getProof/"

  payload := strings.NewReader("{\"Address\":\"string\",\"BlockNumber\":\"string\",\"StorageKeys\":[]}")

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

  req.Header.Add("Accept", "application/json, application/problem+json")
  req.Header.Add("Content-Type", "application/json")

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

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

  fmt.Println(string(body))

}
import requests

url = "https://rpc-testnet.qanplatform.com/getProof/"

payload = {
  "Address": "string",
  "BlockNumber": "string",
  "StorageKeys": []
}
headers = {
  "Accept": "application/json, application/problem+json",
  "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
HttpResponse<String> response = Unirest.post("https://rpc-testnet.qanplatform.com/getProof/")
  .header("Accept", "application/json, application/problem+json")
  .header("Content-Type", "application/json")
  .body("{\"Address\":\"string\",\"BlockNumber\":\"string\",\"StorageKeys\":[]}")
  .asString();

Responses

200400404422500

Description: OK

Content type: application/json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/Output_getProof.json",
  "AccountProof": "string",
  "Address": "string",
  "Balance": "string",
  "CodeHash": "string",
  "Nonce": "string",
  "StorageHash": "string",
  "StorageProof": []
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/Output_getProof.json

AccountProofstringRequired

An array of rlp-serialized MerkleTree-Nodes which starts with the stateRoot-Node and follows the path of the SHA3 address as key

AddressstringRequired

The address associated with the account

BalancestringRequired

The current balance of the account in wei

CodeHashstringRequired

A 32 byte hash of the code of the account

Noncestring,nullRequired

The hash of the generated proof-of-work. Null if pending

StorageHashstringRequired

A 32 byte SHA3 of the storageRoot. All storage will deliver a MerkleProof starting with this rootHash

StorageProofarray[object]Required

An array of storage-entries as requested. Each entry is an object with the following fields:

Keystring

The requested storage key

Proofstring

An array of rlp-serialized MerkleTree-Nodes which starts with the stateRoot-Node and follows the path of the SHA3 address as key

Valuestring

The storage value

Description: Bad Request

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Description: Not Found

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Description: Unprocessable Entity

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Description: Internal Server Error

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Previous

qan_getLogs

Next

qan_getStorageAt