Skip to main content

Neon API

danger

This page is wip :construction_worker:

TL;DR

Neon provides several endpoints to assist our users to access data related to the Neon Proxy service. Each Proxy may be queried to provide details on:

  • Transactions
  • Versions
  • Configurations

Neon Proxy API service

This page provides the information you need to interact with the Proxy query services.

Authentication

No authentication is required. All publicly-available JSON RPC endpoints are listed on Chainlist.

note

The curl request below uses P2P's public endpoint. You may select whichever Proxy Operator you prefer, or (coming soon), run your own Proxy server.

Neon API specifications

All API calls use the POST method.

For example, the following request returns the current Neon Proxy version being provided by P2P:

curl -X POST https://neon-proxy-mainnet.solana.p2p.org \
-H "Content-Type: application/json" \
-d '{"method":"neon_proxyVersion"}'

API services

The following services are available in Neon API V1:

1. Version information

The method neon_versions returns a list of components and their versions provided by the current Neon Platform. Alternatively, you may request each component's version individually.

2. Gas price information

The method neon_gasPrice returns data on gas price.

3. Neon transaction data

4. Parameters

neon_getEvmParams: returns parameters of the Neon EVM program deployed on Solana.

Get versions

The neon_versions method returns a list of all the components and their version as provided by the current Neon Proxy. Alternatively, apply the following methods for granular responses:

  • neon_cliVersion returns the current version of Neon EVM CLI used by the Neon Proxy
  • neon_evmVersion returns the current version of the Neon EVM program deployed
  • neon_proxyVersion returns the current version of the Neon Proxy
  • neon_solanaVersion returns the version of the Solana node the Neon Proxy runs on

The JSON and examples demonstrate the verbose request.

Loading ....

Get version request as JSON

{
"type": "object",
"description": "POST request to get current versions for the Proxy tech stack.",
"required": [
"method",
"params",
"jsonrpc"
],
"properties": {
"jsonrpc": {
"type": "string",
"default": "2.0",
"description": "The JSON RPC version."
},
"method": {
"type": "string",
"enum": [
"neon_versions",
"neon_evmVersion",
"neon_cliVersion",
"neon_solanaVersion",
"neon_proxyVersion"
],
"description": "The method name."
},
"id": {
"type": "string",
"example": "K827qw7r98qwerqwehkjhwe8",
"description": "End-user provided identifier for the request; returned with payload."
}
}
}

Get Neon Gas price

Neon Gas price may be requested for an individual account or for all accounts, depending on the parameters passed.

The JSON for this request schema is available below.

Loading ....

Get Neon Gas price request as JSON

{
"type": "object",
"description": "POST request to get transaction gas price. The payload returned depends on how you form the request using the `params` object. While each property is optional individually, an empty array is not processed. Two example permutations of possible request structures are provided; more are supported.",
"required": [
"method",
"params",
"jsonrpc"
],
"properties": {
"jsonrpc": {
"type": "string",
"default": "2.0",
"description": "The JSON RPC version."
},
"method": {
"type": "string",
"const": "neon_gasPrice",
"description": "The method name."
},
"id": {
"type": "number",
"examples": [
"OpEgqw7r98qwerqwehkjhwe8"
],
"description": "End-user provided identifier for the request; returned with payload."
},
"params": {
"oneOf": [
{
"type": "object",
"title": "Filter request",
"description": "Exclude `from` address to retrieve common gas price for all accounts.",
"properties": {
"from": {
"type": "string",
"description": "Optional. Account tx request originates from. If not provided, request retrieves common gas price for all accounts.",
"examples": [
"0x348ee8817eA227e52e233668874fA609aA51C83D"
]
},
"nonce": {
"type": "number",
"format": "hexadecimal",
"description": "Optional. Requires `from` property. If `from` is provided but `nonce` is not provided, Neon Proxy uses the transaction counter providing the state of the `from` account as the nonce for the request. If nonce is absent from the request, the Proxy accesses the value of the nonce from the state.",
"examples": [
"0x0"
]
},
"full": {
"type": "boolean",
"description": "Optional. Switch to determine verbose or light response. For verbose, use `true`.",
"examples": [
true,
false
]
}
}
},
{
"type": "object",
"title": "All accounts",
"description": "This request returns the details for all accounts.",
"properties": {
"full": {
"type": "boolean",
"description": "Switch to determine verbose or light response. For verbose, use `true`.",
"example": true
}
}
}
]
}
}
}

Get transaction data

Get transaction logs :construction_worker:

The neon_getLogs method returns transaction log data. This is an extended variant of the eth_getLogs API method.

Request

Loading ....

Response

Loading ....

Get transaction receipt :construction_worker:

The neon_getTransactionReceipt method returns transaction receipt data.

Request

Loading ....

Response

Loading ....

Get Solana transactions :construction_worker:

The neon_getSolanaTransactionByNeonTransaction method returns a list of Solana transactions that correspond to a given Neon transaction.

Request

Loading ....

Response

Loading ....

Emulate a Neon transaction :construction_worker:

The neon_emulate method returns details of an emultated transaction.

The JSON for this request schema is available below.

Loading ....

Get Neon emulate request as JSON

{
"type": "object",
"description": "Request to emulate a tx.",
"properties": {
"jsonrpc": {
"type": "string",
"default": "2.0",
"description": "The JSON RPC version."
},
"method": {
"type": "string",
"const": "neon_emulate",
"description": "The method name."
},
"id": {
"type": "number",
"examples": [
"OpEgqw7r98qwerqwehkjhwe8"
],
"description": "End-user provided identifier for the request; returned with payload."
},
"params": [
"f88c25851150a01ae482d6d894549b5cb2d324f901aed6938a3838fb9b1089844180a4a59f3e0c00000000000000000000000000000000000000000000000873ee7db76059be9b841d3581bfa036c26c7f3d5f20a34da19cf5796c40be39add518027f40f37a51d215db242074a004402aa547dc02e4ca63f87c1caee2f8c41eb6bdb5eb49fba8507e1383c68dc2"
]
},
"required": [
"id",
"jsonrpc",
"method"
]
}

Get Parameters :construction_worker:

The neon_getEVMParams method returns details of the EVM.

The JSON for this request schema is available below.

Loading ....

Get Neon EVM parameters request as JSON

{
"type": "object",
"description": "POST request for parameters of the Neon EVM program deployed on Solana.",
"required": [
"method",
"params",
"jsonrpc"
],
"properties": {
"jsonrpc": {
"type": "string",
"default": "2.0",
"description": "The JSON RPC version."
},
"method": {
"type": "string",
"const": "nneon_getEvmParams",
"description": "The method name."
},
"id": {
"type": "number",
"examples": [
"OpEgqw7r98qwerqwehkjhwe8"
],
"description": "End-user provided identifier for the request; returned with payload."
}
}
}
Was this page helpful?