# DIN docs
> Documentation for the Decentralized Infrastrucure Network (DIN).
This file contains all documentation content in a single document following the llmstxt.org standard.
## Filter methods
Filter methods allow you to create, poll, and manage filters for monitoring blockchain events and logs.
## Available methods
- [`eth_getFilterChanges`](./eth_getfilterchanges.mdx) - Get changes since last poll
- [`eth_getFilterLogs`](./eth_getfilterlogs.mdx) - Get all logs for a filter
- [`eth_newBlockFilter`](./eth_newblockfilter.mdx) - Create new block filter
- [`eth_newFilter`](./eth_newfilter.mdx) - Create new log filter
- [`eth_uninstallFilter`](./eth_uninstallfilter.mdx) - Remove filter
---
## Subscription methods
Subscription methods enable real-time event monitoring via WebSocket connections.
## Available methods
- [`eth_subscribe`](./eth_subscribe.mdx) - Subscribe to events
- [`eth_unsubscribe`](./eth_unsubscribe.mdx) - Cancel subscription
---
## Filter methods(Filter)
Filter methods allow you to create, poll, and manage filters for monitoring blockchain events and logs.
## Available methods
- [`eth_getFilterChanges`](./eth_getfilterchanges.mdx) - Get changes since last poll
- [`eth_getFilterLogs`](./eth_getfilterlogs.mdx) - Get all logs for a filter
- [`eth_newBlockFilter`](./eth_newblockfilter.mdx) - Create new block filter
- [`eth_newFilter`](./eth_newfilter.mdx) - Create new log filter
- [`eth_newPendingTransactionFilter`](./eth_newpendingtransactionfilter.mdx) - Create new pending transaction filter
- [`eth_uninstallFilter`](./eth_uninstallfilter.mdx) - Remove filter
---
## Subscription methods(Subscription)
Subscription methods enable real-time event monitoring via WebSocket connections.
## Available methods
- [`eth_subscribe`](./eth_subscribe.mdx) - Subscribe to events
- [`eth_unsubscribe`](./eth_unsubscribe.mdx) - Cancel subscription
---
## Filter methods(3)
Filter methods allow you to create, poll, and manage filters for monitoring blockchain events and logs.
## Available methods
- [`eth_getFilterChanges`](./eth_getfilterchanges.mdx) - Get changes since last poll
- [`eth_getFilterLogs`](./eth_getfilterlogs.mdx) - Get all logs for a filter
- [`eth_newBlockFilter`](./eth_newblockfilter.mdx) - Create new block filter
- [`eth_newFilter`](./eth_newfilter.mdx) - Create new log filter
- [`eth_newPendingTransactionFilter`](./eth_newpendingtransactionfilter.mdx) - Create new pending transaction filter
- [`eth_uninstallFilter`](./eth_uninstallfilter.mdx) - Remove filter
---
## Subscription methods(3)
Subscription methods enable real-time event monitoring via WebSocket connections.
## Available methods
- [`eth_subscribe`](./eth_subscribe.mdx) - Subscribe to events
- [`eth_unsubscribe`](./eth_unsubscribe.mdx) - Cancel subscription
---
## Trace methods
Trace methods provide detailed execution information for transactions and blocks, useful for debugging and analysis.
## Available methods
- [`trace_block`](./trace_block.mdx) - Trace all transactions in a block
- [`trace_call`](./trace_call.mdx) - Trace a call execution
- [`trace_callMany`](./trace_callmany.mdx) - Trace multiple calls
- [`trace_filter`](./trace_filter.mdx) - Get traces matching filter
- [`trace_transaction`](./trace_transaction.mdx) - Trace specific transaction
---
## Digital Asset Standard (DAS) API
The DAS API provides an interface for interacting with digital assets such as fungible tokens, regular
NFTs, and compressed NFTs.
Use the pagination and sort options available to some API methods that return a large amount on data.
## Supported DAS methods
Infura supports the following DAS API methods:
- [`getAsset`](./getasset.mdx)
- [`getAssetProof`](./getassetproof.mdx)
- [`getAssetProofBatch`](./getassetproofbatch.mdx)
- [`getAssets`](./getassets.mdx)
- [`getAssetsByAuthority`](./getassetsbyauthority.mdx)
- [`getAssetsByCreator`](./getassetsbycreator.mdx)
- [`getAssetsByGroup`](./getassetsbygroup.mdx)
- [`getAssetsByOwner`](./getassetsbyowner.mdx)
- [`getAssetSignatures`](./getassetsignatures.mdx)
- [`getNftEditions`](./getnfteditions.mdx)
- [`getTokenAccounts`](./gettokenaccounts.mdx)
- [`searchAssets`](./searchassets.mdx)
## Pagination options
Use pagination to manage large result sets and control how data is returned.
- **By page**: Use when you want to access results in fixed-size pages (for example, when
displaying data in a paged UI). Requires the `page` parameter and can be combined with a `limit`.
- **By cursor**: Use for efficient pagination through a large or frequently changing dataset.
Requires a `cursor` value from a previous response.
- **By range**: Use when you need to retrieve results within a specific time or ID range.
Requires `before` or `after` parameters. Useful for narrowing a query.
## Sorting options
Control the order in which results are returned. Sorting may affect performance.
- **`id`**: Sorts results by ID. Useful when IDs are incremental and correlate with creation order.
- **`created`**: Sorts results by creation timestamp. Use this to get the oldest or newest records
first.
- **`recent_action`**: Sorts by the timestamp of the most recent update or event. Helpful when
tracking activity or status changes.
- **`none`**: No sorting applied. Use for faster responses when order doesn’t matter.
## Sort direction
Define how sorted results are ordered.
- **`asc`**: Sorts in ascending order (for example, from oldest to newest).
- **`desc`**: Sorts in descending order (for example, from newest to oldest). Often used to show the most recent results first.
---
## JSON-RPC methods
# JSON-RPC API
DIN supports the standard Solana API methods and the
[Digital Asset Standard (DAS) API methods](./digital-asset-standard/index.md)
used to query digital assets.
---
## DIN as an AVS
DIN uses [EigenLayer's Autonomous Verifiable Service (AVS)](https://docs.eigencloud.xyz/products/eigenlayer/developers/concepts/avs-developer-guide) model to provide economic security, performance
accountability, and transparent governance for its decentralized RPC/API marketplace.
EigenLayer's AVS aligns incentives for node providers, watchers, and gateways to meet clear, measurable service
level agreements (SLAs) and incentivizes consistent performance. It enforces these standards with
staking and real-time slashing, providing reliable, economically secure infrastructure for web3 applications.
:::warning Mainnet Launch - November 14th, 2025
DIN AVS is launching on mainnet soon! Operators must begin onboarding **immediately**
due to a 17-day operator allocation delay. See the
[operator onboarding information](./operator-onboarding/index.md) to get started.
:::
## AVS architecture
The AVS coordinates independent actors, including node providers, watchers, and gateways, so the network
meets measurable SLAs and applies incentives or penalties based on verified performance.
### Economic alignment through staking and slashing
- **Staking requirements** - Each node provider and watcher within DIN must stake tokens through the
EigenLayer AVS model, creating an economic commitment to their roles.
This stake acts as collateral, guaranteeing that providers and watchers are financially invested in maintaining network standards.
- **Slashing mechanism** - To enforce compliance, the AVS enables slashing protocols, where staked tokens
are deducted if operators or watchers fail to meet SLA standards for freshness, validity, or availability.
By financially penalizing non-compliance, AVS reduces the likelihood of low-quality service and incentivizes participants to uphold their obligations.
See [slashing and rewards](slashing-and-rewards.md) for more information.
### Real-time SLA enforcement
- **Continuous validation** - Watchers serve as AVS operators, continuously monitoring the performance
of node providers to validate adherence to SLAs.
They track key metrics—such as response freshness, data validity, and service availability—and report any deviations.
This real-time validation ensures that any breaches in service quality are quickly detected and addressed.
- **Automated penalties for SLA violations** - The AVS automates the enforcement of penalties for SLA breaches,
enabling immediate slashing for operators who fail to meet performance standards.
This process ensures swift accountability without requiring manual intervention, protecting network integrity and user trust.
### Transparent monitoring and reporting
- **Decentralized public ledger** - DIN's AVS integration ensures that performance data, including SLA
compliance and slashing events, is published on a public ledger.
This decentralized transparency allows users, DAO members, and other stakeholders to review the historical performance of node providers and watchers, fostering trust and accountability.
- **Performance reputation system** - AVS supports the development of a reputation system within DIN,
where node providers and watchers build credibility based on their adherence to SLA standards.
Consistent high performers may gain a higher reputation, making them preferred options for request routing, while poor performers face economic consequences and potential removal.
---
## Operator onboarding
A DIN Autonomous Verifiable Service (AVS) operator runs infrastructure that serves RPC requests on the
DIN network while staking funds with one or more [operator sets](../operator-sets.md).
:::warning Mainnet Launch - November 14th, 2025
DIN AVS is launching on mainnet soon! Operators must begin onboarding **immediately**
due to a 17-day operator allocation delay.
:::
## Onboarding process
The complete onboarding process consists of the following steps:
1. [**Review the prerequisite checklist**](./prerequisites.md) - The checklist provides information about
all the requirements (wallet, financial, account) you must meet to begin onboarding through the DIN app.
1. [**Prepare for mainnet launch**](./mainnet-preparation.md) - View the time-sensitive instructions to be
ready for the mainnet launch on November 14, 2025.
1. [**Onboard using the DIN app**](onboard/index.md):
1. [**Register as an EigenLayer operator**](./onboard/register-operator.md) - Register your operator address
with EigenLayer's delegation manager contract. This establishes your identity as an operator on
the EigenLayer protocol.
1. [**Stake tokens**](./onboard/stake-tokens.md) - Stake the required tokens (stETH, WETH, etc.) into
EigenLayer strategies. This provides the economic security backing for your operator services.
1. [**Set the allocation delay**](./onboard/allocation-delay.md) - Configure the allocation delay for your
staked assets. This determines when your stake becomes active for slashing conditions.
1. [**Watcher setup**](./onboard/watchers.md) (Coming soon) - Configure watcher services to monitor your
operator performance. Currently in development.
1. [**Allocate stake to operator sets**](./onboard/opt-in-avs.md) - Final registration step to join the
DIN AVS and begin serving traffic.
## Environment differences
Testnet and mainnet have different risk, funding, and activation profiles. Use Sepolia testnet to
validate your setup end to end with test funds, then move to mainnet when you are ready to stake real
assets and accept slashing risk.
View the [environment differences](./mainnet-preparation.md#mainnet-and-testnet-differences)
for more information about the differences between running as a DIN operator on mainnet and testnet.
## Supported operator sets
[Operator sets](../operator-sets.md) in DIN represent different blockchain networks that operators can serve. For example: Ethereum, Base, Optimism, Arbitrum, and so on.
You'll select which operator sets to join during the onboarding process.
You can view the most up-to-date list of supported operator sets in the [DIN app](https://app.din.build).
## Get started
To begin, start with the [prerequisites](./prerequisites.md) to ensure you have everything needed
for a smooth onboarding experience.
Additional resources include video guides for each step in the DIN onboarding process.
---
## Onboard using the DIN app
Follow these steps to onboard as a DIN AVS operator using the [DIN app](https://app.din.build).
Complete each step in order to successfully register and begin serving traffic.
Ensure you've reviewed the [prerequisites](../prerequisites.md) before continuing with the onboarding
process.
## Required steps
1. **[Register as an EigenLayer operator](./register-operator.md)** - Register your
operator address with EigenLayer's delegation manager contract. This establishes your
identity as an operator on the EigenLayer protocol.
2. **[Stake tokens](./stake-tokens.md)** - Stake the required tokens (stETH, WETH, etc.) into EigenLayer strategies. This provides the economic security backing for your operator services.
3. **[Set the allocation delay](./allocation-delay.md)** - Configure the allocation delay for your staked assets. This determines when your stake becomes active for slashing conditions.
4. **[Watcher setup](./watchers.md)** (Coming soon) - Configure watcher services to monitor your operator performance. Currently in development.
5. **[Allocate stake to operator sets](./opt-in-avs.md)** - Final registration step to join the DIN AVS and begin serving traffic.
---
## DIN documentation
import CardList from "@site/src/components/CardList"
# DIN documentation
DIN (Decentralized Infrastructure Network) is a B2B service-discovery marketplace for web3 infrastructure.
It helps RPC providers (like Infura) source, validate, and route capacity across a network of node
providers. DIN improves reliability, performance, and cost efficiency through provider choice, real-time health and reputation monitoring, and incentive-aligned governance (staking, slashing, and SLA enforcement).
:::info
For more background information, read the DIN [litepaper](https://drive.google.com/file/d/17t7tLbpyafvVv8UPSrjtaO68zgxOzXXa/view) and [whitepaper](https://drive.google.com/file/d/1hCHmcXMN6YpmGQkdxSTuZb6Ne_EaehJt/view).
:::
DIN's RPC-as-a-service model lets centralized RPC providers give developers access to
blockchain network APIs and RPCs across many chains, through resilient and high-performance endpoints. Developers continue to consume RPCs from their chosen provider, not from DIN directly.
DIN builds with the EigenLayer ecosystem to align onboarding and incentives for participants
[node providers](node-providers/index.md), [watchers](watchers/index.md), and [web3 gateways](web3-gateways/index.md).
[DIN as an AVS](avs/index.md) (Autonomous Verifiable Service) provides decentralized administration for router identities, reputation, and network endpoint management.
## DIN values
DIN's foundational values are:
- **Decentralization** – Reduce reliance on a single authority for infrastructure provisioning to
improve reliability and access across the ecosystem.
- **Competitive collaboration with partners** – Work with traditional competitors to build a marketplace
that increases access and reduces costs across the web3 infrastructure ecosystem.
- **Scalability and resilience** – Meet growing demand via distributed nodes and partnerships with
domain experts in blockchain infrastructure.
## How do I participate in DIN?
See the following documentation to onboard and participate as various DIN roles:
---
## Node providers
A node provider runs blockchain nodes and exposes API endpoints that DIN can route traffic to.
Node providers are incentivized for providing high-quality, reliable, and secure services to DIN users
via [web3 gateways](../web3-gateways/index.md).
Node providers earn fiat, stablecoins, or other tokens for hosting nodes in DIN.
They are added to a Network-Services list so the DIN Router can effectively direct traffic and keep track of all relays.
To participate in DIN, a node operator must [onboard as an AVS operator](../avs/operator-onboarding/index.md).
Node providers join the DIN AVS through EigenLayer restaking (or staking tokens in the staking contract).
Upon registration, providers declare the blockchain protocols they support, such as Ethereum, Layer 2 networks, or additional Layer 1s, and detail their API capabilities in the Node Registry.
Node providers are then available to service requests from users, governed by SLA requirements and monitored by [watchers](../watchers/index.md).
---
## Watchers
Watchers have the following responsibilities:
- **Real-time monitoring** - Watchers play a vital role in the load-sharing process by continuously tracking and validating operator response times, accuracy, and SLA compliance.
This monitoring data is published to the public bulletin board, allowing the DAO and users to assess operator reliability and request routing.
- **Load redistribution** - If a node provider underperforms or faces connectivity issues, watchers flag the issue, and requests are automatically rerouted to maintain service continuity.
EigenLayer's AVS integration supports slashing penalties for operators that fail to meet performance benchmarks, encouraging operators to maintain consistent and reliable service.
To participate in DIN, a watcher must [onboard as an AVS operator](../avs/operator-onboarding/index.md).
Watchers join the DIN AVS through EigenLayer restaking (or staking tokens in the staking contract).
Their stake serves as collateral, with penalties enforced through EigenLayer's slashing protocols for any lapses in performance or accuracy.
The watcher set is open membership such that anyone can join given their economic staking and report on the DIN network's reliability.
The quantity of required stake is adjusted by the DAO.
Watchers are rewarded within the EigenLayer ecosystem for running as an operator.
Watchers can also earn rewards for completing tests on fulfilling bounties for onboarding DIN nodes.
See [DIN as an AVS](../avs/index.md) for more information about watchers' roles in the AVS.
---
## Web3 gateways
Web3 gateways can:
- Authenticate with the DIN Router using the DIN Authentication Protocol.
- Request and receive access to services available on the DIN Router.
- Consume the OpenTelemetry Collector from the DIN Router for only the services the gateway is accessing and only for the requests that are coming from that specific gateway.
- Receive data from the [watcher](../watchers/index.md) in order to serve as an additional verification on the requests served by the DIN Router to the gateway.
- Implement session ID to ensure consistency of responses.
- Access the DIN Observability Dashboard (includes the OpenTelemetry Collector data).
- Use open channels to raise any technical issues.
### DIN touchpoints

From a component perspective, DIN aims to make the experience of running a Router as seamless and configurable as possible.
- Offer a Node Kit to run your own router with your own identity, payment mechanisms, and routing configuration.
- Offer the ability to run on an existing router with the customization offered by another gateway (e.g. Infura or Rivet) - this is the beta program.
- Dynamically choose RPC network endpoints with dynamic pricing.
- Monitor usage through a localhost or external app.
- Manage payments through your localhost or external app.
- Engage with the marketplace for payments and credit commitments.
- Work with our team across different support services.
---
## Architecture
DIN uses a decentralized structure composed of multiple actors:
- [**Node providers**](node-providers/index.md) - Node providers for different networks serve traffic via the DIN Router.
These providers are compensated for their fulfilled traffic.
- [**Watchers**](watchers/index.md) - Watchers monitor the health of the network traffic.
The DIN dashboard is the source of truth for the processed requests by node providers.
- [**Web3 gateways**](web3-gateways/index.md) - Web3 gateways connect to DIN nodes and pay for processing traffic from node providers.
- **Web3 customers** - These individuals or companies interact directly with web3 gateways through their provided identities and processes.
They receive services and pay for service level agreements covered by the web3 gateways.
## Key components
```mermaid
---
config:
layout: elk
---
flowchart TD
d["**Dapps/developers**"] --> wg["**Web3 gateways**
(Infura, others)"]
wg -->|"Pay for network usage"| dp["**DIN Payments**"]
wg <-->|"Send API requests"| dr["**DIN Router**"]
pn@{ shape: processes, label: "**Provider nodes**" }
dp -->|"Pay providers
for served
requests & txns"| pn
dr <-->|Process requests| pn
dw["**Watchers**"] -->|"Monitor network
traffic"| pn
```
- **DIN Router** - A service registry that routes traffic between consumers and providers.
- **DIN Payments** - Mechanisms for paying from provider to provider, for successfully processed transactions and APIs.
- **Staking contracts** - Contracts that enforce economic accountability.
- **Performance monitoring systems** - Systems that ensure service level agreement (SLA) compliance.
- **Smart contracts** - Contracts that manage node registration, network mapping, payment, and governance.
## How DIN works
DIN operates through a multi-layered, decentralized infrastructure that ensures robust, scalable, and efficient blockchain API services.
The core layers include:
**1. Request routing layer:**
- [Web3 gateway](web3-gateways/index.md) API requests are routed through the DIN Router,
which dynamically selects an optimal node provider based on performance,
load balancing, reputation, and network proximity.
- The DIN Router prioritizes responses from node providers with high uptime and low latency,
ensuring an efficient service experience.
**2. Infrastructure and validation layer:**
- [Node providers](node-providers/index.md) provide the fundamental infrastructure by running blockchain nodes
and handling API requests based on the provided technical specifications.
- [Watchers](watchers/index.md) independently listen to open telemetry data from the DIN Router
and validate responses, checking for correctness, latency, and uptime.
- Performance metrics are continuously recorded and used for staking rewards and penalties managed through the AVS.
**3. Economic security and staking layer (AVS):**
- Staking contracts manage the economic incentives of DIN,
requiring node providers and watchers to stake assets to participate.
[DIN as an AVS](avs/index.md) handles the staking rewards and penalties.
- The EigenLayer integration ensures that nodes with poor performance are economically penalized
via slashing mechanisms, while high-performing nodes receive greater rewards.
- Slashing conditions: If an operator repeatedly fails to meet SLA standards,
a portion of their staked tokens is slashed.
**4. Governance and automation layer (future state):**
- DIN operates under a Decentralized Autonomous Organization (DAO) model,
allowing stakeholders to vote on key protocol updates and economic parameters.
- Smart contracts automate governance proposals, ensuring transparency and trustless decision-making.
- Governance controls key aspects, including staking requirements, node licensing, and fee structures.
**5. Payment and settlement layer:**
- DIN uses an onchain payment system,
enabling transparent, automated transactions between web3 gateways and node providers.
- Subscription and pay-as-you-go models: Web3 gateways use pay-per-request via smart contracts
to stream data to different node providers.
- Reward distribution follows a performance-based model, ensuring high-quality services.
By structuring its architecture in this modular way,
DIN ensures that blockchain API services remain decentralized, reliable, and economically secure
while supporting seamless scaling across multiple blockchain networks.
---
## Base
This section provides reference information for the Base JSON-RPC API methods.
---
## Base eth_accounts
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_accounts`
Returns a list of addresses owned by the client.
## Parameters
None
## Returns
An array of hexadecimals as strings representing the addresses owned by the client.
:::caution will not return any accounts
While this JSON-RPC method is supported, it will _not_ return any accounts.
:::
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": []
}
```
---
## Base eth_blockNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_blockNumber`
Returns the current latest block number.
## Parameters
None
## Returns
A hexadecimal of an integer representing the current block number the client is on.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x65a8db"
}
```
:::tip Convert hexadecimal to integer
On macOS, you can use `printf "%d\n" 0x65a8db` to convert the above hexadecimal number into an integer number.
:::
---
## Base eth_call
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_call`
Executes a new message call immediately without creating a transaction on the blockchain.
## Parameters
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[required]_ - Address the transaction is sent from (20 bytes).
- `to`: (string) _[optional]_ - Address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution.
`eth_call` consumes zero gas, but this parameter may be needed by some executions.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the `gasPrice` used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay
per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the
sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `value`: (string) _[optional]_ - Hexadecimal of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters.
See [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags
`latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
The returned value of the executed contract.
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with
the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x"
}
```
---
## Base eth_chainId
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_chainId`
Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced
by [EIP-155](https://eips.ethereum.org/EIPS/eip-155).
## Parameters
None.
## Returns
- `chainId` - A hexadecimal of the current chain ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Base eth_estimateGas
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_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
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[optional]_ - The address the transaction is sent from (20 bytes).
- `to`: (string) _[optional]_ - The address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution. `eth_estimateGas` consumes zero gas, but this parameter may be needed by some executions.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the gas price used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `value`: (string) _[optional]_ - Hexadecimal value of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters. See the [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block number`: (string) _[optional]_ - A string representing a block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
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
- `gasEstimate` - A hexadecimal of the estimate of the gas for the given transaction.
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5cec"
}
```
---
## Base eth_feeHistory
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_feeHistory`
Returns historical gas information, allowing you to track trends over time.
## Parameters
- `blockCount`: (integer) _[required]_ - Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. If blocks in the specified block range are not available, then only the fee history for available blocks is returned.
- `newestBlock`: (string) _[required]_ - Integer representing the highest number block of the requested range, or one of the string tags `latest`, `earliest`, or `pending`.
- `array` of `integers`: (array) _[optional]_ - A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.
## Returns
- `oldestBlock` - Lowest number block of the returned range expressed as a hexadecimal number.
- `baseFeePerGas` - An array of block base fees per gas, including an extra block value. The extra value is the next block after the newest block in the returned range. Returns zeroes for blocks created before [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559).
- `gasUsedRatio` - An array of block gas used ratios. These are calculated as the ratio of `gasUsed` and `gasLimit`.
- `reward` - An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"id": 1, "jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", [20,30]] }'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", []], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"result": {
"baseFeePerGas": [
"0x3da8e7618",
"0x3e1ba3b1b",
"0x3dfd72b90",
"0x3d64eee76",
"0x3d4da2da0",
"0x3ccbcac6b"
],
"gasUsedRatio": [
0.5290747666666666,
0.49240453333333334,
0.4615576,
0.49407083333333335,
0.4669053
],
"oldestBlock": "0xfab8ac",
"reward": [
[
"0x59682f00",
"0x59682f00"
],
[
"0x59682f00",
"0x59682f00"
],
[
"0x3b9aca00",
"0x59682f00"
],
[
"0x510b0870",
"0x59682f00"
],
[
"0x3b9aca00",
"0x59682f00"
]
]
},
"id": 0
}
```
---
## Base eth_gasPrice
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_gasPrice`
Returns the current gas price in wei.
## Parameters
None.
## Returns
A hexadecimal equivalent of an integer representing the current gas price in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x6bcc886e7"
}
```
---
## Base eth_getBalance
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBalance`
Returns the balance of the account of a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) to check for balance.
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal of the current balance in the account at the given address. The balance is in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x7c2562030800"
}
```
---
## Base eth_getBlockByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockByHash`
Returns information about a block given its block hash.
## Parameters
- `hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `transaction details flag`: (boolean) _[required]_ - If set to `true`, returns the full transaction objects, if `false` returns only the hashes of the transactions.
## Returns
A block object matching the hash in the request, or null when no block was found. The matched block contains the following keys and their values:
- `difficulty` - A hexadecimal of the difficulty for this block.
- `extraData` - The "extra data" field of this block.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `hash` - The hash of the block (32 bytes). Null when the returned block is the pending block.
- `logsBloom` - The bloom filter for the logs of the block (256 bytes). Null when the returned block is the pending block.
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `nonce` - The hash of the generated proof-of-work (8 bytes). Null when the returned block is the pending block.
- `number` - The block number. Null when the returned block is the pending block.
- `parentHash` - The hash of the parent block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `size` - A hexadecimal of the size of this block in bytes.
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `timestamp` - Unix timestamp for when the block was collated.
- `totalDifficulty` - A hexadecimal of the total difficulty of the chain until this block.
- `transactions` - An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `uncles` - An Array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbfabcdbd93dda",
"extraData": "0x737061726b706f6f6c2d636e2d6e6f64652d3132",
"gasLimit": "0x79f39e",
"gasUsed": "0x79ccd3",
"hash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"logsBloom": "0x4848112002a2020aaa0812180045840210020005281600c80104264300080008000491220144461026015300100000128005018401002090a824a4150015410020140400d808440106689b29d0280b1005200007480ca950b15b010908814e01911000054202a020b05880b914642a0000300003010044044082075290283516be82504082003008c4d8d14462a8800c2990c88002a030140180036c220205201860402001014040180002006860810ec0a1100a14144148408118608200060461821802c081000042d0810104a8004510020211c088200420822a082040e10104c00d010064004c122692020c408a1aa2348020445403814002c800888208b1",
"miner": "0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c",
"mixHash": "0x3d1fdd16f15aeab72e7db1013b9f034ee33641d92f71c0736beab4e67d34c7a7",
"nonce": "0x4db7a1c01d8a8072",
"number": "0x5bad55",
"parentHash": "0x61a8ad530a8a43e3583f8ec163f773ad370329b2375d66433eb82f005e1d6202",
"receiptsRoot": "0x5eced534b3d84d3d732ddbc714f5fd51d98a941b28182b6efe6df3a0fe90004b",
"sha3Uncles": "0x8a562e7634774d3e3a36698ac4915e37fc84a2cd0044cb84fa5d80263d2af4f6",
"size": "0x41c7",
"stateRoot": "0xf5208fffa2ba5a3f3a2f64ebd5ca3d098978bedd75f335f56b705d8715ee2305",
"timestamp": "0x5b541449",
"totalDifficulty": "0x12ac11391a2f3872fcd",
"transactions": [
"0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f",
"0xe42b0256058b7cad8a14b136a0364acda0b4c36f5b02dea7e69bfd82cef252a2",
"0x4eb05376055c6456ed883fc843bc43df1dcf739c321ba431d518aecd7f98ca11",
"0x994dd9e72b212b7dc5fd0466ab75adf7d391cf4f206a65b7ad2a1fd032bb06d7",
"0xf6feecbb9ab0ac58591a4bc287059b1133089c499517e91a274e6a1f5e7dce53",
"0x7e537d687a5525259480440c6ea2e1a8469cd98906eaff8597f3d2a44422ff97",
"0xa762220e92bed6d77a2c19ffc60dad77d71bd5028c5230c896ab4b9552a39b50",
"0xf1fa677edda7e5add8e794732c7554cd5459a5c12781dc71de73c7937dfb2775",
"0x241d89f7888fbcfadfd415ee967882fec6fdd67c07ca8a00f2ca4c910a84c7dd"
]
}
}
```
---
## Base eth_getBlockByNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockByNumber`
Returns information about a block given its block number.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `show transaction details flag`: (boolean) _[required]_ - If set to `true`, returns the full transaction objects. If `false` returns only the hashes of the transactions.
## Returns
A block object, or null when no block was found. The returned block object contains the following keys and their values:
- `difficulty` - A hexadecimal of the difficulty for this block.
- `extraData` - The "extra data" field of this block.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `hash` - Hash of the block (32 bytes). `Null` when the returned block is the pending block.
- `logsBloom` - The bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `miner` - Address of the beneficiary to whom the mining rewards were given (20 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `number` - Block number. `Null` when the returned block is the pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes). Also see [Tries in Ethereum](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#tries-in-ethereum).
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `size` - A hexadecimal of the size of this block in bytes.
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `timestamp` - The unix timestamp for when the block was collated.
- `totalDifficulty` - A hexadecimal of the total difficulty of the chain until this block.
- `transactions` - An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `uncles` - An array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55",false], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55", false], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbfabcdbd93dda",
"extraData": "0x737061726b706f6f6c2d636e2d6e6f64652d3132",
"gasLimit": "0x79f39e",
"gasUsed": "0x79ccd3",
"hash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"logsBloom": "0x4848112002a2020aaa0812180045840210020005281600c80104264300080008000491220144461026015300100000128005018401002090a824a4150015410020140400d808440106689b29d0280b1005200007480ca950b15b010908814e01911000054202a020b05880b914642a0000300003010044044082075290283516be82504082003008c4d8d14462a8800c2990c88002a030140180036c220205201860402001014040180002006860810ec0a1100a14144148408118608200060461821802c081000042d0810104a8004510020211c088200420822a082040e10104c00d010064004c122692020c408a1aa2348020445403814002c800888208b1",
"miner": "0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c",
"mixHash": "0x3d1fdd16f15aeab72e7db1013b9f034ee33641d92f71c0736beab4e67d34c7a7",
"nonce": "0x4db7a1c01d8a8072",
"number": "0x5bad55",
"parentHash": "0x61a8ad530a8a43e3583f8ec163f773ad370329b2375d66433eb82f005e1d6202",
"receiptsRoot": "0x5eced534b3d84d3d732ddbc714f5fd51d98a941b28182b6efe6df3a0fe90004b",
"sha3Uncles": "0x8a562e7634774d3e3a36698ac4915e37fc84a2cd0044cb84fa5d80263d2af4f6",
"size": "0x41c7",
"stateRoot": "0xf5208fffa2ba5a3f3a2f64ebd5ca3d098978bedd75f335f56b705d8715ee2305",
"timestamp": "0x5b541449",
"totalDifficulty": "0x12ac11391a2f3872fcd",
"transactions": [
"0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f",
"0xe42b0256058b7cad8a14b136a0364acda0b4c36f5b02dea7e69bfd82cef252a2",
"0x4eb05376055c6456ed883fc843bc43df1dcf739c321ba431d518aecd7f98ca11",
"0x994dd9e72b212b7dc5fd0466ab75adf7d391cf4f206a65b7ad2a1fd032bb06d7",
"0xf6feecbb9ab0ac58591a4bc287059b1133089c499517e91a274e6a1f5e7dce53",
"0x7e537d687a5525259480440c6ea2e1a8469cd98906eaff8597f3d2a44422ff97",
"0xa762220e92bed6d77a2c19ffc60dad77d71bd5028c5230c896ab4b9552a39b50",
"0xf1fa677edda7e5add8e794732c7554cd5459a5c12781dc71de73c7937dfb2775",
"0x241d89f7888fbcfadfd415ee967882fec6fdd67c07ca8a00f2ca4c910a84c7dd"
],
"transactionsRoot": "0xf98631e290e88f58a46b7032f025969039aa9b5696498efc76baf436fa69b262",
"uncles": [
"0x824cce7c7c2ec6874b9fa9a9a898eb5f27cbaf3991dfa81084c3af60d1db618c"
]
}
}
```
---
## Base eth_getBlockTransactionCountByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockTransactionCountByHash`
Returns the number of transactions in the block with the given block hash.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
## Returns
A hexadecimal equivalent of the integer representing the number of transactions in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x50"
}
```
---
## Base eth_getBlockTransactionCountByNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockTransactionCountByNumber`
Returns the number of transactions in the block with the given block number.
## Parameters
- `block number`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of transactions in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xa0"
}
```
---
## Base eth_getCode
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getCode`
Returns the compiled byte code of a smart contract, if any, at a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) of the smart contract, from which the compiled byte code will be obtained.
- `block number`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
The compiled byte code of the smart contract at the given address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x60606040..."
}
```
---
## Base eth_getLogs
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getLogs`
Returns an array of all the logs matching the given filter object. See also the below [Constraints](#constraints) section.
## Parameters
- `filter object`: (object) _[required]_ - A filter object containing the following:
- `address`: (string or array) _[optional]_ - Contract address (20 bytes) or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default is "latest"]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default is "latest"]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `topics`: (array) _[optional]_ - Array of 32 bytes DATA topics. Topics are order-dependent.
- `blockhash`: (string) _[optional]_ - Restricts the logs returned to the single block referenced in the 32-byte hash `blockHash`. Using `blockHash` is equivalent to setting `fromBlock` and `toBlock` to the block number referenced in the `blockHash`. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.
## Returns
An array of log objects, or an empty array if nothing has changed since the last poll. Log objects contain the following keys and their values:
- `removed` - `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `logIndex` - Hexadecimal of the log index position in the block. `Null` when it is a pending log.
- `transactionIndex` - Hexadecimal of the transactions index position from which the log created. `Null` when it is a pending log.
- `transactionHash` - Hash of the transactions from which this log was created (32 bytes). `Null` when it is a pending log.
- `blockHash` - Hash of the block where this log was in (32 bytes). `Null` when it is a pending log.
- `blockNumber` - Block number where this log was in. `Null` when it is a pending log.
- `address` - Address from which this log originated (20 bytes).
- `data` - Contains one or more 32-bytes non-indexed arguments of the log.
- `topics` - An array of 0 to 4 indexed log arguments, each 32 bytes. In solidity the first topic is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id":1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x1a94fce7ef36bc90959e206ba569a12afbc91ca1",
"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70",
"blockNumber": "0x5c29fb",
"data": "0x0000000000000000000000003e3310720058c51f0de456e273c626cdd35065700000000000000000000000000000000000000000000000000000000000003185000000000000000000000000000000000000000000000000000000000000318200000000000000000000000000000000000000000000000000000000005c2a23",
"logIndex": "0x1d",
"removed": false,
"topics": [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash": "0x3dc91b98249fa9f2c5c37486a2427a3a7825be240c1c84961dfb3063d9c04d50",
"transactionIndex": "0x1d"
},
{
"address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70",
"blockNumber": "0x5c29fb",
"data": "0x00000000000000000000000077ea137625739598666ded665953d26b3d8e374400000000000000000000000000000000000000000000000000000000000749ff00000000000000000000000000000000000000000000000000000000000a749d00000000000000000000000000000000000000000000000000000000005c2a0f",
"logIndex": "0x57",
"removed": false,
"topics": [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash": "0x788b1442414cb9c9a36dba2abe250763161a6f6395788a2e808f1b34e92beec1",
"transactionIndex": "0x54"
}
]
}
```
## Constraints
The following constraints apply:
To prevent queries from consuming too many resources, `eth_getLogs` requests are currently limited by three constraints:
- A maximum of 5,000 parameters in a single request
- A maximum of 10,000 results can be returned by a single query
- Query duration must not exceed 10 seconds
If a query returns too many results or exceeds the max query duration, one of the following errors is returned:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32005,
"message": "query returned more than 10000 results"
}
}
```
or
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32005,
"message": "query timeout exceeded"
}
}
```
If this happens:
- Limit your query to a smaller number of blocks using `fromBlock` and `toBlock`.
- If querying for commonly used `topics`, consider limiting to a single smart contract `address`.
---
## Base eth_getProof
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getProof`
Returns the account and storage values, including the Merkle proof, of the specified account.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) to check for balance.
- `storageKeys`: (array) _[required]_ - An array of 32-byte storage keys to be proofed and included.
- `blockParameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
- `balance` - Hexadecimal of the current balance in wei.
- `codeHash` - The 32-byte hash of the code of the account.
- `nonce` - The nonce of the account.
- `storageHash` - The SHA3 of the StorageRoot (32 bytes). All storage will deliver a Merkle proof starting with this `rootHash`.
- `accountProof` - An array of RLP-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key.
- `storageProof` - An array of storage-entries as requested. Each entry is an object with these properties:
- `key` - The requested storage key.
- `value` - The storage value.
- `proof` - An array of RLP-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getProof", "id": 1, "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"accountProof": [
"0xf90211a...0701bc80",
"0xf90211a...0d832380",
"0xf90211a...5fb20c80",
"0xf90211a...0675b80",
"0xf90151a0...ca08080"
],
"address": "0x7f0d15c7faae65896648c8273b6d7e43f58fa842",
"balance": "0x0",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce": "0x0",
"storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof": [
{
"key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"proof": [],
"value": "0x0"
}
]
}
}
```
---
## Base eth_getStorageAt
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getStorageAt`
Returns the value from a storage position at a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) of the storage.
- `storage position`: (string) _[required]_ - A hexadecimal code of the position in the storage.
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer indicating the value of the storage position at the provided address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
```
## Additional notes
Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at `0x295a70b2de5e3953354a6a8344e616ed314d7251` by address `0x391694e7e0b0cce554cb130d723a9d27458f9298`:
```solidity
contract Storage {
uint pos0;
mapping(address => uint) pos1;
function Storage() public {
pos0 = 1234;
pos1[msg.sender] = 5678;
}
}
```
Retrieving the value of pos0 is straight forward:
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "0x65a8db"], "id": 1}'
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x00000000000000000000000000000000000000000000000000000000000004d2"
}
```
Retrieving an element of the map is harder. The position of an element in the map is calculated with:
```js
keccak(LeftPad32(key, 0), LeftPad32(map position, 0))
```
This means to retrieve the storage on `pos1["0x391694e7e0b0cce554cb130d723a9d27458f9298"]` we need to calculate the position with:
```js
keccak(
decodeHex(
"000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" +
"0000000000000000000000000000000000000000000000000000000000000001"
)
)
```
The Geth console which comes with the web3 library can be used to make the calculation:
```js
> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"
undefined
> web3.sha3(key, {"encoding": "hex"})
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"
```
Now to fetch the storage:
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x000000000000000000000000000000000000000000000000000000000000162e"
}
```
---
## Base eth_getTransactionByBlockHashAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByBlockHashAndIndex`
Returns information about a transaction given block hash and transaction index position.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `transaction index position`: (string) _[required]_ - A hexadecimal of the integer representing the position in the block.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x25",
"value": "0x0"
}
}
```
---
## Base eth_getTransactionByBlockNumberAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByBlockNumberAndIndex`
Returns information about a transaction given block number and transaction index position.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `transaction index position`: (string) _[required]_ - A hexadecimal of the integer representing the position in the block.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x25",
"value": "0x0"
}
}
```
---
## Base eth_getTransactionByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByHash`
Returns information about a transaction for a given hash.
## Parameters
- `transaction hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a transaction.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0x398137383b3d25c92898c656696e41950e47316b",
"gas": "0x1d45e",
"gasPrice": "0xfa56ea00",
"hash": "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
"input": "0xf7d8c88300000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e1",
"nonce": "0x18",
"r": "0x2a378831cf81d99a3f06a18ae1b6ca366817ab4d88a70053c41d7a8f0368e031",
"s": "0x450d831a05b6e418724436c05c155e0a1b7b921015d0fbc2f667aed709ac4fb5",
"to": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"transactionIndex": "0x11",
"type": "0x0",
"v": "0x25",
"value": "0x1c6bf526340000"
}
}
```
---
## Base eth_getTransactionCount
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionCount`
Returns the number of transactions sent from an address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes).
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of transactions sent from the given address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1a"
}
```
---
## Base eth_getTransactionReceipt
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionReceipt`
Returns the receipt of a transaction given transaction hash. Note that the receipt is not available for pending transactions.
## Parameters
- `transaction hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a transaction.
## Returns
A transaction receipt object, or null when no receipt was found. The transaction receipt object will contain the following keys and their values:
- `blockHash` - Hash of the block including this transaction (32 bytes).
- `blockNumber` - Block number including this transaction.
- `contractAddress` - The contract address created if the transaction was a contract creation, otherwise `null` (20 bytes).
- `cumulativeGasUsed` - The total amount of gas used when this transaction was executed in the block.
- `effectiveGasPrice` - The actual value per gas deducted from the sender's account. Before [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559), equal to the gas price.
- `from` - The address of the sender (20 bytes).
- `gasUsed` - The amount of gas used by this specific transaction alone.
- `logs` - An array of log objects generated by this transaction.
- `logsBloom` - Bloom filter for light clients to quickly retrieve related logs (256 bytes).
- One of the following:
- `root` - 32 bytes of post-transaction stateroot (pre-Byzantium)
- `status` - Either 1 (success) or 0 (failure)
- `to` - The address of the receiver (20 bytes). `null` when the transaction is a contract creation transaction.
- `transactionHash` - The hash of the transaction (32 bytes).
- `transactionIndex` - Hexadecimal of the transaction's index position in the block.
- `type` - The transaction type.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x0a79eca9f5ca58a1d5d5030a0fabfdd8e815b8b77a9f223f74d59aa39596e1c7",
"blockNumber": "0x11e5883",
"contractAddress": null,
"cumulativeGasUsed": "0xc5f3e7",
"effectiveGasPrice": "0xa45b9a444",
"from": "0x690b9a9e9aa1c9db991c7721a92d351db4fac990",
"gasUsed": "0x565f",
"logs": [
{
"address": "0x388c818ca8b9251b393131c08a736a67ccb19297",
"blockHash": "0x0a79eca9f5ca58a1d5d5030a0fabfdd8e815b8b77a9f223f74d59aa39596e1c7",
"blockNumber": "0x11e5883",
"data": "0x00000000000000000000000000000000000000000000000011b6b79503fb875d",
"logIndex": "0x187",
"removed": false,
"topics": [
"0x27f12abfe35860a9a927b465bb3d4a9c23c8428174b83f278fe45ed7b4da2662"
],
"transactionHash": "0x7114b4da1a6ed391d5d781447ed443733dcf2b508c515b81c17379dea8a3c9af",
"transactionIndex": "0x76"
}
],
"logsBloom": "0x00000000000000000000000000000000000100004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x388c818ca8b9251b393131c08a736a67ccb19297",
"transactionHash": "0x7114b4da1a6ed391d5d781447ed443733dcf2b508c515b81c17379dea8a3c9af",
"transactionIndex": "0x76",
"type": "0x2"
}
}
```
---
## Base eth_getUncleByBlockHashAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleByBlockHashAndIndex`
Returns information about an uncle of a block given the block hash and the uncle index position.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `uncle index position`: (string) _[required]_ - A hexadecimal equivalent of the integer indicating the uncle's index position.
## Returns
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- `number` - The block number. `Null` when the returned block is the pending block.
- `hash` - Hash of the block (32 bytes). `Null` when its pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `logsBloom` - The Bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `difficulty` - The hexadecimal of the difficulty for this block.
- `totalDifficulty` - The hexadecimal of the total difficulty of the chain until this block.
- `extraData` - The "extra data" field of this block.
- `size` - The hexadecimal of the size of this block in bytes.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `timestamp` - The unix timestamp for when the block was collated.
- `uncles` - An array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": null,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
---
## Base eth_getUncleByBlockNumberAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleByBlockNumberAndIndex`
Returns information about an uncle of a block given the block number and the uncle index position.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `uncle index position`: (string) _[required]_ - A hexadecimal equivalent of the integer indicating the uncle's index position.
## Returns
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- `number` - The block number. `Null` when the returned block is the pending block.
- `hash` - Hash of the block (32 bytes). `Null` when its pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `logsBloom` - The Bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `difficulty` - The hexadecimal of the difficulty for this block.
- `totalDifficulty` - The hexadecimal of the total difficulty of the chain until this block.
- `extraData` - The "extra data" field of this block.
- `size` - The hexadecimal of the size of this block in bytes.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `timestamp` - The unix timestamp for when the block was collated.
- `uncles` - An array of uncle hashes.
:::note
An uncle doesn't contain individual transactions.
:::
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": null,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
---
## Base eth_getUncleCountByBlockHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleCountByBlockHash`
Returns the number of uncles in a block from a block matching the given block hash.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
## Returns
A hexadecimal equivalent of the integer representing the number of uncles in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Base eth_getUncleCountByBlockNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleCountByBlockNumber`
Returns the number of uncles in a block from a block matching the given block number.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of uncles in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Base eth_maxPriorityFeePerGas
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_maxPriorityFeePerGas`
Returns an estimate of how much priority fee, in wei, you need to be included in a block.
## Parameters
None.
## Returns
A hexadecimal value of the priority fee, in wei, needed to be included in a block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x55d4a80"
}
```
---
## Base eth_protocolVersion
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_protocolVersion`
Returns the current Ethereum protocol version.
## Parameters
None.
## Returns
`protocol version`: A hexadecimal indicating the current Ethereum protocol version.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x41"
}
```
---
## Base eth_sendRawTransaction
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_sendRawTransaction`
Submits a pre-signed transaction for broadcast to the Ethereum network.
## Parameters
- `transaction data`: (string) _[required]_ - The signed transaction data.
## Returns
The transaction hash (32 bytes), or the zero hash if the transaction is not yet available. Use [`eth_getTransactionReceipt`](../ethereum/json-rpc-methods/eth_gettransactionreceipt.mdx) to get the contract address, after the transaction was mined, when you created a contract.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
```
## Error response
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
---
## Base eth_syncing
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_syncing`
Returns an object with data about the sync status or `false`.
## Parameters
None.
## Returns
- `sync status`: (boolean) Returns `false` only when not syncing.
- `sync blocks`:
- `startingBlock`: A hexadecimal equivalent the integer indicating the block at which the import started (will only be reset after the sync reaches the head).
- `currentBlock`: A hexadecimal equivalent the integer indicating the current block, same as
[`eth_blockNumber`](../ethereum/json-rpc-methods/eth_blocknumber.mdx).
- `highestBlock`: A hexadecimal equivalent the integer indicating the highest block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
```
---
## Base eth_getFilterChanges
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getFilterChanges`
Polling method for a filter, which returns an array of logs which occurred since the last poll.
Filter must be created by calling either `eth_newFilter` or `eth_newBlockFilter`.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the filter ID.
## Returns
- `log object array`: An array of log objects, or an empty array if nothing has changed since the last poll.
- For filters created with `eth_newBlockFilter` the return values are block hashes (32 bytes), for example, `["0x3454645634534..."]`.
- For filters created with `eth_newFilter` the logs are objects with the following params:
- `address`: 20 bytes - Address from which this log originated.
- `blockHash`: 32 bytes - The hash of the block where this log was in. `null` when it is a pending log.
- `blockNumber`: The block number where this log was in. `null` when it is a pending log.
- `data`: Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it is a valid log.
- `topics`: Array of data - An array of 0 to 4 32-bytes data of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes - A hash of the transactions from which this log was created. `null` when it is a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it is a pending log.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 73,
"result": [
{
"address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"blockHash": "0x99e8663c7b6d8bba3c7627a17d774238eae3e793dee30008debb2699666657de",
"blockNumber": "0x5d12ab",
"data": "0x0000000000000000000000000000000000000000000000a247d7a2955b61d000",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000bdc0afe57b8e9468aa95396da2ab2063e595f37e",
"0x0000000000000000000000007503e090dc2b64a88f034fb45e247cbd82b8741e"
],
"transactionHash": "0xa74c2432c9cf7dbb875a385a2411fd8f13ca9ec12216864b1a1ead3c99de99cd",
"transactionIndex": "0x3"
}
]
}
```
---
## Base eth_getFilterLogs
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getFilterLogs`
Returns an array of all logs matching the filter with the given filter ID.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the filter ID.
## Returns
- `log object array`: An array of log objects that match the filter. For an array of logs that occurred since the last poll, use `eth_getFilterChanges`. Log objects contain the following keys and their values:
- `address`: 20 bytes - Address from which this log originated.
- `blockHash`: 32 bytes - The hash of the block where this log was in. `null` when it's a pending log.
- `blockNumber`: The block number where this log was in. `null` when it's a pending log.
- `data`: Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `topics`: Array of data - An array of 0 to 4 32-bytes data of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes - A hash of the transactions from which this log was created. `null` when it's a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it's a pending log.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 73,
"result": [
{
"address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"blockHash": "0x99e8663c7b6d8bba3c7627a17d774238eae3e793dee30008debb2699666657de",
"blockNumber": "0x5d12ab",
"data": "0x0000000000000000000000000000000000000000000000a247d7a2955b61d000",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000bdc0afe57b8e9468aa95396da2ab2063e595f37e",
"0x0000000000000000000000007503e090dc2b64a88f034fb45e247cbd82b8741e"
],
"transactionHash": "0xa74c2432c9cf7dbb875a385a2411fd8f13ca9ec12216864b1a1ead3c99de99cd",
"transactionIndex": "0x3"
}
]
}
```
---
## Base eth_newBlockFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newBlockFilter`
Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call `eth_getFilterChanges`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using `eth_getFilterChanges` automatically expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
## Parameters
None
## Returns
`filter ID`: A hexadecimal denoting the newly created filter ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x8144114ddff0b3be57ad6a848ee4fe4a44cdda667055"
}
```
---
## Base eth_newFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newFilter`
Creates a filter object based on the given filter options, to notify when the state changes (logs). To check if the state has changed, call `eth_getFilterChanges`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using `eth_getFilterChanges` automatically expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
## Parameters
- `filter object`: (object) _[required]_ - A filter object with the following keys and their values:
- `address`: (string or array) _[optional]_ - A contract address or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default: latest]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default: latest]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `topics`: (array) _[optional]_ - An array of 32 bytes data topics. Topics are order-dependent.
### Specifying topic filters
Topics are order-dependent. A transaction with a log with topics `[A, B]` will be matched by the following topic filters:
- `[]`: Anything.
- `[A]`: `A` in the first position, and anything after.
- `[null, B]`: Anything in first position AND `B` in second position, and anything after.
- `[A, B]`: `A` in the first position AND `B` in second position, and anything after.
- `[[A, B], [A, B]]`: `(A OR B)` in first position AND `(A OR B)` in second position, and anything after.
## Returns
`filter ID`: A hexadecimal denoting the newly created filter ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x10ff114de54f0bfdbd7855f8a1dd7317e6500495a24f"
}
```
---
## Base eth_uninstallFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_uninstallFilter`
Uninstalls a filter with given ID. This method should always be called when watching is no longer needed. Additionally, filters time out when they aren't requested with `eth_getFilterChanges` for a period of time.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the ID of the filter to be uninstalled.
## Returns
`uninstalled flag`: Returns `true` if the filter was successfully uninstalled, otherwise `false`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```
---
## Base net_peerCount
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_peerCount`
Returns the number of peers currently connected to the client.
## Parameters
None
## Returns
`peer count`: A hexadecimal of the number of connected peers.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x64"
}
```
---
## Base net_version
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_version`
Returns the current network ID.
## Parameters
None.
## Returns
`network ID`: A string representing the current network ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "1"
}
```
---
## Base eth_subscribe
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_subscribe`
Creates a new subscription for particular events. The node returns a subscription ID. For each event that matches the subscription, a notification with relevant data is sent together with the subscription ID.
## Parameters
Specify one of the following subscription events:
- `newHeads`: (string) _[required]_ - Subscribing to this returns a notification each time a new header is appended to the chain, including chain reorganizations. In a chain reorganization, the subscription emits all new headers for the new chain. Therefore the subscription can emit multiple headers at the same height.
- `logs`: (object) _[required]_ - Returns logs that are included in new imported blocks and match the given filter criteria. In case of a chain reorganization, previously sent logs that are on the old chain are resent with the removed property set to `true`. Logs from transactions that ended up in the new chain are emitted. Therefore a subscription can emit logs for the same transaction multiple times. This parameter has the following fields:
- `address`: (string or array) _[optional]_ - Either an address or an array of addresses. Only logs that are created from these addresses are returned.
- `topics`: (array) _[optional]_ - Only logs that match these specified topics are returned.
- `newPendingTransactions`: (string) _[required]_ - Returns the hash for all transactions that are added to the pending state and are signed with a key that's available in the node. When a transaction that was previously part of the canonical chain isn't part of the new canonical chain after a reorganization, it's emitted again.
:::tip DIN Recommendation
We strongly recommend specifying a filter (`address` or `topics` or both) when subscribing to the `logs` event.
:::
## Returns
`subscription ID`: The ID of the newly created subscription on the node.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newHeads"]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", "topics":["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"]}]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x9cef478923ff08bf67fde6c64013158d"
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"result": {
"difficulty": "0x15d9223a23aa",
"extraData": "0xd983010305844765746887676f312e342e328777696e646f7773",
"gasLimit": "0x47e7c4",
"gasUsed": "0x38658",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
"nonce": "0x084149998194cc5f",
"number": "0x1348c9",
"parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701",
"receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378",
"timestamp": "0x56ffeff8",
"transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f"
},
"subscription": "0x9ce59a13059e417087c02d3236a0b1cc"
}
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0x4a8a4c0517381924f9838102c5a4dcb7",
"result": {
"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd",
"blockHash": "0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04",
"blockNumber": "0x29e87",
"data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003",
"logIndex": "0x0",
"topics": [
"0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"
],
"transactionHash": "0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4",
"transactionIndex": "0x0"
}
}
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0xc3b33aa549fb9a60e95d21862596617c",
"result": "0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa"
}
}
```
---
## Base eth_unsubscribe
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_unsubscribe`
Cancel subscriptions by calling this method with the subscription ID. It returns a boolean indicating that the subscription was canceled successfully.
## Parameters
- `subscription ID`: (string) _[required]_ - The ID of the subscription you want to unsubscribe.
## Returns
`unsubscribed flag`: Returns `true` if the subscription is canceled successfully.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": true
}
```
---
## Base web3_clientVersion
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `web3_clientversion`
Returns the current client version.
## Parameters
None.
## Returns
A string representing the current client version.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "Geth/v1.11.6-omnibus-f83e1598/linux-.mdx64/go1.20.3"
}
```
---
## BNB Smart Chain
This section provides reference information for the BNB Smart Chain JSON-RPC API methods.
---
## BNB Smart Chain eth_accounts
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_accounts`
Returns a list of addresses owned by the client.
## Parameters
None
## Returns
An array of hexadecimals as strings representing the addresses owned by the client.
:::caution will not return any accounts
While this JSON-RPC method is supported, it will _not_ return any accounts.
:::
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": []
}
```
---
## BNB Smart Chain eth_blockNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_blockNumber`
Returns the current latest block number.
## Parameters
None
## Returns
A hexadecimal of an integer representing the current block number the client is on.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x65a8db"
}
```
:::tip Convert hexadecimal to integer
On macOS, you can use `printf "%d\n" 0x65a8db` to convert the above hexadecimal number into an integer number.
:::
---
## BNB Smart Chain eth_call
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_call`
Executes a new message call immediately without creating a transaction on the blockchain.
## Parameters
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[required]_ - Address the transaction is sent from (20 bytes).
- `to`: (string) _[optional]_ - Address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution.
`eth_call` consumes zero gas, but this parameter may be needed by some executions.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the `gasPrice` used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay
per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the
sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `value`: (string) _[optional]_ - Hexadecimal of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters.
See [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags
`latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
The returned value of the executed contract.
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with
the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x"
}
```
---
## BNB Smart Chain eth_chainId
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_chainId`
Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced
by [EIP-155](https://eips.ethereum.org/EIPS/eip-155).
## Parameters
None.
## Returns
- `chainId` - A hexadecimal of the current chain ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## BNB Smart Chain eth_estimateGas
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_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
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[optional]_ - The address the transaction is sent from (20 bytes).
- `to`: (string) _[optional]_ - The address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution. `eth_estimateGas` consumes zero gas, but this parameter may be needed by some executions.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the gas price used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `value`: (string) _[optional]_ - Hexadecimal value of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters. See the [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block number`: (string) _[optional]_ - A string representing a block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
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
- `gasEstimate` - A hexadecimal of the estimate of the gas for the given transaction.
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5cec"
}
```
---
## BNB Smart Chain eth_gasPrice
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_gasPrice`
Returns the current gas price in wei.
## Parameters
None.
## Returns
A hexadecimal equivalent of an integer representing the current gas price in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x6bcc886e7"
}
```
---
## BNB Smart Chain eth_getBalance
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBalance`
Returns the balance of the account of a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) to check for balance.
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal of the current balance in the account at the given address. The balance is in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x7c2562030800"
}
```
---
## BNB Smart Chain eth_getBlockByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockByHash`
Returns information about a block given its block hash.
## Parameters
- `hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `transaction details flag`: (boolean) _[required]_ - If set to `true`, returns the full transaction objects, if `false` returns only the hashes of the transactions.
## Returns
A block object matching the hash in the request, or null when no block was found. The matched block contains the following keys and their values:
- `difficulty` - A hexadecimal of the difficulty for this block.
- `extraData` - The "extra data" field of this block.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `hash` - The hash of the block (32 bytes). Null when the returned block is the pending block.
- `logsBloom` - The bloom filter for the logs of the block (256 bytes). Null when the returned block is the pending block.
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `nonce` - The hash of the generated proof-of-work (8 bytes). Null when the returned block is the pending block.
- `number` - The block number. Null when the returned block is the pending block.
- `parentHash` - The hash of the parent block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `size` - A hexadecimal of the size of this block in bytes.
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `timestamp` - Unix timestamp for when the block was collated.
- `totalDifficulty` - A hexadecimal of the total difficulty of the chain until this block.
- `transactions` - An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `uncles` - An Array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbfabcdbd93dda",
"extraData": "0x737061726b706f6f6c2d636e2d6e6f64652d3132",
"gasLimit": "0x79f39e",
"gasUsed": "0x79ccd3",
"hash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"logsBloom": "0x4848112002a2020aaa0812180045840210020005281600c80104264300080008000491220144461026015300100000128005018401002090a824a4150015410020140400d808440106689b29d0280b1005200007480ca950b15b010908814e01911000054202a020b05880b914642a0000300003010044044082075290283516be82504082003008c4d8d14462a8800c2990c88002a030140180036c220205201860402001014040180002006860810ec0a1100a14144148408118608200060461821802c081000042d0810104a8004510020211c088200420822a082040e10104c00d010064004c122692020c408a1aa2348020445403814002c800888208b1",
"miner": "0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c",
"mixHash": "0x3d1fdd16f15aeab72e7db1013b9f034ee33641d92f71c0736beab4e67d34c7a7",
"nonce": "0x4db7a1c01d8a8072",
"number": "0x5bad55",
"parentHash": "0x61a8ad530a8a43e3583f8ec163f773ad370329b2375d66433eb82f005e1d6202",
"receiptsRoot": "0x5eced534b3d84d3d732ddbc714f5fd51d98a941b28182b6efe6df3a0fe90004b",
"sha3Uncles": "0x8a562e7634774d3e3a36698ac4915e37fc84a2cd0044cb84fa5d80263d2af4f6",
"size": "0x41c7",
"stateRoot": "0xf5208fffa2ba5a3f3a2f64ebd5ca3d098978bedd75f335f56b705d8715ee2305",
"timestamp": "0x5b541449",
"totalDifficulty": "0x12ac11391a2f3872fcd",
"transactions": [
"0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f",
"0xe42b0256058b7cad8a14b136a0364acda0b4c36f5b02dea7e69bfd82cef252a2",
"0x4eb05376055c6456ed883fc843bc43df1dcf739c321ba431d518aecd7f98ca11",
"0x994dd9e72b212b7dc5fd0466ab75adf7d391cf4f206a65b7ad2a1fd032bb06d7",
"0xf6feecbb9ab0ac58591a4bc287059b1133089c499517e91a274e6a1f5e7dce53",
"0x7e537d687a5525259480440c6ea2e1a8469cd98906eaff8597f3d2a44422ff97",
"0xa762220e92bed6d77a2c19ffc60dad77d71bd5028c5230c896ab4b9552a39b50",
"0xf1fa677edda7e5add8e794732c7554cd5459a5c12781dc71de73c7937dfb2775",
"0x241d89f7888fbcfadfd415ee967882fec6fdd67c07ca8a00f2ca4c910a84c7dd"
]
}
}
```
---
## BNB Smart Chain eth_getBlockByNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockByNumber`
Returns information about a block given its block number.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `show transaction details flag`: (boolean) _[required]_ - If set to `true`, returns the full transaction objects. If `false` returns only the hashes of the transactions.
## Returns
A block object, or null when no block was found. The returned block object contains the following keys and their values:
- `difficulty` - A hexadecimal of the difficulty for this block.
- `extraData` - The "extra data" field of this block.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `hash` - Hash of the block (32 bytes). `Null` when the returned block is the pending block.
- `logsBloom` - The bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `miner` - Address of the beneficiary to whom the mining rewards were given (20 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `number` - Block number. `Null` when the returned block is the pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes). Also see [Tries in Ethereum](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#tries-in-ethereum).
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `size` - A hexadecimal of the size of this block in bytes.
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `timestamp` - The unix timestamp for when the block was collated.
- `totalDifficulty` - A hexadecimal of the total difficulty of the chain until this block.
- `transactions` - An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `uncles` - An array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55",false], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55", false], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbfabcdbd93dda",
"extraData": "0x737061726b706f6f6c2d636e2d6e6f64652d3132",
"gasLimit": "0x79f39e",
"gasUsed": "0x79ccd3",
"hash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"logsBloom": "0x4848112002a2020aaa0812180045840210020005281600c80104264300080008000491220144461026015300100000128005018401002090a824a4150015410020140400d808440106689b29d0280b1005200007480ca950b15b010908814e01911000054202a020b05880b914642a0000300003010044044082075290283516be82504082003008c4d8d14462a8800c2990c88002a030140180036c220205201860402001014040180002006860810ec0a1100a14144148408118608200060461821802c081000042d0810104a8004510020211c088200420822a082040e10104c00d010064004c122692020c408a1aa2348020445403814002c800888208b1",
"miner": "0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c",
"mixHash": "0x3d1fdd16f15aeab72e7db1013b9f034ee33641d92f71c0736beab4e67d34c7a7",
"nonce": "0x4db7a1c01d8a8072",
"number": "0x5bad55",
"parentHash": "0x61a8ad530a8a43e3583f8ec163f773ad370329b2375d66433eb82f005e1d6202",
"receiptsRoot": "0x5eced534b3d84d3d732ddbc714f5fd51d98a941b28182b6efe6df3a0fe90004b",
"sha3Uncles": "0x8a562e7634774d3e3a36698ac4915e37fc84a2cd0044cb84fa5d80263d2af4f6",
"size": "0x41c7",
"stateRoot": "0xf5208fffa2ba5a3f3a2f64ebd5ca3d098978bedd75f335f56b705d8715ee2305",
"timestamp": "0x5b541449",
"totalDifficulty": "0x12ac11391a2f3872fcd",
"transactions": [
"0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f",
"0xe42b0256058b7cad8a14b136a0364acda0b4c36f5b02dea7e69bfd82cef252a2",
"0x4eb05376055c6456ed883fc843bc43df1dcf739c321ba431d518aecd7f98ca11",
"0x994dd9e72b212b7dc5fd0466ab75adf7d391cf4f206a65b7ad2a1fd032bb06d7",
"0xf6feecbb9ab0ac58591a4bc287059b1133089c499517e91a274e6a1f5e7dce53",
"0x7e537d687a5525259480440c6ea2e1a8469cd98906eaff8597f3d2a44422ff97",
"0xa762220e92bed6d77a2c19ffc60dad77d71bd5028c5230c896ab4b9552a39b50",
"0xf1fa677edda7e5add8e794732c7554cd5459a5c12781dc71de73c7937dfb2775",
"0x241d89f7888fbcfadfd415ee967882fec6fdd67c07ca8a00f2ca4c910a84c7dd"
],
"transactionsRoot": "0xf98631e290e88f58a46b7032f025969039aa9b5696498efc76baf436fa69b262",
"uncles": [
"0x824cce7c7c2ec6874b9fa9a9a898eb5f27cbaf3991dfa81084c3af60d1db618c"
]
}
}
```
---
## BNB Smart Chain eth_getBlockReceipts
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockReceipts`
Returns all transaction receipts for a given block, the amount of gas used, and any event logs that
might have been produced by a smart contract during the transaction.
## Parameters
- `blockNumber`: (string) _[required]_ - Hexadecimal or decimal integer representing a block number, or one of the string tags:
- `latest`
- `earliest`
- `pending`
- `finalized`
- `safe`
:::note
`pending` returns the same data as `latest`.
:::
## Returns
- `result` - Block object or `null` when there is no corresponding block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockNumber": "0x6f55",
"contractAddress": null,
"cumulativeGasUsed": "0x18c36",
"from": "0x22896bfc68814bfd855b1a167255ee497006e730",
"gasUsed": "0x18c36",
"effectiveGasPrice": "0x9502f907",
"logs": [
{
"address": "0xfd584430cafa2f451b4e2ebcf3986a21fff04350",
"topics": [
"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d",
"0x4be29e0e4eb91f98f709d98803cba271592782e293b84a625e025cbb40197ba8",
"0x000000000000000000000000835281a2563db4ebf1b626172e085dc406bfc7d2",
"0x00000000000000000000000022896bfc68814bfd855b1a167255ee497006e730"
],
"data": "0x",
"blockNumber": "0x6f55",
"transactionHash": "0x4a481e4649da999d92db0585c36cba94c18a33747e95dc235330e6c737c6f975",
"transactionIndex": "0x0",
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"logIndex": "0x0",
"removed": false
}
],
"logsBloom": "0x00000004000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000080020000000000000200010000000000000000000001000000800000000000000000000000000000000000000000000000000000100100000000000000000000008000000000000000000000000000000002000000000000000000000",
"status": "0x1",
"to": "0xfd584430cafa2f451b4e2ebcf3986a21fff04350",
"transactionHash": "0x4a481e4649da999d92db0585c36cba94c18a33747e95dc235330e6c737c6f975",
"transactionIndex": "0x0",
"type": "0x0"
},
{
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockNumber": "0x6f55",
"contractAddress": null,
"cumulativeGasUsed": "0x1de3e",
"from": "0x712e3a792c974b3e3dbe41229ad4290791c75a82",
"gasUsed": "0x5208",
"effectiveGasPrice": "0x9502f907",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0xd42e2b1c14d02f1df5369a9827cb8e6f3f75f338",
"transactionHash": "0xefb83b4e3f1c317e8da0f8e2fbb2fe964f34ee184466032aeecac79f20eacaf6",
"transactionIndex": "0x1",
"type": "0x2"
}
]
}
```
---
## BNB Smart Chain eth_getBlockTransactionCountByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockTransactionCountByHash`
Returns the number of transactions in the block with the given block hash.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
## Returns
A hexadecimal equivalent of the integer representing the number of transactions in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x50"
}
```
---
## BNB Smart Chain eth_getBlockTransactionCountByNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockTransactionCountByNumber`
Returns the number of transactions in the block with the given block number.
## Parameters
- `block number`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of transactions in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xa0"
}
```
---
## BNB Smart Chain eth_getCode
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getCode`
Returns the compiled byte code of a smart contract, if any, at a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) of the smart contract, from which the compiled byte code will be obtained.
- `block number`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
The compiled byte code of the smart contract at the given address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x60606040..."
}
```
---
## BNB Smart Chain eth_getLogs
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getLogs`
Returns an array of all the logs matching the given filter object. See also the below [Constraints](#constraints) section.
## Parameters
- `filter object`: (object) _[required]_ - A filter object containing the following:
- `address`: (string or array) _[optional]_ - Contract address (20 bytes) or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default is "latest"]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default is "latest"]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `topics`: (array) _[optional]_ - Array of 32 bytes DATA topics. Topics are order-dependent.
- `blockhash`: (string) _[optional]_ - Restricts the logs returned to the single block referenced in the 32-byte hash `blockHash`. Using `blockHash` is equivalent to setting `fromBlock` and `toBlock` to the block number referenced in the `blockHash`. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.
## Returns
An array of log objects, or an empty array if nothing has changed since the last poll. Log objects contain the following keys and their values:
- `removed` - `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `logIndex` - Hexadecimal of the log index position in the block. `Null` when it is a pending log.
- `transactionIndex` - Hexadecimal of the transactions index position from which the log created. `Null` when it is a pending log.
- `transactionHash` - Hash of the transactions from which this log was created (32 bytes). `Null` when it is a pending log.
- `blockHash` - Hash of the block where this log was in (32 bytes). `Null` when it is a pending log.
- `blockNumber` - Block number where this log was in. `Null` when it is a pending log.
- `address` - Address from which this log originated (20 bytes).
- `data` - Contains one or more 32-bytes non-indexed arguments of the log.
- `topics` - An array of 0 to 4 indexed log arguments, each 32 bytes. In solidity the first topic is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id":1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x1a94fce7ef36bc90959e206ba569a12afbc91ca1",
"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70",
"blockNumber": "0x5c29fb",
"data": "0x0000000000000000000000003e3310720058c51f0de456e273c626cdd35065700000000000000000000000000000000000000000000000000000000000003185000000000000000000000000000000000000000000000000000000000000318200000000000000000000000000000000000000000000000000000000005c2a23",
"logIndex": "0x1d",
"removed": false,
"topics": [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash": "0x3dc91b98249fa9f2c5c37486a2427a3a7825be240c1c84961dfb3063d9c04d50",
"transactionIndex": "0x1d"
},
{
"address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70",
"blockNumber": "0x5c29fb",
"data": "0x00000000000000000000000077ea137625739598666ded665953d26b3d8e374400000000000000000000000000000000000000000000000000000000000749ff00000000000000000000000000000000000000000000000000000000000a749d00000000000000000000000000000000000000000000000000000000005c2a0f",
"logIndex": "0x57",
"removed": false,
"topics": [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash": "0x788b1442414cb9c9a36dba2abe250763161a6f6395788a2e808f1b34e92beec1",
"transactionIndex": "0x54"
}
]
}
```
## Constraints
The following constraints apply:
To prevent queries from consuming too many resources, `eth_getLogs` requests are currently limited by three constraints:
- A maximum of 5,000 parameters in a single request
- A maximum of 10,000 results can be returned by a single query
- Query duration must not exceed 10 seconds
If a query returns too many results or exceeds the max query duration, one of the following errors is returned:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32005,
"message": "query returned more than 10000 results"
}
}
```
or
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32005,
"message": "query timeout exceeded"
}
}
```
If this happens:
- Limit your query to a smaller number of blocks using `fromBlock` and `toBlock`.
- If querying for commonly used `topics`, consider limiting to a single smart contract `address`.
---
## BNB Smart Chain eth_getProof
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getProof`
Returns the account and storage values, including the Merkle proof, of the specified account.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) to check for balance.
- `storageKeys`: (array) _[required]_ - An array of 32-byte storage keys to be proofed and included.
- `blockParameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
- `balance` - Hexadecimal of the current balance in wei.
- `codeHash` - The 32-byte hash of the code of the account.
- `nonce` - The nonce of the account.
- `storageHash` - The SHA3 of the StorageRoot (32 bytes). All storage will deliver a Merkle proof starting with this `rootHash`.
- `accountProof` - An array of RLP-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key.
- `storageProof` - An array of storage-entries as requested. Each entry is an object with these properties:
- `key` - The requested storage key.
- `value` - The storage value.
- `proof` - An array of RLP-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getProof", "id": 1, "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"accountProof": [
"0xf90211a...0701bc80",
"0xf90211a...0d832380",
"0xf90211a...5fb20c80",
"0xf90211a...0675b80",
"0xf90151a0...ca08080"
],
"address": "0x7f0d15c7faae65896648c8273b6d7e43f58fa842",
"balance": "0x0",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce": "0x0",
"storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof": [
{
"key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"proof": [],
"value": "0x0"
}
]
}
}
```
---
## BNB Smart Chain eth_getStorageAt
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getStorageAt`
Returns the value from a storage position at a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) of the storage.
- `storage position`: (string) _[required]_ - A hexadecimal code of the position in the storage.
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer indicating the value of the storage position at the provided address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
```
## Additional notes
Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at `0x295a70b2de5e3953354a6a8344e616ed314d7251` by address `0x391694e7e0b0cce554cb130d723a9d27458f9298`:
```solidity
contract Storage {
uint pos0;
mapping(address => uint) pos1;
function Storage() public {
pos0 = 1234;
pos1[msg.sender] = 5678;
}
}
```
Retrieving the value of pos0 is straight forward:
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "0x65a8db"], "id": 1}'
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x00000000000000000000000000000000000000000000000000000000000004d2"
}
```
Retrieving an element of the map is harder. The position of an element in the map is calculated with:
```js
keccak(LeftPad32(key, 0), LeftPad32(map position, 0))
```
This means to retrieve the storage on `pos1["0x391694e7e0b0cce554cb130d723a9d27458f9298"]` we need to calculate the position with:
```js
keccak(
decodeHex(
"000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" +
"0000000000000000000000000000000000000000000000000000000000000001"
)
)
```
The Geth console which comes with the web3 library can be used to make the calculation:
```js
> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"
undefined
> web3.sha3(key, {"encoding": "hex"})
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"
```
Now to fetch the storage:
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x000000000000000000000000000000000000000000000000000000000000162e"
}
```
---
## BNB Smart Chain eth_getTransactionByBlockHashAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByBlockHashAndIndex`
Returns information about a transaction given block hash and transaction index position.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `transaction index position`: (string) _[required]_ - A hexadecimal of the integer representing the position in the block.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x25",
"value": "0x0"
}
}
```
---
## BNB Smart Chain eth_getTransactionByBlockNumberAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByBlockNumberAndIndex`
Returns information about a transaction given block number and transaction index position.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `transaction index position`: (string) _[required]_ - A hexadecimal of the integer representing the position in the block.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x25",
"value": "0x0"
}
}
```
---
## BNB Smart Chain eth_getTransactionByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByHash`
Returns information about a transaction for a given hash.
## Parameters
- `transaction hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a transaction.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0x398137383b3d25c92898c656696e41950e47316b",
"gas": "0x1d45e",
"gasPrice": "0xfa56ea00",
"hash": "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
"input": "0xf7d8c88300000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e1",
"nonce": "0x18",
"r": "0x2a378831cf81d99a3f06a18ae1b6ca366817ab4d88a70053c41d7a8f0368e031",
"s": "0x450d831a05b6e418724436c05c155e0a1b7b921015d0fbc2f667aed709ac4fb5",
"to": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"transactionIndex": "0x11",
"type": "0x0",
"v": "0x25",
"value": "0x1c6bf526340000"
}
}
```
---
## BNB Smart Chain eth_getTransactionCount
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionCount`
Returns the number of transactions sent from an address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes).
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of transactions sent from the given address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1a"
}
```
---
## BNB Smart Chain eth_getTransactionReceipt
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionReceipt`
Returns the receipt of a transaction given transaction hash. Note that the receipt is not available for pending transactions.
## Parameters
- `transaction hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a transaction.
## Returns
A transaction receipt object, or null when no receipt was found. The transaction receipt object will contain the following keys and their values:
- `blockHash` - Hash of the block including this transaction (32 bytes).
- `blockNumber` - Block number including this transaction.
- `contractAddress` - The contract address created if the transaction was a contract creation, otherwise `null` (20 bytes).
- `cumulativeGasUsed` - The total amount of gas used when this transaction was executed in the block.
- `effectiveGasPrice` - The actual value per gas deducted from the sender's account. Before [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559), equal to the gas price.
- `from` - The address of the sender (20 bytes).
- `gasUsed` - The amount of gas used by this specific transaction alone.
- `logs` - An array of log objects generated by this transaction.
- `logsBloom` - Bloom filter for light clients to quickly retrieve related logs (256 bytes).
- One of the following:
- `root` - 32 bytes of post-transaction stateroot (pre-Byzantium)
- `status` - Either 1 (success) or 0 (failure)
- `to` - The address of the receiver (20 bytes). `null` when the transaction is a contract creation transaction.
- `transactionHash` - The hash of the transaction (32 bytes).
- `transactionIndex` - Hexadecimal of the transaction's index position in the block.
- `type` - The transaction type.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x0a79eca9f5ca58a1d5d5030a0fabfdd8e815b8b77a9f223f74d59aa39596e1c7",
"blockNumber": "0x11e5883",
"contractAddress": null,
"cumulativeGasUsed": "0xc5f3e7",
"effectiveGasPrice": "0xa45b9a444",
"from": "0x690b9a9e9aa1c9db991c7721a92d351db4fac990",
"gasUsed": "0x565f",
"logs": [
{
"address": "0x388c818ca8b9251b393131c08a736a67ccb19297",
"blockHash": "0x0a79eca9f5ca58a1d5d5030a0fabfdd8e815b8b77a9f223f74d59aa39596e1c7",
"blockNumber": "0x11e5883",
"data": "0x00000000000000000000000000000000000000000000000011b6b79503fb875d",
"logIndex": "0x187",
"removed": false,
"topics": [
"0x27f12abfe35860a9a927b465bb3d4a9c23c8428174b83f278fe45ed7b4da2662"
],
"transactionHash": "0x7114b4da1a6ed391d5d781447ed443733dcf2b508c515b81c17379dea8a3c9af",
"transactionIndex": "0x76"
}
],
"logsBloom": "0x00000000000000000000000000000000000100004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x388c818ca8b9251b393131c08a736a67ccb19297",
"transactionHash": "0x7114b4da1a6ed391d5d781447ed443733dcf2b508c515b81c17379dea8a3c9af",
"transactionIndex": "0x76",
"type": "0x2"
}
}
```
---
## BNB Smart Chain eth_getUncleByBlockHashAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleByBlockHashAndIndex`
Returns information about an uncle of a block given the block hash and the uncle index position.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `uncle index position`: (string) _[required]_ - A hexadecimal equivalent of the integer indicating the uncle's index position.
## Returns
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- `number` - The block number. `Null` when the returned block is the pending block.
- `hash` - Hash of the block (32 bytes). `Null` when its pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `logsBloom` - The Bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `difficulty` - The hexadecimal of the difficulty for this block.
- `totalDifficulty` - The hexadecimal of the total difficulty of the chain until this block.
- `extraData` - The "extra data" field of this block.
- `size` - The hexadecimal of the size of this block in bytes.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `timestamp` - The unix timestamp for when the block was collated.
- `uncles` - An array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": null,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
---
## BNB Smart Chain eth_getUncleByBlockNumberAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleByBlockNumberAndIndex`
Returns information about an uncle of a block given the block number and the uncle index position.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `uncle index position`: (string) _[required]_ - A hexadecimal equivalent of the integer indicating the uncle's index position.
## Returns
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- `number` - The block number. `Null` when the returned block is the pending block.
- `hash` - Hash of the block (32 bytes). `Null` when its pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `logsBloom` - The Bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `difficulty` - The hexadecimal of the difficulty for this block.
- `totalDifficulty` - The hexadecimal of the total difficulty of the chain until this block.
- `extraData` - The "extra data" field of this block.
- `size` - The hexadecimal of the size of this block in bytes.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `timestamp` - The unix timestamp for when the block was collated.
- `uncles` - An array of uncle hashes.
:::note
An uncle doesn't contain individual transactions.
:::
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": null,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
---
## BNB Smart Chain eth_getUncleCountByBlockHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleCountByBlockHash`
Returns the number of uncles in a block from a block matching the given block hash.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
## Returns
A hexadecimal equivalent of the integer representing the number of uncles in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## BNB Smart Chain eth_getUncleCountByBlockNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleCountByBlockNumber`
Returns the number of uncles in a block from a block matching the given block number.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of uncles in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## BNB Smart Chain eth_maxPriorityFeePerGas
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_maxPriorityFeePerGas`
Returns an estimate of how much priority fee, in wei, you need to be included in a block.
## Parameters
None.
## Returns
A hexadecimal value of the priority fee, in wei, needed to be included in a block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x55d4a80"
}
```
---
## BNB Smart Chain eth_protocolVersion
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_protocolVersion`
Returns the current Ethereum protocol version.
## Parameters
None.
## Returns
`protocol version`: A hexadecimal indicating the current Ethereum protocol version.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x41"
}
```
---
## BNB Smart Chain eth_sendRawTransaction
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_sendRawTransaction`
Submits a pre-signed transaction for broadcast to the Ethereum network.
## Parameters
- `transaction data`: (string) _[required]_ - The signed transaction data.
## Returns
The transaction hash (32 bytes), or the zero hash if the transaction is not yet available. Use [`eth_getTransactionReceipt`](../ethereum/json-rpc-methods/eth_gettransactionreceipt.mdx) to get the contract address, after the transaction was mined, when you created a contract.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
```
## Error response
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
---
## BNB Smart Chain eth_submitWork
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_submitWork`
Used for submitting a proof-of-work solution.
## Parameters
- `work array`: (array) _[required]_ - A work array with the following properties:
- 8 bytes: The nonce found (64 bits)
- 32 bytes: The header's PoW-hash (256 bits)
- 32 bytes: The mix digest (256 bits)
## Returns
Returns `true` if the provided solution is valid, otherwise `false`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
```
---
## BNB Smart Chain eth_syncing
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_syncing`
Returns an object with data about the sync status or `false`.
## Parameters
None.
## Returns
- `sync status`: (boolean) Returns `false` only when not syncing.
- `sync blocks`:
- `startingBlock`: A hexadecimal equivalent the integer indicating the block at which the import started (will only be reset after the sync reaches the head).
- `currentBlock`: A hexadecimal equivalent the integer indicating the current block, same as
[`eth_blockNumber`](../ethereum/json-rpc-methods/eth_blocknumber.mdx).
- `highestBlock`: A hexadecimal equivalent the integer indicating the highest block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
```
---
## BNB Smart Chain eth_getFilterChanges
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getFilterChanges`
Polling method for a filter, which returns an array of logs which occurred since the last poll.
Filter must be created by calling either `eth_newFilter` or `eth_newBlockFilter`.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the filter ID.
## Returns
- `log object array`: An array of log objects, or an empty array if nothing has changed since the last poll.
- For filters created with `eth_newBlockFilter` the return values are block hashes (32 bytes), for example, `["0x3454645634534..."]`.
- For filters created with `eth_newFilter` the logs are objects with the following params:
- `address`: 20 bytes - Address from which this log originated.
- `blockHash`: 32 bytes - The hash of the block where this log was in. `null` when it is a pending log.
- `blockNumber`: The block number where this log was in. `null` when it is a pending log.
- `data`: Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it is a valid log.
- `topics`: Array of data - An array of 0 to 4 32-bytes data of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes - A hash of the transactions from which this log was created. `null` when it is a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it is a pending log.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 73,
"result": [
{
"address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"blockHash": "0x99e8663c7b6d8bba3c7627a17d774238eae3e793dee30008debb2699666657de",
"blockNumber": "0x5d12ab",
"data": "0x0000000000000000000000000000000000000000000000a247d7a2955b61d000",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000bdc0afe57b8e9468aa95396da2ab2063e595f37e",
"0x0000000000000000000000007503e090dc2b64a88f034fb45e247cbd82b8741e"
],
"transactionHash": "0xa74c2432c9cf7dbb875a385a2411fd8f13ca9ec12216864b1a1ead3c99de99cd",
"transactionIndex": "0x3"
}
]
}
```
---
## BNB Smart Chain eth_getFilterLogs
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getFilterLogs`
Returns an array of all logs matching the filter with the given filter ID.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the filter ID.
## Returns
- `log object array`: An array of log objects that match the filter. For an array of logs that occurred since the last poll, use `eth_getFilterChanges`. Log objects contain the following keys and their values:
- `address`: 20 bytes - Address from which this log originated.
- `blockHash`: 32 bytes - The hash of the block where this log was in. `null` when it's a pending log.
- `blockNumber`: The block number where this log was in. `null` when it's a pending log.
- `data`: Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `topics`: Array of data - An array of 0 to 4 32-bytes data of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes - A hash of the transactions from which this log was created. `null` when it's a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it's a pending log.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 73,
"result": [
{
"address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"blockHash": "0x99e8663c7b6d8bba3c7627a17d774238eae3e793dee30008debb2699666657de",
"blockNumber": "0x5d12ab",
"data": "0x0000000000000000000000000000000000000000000000a247d7a2955b61d000",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000bdc0afe57b8e9468aa95396da2ab2063e595f37e",
"0x0000000000000000000000007503e090dc2b64a88f034fb45e247cbd82b8741e"
],
"transactionHash": "0xa74c2432c9cf7dbb875a385a2411fd8f13ca9ec12216864b1a1ead3c99de99cd",
"transactionIndex": "0x3"
}
]
}
```
---
## BNB Smart Chain eth_newBlockFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newBlockFilter`
Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call `eth_getFilterChanges`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using `eth_getFilterChanges` automatically expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
## Parameters
None
## Returns
`filter ID`: A hexadecimal denoting the newly created filter ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x8144114ddff0b3be57ad6a848ee4fe4a44cdda667055"
}
```
---
## BNB Smart Chain eth_newFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newFilter`
Creates a filter object based on the given filter options, to notify when the state changes (logs). To check if the state has changed, call `eth_getFilterChanges`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using `eth_getFilterChanges` automatically expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
## Parameters
- `filter object`: (object) _[required]_ - A filter object with the following keys and their values:
- `address`: (string or array) _[optional]_ - A contract address or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default: latest]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default: latest]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `topics`: (array) _[optional]_ - An array of 32 bytes data topics. Topics are order-dependent.
### Specifying topic filters
Topics are order-dependent. A transaction with a log with topics `[A, B]` will be matched by the following topic filters:
- `[]`: Anything.
- `[A]`: `A` in the first position, and anything after.
- `[null, B]`: Anything in first position AND `B` in second position, and anything after.
- `[A, B]`: `A` in the first position AND `B` in second position, and anything after.
- `[[A, B], [A, B]]`: `(A OR B)` in first position AND `(A OR B)` in second position, and anything after.
## Returns
`filter ID`: A hexadecimal denoting the newly created filter ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x10ff114de54f0bfdbd7855f8a1dd7317e6500495a24f"
}
```
---
## BNB Smart Chain eth_newPendingTransactionFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newPendingTransactionFilter`
Creates a filter to retrieve new pending transaction hashes. To poll for new pending transactions, use `eth_getFilterChanges`.
## Parameters
None
## Returns
A filter ID that can be used to call `eth_getFilterChanges`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newPendingTransactionFilter", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newPendingTransactionFilter", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x443d6a77c4964707a8554c92f7e4debd"
}
```
---
## BNB Smart Chain eth_uninstallFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_uninstallFilter`
Uninstalls a filter with given ID. This method should always be called when watching is no longer needed. Additionally, filters time out when they aren't requested with `eth_getFilterChanges` for a period of time.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the ID of the filter to be uninstalled.
## Returns
`uninstalled flag`: Returns `true` if the filter was successfully uninstalled, otherwise `false`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```
---
## BNB Smart Chain net_listening
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_listening`
Returns `true` if client is actively listening for network connections.
## Parameters
None.
## Returns
`listening flag`: (boolean) Indicating whether the client is actively listening for network connections.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```
---
## BNB Smart Chain net_peerCount
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_peerCount`
Returns the number of peers currently connected to the client.
## Parameters
None
## Returns
`peer count`: A hexadecimal of the number of connected peers.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x64"
}
```
---
## BNB Smart Chain net_version
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_version`
Returns the current network ID.
## Parameters
None.
## Returns
`network ID`: A string representing the current network ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "1"
}
```
---
## BNB Smart Chain eth_subscribe
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_subscribe`
Creates a new subscription for particular events. The node returns a subscription ID. For each event that matches the subscription, a notification with relevant data is sent together with the subscription ID.
## Parameters
Specify one of the following subscription events:
- `newHeads`: (string) _[required]_ - Subscribing to this returns a notification each time a new header is appended to the chain, including chain reorganizations. In a chain reorganization, the subscription emits all new headers for the new chain. Therefore the subscription can emit multiple headers at the same height.
- `logs`: (object) _[required]_ - Returns logs that are included in new imported blocks and match the given filter criteria. In case of a chain reorganization, previously sent logs that are on the old chain are resent with the removed property set to `true`. Logs from transactions that ended up in the new chain are emitted. Therefore a subscription can emit logs for the same transaction multiple times. This parameter has the following fields:
- `address`: (string or array) _[optional]_ - Either an address or an array of addresses. Only logs that are created from these addresses are returned.
- `topics`: (array) _[optional]_ - Only logs that match these specified topics are returned.
- `newPendingTransactions`: (string) _[required]_ - Returns the hash for all transactions that are added to the pending state and are signed with a key that's available in the node. When a transaction that was previously part of the canonical chain isn't part of the new canonical chain after a reorganization, it's emitted again.
:::tip DIN Recommendation
We strongly recommend specifying a filter (`address` or `topics` or both) when subscribing to the `logs` event.
:::
## Returns
`subscription ID`: The ID of the newly created subscription on the node.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newHeads"]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", "topics":["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"]}]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x9cef478923ff08bf67fde6c64013158d"
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"result": {
"difficulty": "0x15d9223a23aa",
"extraData": "0xd983010305844765746887676f312e342e328777696e646f7773",
"gasLimit": "0x47e7c4",
"gasUsed": "0x38658",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
"nonce": "0x084149998194cc5f",
"number": "0x1348c9",
"parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701",
"receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378",
"timestamp": "0x56ffeff8",
"transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f"
},
"subscription": "0x9ce59a13059e417087c02d3236a0b1cc"
}
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0x4a8a4c0517381924f9838102c5a4dcb7",
"result": {
"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd",
"blockHash": "0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04",
"blockNumber": "0x29e87",
"data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003",
"logIndex": "0x0",
"topics": [
"0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"
],
"transactionHash": "0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4",
"transactionIndex": "0x0"
}
}
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0xc3b33aa549fb9a60e95d21862596617c",
"result": "0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa"
}
}
```
---
## BNB Smart Chain eth_unsubscribe
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_unsubscribe`
Cancel subscriptions by calling this method with the subscription ID. It returns a boolean indicating that the subscription was canceled successfully.
## Parameters
- `subscription ID`: (string) _[required]_ - The ID of the subscription you want to unsubscribe.
## Returns
`unsubscribed flag`: Returns `true` if the subscription is canceled successfully.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": true
}
```
---
## BNB Smart Chain web3_clientVersion
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `web3_clientversion`
Returns the current client version.
## Parameters
None.
## Returns
A string representing the current client version.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "Geth/v1.11.6-omnibus-f83e1598/linux-.mdx64/go1.20.3"
}
```
---
## Ethereum
This section provides reference information for the Ethereum JSON-RPC API
and Beacon chain API.
---
## Ethereum eth_accounts
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_accounts`
Returns a list of addresses owned by the client.
## Parameters
None
## Returns
An array of hexadecimals as strings representing the addresses owned by the client.
:::caution will not return any accounts
While this JSON-RPC method is supported, it will _not_ return any accounts.
:::
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": []
}
```
---
## Ethereum eth_blobBaseFee
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_blobBaseFee`
Returns the expected base fee for blobs in the next block.
## Parameters
None.
## Returns
- `blobBaseFee` - The expected base fee in wei, represented as a hexadecimal.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_blobBaseFee", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_blobBaseFee", "params": [], "id":1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Ethereum eth_blockNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_blockNumber`
Returns the current latest block number.
## Parameters
None
## Returns
A hexadecimal of an integer representing the current block number the client is on.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x65a8db"
}
```
:::tip Convert hexadecimal to integer
On macOS, you can use `printf "%d\n" 0x65a8db` to convert the above hexadecimal number into an integer number.
:::
---
## Ethereum eth_call
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_call`
Executes a new message call immediately without creating a transaction on the blockchain.
## Parameters
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[required]_ - Address the transaction is sent from (20 bytes).
- `to`: (string) _[optional]_ - Address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution.
`eth_call` consumes zero gas, but this parameter may be needed by some executions.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the `gasPrice` used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay
per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the
sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `value`: (string) _[optional]_ - Hexadecimal of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters.
See [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags
`latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
The returned value of the executed contract.
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with
the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x9184e72a", "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x"
}
```
---
## Ethereum eth_chainId
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_chainId`
Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced
by [EIP-155](https://eips.ethereum.org/EIPS/eip-155).
## Parameters
None.
## Returns
- `chainId` - A hexadecimal of the current chain ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Ethereum eth_createAccessList
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_createAccessList`
Creates an [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) access list that you can include in a
transaction.
Use this method to optimize your smart contract interactions. Access lists are a part of Ethereum's
EIP-2930, which aims to improve the network's scalability and reduce gas costs by specifying an explicit
list of addresses and storage keys that a transaction intends to access.
## Parameters
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[optional]_ - The address of the sender (20 bytes).
- `to`: (string) _[optional]_ - Address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value gas price, in wei, provided by the sender. The default is `0`. Used only in non-EIP-1559 transactions.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](https://eips.ethereum.org/EIPS/eip-1559). If used, must specify `maxFeePerGas`.
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559). If used, must specify `maxPriorityFeePerGas`.
- `value`: (string) _[optional]_ - Hexadecimal of the value transferred, in wei.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters. See [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block number` or `block hash`: (string) _[required]_ - A string representing a block number, block hash, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
Access list object with the following fields:
- `accessList` - A list of objects with the following fields:
- `address` - Addresses to be accessed by the transaction.
- `storageKeys` - Storage keys to be accessed by the transaction.
- `gasUsed` - A hexadecimal string representing the approximate gas cost for the transaction if the access list is included.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"method": "eth_createAccessList", "params": [{"from": "0xaeA8F8f781326bfE6A7683C2BD48Dd6AA4d3Ba63", "data": "0x608060806080608155"}, "pending"], "id": 1, "jsonrpc": "2.0"}'
```
```bash
wscat -c -x '{"method": "eth_createAccessList", "params": [{"from": "0xaeA8F8f781326bfE6A7683C2BD48Dd6AA4d3Ba63", "data": "0x608060806080608155"}, "pending"], "id": 1, "jsonrpc": "2.0"}'
```
### Response
```json
{
"accessList": [
{
"address": "0xa02457e5dfd32bda5fc7e1f1b008aa5979568150",
"storageKeys": [
"0x0000000000000000000000000000000000000000000000000000000000000081",
]
}
]
"gasUsed": "0x125f8"
}
```
---
## Ethereum eth_estimateGas
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_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
- `transaction call object`: (object) _[required]_ - The transaction call object containing:
- `from`: (string) _[optional]_ - The address the transaction is sent from (20 bytes).
- `to`: (string) _[optional]_ - The address the transaction is directed to (20 bytes).
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution. `eth_estimateGas` consumes zero gas, but this parameter may be needed by some executions.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the gas price used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `value`: (string) _[optional]_ - Hexadecimal value of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters. See the [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block number`: (string) _[optional]_ - A string representing a block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
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
- `gasEstimate` - A hexadecimal of the estimate of the gas for the given transaction.
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5cec"
}
```
---
## Ethereum eth_feeHistory
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_feeHistory`
Returns historical gas information, allowing you to track trends over time.
## Parameters
- `blockCount`: (integer) _[required]_ - Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. If blocks in the specified block range are not available, then only the fee history for available blocks is returned.
- `newestBlock`: (string) _[required]_ - Integer representing the highest number block of the requested range, or one of the string tags `latest`, `earliest`, or `pending`.
- `array` of `integers`: (array) _[optional]_ - A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.
## Returns
- `oldestBlock` - Lowest number block of the returned range expressed as a hexadecimal number.
- `baseFeePerGas` - An array of block base fees per gas, including an extra block value. The extra value is the next block after the newest block in the returned range. Returns zeroes for blocks created before [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559).
- `gasUsedRatio` - An array of block gas used ratios. These are calculated as the ratio of `gasUsed` and `gasLimit`.
- `reward` - An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"id": 1, "jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", [20,30]] }'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", []], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"result": {
"baseFeePerGas": [
"0x3da8e7618",
"0x3e1ba3b1b",
"0x3dfd72b90",
"0x3d64eee76",
"0x3d4da2da0",
"0x3ccbcac6b"
],
"gasUsedRatio": [
0.5290747666666666,
0.49240453333333334,
0.4615576,
0.49407083333333335,
0.4669053
],
"oldestBlock": "0xfab8ac",
"reward": [
[
"0x59682f00",
"0x59682f00"
],
[
"0x59682f00",
"0x59682f00"
],
[
"0x3b9aca00",
"0x59682f00"
],
[
"0x510b0870",
"0x59682f00"
],
[
"0x3b9aca00",
"0x59682f00"
]
]
},
"id": 0
}
```
---
## Ethereum eth_gasPrice
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_gasPrice`
Returns the current gas price in wei.
## Parameters
None.
## Returns
A hexadecimal equivalent of an integer representing the current gas price in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x6bcc886e7"
}
```
---
## Ethereum eth_getBalance
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBalance`
Returns the balance of the account of a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) to check for balance.
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal of the current balance in the account at the given address. The balance is in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x7c2562030800"
}
```
---
## Ethereum eth_getBlockByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockByHash`
Returns information about a block given its block hash.
## Parameters
- `hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `transaction details flag`: (boolean) _[required]_ - If set to `true`, returns the full transaction objects, if `false` returns only the hashes of the transactions.
## Returns
A block object matching the hash in the request, or null when no block was found. The matched block contains the following keys and their values:
- `difficulty` - A hexadecimal of the difficulty for this block.
- `extraData` - The "extra data" field of this block.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `hash` - The hash of the block (32 bytes). Null when the returned block is the pending block.
- `logsBloom` - The bloom filter for the logs of the block (256 bytes). Null when the returned block is the pending block.
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `nonce` - The hash of the generated proof-of-work (8 bytes). Null when the returned block is the pending block.
- `number` - The block number. Null when the returned block is the pending block.
- `parentHash` - The hash of the parent block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `size` - A hexadecimal of the size of this block in bytes.
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `timestamp` - Unix timestamp for when the block was collated.
- `totalDifficulty` - A hexadecimal of the total difficulty of the chain until this block.
- `transactions` - An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `uncles` - An Array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", false], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbfabcdbd93dda",
"extraData": "0x737061726b706f6f6c2d636e2d6e6f64652d3132",
"gasLimit": "0x79f39e",
"gasUsed": "0x79ccd3",
"hash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"logsBloom": "0x4848112002a2020aaa0812180045840210020005281600c80104264300080008000491220144461026015300100000128005018401002090a824a4150015410020140400d808440106689b29d0280b1005200007480ca950b15b010908814e01911000054202a020b05880b914642a0000300003010044044082075290283516be82504082003008c4d8d14462a8800c2990c88002a030140180036c220205201860402001014040180002006860810ec0a1100a14144148408118608200060461821802c081000042d0810104a8004510020211c088200420822a082040e10104c00d010064004c122692020c408a1aa2348020445403814002c800888208b1",
"miner": "0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c",
"mixHash": "0x3d1fdd16f15aeab72e7db1013b9f034ee33641d92f71c0736beab4e67d34c7a7",
"nonce": "0x4db7a1c01d8a8072",
"number": "0x5bad55",
"parentHash": "0x61a8ad530a8a43e3583f8ec163f773ad370329b2375d66433eb82f005e1d6202",
"receiptsRoot": "0x5eced534b3d84d3d732ddbc714f5fd51d98a941b28182b6efe6df3a0fe90004b",
"sha3Uncles": "0x8a562e7634774d3e3a36698ac4915e37fc84a2cd0044cb84fa5d80263d2af4f6",
"size": "0x41c7",
"stateRoot": "0xf5208fffa2ba5a3f3a2f64ebd5ca3d098978bedd75f335f56b705d8715ee2305",
"timestamp": "0x5b541449",
"totalDifficulty": "0x12ac11391a2f3872fcd",
"transactions": [
"0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f",
"0xe42b0256058b7cad8a14b136a0364acda0b4c36f5b02dea7e69bfd82cef252a2",
"0x4eb05376055c6456ed883fc843bc43df1dcf739c321ba431d518aecd7f98ca11",
"0x994dd9e72b212b7dc5fd0466ab75adf7d391cf4f206a65b7ad2a1fd032bb06d7",
"0xf6feecbb9ab0ac58591a4bc287059b1133089c499517e91a274e6a1f5e7dce53",
"0x7e537d687a5525259480440c6ea2e1a8469cd98906eaff8597f3d2a44422ff97",
"0xa762220e92bed6d77a2c19ffc60dad77d71bd5028c5230c896ab4b9552a39b50",
"0xf1fa677edda7e5add8e794732c7554cd5459a5c12781dc71de73c7937dfb2775",
"0x241d89f7888fbcfadfd415ee967882fec6fdd67c07ca8a00f2ca4c910a84c7dd"
]
}
}
```
---
## Ethereum eth_getBlockByNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockByNumber`
Returns information about a block given its block number.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `show transaction details flag`: (boolean) _[required]_ - If set to `true`, returns the full transaction objects. If `false` returns only the hashes of the transactions.
## Returns
A block object, or null when no block was found. The returned block object contains the following keys and their values:
- `difficulty` - A hexadecimal of the difficulty for this block.
- `extraData` - The "extra data" field of this block.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `hash` - Hash of the block (32 bytes). `Null` when the returned block is the pending block.
- `logsBloom` - The bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `miner` - Address of the beneficiary to whom the mining rewards were given (20 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `number` - Block number. `Null` when the returned block is the pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes). Also see [Tries in Ethereum](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#tries-in-ethereum).
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `size` - A hexadecimal of the size of this block in bytes.
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `timestamp` - The unix timestamp for when the block was collated.
- `totalDifficulty` - A hexadecimal of the total difficulty of the chain until this block.
- `transactions` - An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `uncles` - An array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55",false], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x5BAD55", false], "id": 1}'
```
### Response
```js
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0xbfabcdbd93dda",
"extraData": "0x737061726b706f6f6c2d636e2d6e6f64652d3132",
"gasLimit": "0x79f39e",
"gasUsed": "0x79ccd3",
"hash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"logsBloom": "0x4848112002a2020aaa0812180045840210020005281600c80104264300080008000491220144461026015300100000128005018401002090a824a4150015410020140400d808440106689b29d0280b1005200007480ca950b15b010908814e01911000054202a020b05880b914642a0000300003010044044082075290283516be82504082003008c4d8d14462a8800c2990c88002a030140180036c220205201860402001014040180002006860810ec0a1100a14144148408118608200060461821802c081000042d0810104a8004510020211c088200420822a082040e10104c00d010064004c122692020c408a1aa2348020445403814002c800888208b1",
"miner": "0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c",
"mixHash": "0x3d1fdd16f15aeab72e7db1013b9f034ee33641d92f71c0736beab4e67d34c7a7",
"nonce": "0x4db7a1c01d8a8072",
"number": "0x5bad55",
"parentHash": "0x61a8ad530a8a43e3583f8ec163f773ad370329b2375d66433eb82f005e1d6202",
"receiptsRoot": "0x5eced534b3d84d3d732ddbc714f5fd51d98a941b28182b6efe6df3a0fe90004b",
"sha3Uncles": "0x8a562e7634774d3e3a36698ac4915e37fc84a2cd0044cb84fa5d80263d2af4f6",
"size": "0x41c7",
"stateRoot": "0xf5208fffa2ba5a3f3a2f64ebd5ca3d098978bedd75f335f56b705d8715ee2305",
"timestamp": "0x5b541449",
"totalDifficulty": "0x12ac11391a2f3872fcd",
"transactions": [
"0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f",
"0xe42b0256058b7cad8a14b136a0364acda0b4c36f5b02dea7e69bfd82cef252a2",
"0x4eb05376055c6456ed883fc843bc43df1dcf739c321ba431d518aecd7f98ca11",
"0x994dd9e72b212b7dc5fd0466ab75adf7d391cf4f206a65b7ad2a1fd032bb06d7",
"0xf6feecbb9ab0ac58591a4bc287059b1133089c499517e91a274e6a1f5e7dce53",
"0x7e537d687a5525259480440c6ea2e1a8469cd98906eaff8597f3d2a44422ff97",
"0xa762220e92bed6d77a2c19ffc60dad77d71bd5028c5230c896ab4b9552a39b50",
"0xf1fa677edda7e5add8e794732c7554cd5459a5c12781dc71de73c7937dfb2775",
"0x241d89f7888fbcfadfd415ee967882fec6fdd67c07ca8a00f2ca4c910a84c7dd"
],
"transactionsRoot": "0xf98631e290e88f58a46b7032f025969039aa9b5696498efc76baf436fa69b262",
"uncles": [
"0x824cce7c7c2ec6874b9fa9a9a898eb5f27cbaf3991dfa81084c3af60d1db618c"
]
}
}
```
---
## Ethereum eth_getBlockReceipts
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockReceipts`
Returns all transaction receipts for a given block, the amount of gas used, and any event logs that
might have been produced by a smart contract during the transaction.
## Parameters
- `blockNumber`: (string) _[required]_ - Hexadecimal or decimal integer representing a block number, or one of the string tags:
- `latest`
- `earliest`
- `pending`
- `finalized`
- `safe`
:::note
`pending` returns the same data as `latest`.
:::
## Returns
- `result` - Block object or `null` when there is no corresponding block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": ["latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockNumber": "0x6f55",
"contractAddress": null,
"cumulativeGasUsed": "0x18c36",
"from": "0x22896bfc68814bfd855b1a167255ee497006e730",
"gasUsed": "0x18c36",
"effectiveGasPrice": "0x9502f907",
"logs": [
{
"address": "0xfd584430cafa2f451b4e2ebcf3986a21fff04350",
"topics": [
"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d",
"0x4be29e0e4eb91f98f709d98803cba271592782e293b84a625e025cbb40197ba8",
"0x000000000000000000000000835281a2563db4ebf1b626172e085dc406bfc7d2",
"0x00000000000000000000000022896bfc68814bfd855b1a167255ee497006e730"
],
"data": "0x",
"blockNumber": "0x6f55",
"transactionHash": "0x4a481e4649da999d92db0585c36cba94c18a33747e95dc235330e6c737c6f975",
"transactionIndex": "0x0",
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"logIndex": "0x0",
"removed": false
}
],
"logsBloom": "0x00000004000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000080020000000000000200010000000000000000000001000000800000000000000000000000000000000000000000000000000000100100000000000000000000008000000000000000000000000000000002000000000000000000000",
"status": "0x1",
"to": "0xfd584430cafa2f451b4e2ebcf3986a21fff04350",
"transactionHash": "0x4a481e4649da999d92db0585c36cba94c18a33747e95dc235330e6c737c6f975",
"transactionIndex": "0x0",
"type": "0x0"
},
{
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockNumber": "0x6f55",
"contractAddress": null,
"cumulativeGasUsed": "0x1de3e",
"from": "0x712e3a792c974b3e3dbe41229ad4290791c75a82",
"gasUsed": "0x5208",
"effectiveGasPrice": "0x9502f907",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0xd42e2b1c14d02f1df5369a9827cb8e6f3f75f338",
"transactionHash": "0xefb83b4e3f1c317e8da0f8e2fbb2fe964f34ee184466032aeecac79f20eacaf6",
"transactionIndex": "0x1",
"type": "0x2"
}
]
}
```
---
## Ethereum eth_getBlockTransactionCountByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockTransactionCountByHash`
Returns the number of transactions in the block with the given block hash.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
## Returns
A hexadecimal equivalent of the integer representing the number of transactions in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x50"
}
```
---
## Ethereum eth_getBlockTransactionCountByNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getBlockTransactionCountByNumber`
Returns the number of transactions in the block with the given block number.
## Parameters
- `block number`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of transactions in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xa0"
}
```
---
## Ethereum eth_getCode
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getCode`
Returns the compiled byte code of a smart contract, if any, at a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) of the smart contract, from which the compiled byte code will be obtained.
- `block number`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
The compiled byte code of the smart contract at the given address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x60606040..."
}
```
---
## Ethereum eth_getLogs
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getLogs`
Returns an array of all the logs matching the given filter object. See also the below [Constraints](#constraints) section.
## Parameters
- `filter object`: (object) _[required]_ - A filter object containing the following:
- `address`: (string or array) _[optional]_ - Contract address (20 bytes) or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default is "latest"]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default is "latest"]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `topics`: (array) _[optional]_ - Array of 32 bytes DATA topics. Topics are order-dependent.
- `blockhash`: (string) _[optional]_ - Restricts the logs returned to the single block referenced in the 32-byte hash `blockHash`. Using `blockHash` is equivalent to setting `fromBlock` and `toBlock` to the block number referenced in the `blockHash`. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.
## Returns
An array of log objects, or an empty array if nothing has changed since the last poll. Log objects contain the following keys and their values:
- `removed` - `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `logIndex` - Hexadecimal of the log index position in the block. `Null` when it is a pending log.
- `transactionIndex` - Hexadecimal of the transactions index position from which the log created. `Null` when it is a pending log.
- `transactionHash` - Hash of the transactions from which this log was created (32 bytes). `Null` when it is a pending log.
- `blockHash` - Hash of the block where this log was in (32 bytes). `Null` when it is a pending log.
- `blockNumber` - Block number where this log was in. `Null` when it is a pending log.
- `address` - Address from which this log originated (20 bytes).
- `data` - Contains one or more 32-bytes non-indexed arguments of the log.
- `topics` - An array of 0 to 4 indexed log arguments, each 32 bytes. In solidity the first topic is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}], "id":1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x1a94fce7ef36bc90959e206ba569a12afbc91ca1",
"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70",
"blockNumber": "0x5c29fb",
"data": "0x0000000000000000000000003e3310720058c51f0de456e273c626cdd35065700000000000000000000000000000000000000000000000000000000000003185000000000000000000000000000000000000000000000000000000000000318200000000000000000000000000000000000000000000000000000000005c2a23",
"logIndex": "0x1d",
"removed": false,
"topics": [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash": "0x3dc91b98249fa9f2c5c37486a2427a3a7825be240c1c84961dfb3063d9c04d50",
"transactionIndex": "0x1d"
},
{
"address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70",
"blockNumber": "0x5c29fb",
"data": "0x00000000000000000000000077ea137625739598666ded665953d26b3d8e374400000000000000000000000000000000000000000000000000000000000749ff00000000000000000000000000000000000000000000000000000000000a749d00000000000000000000000000000000000000000000000000000000005c2a0f",
"logIndex": "0x57",
"removed": false,
"topics": [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash": "0x788b1442414cb9c9a36dba2abe250763161a6f6395788a2e808f1b34e92beec1",
"transactionIndex": "0x54"
}
]
}
```
## Constraints
The following constraints apply:
To prevent queries from consuming too many resources, `eth_getLogs` requests are currently limited by three constraints:
- A maximum of 5,000 parameters in a single request
- A maximum of 10,000 results can be returned by a single query
- Query duration must not exceed 10 seconds
If a query returns too many results or exceeds the max query duration, one of the following errors is returned:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32005,
"message": "query returned more than 10000 results"
}
}
```
or
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32005,
"message": "query timeout exceeded"
}
}
```
If this happens:
- Limit your query to a smaller number of blocks using `fromBlock` and `toBlock`.
- If querying for commonly used `topics`, consider limiting to a single smart contract `address`.
---
## Ethereum eth_getProof
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getProof`
Returns the account and storage values, including the Merkle proof, of the specified account.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) to check for balance.
- `storageKeys`: (array) _[required]_ - An array of 32-byte storage keys to be proofed and included.
- `blockParameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
- `balance` - Hexadecimal of the current balance in wei.
- `codeHash` - The 32-byte hash of the code of the account.
- `nonce` - The nonce of the account.
- `storageHash` - The SHA3 of the StorageRoot (32 bytes). All storage will deliver a Merkle proof starting with this `rootHash`.
- `accountProof` - An array of RLP-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key.
- `storageProof` - An array of storage-entries as requested. Each entry is an object with these properties:
- `key` - The requested storage key.
- `value` - The storage value.
- `proof` - An array of RLP-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getProof", "id": 1, "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getProof", "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"accountProof": [
"0xf90211a...0701bc80",
"0xf90211a...0d832380",
"0xf90211a...5fb20c80",
"0xf90211a...0675b80",
"0xf90151a0...ca08080"
],
"address": "0x7f0d15c7faae65896648c8273b6d7e43f58fa842",
"balance": "0x0",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce": "0x0",
"storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof": [
{
"key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"proof": [],
"value": "0x0"
}
]
}
}
```
---
## Ethereum eth_getStorageAt
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getStorageAt`
Returns the value from a storage position at a given address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes) of the storage.
- `storage position`: (string) _[required]_ - A hexadecimal code of the position in the storage.
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer indicating the value of the storage position at the provided address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
```
## Additional notes
Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at `0x295a70b2de5e3953354a6a8344e616ed314d7251` by address `0x391694e7e0b0cce554cb130d723a9d27458f9298`:
```solidity
contract Storage {
uint pos0;
mapping(address => uint) pos1;
function Storage() public {
pos0 = 1234;
pos1[msg.sender] = 5678;
}
}
```
Retrieving the value of pos0 is straight forward:
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "0x65a8db"], "id": 1}'
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x00000000000000000000000000000000000000000000000000000000000004d2"
}
```
Retrieving an element of the map is harder. The position of an element in the map is calculated with:
```js
keccak(LeftPad32(key, 0), LeftPad32(map position, 0))
```
This means to retrieve the storage on `pos1["0x391694e7e0b0cce554cb130d723a9d27458f9298"]` we need to calculate the position with:
```js
keccak(
decodeHex(
"000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" +
"0000000000000000000000000000000000000000000000000000000000000001"
)
)
```
The Geth console which comes with the web3 library can be used to make the calculation:
```js
> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"
undefined
> web3.sha3(key, {"encoding": "hex"})
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"
```
Now to fetch the storage:
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"], "id": 1}'
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x000000000000000000000000000000000000000000000000000000000000162e"
}
```
---
## Ethereum eth_getTransactionByBlockHashAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByBlockHashAndIndex`
Returns information about a transaction given block hash and transaction index position.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `transaction index position`: (string) _[required]_ - A hexadecimal of the integer representing the position in the block.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x25",
"value": "0x0"
}
}
```
---
## Ethereum eth_getTransactionByBlockNumberAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByBlockNumberAndIndex`
Returns information about a transaction given block number and transaction index position.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `transaction index position`: (string) _[required]_ - A hexadecimal of the integer representing the position in the block.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x5BAD55", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x25",
"value": "0x0"
}
}
```
---
## Ethereum eth_getTransactionByHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionByHash`
Returns information about a transaction for a given hash.
## Parameters
- `transaction hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a transaction.
## Returns
A transaction object, or null when no transaction was found. The transaction object will consist of the following keys and their values:
- `accessList` - A list of addresses and storage keys accessed by the transaction.
- `blockHash` - A hash of the block including this transaction (32 bytes). `null` when it's pending.
- `blockNumber` - The number of the block including this transaction. `null` when it's pending.
- `chainID` - Chain ID specifying the network. Returned only for [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `from` - The address of the sender (20 bytes).
- `gas` - Gas provided by the sender.
- `gasPrice` - Gas price provided by the sender in wei.
- `hash` - The hash of the transaction (32 bytes).
- `input` - The data sent along with the transaction.
- `maxPriorityFeePerGas` - Maximum fee, in wei, the sender is willing to pay per gas above the base fee. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `maxFeePerGas` - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas. See [EIP-1559 transactions](http://eips.ethereum.org/EIPS/eip-1559).
- `nonce` - The number of transactions made by the sender prior to this one.
- `r` - The ECDSA signature `r` (32 bytes).
- `s` - The ECDSA signature `s` (32 bytes).
- `to` - The address of the receiver (20 bytes). `null` when it's a contract creation transaction.
- `transactionIndex` - The transaction's index position in the block, in hexadecimal. `null` when it's pending.
- `type` - The transaction type.
- `v` - The ECDSA recovery ID.
- `value` - The value transferred in wei.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"chainId": "0x1",
"from": "0x398137383b3d25c92898c656696e41950e47316b",
"gas": "0x1d45e",
"gasPrice": "0xfa56ea00",
"hash": "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
"input": "0xf7d8c88300000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e1",
"nonce": "0x18",
"r": "0x2a378831cf81d99a3f06a18ae1b6ca366817ab4d88a70053c41d7a8f0368e031",
"s": "0x450d831a05b6e418724436c05c155e0a1b7b921015d0fbc2f667aed709ac4fb5",
"to": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"transactionIndex": "0x11",
"type": "0x0",
"v": "0x25",
"value": "0x1c6bf526340000"
}
}
```
---
## Ethereum eth_getTransactionCount
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionCount`
Returns the number of transactions sent from an address.
## Parameters
- `address`: (string) _[required]_ - A string representing the address (20 bytes).
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of transactions sent from the given address.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "0x5bad55"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1a"
}
```
---
## Ethereum eth_getTransactionReceipt
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getTransactionReceipt`
Returns the receipt of a transaction given transaction hash. Note that the receipt is not available for pending transactions.
## Parameters
- `transaction hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a transaction.
## Returns
A transaction receipt object, or null when no receipt was found. The transaction receipt object will contain the following keys and their values:
- `blockHash` - Hash of the block including this transaction (32 bytes).
- `blockNumber` - Block number including this transaction.
- `contractAddress` - The contract address created if the transaction was a contract creation, otherwise `null` (20 bytes).
- `cumulativeGasUsed` - The total amount of gas used when this transaction was executed in the block.
- `effectiveGasPrice` - The actual value per gas deducted from the sender's account. Before [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559), equal to the gas price.
- `from` - The address of the sender (20 bytes).
- `gasUsed` - The amount of gas used by this specific transaction alone.
- `logs` - An array of log objects generated by this transaction.
- `logsBloom` - Bloom filter for light clients to quickly retrieve related logs (256 bytes).
- One of the following:
- `root` - 32 bytes of post-transaction stateroot (pre-Byzantium)
- `status` - Either 1 (success) or 0 (failure)
- `to` - The address of the receiver (20 bytes). `null` when the transaction is a contract creation transaction.
- `transactionHash` - The hash of the transaction (32 bytes).
- `transactionIndex` - Hexadecimal of the transaction's index position in the block.
- `type` - The transaction type.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x0a79eca9f5ca58a1d5d5030a0fabfdd8e815b8b77a9f223f74d59aa39596e1c7",
"blockNumber": "0x11e5883",
"contractAddress": null,
"cumulativeGasUsed": "0xc5f3e7",
"effectiveGasPrice": "0xa45b9a444",
"from": "0x690b9a9e9aa1c9db991c7721a92d351db4fac990",
"gasUsed": "0x565f",
"logs": [
{
"address": "0x388c818ca8b9251b393131c08a736a67ccb19297",
"blockHash": "0x0a79eca9f5ca58a1d5d5030a0fabfdd8e815b8b77a9f223f74d59aa39596e1c7",
"blockNumber": "0x11e5883",
"data": "0x00000000000000000000000000000000000000000000000011b6b79503fb875d",
"logIndex": "0x187",
"removed": false,
"topics": [
"0x27f12abfe35860a9a927b465bb3d4a9c23c8428174b83f278fe45ed7b4da2662"
],
"transactionHash": "0x7114b4da1a6ed391d5d781447ed443733dcf2b508c515b81c17379dea8a3c9af",
"transactionIndex": "0x76"
}
],
"logsBloom": "0x00000000000000000000000000000000000100004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x388c818ca8b9251b393131c08a736a67ccb19297",
"transactionHash": "0x7114b4da1a6ed391d5d781447ed443733dcf2b508c515b81c17379dea8a3c9af",
"transactionIndex": "0x76",
"type": "0x2"
}
}
```
---
## Ethereum eth_getUncleByBlockHashAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleByBlockHashAndIndex`
Returns information about an uncle of a block given the block hash and the uncle index position.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
- `uncle index position`: (string) _[required]_ - A hexadecimal equivalent of the integer indicating the uncle's index position.
## Returns
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- `number` - The block number. `Null` when the returned block is the pending block.
- `hash` - Hash of the block (32 bytes). `Null` when its pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `logsBloom` - The Bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `difficulty` - The hexadecimal of the difficulty for this block.
- `totalDifficulty` - The hexadecimal of the total difficulty of the chain until this block.
- `extraData` - The "extra data" field of this block.
- `size` - The hexadecimal of the size of this block in bytes.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `timestamp` - The unix timestamp for when the block was collated.
- `uncles` - An array of uncle hashes.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", "0x0"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": null,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
---
## Ethereum eth_getUncleByBlockNumberAndIndex
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleByBlockNumberAndIndex`
Returns information about an uncle of a block given the block number and the uncle index position.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `uncle index position`: (string) _[required]_ - A hexadecimal equivalent of the integer indicating the uncle's index position.
## Returns
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- `number` - The block number. `Null` when the returned block is the pending block.
- `hash` - Hash of the block (32 bytes). `Null` when its pending block.
- `parentHash` - Hash of the parent block (32 bytes).
- `nonce` - Hash of the generated proof-of-work (8 bytes). `Null` when the returned block is the pending block.
- `sha3Uncles` - The SHA3 of the uncles data in the block (32 bytes).
- `logsBloom` - The Bloom filter for the logs of the block (256 bytes). `Null` when the returned block is the pending block.
- `transactionsRoot` - The root of the transaction trie of the block (32 bytes).
- `stateRoot` - The root of the final state trie of the block (32 bytes).
- `receiptsRoot` - The root of the receipts trie of the block (32 bytes).
- `miner` - The address of the beneficiary to whom the mining rewards were given (20 bytes).
- `difficulty` - The hexadecimal of the difficulty for this block.
- `totalDifficulty` - The hexadecimal of the total difficulty of the chain until this block.
- `extraData` - The "extra data" field of this block.
- `size` - The hexadecimal of the size of this block in bytes.
- `gasLimit` - Maximum gas allowed in this block.
- `gasUsed` - Total used gas by all transactions in this block.
- `timestamp` - The unix timestamp for when the block was collated.
- `uncles` - An array of uncle hashes.
:::note
An uncle doesn't contain individual transactions.
:::
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": null,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
```
---
## Ethereum eth_getUncleCountByBlockHash
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleCountByBlockHash`
Returns the number of uncles in a block from a block matching the given block hash.
## Parameters
- `block hash`: (string) _[required]_ - A string representing the hash (32 bytes) of a block.
## Returns
A hexadecimal equivalent of the integer representing the number of uncles in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Ethereum eth_getUncleCountByBlockNumber
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getUncleCountByBlockNumber`
Returns the number of uncles in a block from a block matching the given block number.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A hexadecimal equivalent of the integer representing the number of uncles in the block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x5bad55"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
```
---
## Ethereum eth_getWork
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getWork`
Returns the hash of the current block, the seed hash, and the boundary condition to be met ("target").
## Parameters
None.
## Returns
An array with the following properties:
- Current block header PoW-hash (32 bytes).
- The seed hash used for the DAG (32 bytes).
- The boundary condition ("target") (32 bytes), 2^256 / difficulty.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getWork", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getWork", "params": [], "id": 1}'
```
### Response
:::note
While gateways will allow this method, `eth_getWork` will not actually return mining work.
:::
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "no mining work available yet"
}
}
```
---
## Ethereum eth_hashrate
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_hashrate`
Returns the number of hashes per second that the node is mining with. Only applicable when the node is mining.
## Parameters
None.
## Returns
`hashrate`: A hexadecimal equivalent of an integer representing the number of hashes per second.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_hashrate", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_hashrate", "params": [], "id": 1}'
```
### Response
:::note
Gateways will always return a `0x0` mining hash rate.
:::
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0"
}
```
---
## Ethereum eth_maxPriorityFeePerGas
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_maxPriorityFeePerGas`
Returns an estimate of how much priority fee, in wei, you need to be included in a block.
## Parameters
None.
## Returns
A hexadecimal value of the priority fee, in wei, needed to be included in a block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x55d4a80"
}
```
---
## Ethereum eth_mining
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_mining`
Returns true if client is actively mining new blocks.
## Parameters
None.
## Returns
`is mining flag`: A boolean indicating if the client is mining.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
```
---
## Ethereum eth_protocolVersion
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_protocolVersion`
Returns the current Ethereum protocol version.
## Parameters
None.
## Returns
`protocol version`: A hexadecimal indicating the current Ethereum protocol version.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x41"
}
```
---
## Ethereum eth_sendRawTransaction
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_sendRawTransaction`
Submits a pre-signed transaction for broadcast to the Ethereum network.
## Parameters
- `transaction data`: (string) _[required]_ - The signed transaction data.
## Returns
The transaction hash (32 bytes), or the zero hash if the transaction is not yet available. Use [`eth_getTransactionReceipt`](../ethereum/json-rpc-methods/eth_gettransactionreceipt.mdx) to get the contract address, after the transaction was mined, when you created a contract.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
```
## Error response
If this call causes the EVM to execute a `REVERT` operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: Dai/insufficient-balance",
"data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
}
}
```
---
## Ethereum eth_simulateV1
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `eth_simulateV1`
Simulates transactions across multiple blocks. Allows you to test transactions with custom state and
block parameters without submitting them to the network.
## Parameters
- `BLOCK STATE CALL OBJECT`: (object) _[required]_ - Block state call object containing:
- `blockStateCalls`: (array) _[required]_ - Array of block, state, and call objects:
- `blockOverrides`: (object) _[optional]_ - Object to override block parameters:
- `baseFeePerGas`: (string) _[optional]_ - Hexadecimal value for the base fee per gas for the block.
- `blobBaseFee`: (string) _[optional]_ - Hexadecimal value for the base fee per unit of blob gas.
- `feeRecipient`: (string) _[optional]_ - Address of the fee recipient for the block proposal.
- `gasLimit`: (string) _[optional]_ - Hexadecimal value that represents the maximum amount of gas that transactions are allowed to consume.
- `number`: (string) _[optional]_ - Hexadecimal block number.
- `prevRandao`: (string) _[optional]_ - The previous value of randomness, which is used as a source of randomness for various protocol operations.
- `time`: (string) _[optional]_ - Hexadecimal value representing the Unix epoch time in seconds.
- `stateOverrides`: (object) _[optional]_ - Object to override account states:
- `balance`: (string) _[optional]_ - Hexadecimal value representing the account balance.
- `nonce`: (string) _[optional]_ - Hexadecimal temporary nonce value for the call execution.
- `code`: (string) _[optional]_ - Bytecode to inject into the account.
- `state`: (object) _[optional]_ - Object of key-value mappings to override all slots in the account storage before executing the call.
- `stateDiff`: (object) _[optional]_ - Object of key-value mappings to override individual slots in the account storage before executing the call.
- `movePrecompileToAddress`: (string) _[optional]_ - Moves the precompile to the supplied address.
- `calls`: (array) _[required]_ - Array of transaction call objects:
- `from`: (string) _[optional]_ - 20 bytes - The address the transaction is sent from.
- `to`: (string) _[optional]_ - 20 bytes - The address the transaction is directed to.
- `gas`: (string) _[optional]_ - Hexadecimal value of the gas provided for the transaction execution.
- `gasPrice`: (string) _[optional]_ - Hexadecimal value of the gas price used for each paid gas.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay per gas above the base fee.
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas.
- `value`: (string) _[optional]_ - Hexadecimal value of the value sent with this transaction.
- `data`: (string) _[optional]_ - Hash of the method signature and encoded parameters. See the [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `returnFullTransactionObjects`: (boolean) _[optional]_ - Boolean value which when `true`, returns full transaction objects, otherwise, just hashes are returned. The default is `false`.
- `traceTransfers`: (boolean) _[optional]_ - Boolean value which when `true`, adds ETH transfers as ERC20 transfer events to the logs, allowing you to trace value transfers. The default is `false`.
- `validation`: (boolean) _[optional]_ - Boolean value which when `true`, does all the validation that a normal EVM would do, except contract sender and signature checks. When `false`, `eth_simulateV1` behaves like `eth_call`. The default is `false`.
- `blockParameter`: (string) _[optional]_ - A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
An array of simulation result objects:
- `baseFeePerGas`: Hexadecimal value for the base fee per gas for the block.
- `blobGasUsed`: Hexadecimal value for the amount of blob gas used.
- `calls`: Array of call results:
- `returnData`: Data returned for the call.
- `logs`: Array of logs generated during the call.
- `address`: Address of the contract that generated the log.
- `blockHash`: Hash of the block.
- `blockNumber`: Hexadecimal block number.
- `data`: Non-indexed log parameters.
- `logIndex`: Index of the log in the block.
- `removed`: Whether the log was removed due to chain reorganization.
- `topics`: Array of indexed log parameters.
- `transactionHash`: Hash of the transaction.
- `transactionIndex`: Index of the transaction in the block.
- `error`: Object containing error information:
- `message`: The error message.
- `code`: The error status code.
- `data`: Error-related information.
- `gasUsed`: Hexadecimal value representing the amount of gas used.
- `status`: Status indicating whether the transaction succeeded (`0x1`). `0x0` indicates that a transaction has failed.
- `difficulty`: A hexadecimal of the difficulty for this block.
- `excessBlobGas`: A hexadecimal of the excess blob gas.
- `extraData`: The "extra data" field of this block.
- `gasLimit`: Maximum gas allowed in this block.
- `gasUsed`: Total used gas by all transactions in this block.
- `hash`: Hash of the block. `Null` when the returned block is the pending block.
- `logsBloom`: The bloom filter for the logs of the block. `Null` when the returned block is the pending block.
- `miner`: Address of the beneficiary to whom the mining rewards were given.
- `mixHash`: Hexadecimal mix hash.
- `nonce`: Hash of the generated proof-of-work. `Null` when the returned block is the pending block.
- `number`: Block number. `Null` when the returned block is the pending block.
- `parentBeaconBlockRoot`: Parent beacon block root.
- `parentHash`: Hash of the parent block.
- `receiptsRoot`: The root of the receipts trie of the block. Also see [Tries in Ethereum](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#tries-in-ethereum).
- `sha3Uncles`: The SHA3 of the uncles data in the block.
- `size`: A hexadecimal of the size of this block in bytes.
- `stateRoot`: The root of the final state trie of the block.
- `timestamp`: The unix timestamp for when the block was collated.
- `totalDifficulty`: A hexadecimal of the total difficulty of the chain until this block.
- `transactions`: (Array) An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
- `transactionsRoot`: The root of the transaction trie of the block.
- `uncles`: (Array) An array of uncle hashes.
- `withdrawals`: (Array) Withdrawal objects.
- `withdrawalsRoot`: Withdrawals trie root.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_simulateV1",
"params": [
{
"blockStateCalls": [
{
"blockOverrides": {
"baseFeePerGas": "0x9"
},
"stateOverrides": {
"0xc000000000000000000000000000000000000000": {
"balance": "0x4a817c800"
}
},
"calls": [
{
"from": "0xc000000000000000000000000000000000000000",
"to": "0xc000000000000000000000000000000000000001",
"maxFeePerGas": "0xf",
"value": "0x1"
},
{
"from": "0xc000000000000000000000000000000000000000",
"to": "0xc000000000000000000000000000000000000002",
"maxFeePerGas": "0xf",
"value": "0x1"
}
]
}
],
"validation": true,
"traceTransfers": true
},
"latest"
]
}'
```
```bash
wscat -c -x '{"jsonrpc":"2.0","id":1,"method":"eth_simulateV1","params":[{"blockStateCalls":[{"blockOverrides":{"baseFeePerGas":"0x9"},"stateOverrides":{"0xc000000000000000000000000000000000000000":{"balance":"0x4a817c800"}},"calls":[{"from":"0xc000000000000000000000000000000000000000","to":"0xc000000000000000000000000000000000000001","maxFeePerGas":"0xf","value":"0x1"},{"from":"0xc000000000000000000000000000000000000000","to":"0xc000000000000000000000000000000000000002","maxFeePerGas":"0xf","value":"0x1"}]}],"validation":true,"traceTransfers":true},"latest"]}'
```
### Response
```JSON
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"baseFeePerGas": "0x9",
"blobGasUsed": "0x0",
"calls": [
{
"gasUsed": "0x5208",
"logs": [
{
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"blockHash": "0xc98388385b0dbfc15ad5c6a0f4b19f7abd94efb4618ced05e3eb320ee30b1e7f",
"blockNumber": "0x1496e50",
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000c000000000000000000000000000000000000000",
"0x000000000000000000000000c000000000000000000000000000000000000001"
],
"transactionHash": "0xe7217784e0c3f7b35d39303b1165046e9b7e8af9b9cf80d5d5f96c3163de8f51",
"transactionIndex": "0x0"
}
],
"returnData": "0x",
"status": "0x1"
},
{
"gasUsed": "0x5208",
"logs": [
{
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"blockHash": "0xc98388385b0dbfc15ad5c6a0f4b19f7abd94efb4618ced05e3eb320ee30b1e7f",
"blockNumber": "0x1496e50",
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logIndex": "0x1",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000c000000000000000000000000000000000000000",
"0x000000000000000000000000c000000000000000000000000000000000000002"
],
"transactionHash": "0xf0182201606ec03701ba3a07d965fabdb4b7d06b424f226ea7ec3581802fc6fa",
"transactionIndex": "0x1"
}
],
"returnData": "0x",
"status": "0x1"
}
],
"difficulty": "0x0",
"excessBlobGas": "0x4920000",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"gasUsed": "0xa410",
"hash": "0xc98388385b0dbfc15ad5c6a0f4b19f7abd94efb4618ced05e3eb320ee30b1e7f",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x7e2a2fa2a064f693f0a55c5639476d913ff12d05",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x1496e50",
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xddd47e7383c8ced495e85e053f898d7a333feb0432fa9098306f6f563cde4984",
"receiptsRoot": "0x75308898d571eafb5cd8cde8278bf5b3d13c5f6ec074926de3bb895b519264e1",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x29c",
"stateRoot": "0xd6da11fae4ab94ddba2c4c71206962f7c6eaec6e5fabf00f3f7540c4ed7ad8f1",
"timestamp": "0x67803e64",
"transactions": [
"0xe7217784e0c3f7b35d39303b1165046e9b7e8af9b9cf80d5d5f96c3163de8f51",
"0xf0182201606ec03701ba3a07d965fabdb4b7d06b424f226ea7ec3581802fc6fa"
],
"transactionsRoot": "0x9bdb74f3ce41f5893a02a631e904ae0d21ae8c4e416786d8dbd9cb5c54f1dc0f",
"uncles": [],
"withdrawals": [],
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
```
---
## Ethereum eth_submitWork
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_submitWork`
Used for submitting a proof-of-work solution.
## Parameters
- `work array`: (array) _[required]_ - A work array with the following properties:
- 8 bytes: The nonce found (64 bits)
- 32 bytes: The header's PoW-hash (256 bits)
- 32 bytes: The mix digest (256 bits)
## Returns
Returns `true` if the provided solution is valid, otherwise `false`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
```
---
## Ethereum eth_syncing
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_syncing`
Returns an object with data about the sync status or `false`.
## Parameters
None.
## Returns
- `sync status`: (boolean) Returns `false` only when not syncing.
- `sync blocks`:
- `startingBlock`: A hexadecimal equivalent the integer indicating the block at which the import started (will only be reset after the sync reaches the head).
- `currentBlock`: A hexadecimal equivalent the integer indicating the current block, same as
[`eth_blockNumber`](../ethereum/json-rpc-methods/eth_blocknumber.mdx).
- `highestBlock`: A hexadecimal equivalent the integer indicating the highest block.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
```
---
## Ethereum eth_getFilterChanges
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getFilterChanges`
Polling method for a filter, which returns an array of logs which occurred since the last poll.
Filter must be created by calling either `eth_newFilter` or `eth_newBlockFilter`.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the filter ID.
## Returns
- `log object array`: An array of log objects, or an empty array if nothing has changed since the last poll.
- For filters created with `eth_newBlockFilter` the return values are block hashes (32 bytes), for example, `["0x3454645634534..."]`.
- For filters created with `eth_newFilter` the logs are objects with the following params:
- `address`: 20 bytes - Address from which this log originated.
- `blockHash`: 32 bytes - The hash of the block where this log was in. `null` when it is a pending log.
- `blockNumber`: The block number where this log was in. `null` when it is a pending log.
- `data`: Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it is a valid log.
- `topics`: Array of data - An array of 0 to 4 32-bytes data of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes - A hash of the transactions from which this log was created. `null` when it is a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it is a pending log.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 73,
"result": [
{
"address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"blockHash": "0x99e8663c7b6d8bba3c7627a17d774238eae3e793dee30008debb2699666657de",
"blockNumber": "0x5d12ab",
"data": "0x0000000000000000000000000000000000000000000000a247d7a2955b61d000",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000bdc0afe57b8e9468aa95396da2ab2063e595f37e",
"0x0000000000000000000000007503e090dc2b64a88f034fb45e247cbd82b8741e"
],
"transactionHash": "0xa74c2432c9cf7dbb875a385a2411fd8f13ca9ec12216864b1a1ead3c99de99cd",
"transactionIndex": "0x3"
}
]
}
```
---
## Ethereum eth_getFilterLogs
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_getFilterLogs`
Returns an array of all logs matching the filter with the given filter ID.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the filter ID.
## Returns
- `log object array`: An array of log objects that match the filter. For an array of logs that occurred since the last poll, use `eth_getFilterChanges`. Log objects contain the following keys and their values:
- `address`: 20 bytes - Address from which this log originated.
- `blockHash`: 32 bytes - The hash of the block where this log was in. `null` when it's a pending log.
- `blockNumber`: The block number where this log was in. `null` when it's a pending log.
- `data`: Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `topics`: Array of data - An array of 0 to 4 32-bytes data of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes - A hash of the transactions from which this log was created. `null` when it's a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it's a pending log.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 73,
"result": [
{
"address": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"blockHash": "0x99e8663c7b6d8bba3c7627a17d774238eae3e793dee30008debb2699666657de",
"blockNumber": "0x5d12ab",
"data": "0x0000000000000000000000000000000000000000000000a247d7a2955b61d000",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000bdc0afe57b8e9468aa95396da2ab2063e595f37e",
"0x0000000000000000000000007503e090dc2b64a88f034fb45e247cbd82b8741e"
],
"transactionHash": "0xa74c2432c9cf7dbb875a385a2411fd8f13ca9ec12216864b1a1ead3c99de99cd",
"transactionIndex": "0x3"
}
]
}
```
---
## Ethereum eth_newBlockFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newBlockFilter`
Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call `eth_getFilterChanges`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using `eth_getFilterChanges` automatically expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
## Parameters
None
## Returns
`filter ID`: A hexadecimal denoting the newly created filter ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x8144114ddff0b3be57ad6a848ee4fe4a44cdda667055"
}
```
---
## Ethereum eth_newFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newFilter`
Creates a filter object based on the given filter options, to notify when the state changes (logs). To check if the state has changed, call `eth_getFilterChanges`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using `eth_getFilterChanges` automatically expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
## Parameters
- `filter object`: (object) _[required]_ - A filter object with the following keys and their values:
- `address`: (string or array) _[optional]_ - A contract address or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default: latest]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default: latest]_ - A hexadecimal block number, or one of the string tags `latest`, `earliest`, `pending`, `safe`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `topics`: (array) _[optional]_ - An array of 32 bytes data topics. Topics are order-dependent.
### Specifying topic filters
Topics are order-dependent. A transaction with a log with topics `[A, B]` will be matched by the following topic filters:
- `[]`: Anything.
- `[A]`: `A` in the first position, and anything after.
- `[null, B]`: Anything in first position AND `B` in second position, and anything after.
- `[A, B]`: `A` in the first position AND `B` in second position, and anything after.
- `[[A, B], [A, B]]`: `(A OR B)` in first position AND `(A OR B)` in second position, and anything after.
## Returns
`filter ID`: A hexadecimal denoting the newly created filter ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x10ff114de54f0bfdbd7855f8a1dd7317e6500495a24f"
}
```
---
## Ethereum eth_newPendingTransactionFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_newPendingTransactionFilter`
Creates a filter to retrieve new pending transaction hashes. To poll for new pending transactions, use `eth_getFilterChanges`.
## Parameters
None
## Returns
A filter ID that can be used to call `eth_getFilterChanges`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newPendingTransactionFilter", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_newPendingTransactionFilter", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x443d6a77c4964707a8554c92f7e4debd"
}
```
---
## Ethereum eth_uninstallFilter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_uninstallFilter`
Uninstalls a filter with given ID. This method should always be called when watching is no longer needed. Additionally, filters time out when they aren't requested with `eth_getFilterChanges` for a period of time.
## Parameters
- `filter ID`: (string) _[required]_ - A string denoting the ID of the filter to be uninstalled.
## Returns
`uninstalled flag`: Returns `true` if the filter was successfully uninstalled, otherwise `false`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```
---
## Ethereum net_listening
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_listening`
Returns `true` if client is actively listening for network connections.
## Parameters
None.
## Returns
`listening flag`: (boolean) Indicating whether the client is actively listening for network connections.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```
---
## Ethereum net_peerCount
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_peerCount`
Returns the number of peers currently connected to the client.
## Parameters
None
## Returns
`peer count`: A hexadecimal of the number of connected peers.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x64"
}
```
---
## Ethereum net_version
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `net_version`
Returns the current network ID.
## Parameters
None.
## Returns
`network ID`: A string representing the current network ID.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "1"
}
```
---
## Ethereum eth_subscribe
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_subscribe`
Creates a new subscription for particular events. The node returns a subscription ID. For each event that matches the subscription, a notification with relevant data is sent together with the subscription ID.
## Parameters
Specify one of the following subscription events:
- `newHeads`: (string) _[required]_ - Subscribing to this returns a notification each time a new header is appended to the chain, including chain reorganizations. In a chain reorganization, the subscription emits all new headers for the new chain. Therefore the subscription can emit multiple headers at the same height.
- `logs`: (object) _[required]_ - Returns logs that are included in new imported blocks and match the given filter criteria. In case of a chain reorganization, previously sent logs that are on the old chain are resent with the removed property set to `true`. Logs from transactions that ended up in the new chain are emitted. Therefore a subscription can emit logs for the same transaction multiple times. This parameter has the following fields:
- `address`: (string or array) _[optional]_ - Either an address or an array of addresses. Only logs that are created from these addresses are returned.
- `topics`: (array) _[optional]_ - Only logs that match these specified topics are returned.
- `newPendingTransactions`: (string) _[required]_ - Returns the hash for all transactions that are added to the pending state and are signed with a key that's available in the node. When a transaction that was previously part of the canonical chain isn't part of the new canonical chain after a reorganization, it's emitted again.
:::tip DIN Recommendation
We strongly recommend specifying a filter (`address` or `topics` or both) when subscribing to the `logs` event.
:::
## Returns
`subscription ID`: The ID of the newly created subscription on the node.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newHeads"]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", "topics":["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"]}]}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x9cef478923ff08bf67fde6c64013158d"
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"result": {
"difficulty": "0x15d9223a23aa",
"extraData": "0xd983010305844765746887676f312e342e328777696e646f7773",
"gasLimit": "0x47e7c4",
"gasUsed": "0x38658",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
"nonce": "0x084149998194cc5f",
"number": "0x1348c9",
"parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701",
"receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378",
"timestamp": "0x56ffeff8",
"transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f"
},
"subscription": "0x9ce59a13059e417087c02d3236a0b1cc"
}
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0x4a8a4c0517381924f9838102c5a4dcb7",
"result": {
"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd",
"blockHash": "0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04",
"blockNumber": "0x29e87",
"data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003",
"logIndex": "0x0",
"topics": [
"0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"
],
"transactionHash": "0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4",
"transactionIndex": "0x0"
}
}
}
```
```json
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0xc3b33aa549fb9a60e95d21862596617c",
"result": "0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa"
}
}
```
---
## Ethereum eth_unsubscribe
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `eth_unsubscribe`
Cancel subscriptions by calling this method with the subscription ID. It returns a boolean indicating that the subscription was canceled successfully.
## Parameters
- `subscription ID`: (string) _[required]_ - The ID of the subscription you want to unsubscribe.
## Returns
`unsubscribed flag`: Returns `true` if the subscription is canceled successfully.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
wscat -c -x '{"jsonrpc": "2.0", "id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]}'
```
### Response
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": true
}
```
---
## Ethereum trace_block
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `trace_block`
Get trace information about all the transactions in a given block. This can be useful for debugging purposes or for analyzing the behavior of a blockchain.
## Parameters
- `block parameter`: (string) _[required]_ - A hexadecimal block number, or the string `latest`, `earliest`, or `pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A list of calls to other contracts containing one object per call, in transaction execution order.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_block", "params": ["0x6"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "trace_block", "params": ["0x6"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0xffad82",
"input": "0x0000000000000000000000000000000000000999",
"to": "0x0020000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd",
"blockNumber": 6,
"result": {
"gasUsed": "0x7536",
"output": "0x"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"address": "0x0020000000000000000000000000000000000000",
"balance": "0x300",
"refundAddress": "0x0000000000000999000000000000000000000000"
},
"blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd",
"blockNumber": 6,
"result": null,
"subtraces": 0,
"traceAddress": [0],
"transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e",
"transactionPosition": 0,
"type": "selfdestruct"
},
{
"action": {
"author": "0x0000000000000000000000000000000000000000",
"rewardType": "block",
"value": "0x1bc16d674ec80000"
},
"blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd",
"blockNumber": 6,
"result": null,
"subtraces": 0,
"traceAddress": [],
"transactionHash": null,
"transactionPosition": null,
"type": "reward"
}
],
"id": 1
}
```
---
## Ethereum trace_call
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `trace_call`
Executes the given call and returns a number of possible traces for it. Use this API to retrieve detailed information about the transaction execution, including state changes and logs generated during the process.
## Parameters
- `transaction call object`: (object) _[required]_ - Transaction call object with the following keys and their values:
- `from`: (string) _[required]_ - 20 bytes. The address the transaction is sent from.
- `to`: (string) _[required]_ - 20 bytes. The address the transaction is directed to.
- `gas`: (string) _[optional]_ - The gas provided for the transaction execution, in hexadecimal.
- `gasPrice`: (string) _[optional]_ - The gas price used for each paid gas, in hexadecimal.
- `maxPriorityFeePerGas`: (string) _[optional]_ - Maximum fee, in wei, the sender is willing to pay per gas above the base fee.
- `maxFeePerGas`: (string) _[optional]_ - Maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas.
- `value`: (string) _[optional]_ - The value sent with this transaction, in hexadecimal.
- `data`: (string) _[optional]_ - The hash of the method signature and encoded parameters. See the [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `trace options`: (array) _[required]_ - A list of tracing options. Tracing options are `trace` and `stateDiff`.
- `block parameter`: (string) _[required]_ - The hexadecimal block number, or the string `latest`, `earliest`, or `pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
A trace object that includes the `trace` and `stateDiff`.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_call", "params": [{"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "to": "0x0010000000000000000000000000000000000000", "gas": "0xfffff2", "gasPrice": "0xef", "value": "0x0", "data": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002", "nonce": "0x0"}, ["trace"], "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "trace_call", "params": [{"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "to": "0x0010000000000000000000000000000000000000", "gas": "0xfffff2", "gasPrice": "0xef", "value": "0x0", "data": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002", "nonce": "0x0"}, ["trace"], "latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"result": {
"output": "0x",
"stateDiff": null,
"trace": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0xffabba",
"input": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
"to": "0x0010000000000000000000000000000000000000",
"value": "0x0"
},
"result": {
"gasUsed": "0x9c58",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"type": "call"
}
],
"vmTrace": null
},
"id": 2
}
```
---
## Ethereum trace_callMany
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `trace_callMany`
Performs multiple call-traces on top of the same block. You can analyze the interactions between different transactions and contracts.
## Parameters
- `calls`: (array) _[required]_ - Array of transaction call objects and trace options pairs.
- `block parameter`: (string) _[required]_ - The hexadecimal block number, or the string `latest`, `earliest`, or `pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
## Returns
Array of trace objects, one for each call performed.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_callMany", "params": [[[{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]], [{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]]], "latest"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "trace_callMany", "params": [[[{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]], [{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]]], "latest"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"result": [
{
"output": "0x",
"stateDiff": null,
"trace": [
{
"action": {
"callType": "call",
"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
"gas": "0x1dcd12f8",
"input": "0x",
"to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"value": "0x186a0"
},
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"type": "call"
}
],
"vmTrace": null
}
],
"id": 1
}
```
---
## Ethereum trace_filter
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `trace_filter`
Returns traces matching the specified filter. The response is limited to 10000 traces per response.
## Parameters
- `filter object`: (object) _[required]_ - Filter object with the following keys:
- `fromBlock`: (string) _[optional]_ - From this block number (hexadecimal).
- `toBlock`: (string) _[optional]_ - To this block number (hexadecimal).
- `fromAddress`: (array) _[optional]_ - Sent from these addresses.
- `toAddress`: (array) _[optional]_ - Sent to these addresses.
- `after`: (number) _[optional]_ - The offset trace number.
- `count`: (number) _[optional]_ - Number of traces to display in a batch.
## Returns
Array of trace objects matching the specified filter criteria.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_filter", "params": [{"fromBlock": "0x2ed0c4", "toBlock": "0x2ed128", "toAddress": ["0x8bbB73BCB5d553B5A556358d27625323Fd781D37"]}], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "trace_filter", "params": [{"fromBlock": "0x2ed0c4", "toBlock": "0x2ed128", "toAddress": ["0x8bbB73BCB5d553B5A556358d27625323Fd781D37"]}], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0x5208",
"input": "0x",
"to": "0x8bbb73bcb5d553b5a556358d27625323fd781d37",
"value": "0x2386f26fc10000"
},
"blockHash": "0x7eb25504e4c202cf3d62fd91d3d3fd16c2c4b17d5a33b4de3e64e2b7db0baf3b",
"blockNumber": 3068100,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",
"transactionPosition": 2,
"type": "call"
}
],
"id": 1
}
```
---
## Ethereum trace_transaction
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `trace_transaction`
Provides transaction processing of type trace for the specified transaction. Use this API to improve smart contract performance by analyzing its internal transactions and execution steps. You can use this information to identify bottlenecks and optimize the contract for better performance.
## Parameters
- `transaction hash`: (string) _[required]_ - Hash of the transaction to trace (32 bytes).
## Returns
Array of trace objects for the specified transaction.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_transaction", "params": ["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "trace_transaction", "params": ["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0x5208",
"input": "0x",
"to": "0x8bbb73bcb5d553b5a556358d27625323fd781d37",
"value": "0x2386f26fc10000"
},
"blockHash": "0x7eb25504e4c202cf3d62fd91d3d3fd16c2c4b17d5a33b4de3e64e2b7db0baf3b",
"blockNumber": 3068100,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",
"transactionPosition": 2,
"type": "call"
}
],
"id": 1
}
```
---
## Ethereum web3_clientVersion
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# `web3_clientversion`
Returns the current client version.
## Parameters
None.
## Returns
A string representing the current client version.
## Example
Replace `` with an API endpoint from your DIN gateway.
### Request
```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'
```
```bash
wscat -c -x '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'
```
### Response
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "Geth/v1.11.6-omnibus-f83e1598/linux-.mdx64/go1.20.3"
}
```
---
## Solana
This section provides reference information for the Solana JSON-RPC API
and Digital Asset Standard API methods.
---
## getAsset
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAsset`
Returns the metadata information of a compressed or standard asset.
## Parameters
- `id`: (string) _[required]_ - The `base58` encoded public key of the asset to query.
- `config`: (object) _[optional]_ - Optional flags to return additional information about the asset:
- `showFungible`: (boolean) - Whether to return the `token_info` object about the asset.
- `showUnverifiedCollections`: (boolean) - Whether to return an asset from an unverified collection.
- `showCollectionMetadata`: (boolean) - Whether to return the collection metadata.
## Returns
`result` - An object with the following fields:
- `interface` - The interface type of the asset. Return types
include: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`, `V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - Metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - Metadata fields:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `supply` - Supply details:
- `print_max_supply` - The maximum supply for prints.
- `print_current_supply` - The current supply for prints.
- `edition_nonce` - The edition nonce.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
- `token_info` - Additional token info which is returned via the `showFungible` parameter:
- `supply` - The supply of the asset.
- `decimals` - The decimals supported by the asset.
- `token_program` - The token program of the asset.
- `mint_authority` - The mint authority of the asset.
- `freeze_authority` - The freeze authority of the asset.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAsset", "params": ["GEciJX32EwG7DeHrXgosvpDAgjiuPo3uSEUAfJPLoSBD"]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"interface": "Custom",
"id": "GEciJX32EwG7DeHrXgosvpDAgjiuPo3uSEUAfJPLoSBD",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://arweave.net/I657C0VaPHIN7G4iL8Lr_8nctJhoIecFIyzlMCVF6IQ",
"files": [
{
"uri": "https://arweave.net/IxZAe2W4quFYdtae3d_NFZ8kAAcledOkK6_C7H352es",
"mime": "image/png"
},
{
"uri": "https://arweave.net/IxZAe2W4quFYdtae3d_NFZ8kAAcledOkK6_C7H352es?ext=png",
"mime": "image/png"
}
],
"metadata": {
"attributes": [
{
"value": "Green",
"trait_type": "Background"
},
{
"value": "Green / Green",
"trait_type": "Fur / Skin"
},
{
"value": "Policeman's Cap",
"trait_type": "Head"
},
{
"value": "Sandwich",
"trait_type": "Mouth"
},
{
"value": "No Traits",
"trait_type": "Teeth"
},
{
"value": "Police Uniform",
"trait_type": "Clothing"
},
{
"value": "No Traits",
"trait_type": "Eyewear"
},
{
"value": 1,
"trait_type": "generation",
"display_type": "number"
},
{
"value": 2463,
"trait_type": "sequence",
"display_type": "number"
}
],
"description": "Deep in the heart of Dingus Forest echoes the sleepless cries of a troop of 10,000 apes. These aren’t just regular apes, however. These are degenerate apes.",
"name": "Degen Ape #2463",
"symbol": "DAPE"
},
"links": {
"external_url": "",
"image": "https://arweave.net/IxZAe2W4quFYdtae3d_NFZ8kAAcledOkK6_C7H352es"
}
},
"authorities": [
{
"address": "DC2mkgwhy56w3viNtHDjJQmc7SGu2QX785bS4aexojwX",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "DSwfRF1jhhu6HpSuzaig1G19kzP73PfLZBPLofkw6fLD"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.042,
"basis_points": 420,
"primary_sale_happened": true,
"locked": false
},
"creators": [
{
"address": "9BKWqDHfHZh9j39xakYVMdr6hXmCLHH5VfCpeq2idU9L",
"share": 39,
"verified": false
},
{
"address": "9FYsKrNuEweb55Wa2jaj8wTKYDBvuCG3huhakEj96iN9",
"share": 25,
"verified": false
},
{
"address": "HNGVuL5kqjDehw7KR63w9gxow32sX6xzRNgLb8GkbwCM",
"share": 25,
"verified": false
},
{
"address": "7FzXBBPjzrNJbm9MrZKZcyvP3ojVeYPUG2XkBPVZvuBu",
"share": 10,
"verified": false
},
{
"address": "DC2mkgwhy56w3viNtHDjJQmc7SGu2QX785bS4aexojwX",
"share": 1,
"verified": true
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 255
},
"mutable": false,
"burnt": false
},
"id": 0
}
```
---
## getAssetProof
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetProof`
Returns the Merkle tree proof information for a compressed asset.
## Parameters
- `id`: (string) _[required]_ - The `base58` encoded public key of the asset to query.
## Returns
`result` - An object containing the following fields:
- `root` - The root hash of the Merkle tree.
- `proof` - An array of hashes representing the Merkle proof.
- `node_index` - The index of the node in the Merkle tree.
- `leaf` - The hash of the leaf node.
- `tree_id` - The ID of the Merkle tree.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetProof", "params": ["Bu1DEKeawy7txbnCEJE4BU3BKLXaNAKCYcHR4XhndGss"]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"root": "2o6Y6EiY3WXhoaEpei2pHmHLYnHDcEQVhgD89GrGHDBH",
"proof": [
"EmJXiXEAhEN3FfNQtBa5hwR8LC5kHvdLsaGCoERosZjK",
"7NEfhcNPAwbw3L87fjsPqTz2fQdd1CjoLE138SD58FDQ",
"6dM3VyeQoYkRFZ74G53EwvUPbQC6LsMZge6c7S1Ds4ks",
"A9AACJ5m7UtaVz4HxzhDxGjYaY88rc2XPoFvnoTvgYBj",
"2VG5cKeBZdqozwhHGGzs13b9tzy9TXt9kPfN8MzSJ1Sm",
"3E1uFze4pi6BnTZXMsQbeh3jQCeDi966Zax9aMbYgg2D",
"Bx9PdctdWCeC1WfU6dwP49idsXCYhqyxbRLyLwwGhr61",
"HSbJ8quT4vuXFgf5FnjzeUuFfAtLKsq6W1Frj8y1qrif",
"GJMLzL4F4hY9yFHY1EY6XRmW4wpuNGeBZTiv7vM2mYra",
"FYPtEiqmRx6JprHQvWeEWEuVp3WA7DPRCE4VbhFRVuAj",
"6MJKrpnK1GbYsnEzwMRWStNGkTjAZF23NhzTQSQVXsD3",
"HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7",
"4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq",
"E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2"
],
"node_index": 16384,
"leaf": "6YdZXw49M97mfFTwgQb6kxM2c6eqZkHSaW9XhhoZXtzv",
"tree_id": "2kuTFCcjbV22wvUmtmgsFR7cas7eZUzAu96jzJUvUcb7"
},
"id": 1
}
```
---
## getAssetProofBatch
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetProofBatch`
Returns the Merkle tree proof information for multiple compressed assets.
## Parameters
- `ids`: (array of strings) _[required]_ - An array of `base58` encoded public keys of the assets to query.
## Returns
`result` - An object where each key is an asset ID, and the value is an object containing the following fields:
- `root` - The root hash of the Merkle tree.
- `proof` - An array of hashes representing the Merkle proof.
- `node_index` - The index of the node in the Merkle tree.
- `leaf` - The hash of the leaf node.
- `tree_id` - The ID of the Merkle tree.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetProofBatch", "params": [["D85MZkvir9yQZFDHt8U2ZmS7D3LXKdiSjvw2MBdscJJa", "ELDjRRs5Wb478K4h3B5bMPEhqFD8FvoET5ctHku5uiYi"]]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"ELDjRRs5Wb478K4h3B5bMPEhqFD8FvoET5ctHku5uiYi": null,
"D85MZkvir9yQZFDHt8U2ZmS7D3LXKdiSjvw2MBdscJJa": {
"root": "HscyoK57Grh1CGHi7HDDGaQRqe3CtetqgwZCBjw6E73t",
"proof": [
"4EVwURnyVehgq4LhPfJFmPngfuNvreJgBGX1jbojcg7p",
"89KmAg6NuRkwbSmpEU2fH8tJmuoGkwAwkV7MZaTRuRyE",
"DD34gSoVzcDJKK4FcQx6RPDBmjwsWJ2JyL9Poch9i6Hm",
"F9oTuKohez7fbLjXXfqurqNG4KhVn2RgnC7o85Z4qgnm",
"HSfwLLiVjmhtFFFaLF6VFQZ7NrWZW9qoZDGWTPnU8Trw",
"CyFfjtkvg1HfexcekN6cCrUYmUwqtoeFGaTWeyPGxqmj",
"3Rv9v5r97j6vudzjVF8idGQdeu7jJdHgm75pTAeiN9ce",
"6mr5hmD2nkPU76irs6duAYekRgPxDWh8JMuunua4Whra",
"HxDaLgV8UrMq4G3YtXfcCx4UXm511hWSxPTeAfcD39vG",
"EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR",
"HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL",
"GcUfCg1P6XhSXzW34YmgXspCYaT7ujHSNmDK2CDEA3dy",
"4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq",
"E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2"
],
"node_index": 18559,
"leaf": "91eAJoZoXMmLbxCGWo7tdfHT7ZDYZMLgJRaGi2ocPxwL",
"tree_id": "5i1rrMFvFfwCkR15cf66bEXM2LmtfffDfYegQ3qdWgcF"
}
},
"id": 1
}
```
---
## getAssets
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssets`
Returns the metadata information of multiple compressed or standard assets.
## Parameters
- `ids`: (array of strings) _[required]_ - The `base58` encoded public keys of the assets to query.
- `config`: (object) _[optional]_ - Optional flags to return additional information about the asset:
- `showFungible`: (boolean) - Whether to return the `token_info` object about the asset.
- `showCollectionMetadata`: (boolean) - Whether to return the collection metadata.
## Returns
`result` - An array of objects, where each object contains the following fields:
- `interface` - The interface type of the asset. Return types include: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`, `V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - Metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - Metadata fields:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `supply` - Supply details:
- `print_max_supply` - The maximum supply for prints.
- `print_current_supply` - The current supply for prints.
- `edition_nonce` - The edition nonce.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
- `token_info` - Additional token info which is returned via the `showFungible` flag:
- `supply` - The supply of the asset.
- `decimals` - The decimals supported by the asset.
- `token_program` - The token program of the asset.
- `mint_authority` - The mint authority of the asset.
- `freeze_authority` - The freeze authority of the asset.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getAssets",
"params": [["GEciJX32EwG7DeHrXgosvpDAgjiuPo3uSEUAfJPLoSBD", "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]]
}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"interface": "Custom",
"id": "GEciJX32EwG7DeHrXgosvpDAgjiuPo3uSEUAfJPLoSBD",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://arweave.net/I657C0VaPHIN7G4iL8Lr_8nctJhoIecFIyzlMCVF6IQ",
"files": [
{
"uri": "https://arweave.net/IxZAe2W4quFYdtae3d_NFZ8kAAcledOkK6_C7H352es",
"mime": "image/png"
},
{
"uri": "https://arweave.net/IxZAe2W4quFYdtae3d_NFZ8kAAcledOkK6_C7H352es?ext=png",
"mime": "image/png"
}
],
"metadata": {
"attributes": [
{
"value": "Green",
"trait_type": "Background"
},
...
{
"value": 2463,
"trait_type": "sequence",
"display_type": "number"
}
],
"description": "Deep in the heart of Dingus Forest echoes the sleepless cries of a troop of 10,000 apes. These aren’t just regular apes, however. These are degenerate apes.",
"name": "Degen Ape #2463",
"symbol": "DAPE"
},
"links": {
"image": "https://arweave.net/IxZAe2W4quFYdtae3d_NFZ8kAAcledOkK6_C7H352es",
"external_url": ""
}
},
"authorities": [
{
"address": "DC2mkgwhy56w3viNtHDjJQmc7SGu2QX785bS4aexojwX",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "DSwfRF1jhhu6HpSuzaig1G19kzP73PfLZBPLofkw6fLD"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.042,
"basis_points": 420,
"primary_sale_happened": true,
"locked": false
},
"creators": [
{
"address": "9BKWqDHfHZh9j39xakYVMdr6hXmCLHH5VfCpeq2idU9L",
"share": 39,
"verified": false
},
{
"address": "9FYsKrNuEweb55Wa2jaj8wTKYDBvuCG3huhakEj96iN9",
"share": 25,
"verified": false
},
{
"address": "HNGVuL5kqjDehw7KR63w9gxow32sX6xzRNgLb8GkbwCM",
"share": 25,
"verified": false
},
{
"address": "7FzXBBPjzrNJbm9MrZKZcyvP3ojVeYPUG2XkBPVZvuBu",
"share": 10,
"verified": false
},
{
"address": "DC2mkgwhy56w3viNtHDjJQmc7SGu2QX785bS4aexojwX",
"share": 1,
"verified": true
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 255
},
"mutable": false,
"burnt": false
},
{
"interface": "ProgrammableNFT",
"id": "exMUf3JuFQMBUc3p6osuqJRFQWr9wgQWBGiuzXmHJTa",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://arweave.net/4yDL8qbv-j58hjv3imAnC_nP-2VKmjy7bNMNPsdUDZQ",
"files": [
{
"uri": "https://arweave.net/qAr3txiC4QwJk5Na9_0bJbEiPlUeRvVDH4-YzOALK44",
"mime": "image/png"
}
],
"metadata": {
"attributes": [
{
"value": "Cream",
"trait_type": "Background"
},
...
{
"value": "Hooded Cardigan",
"trait_type": "Clothes"
}
],
"description": "Okay Bears is a culture shift. A clean collection of 10,000 diverse bears building a virtuous community that will transcend the internet into the real world.",
"name": "Okay Bear #6261",
"symbol": "OKB",
"token_standard": "ProgrammableNonFungible"
},
"links": {
"external_url": "https://www.okaybears.com/",
"image": "https://arweave.net/qAr3txiC4QwJk5Na9_0bJbEiPlUeRvVDH4-YzOALK44"
}
},
"authorities": [
{
"address": "4zj22pu8yRyenFHwLmue28CqVmGFgVQt5FmVvwdP5fLa",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "3saAedkM9o5g1u5DCqsuMZuC4GRqPB4TuMkvSsSVvGQ3"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.05,
"basis_points": 500,
"primary_sale_happened": true,
"locked": false
},
"creators": [
{
"address": "3xVDoLaecZwXXtN59o6T3Gfxwjcgf8Hc9RfoqBn995P9",
"share": 0,
"verified": true
},
{
"address": "7zL7HVn85F5yFT6XM3BsJcQF7PBcNE7R2BT5GyfunpKe",
"share": 100,
"verified": false
}
],
"ownership": {
"frozen": true,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 254
},
"mutable": true,
"burnt": false
}
],
"id": 1
}
```
---
## getAssetsByAuthority
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetsByAuthority`
Returns the list of assets given an authority address.
## Parameters
- `authorityAddress`: (string) _[required]_ - The `base58` encoded public key of the authority of the assets.
- `sortBy`: (object) _[optional]_ - Sorting criteria for the results:
- `sortBy` - The field to sort by. Possible values: `created`, `updated`, `recent_action`, `id`, `none`.
- `sortDirection` - The sort direction. Possible values: `asc`, `desc`.
- `limit`: (number) _[optional]_ - The maximum number of assets to retrieve.
- `page`: (number) _[optional]_ - The index of the page to retrieve.
- `before`: (string) _[optional]_ - Retrieve assets before the specified ID.
- `after`: (string) _[optional]_ - Retrieve assets after the specified ID.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of assets matching the query.
- `limit` - The maximum number of assets returned in this response.
- `items` - An array of asset objects. Each asset object contains:
- `interface` - The interface type of the asset. Return types include: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`,
`V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - An object containing the metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - An object containing the metadata information:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetsByAuthority", "params": ["3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA", {"sortBy": "created", "sortDirection": "desc"}, 50, 1, null, null]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 50,
"limit": 50,
"page": 1,
"items": [
{
"interface": "V1_NFT",
"id": "AMBvgj2Zcjg7wpo5Vfzy1ruXUWmYHS2fZkrqSwQEtpJz",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://famousfoxes.com/metadata/9712.json",
"files": [
{
"uri": "https://famousfoxes.com/hd/9712.png",
"mime": "image/png"
}
],
"metadata": {
"attributes": [
{
"value": "Straw",
"trait_type": "Background"
},
{
"value": "Jacket Denim",
"trait_type": "Outfit"
},
{
"value": "Natural",
"trait_type": "Skin"
},
{
"value": "Vixen",
"trait_type": "Eyes"
},
{
"value": "UwU",
"trait_type": "Mouth"
},
{
"value": "Cap Purple",
"trait_type": "Head"
},
{
"value": "True",
"trait_type": "Summoned"
}
],
"description": "The Famous Fox Federation, an independent organization of the most fabulously famous foxes on the Blockchain.",
"name": "Fox #9712",
"symbol": "FFF",
"token_standard": "NonFungible"
},
"links": {
"external_url": "https://famousfoxes.com",
"image": "https://famousfoxes.com/hd/9712.png"
}
},
"authorities": [
{
"address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.042,
"basis_points": 420,
"primary_sale_happened": true,
"locked": false
},
"creators": [
{
"address": "442t3gHbw55CqiEAtoSWasVQ3eAhmYW2gPy5jqJNTdcw",
"share": 0,
"verified": true
},
{
"address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
"share": 100,
"verified": false
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "91GBiM6pBxVsANodJd4nGjnKBDE8XRJbcvQD9C1Phpyb"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 255
},
"mutable": true,
"burnt": false
},
...
]
},
"id": 1
}
```
---
## getAssetsByCreator
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetsByCreator`
Returns the list of assets given a creator address.
## Parameters
- `creatorAddress`: (string) _[required]_ - The `base58` encoded public key of the creator of the assets.
- `onlyVerified`: (boolean) _[optional]_ - Indicates whether to retrieve only verified assets.
- `sortBy`: (object) _[optional]_ - Sorting criteria for the results:
- `sortBy` - The field to sort by. Possible values: `created`, `updated`, `recent_action`, `id`, `none`.
- `sortDirection` - The sort direction. Possible values: `asc`, `desc`.
- `limit`: (number) _[optional]_ - The maximum number of assets to retrieve.
- `page`: (number) _[optional]_ - The index of the page to retrieve.
- `before`: (string) _[optional]_ - Retrieve assets before the specified ID.
- `after`: (string) _[optional]_ - Retrieve assets after the specified ID.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of assets matching the query.
- `limit` - The maximum number of assets returned in this response.
- `items` - An array of asset objects. Each asset object contains:
- `interface` - The interface type of the asset. Return types include: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`,
`V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - An object containing the metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - An object containing the metadata information:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetsByCreator", "params": ["D3XrkNZz6wx6cofot7Zohsf2KSsu2ArngNk8VqU9cTY3", true, {"sortBy": "created", "sortDirection": "desc"}, 50, 1, null, null]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 50,
"limit": 50,
"page": 1,
"items": [
{
"interface": "Custom",
"id": "H5soVfY8CD5Pcdmud6HUdW6N4GN7amE7zAxgDjWtMux6",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://famousfoxes.com/metadata/7616.json",
"files": [
{
"uri": "https://famousfoxes.com/hd/7616.png",
"mime": "image/png"
}
],
"metadata": {
"attributes": [
{
"value": "Straw",
"trait_type": "Background"
},
{
"value": "Hoodie Light",
"trait_type": "Outfit"
},
{
"value": "Natural",
"trait_type": "Skin"
},
{
"value": "Smirk",
"trait_type": "Mouth"
},
{
"value": "None",
"trait_type": "Head"
},
{
"value": "Scar",
"trait_type": "Eyes"
}
],
"description": "The Famous Fox Federation, an independent organization of the most fabulously famous foxes on the Blockchain.",
"name": "Fox #7616",
"symbol": "FFF"
},
"links": {
"external_url": "https://famousfoxes.com",
"image": "https://famousfoxes.com/hd/7616.png"
}
},
"authorities": [
{
"address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.042,
"basis_points": 420,
"primary_sale_happened": true,
"locked": false
},
"creators": [
{
"address": "D3XrkNZz6wx6cofot7Zohsf2KSsu2ArngNk8VqU9cTY3",
"share": 0,
"verified": true
},
{
"address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
"share": 100,
"verified": true
}
],
"ownership": {
"frozen": true,
"delegated": true,
"delegate": "3fn29NJqUuKJgwHKmk9n54TbaXG9DgWvLAqajxZLUi22",
"ownership_model": "single",
"owner": "3ZsZsjVDjMh6rrEdFi13TnBgh9W9vLyCYcY4yzApzrdK"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 254
},
"mutable": true,
"burnt": false
},
...
]
},
"id": 1
}
```
---
## getAssetsByGroup
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetsByGroup`
Returns the list of assets given a group (key, value) pair.
## Parameters
- `groupKey`: (string) _[required]_ - The key of the group (for example `collection`).
- `groupValue`: (string) _[required]_ - The value of the group.
- `sortBy`: (object) _[optional]_ - Sorting criteria for the results:
- `sortBy` - The field to sort by. Possible values: `created`, `updated`, `recent_action`, `id`, `none`.
- `sortDirection` - The sort direction. Possible values: `asc`, `desc`.
- `limit`: (number) _[optional]_ - The maximum number of assets to retrieve.
- `page`: (number) _[optional]_ - The index of the page to retrieve.
- `before`: (string) _[optional]_ - Retrieve assets before the specified ID.
- `after`: (string) _[optional]_ - Retrieve assets after the specified ID.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of assets matching the query.
- `limit` - The maximum number of assets returned in this response.
- `items` - An array of asset objects. Each asset object contains:
- `interface` - The interface type of the asset. Return types include: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`,
`V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - An object containing the metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - An object containing the metadata information:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetsByGroup", "params": ["collection", "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac", {"sortBy": "created", "sortDirection": "desc"}, 50, 1, null, null]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 50,
"limit": 50,
"page": 1,
"items": [
{
"interface": "V1_NFT",
"id": "An7sN8sjhd7bBzsNoryPYtrRdgjPixT4FFsSxPSxnf5g",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://famousfoxes.com/metadata/9713.json",
"files": [
{
"uri": "https://famousfoxes.com/hd/9713.png",
"mime": "image/png"
}
],
"metadata": {
"attributes": [
{
"value": "Cream",
"trait_type": "Background"
},
{
"value": "Jacket Red",
"trait_type": "Outfit"
},
{
"value": "Natural",
"trait_type": "Skin"
},
{
"value": "Blue",
"trait_type": "Eyes"
},
{
"value": "Toothy",
"trait_type": "Mouth"
},
{
"value": "Cap Fire",
"trait_type": "Head"
},
{
"value": "True",
"trait_type": "Summoned"
}
],
"description": "The Famous Fox Federation, an independent organization of the most fabulously famous foxes on the Blockchain.",
"name": "Fox #9713",
"symbol": "FFF",
"token_standard": "NonFungible"
},
"links": {
"image": "https://famousfoxes.com/hd/9713.png",
"external_url": "https://famousfoxes.com"
}
},
"authorities": [
{
"address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.042,
"basis_points": 420,
"primary_sale_happened": true,
"locked": false
},
"creators": [
{
"address": "442t3gHbw55CqiEAtoSWasVQ3eAhmYW2gPy5jqJNTdcw",
"share": 0,
"verified": true
},
{
"address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
"share": 100,
"verified": false
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "BJL17Qr3cKSMXWBFqvWN58FhRqZPqdJCXU9MJykUuS7w"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 255
},
"mutable": true,
"burnt": false
},
...
]
},
"id": 1
}
```
---
## getAssetsByOwner
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetsByOwner`
Returns the list of assets given an owner address.
## Parameters
- `ownerAddress`: (string) _[required]_ - The `base58` encoded public key of the owner of the assets.
- `sortBy`: (object) _[optional]_ - Sorting criteria for the results:
- `sortBy` - The field to sort by. Possible values: `created`, `updated`, `recent_action`, `id`, `none`.
- `sortDirection` - The sort direction. Possible values: `asc`, `desc`.
- `limit`: (number) _[optional]_ - The maximum number of assets to retrieve.
- `page`: (number) _[optional]_ - The index of the page to retrieve.
- `before`: (string) _[optional]_ - Retrieve assets before the specified ID.
- `after`: (string) _[optional]_ - Retrieve assets after the specified ID.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of assets matching the query.
- `limit` - The maximum number of assets returned in this response.
- `items` - An array of asset objects. Each asset object contains:
- `interface` - The interface type of the asset. Return types include: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`,
`V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - An object containing the metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - An object containing the metadata information:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetsByOwner", "params": ["4cbnLyRoowAXtxLN6sEYrdYTFUkzodRyNFG7g4FKWBBA", {"sortBy": "created", "sortDirection": "desc"}, 50, 1, null, null]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 46,
"limit": 50,
"page": 1,
"items": [
{
"interface": "V1_NFT",
"id": "6rZXazDDvM8RU1UDwunkqdhw1nXVFWRuk2Dh1ThJYLTH",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://cloudflare-ipfs.com/ipfs/QmctZUaANofFr1BLgWQchwjcUMYEX2ZSx2LpDSHSRtQj5m",
"files": [],
"metadata": {
"name": "Key",
"symbol": "",
"token_standard": "NonFungible"
},
"links": {}
},
"authorities": [
{
"address": "9NFLyt33NWcidPYbPyVW7yWpAM1RKepNVMYAhCSpSM3w",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": true,
"data_hash": "5ZUYsZn64hubvRVCpnVxX9iBmEbEt1N8v5kbtoSS3L2K",
"creator_hash": "8i3JU72aZtimFTFFQtZCGkzrnLbibBDYVycCn3yrKc5e",
"asset_hash": "37fJAak3P8dFCJX4HijBtqEG6PjoXr74g86xaW4bPfjB",
"tree": "EpGN5mjMwAdWAQHZSHrjGcB7zewEw2KrRezZchSq9W6B",
"seq": 238234,
"leaf_id": 225357
},
"grouping": [
{
"group_key": "collection",
"group_value": "BZNai1KJr17myQUUSfcU6FGHxtp4UwMPawkszXmihyiJ"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0,
"basis_points": 0,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "HeUwVyLufyPMiUnRe6Fo9iUvSBXtFYszAkG6q2WLCikD",
"share": 100,
"verified": false
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "4cbnLyRoowAXtxLN6sEYrdYTFUkzodRyNFG7g4FKWBBA"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": null
},
"mutable": true,
"burnt": false
},
...
]
},
"id": 1
}
```
---
## getAssetSignatures
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAssetSignatures`
Retrieve a list of transaction signatures linked to a compressed asset.
This method supports only compressed assets created by the
[Metaplex Bubblegum program](https://developers.metaplex.com/bubblegum).
## Parameters
- `id`: (string) _[required]_ - The `base58` encoded public key of the asset.
- `owner`: (string) _[optional]_ - The `base58` encoded public key of the asset owner.
- `page`: (number) _[optional]_ - The current pagination page.
- `limit`: (number) _[optional]_ - The number of results per page.
- `cursor`: (string) _[optional]_ - Optional pagination cursor.
- `before`: (string) _[optional]_ - Return results before the specified signature.
- `after`: (string) _[optional]_ - Return results after the specified signature.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of transaction signatures matching the query.
- `limit` - The maximum number of transaction signatures returned in this response.
- `page` - The current pagination page.
- `items` - An array of transaction signature objects. Each object contains:
- `signature` - The transaction signature.
- `type` - The type of the signature.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getAssetSignatures",
"params": [
"D85MZkvir9yQZFDHt8U2ZmS7D3LXKdiSjvw2MBdscJJa",
null,
1,
null,
null,
null,
null
]
}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 1,
"limit": 1000,
"page": 1,
"items": [
[
"3b52uoDvGTkJKk7ygozyK38gfrU8iruz2VPRZPFJKY1zUgWCA8df1ZZUFf5zwokwhEinsofHxiY7mMMuFsik6bjW",
"MintToCollectionV1"
]
]
},
"id": 1
}
```
---
## getNftEditions
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getNftEditions`
Retrieves all printable editions for a parent edition NFT mint.
## Parameters
- `mint`: (string) _[required]_ - The mint address of the parent edition.
- `page`: (number) _[optional]_ - The current pagination page.
- `limit`: (number) _[optional]_ - The number of results per page.
- `cursor`: (string) _[optional]_ - Optional pagination cursor.
- `before`: (string) _[optional]_ - Return results before the cursor.
- `after`: (string) _[optional]_ - Return results after the cursor.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of printable editions.
- `limit` - The maximum number of editions returned in this response.
- `page` - The current pagination page.
- `master_edition_address` - The address of the parent edition.
- `supply` - The current supply of editions.
- `max_supply` - The maximum supply of editions.
- `editions` - An array of edition objects. Each edition object contains:
- `mint` - The mint address of the edition.
- `edition_address` - The address of the edition.
- `edition` - The edition number.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getNftEditions",
"params": [
"Ey2Qb8kLctbchQsMnhZs5DjY32To2QtPuXNwWvk4NosL",
1,
null,
null,
null,
null
]
}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 66,
"limit": 100,
"page": 1,
"master_edition_address": "8SHfqzJYABeGfiG1apwiEYt6TvfGQiL1pdwEjvTKsyiZ",
"supply": 57,
"max_supply": 69,
"editions": [
{
"mint": "GJvFDcBWf6aDncd1TBzx2ou1rgLFYaMBdbYLBa9oTAEw",
"edition_address": "AoxgzXKEsJmUyF5pBb3djn9cJFA26zh2SQHvd9EYijZV",
"edition": 1
},
...
]
},
"id": 1
}
```
---
## getTokenAccounts
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTokenAccounts`
Retrieves information about all token accounts for a specific mint or an owner.
## Parameters
- `mint`: (string) _[optional]_ - The address of the associated mint.
- `owner`: (string) _[optional]_ - The owner address of the tokens.
- `page`: (integer) _[optional]_ - The index of the page to retrieve. The page parameter starts at `1`
- `limit`: (integer) _[optional]_ - The number of results per page.
- `cursor`: (string) _[optional]_ - Optional pagination cursor.
- `before`: (string) _[optional]_ - Return results before the cursor.
- `after`: (string) _[optional]_ - Return results after the cursor.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of token accounts matching the query.
- `limit` - The maximum number of token accounts returned in this response.
- `page` - The current pagination page.
- `token_accounts` - An array of token account objects. Each token account object contains:
- `address` - The address of the token account.
- `mint` - The mint address associated with the token account.
- `owner` - The owner address of the token account.
- `frozen` - Whether the token account is frozen.
- `amount` - The amount of tokens held in the account.
- `delegate` - The delegate address, if any.
- `close_authority` - The address that can close the token account, if any.
- `extensions` - Additional information about the token account, if any.
- `delegated_amount` - The amount of tokens delegated, if any.
- `errors` - An array of error objects, if any errors occurred during the request.
- `cursor` - The pagination cursor for the next page of results.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccounts",
"params": [
"So11111111111111111111111111111111111111112",
null,
1,
50,
null,
null,
null
]
}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 1,
"limit": 1,
"page": 50,
"token_accounts": [
{
"address": "DgeCdQBqsoAWhJtewsSN4Pcz9okEGBTebEZcrcGhPXDE",
"mint": "5fgwRW94H1KavvaGEanNZc2AnEGKkFaJWkZzAuvaxRNH",
"amount": 100000000,
"owner": "So11111111111111111111111111111111111111112",
"frozen": false,
"delegate": null,
"delegated_amount": 0,
"close_authority": null,
"extensions": null
}
],
"cursor": null,
"errors": []
},
"id": 1
}
```
---
## searchAssets
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `searchAssets`
Returns the list of assets based on the specified search criteria.
## Parameters
- `negate`: (boolean) _[optional]_ - Indicates whether the search criteria should be inverted.
- `conditionType`: (string) _[optional]_ - Indicates whether to retrieve all or any asset that matches the search criteria.
Valid options are: `all`, `any`.
- `interface`: (string) _[optional]_ - The interface of the asset.
Valid options are: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`, `V2_NFT`, `FungibleAsset`, `Custom`, `Identity`, `Executable`.
- `ownerAddress`: (string) _[optional]_ - The `base58` encoded public key of the owner.
- `ownerType`: (string) _[optional]_ - The type of ownership. Valid options are: `single`, `token`.
- `creatorAddress`: (string) _[optional]_ - The `base58` encoded public key of the creator.
- `creatorVerified`: (boolean) _[optional]_ - Indicates whether the creator must be verified.
- `authorityAddress`: (string) _[optional]_ - The `base58` encoded public key of the authority.
- `grouping`: (array) _[optional]_ - A group (key, value) pair.
- `delegateAddress`: (string) _[optional]_ - The `base58` encoded public key of the delegate.
- `frozen`: (boolean) _[optional]_ - Indicates whether the asset is frozen.
- `supply`: (number) _[optional]_ - The supply of the asset.
- `supplyMint`: (string) _[optional]_ - The `base58` encoded public key of the supply mint.
- `compressed`: (boolean) _[optional]_ - Indicates whether the asset is compressed.
- `compressible`: (boolean) _[optional]_ - Indicates whether the asset is compressible.
- `royaltyTargetType`: (string) _[optional]_ - The type of royalty. Valid options are: `creators`, `fanout`, `single`.
- `royaltyTarget`: (string) _[optional]_ - The target address for royalties.
- `royaltyAmount`: (number) _[optional]_ - The royalties amount.
- `burnt`: (boolean) _[optional]_ - Indicates whether the asset is burnt.
- `sortBy`: (object) _[optional]_ - Sorting criteria for the results:
- `sortBy` - The field to sort by. Valid options are: `created`, `updated`, `recent_action`, `id`, `none`.
- `sortDirection` - The sort direction. Valid options are: `asc`, `desc`.
- `limit`: (number) _[optional]_ - The maximum number of assets to retrieve.
- `page`: (number) _[optional]_ - The index of the page to retrieve.
- `before`: (string) _[optional]_ - Retrieve assets before the specified ID.
- `after`: (string) _[optional]_ - Retrieve assets after the specified ID.
- `jsonUri`: (string) _[optional]_ - The value for the JSON URI.
## Returns
`result` - An object containing the following fields:
- `total` - The total number of assets matching the query.
- `limit` - The maximum number of assets returned in this response.
- `items` - An array of asset objects. Each asset object contains:
- `interface` - The interface type of the asset. Valid options are: `V1_NFT`, `V1_PRINT`, `LEGACY_NFT`, `V2_NFT`, `FungibleAsset`, `FungibleToken`, `Custom`, `Identity`, `Executable`, `ProgrammableNFT`.
- `id` - The ID of the asset.
- `content` - An object containing the metadata and content information:
- `$schema` - The schema URI.
- `json_uri` - The URI pointing to the asset's JSON metadata.
- `files` - List of associated files with `uri`, `mime`, and optional `contexts`.
- `metadata` - An object containing the metadata information:
- `name` - The name of the asset.
- `symbol` - The symbol of the asset.
- `description` - A description of the asset.
- `attributes` - List of attributes with `trait_type` and `value`.
- `token_standard` - The token standard of the asset.
- `ownership` - An object containing the ownership details:
- `owner` - The owner's public key.
- `frozen` - Whether the asset is frozen.
- `delegated` - Whether the asset is delegated.
- `delegate` - The delegate's public key.
- `ownership_model` - The ownership model, for example `single` or `token`.
- `compression` - An object containing the asset compression details:
- `eligible` - Whether the asset is eligible for compression.
- `compressed` - Whether the asset is compressed.
- `data_hash` - The data hash of the asset.
- `creator_hash` - The creator hash of the asset.
- `asset_hash` - The asset hash.
- `tree` - The Merkle tree ID.
- `seq` - The sequence number.
- `leaf_id` - The leaf ID.
- `royalty` - An object containing the royalty details:
- `royalty_model` - The royalty model (`creators`, `fanout`, or `single`).
- `target` - The target address for royalties.
- `percent` - The royalty percentage.
- `basis_points` - The royalty in basis points.
- `primary_sale_happened` - Whether the primary sale has occurred.
- `locked` - Whether the royalty is locked.
- `creators` - List of creators:
- `address` - The creator's public key.
- `share` - The creator's share percentage.
- `verified` - Whether the creator is verified.
- `grouping` - Grouping details:
- `group_key` - The group key (for example, `collection`).
- `group_value` - The group value.
- `uses` - An object containing the usage details:
- `use_method` - The usage method (`burn`, `multiple`, or `single`).
- `remaining` - The remaining uses.
- `total` - The total uses.
- `mutable` - Whether the asset is mutable.
- `burnt` - Whether the asset is burnt.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "searchAssets",
"params": [
false,
"all",
"V1_NFT",
"2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"single",
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
{ "sortBy": "created", "sortDirection": "desc" },
50,
1,
null,
null,
null
]
}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"total": 50,
"limit": 50,
"page": 1,
"items": [
{
"interface": "V1_NFT",
"id": "2SiYEckvp5MHz63ybheoehgk7YYPGZksKcxyT7MsJvDS",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://ipfs.io/ipfs/QmUWytohB2ecUqbor12sm7ozDrVzgbwnCtqF66m9abMLWG",
"files": [],
"metadata": {
"name": "5000 TO 50000 #54",
"symbol": "",
"token_standard": "NonFungible"
},
"links": {}
},
"authorities": [
{
"address": "7GaUkgafjv7uxni4GuvBFp8b1qFVRyZAmwNHzjeFbmTt",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": true,
"data_hash": "8uwkK3ydNdnGUbSGTfHjmw8uQ8HheerdEB1RmiL7xyvD",
"creator_hash": "9FiGqDmyw6peu9uZk3XekNC3S7KjaTV6oxC476gPCHLz",
"asset_hash": "9g5DrQ3ndkzLo2mfN74hqhzHG8suKyAetrgJZ4KG4xb8",
"tree": "2xZ7XN9wkUuMRj9RiCbBLXYMofAyHsrEKpWbA3xwxPfG",
"seq": 1038593,
"leaf_id": 1037754
},
"grouping": [
{
"group_key": "collection",
"group_value": "71zrEGzfv4oX3uhc96trWayxdF3xm2kD9WWWoiMZkHAR"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.055,
"basis_points": 550,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "4AuVuuzh7NA8b8jCcJzARdUALum4MxG9tPYA7QxTPHqo",
"share": 100,
"verified": false
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": null
},
"mutable": true,
"burnt": false
},
...
]
},
"id": 1
}
```
---
## getAccountInfo
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getAccountInfo`
Returns information associated with the account of the specified address.
## Parameters
- `address`: (string) _[required]_ - The `base-58` encoded public key of the account to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
or `jsonParsed`
- `dataSlice`: (object) _[optional]_ - A slice of the account data to return. Only available for `base58`, `base64`,
or `base64+zstd` encoding. This is an object with two properties:
- `offset` - The starting byte offset of the slice.
- `length` - The length of the slice in bytes.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - `null` when the account doesn't exist, or an object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object containing the following keys:
- `data` - The account data, encoded in the specified format.
- `executable` - A boolean indicating whether the account is executable.
- `lamports` - The number of lamports in the account.
- `owner` - The public key of the program that owns the account.
- `rentEpoch` - The epoch in which the account will next be due for rent.
- `space` - The size of the account data in bytes.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "getAccountInfo", "params": ["F5a3ExamplePubkeyABCDEFGH", {"encoding": "jsonParsed"}],"id": 1}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 371626267
},
"value": {
"data": [
"",
"base58"
],
"executable": false,
"lamports": 88859014690252,
"owner": "11111111111111111111111111111111",
"rentEpoch": 18446744073709552000,
"space": 0
}
},
"id": 1
}
```
---
## getBalance
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBalance`
Returns the balance of the specified address in lamports.
## Parameters
- `address`: (string) _[required]_ - The `base-58` encoded public key of the account to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: (integer) _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - `null` when the account doesn't exist, or an object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - The balance of the account in lamports.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getBalance", "params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 1 },
"value": 0
},
"id": 1
}
```
---
## getBlock
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBlock`
Returns the identity and transaction information about a confirmed block.
## Parameters
- `slot`: (integer) _[required]_ - The slot number of the block to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `transactionDetails`: (string) _[optional]_ - The level of transaction details to include in the response. Possible values are:
- `none` - No transaction details.
- `accounts` - Transaction details only include signatures and an annotated list of accounts in each transaction.
- `signatures` - Only the signatures of the transactions.
- `full` - Full transaction details. This is the default option.
- `rewards`: (boolean) _[optional]_ - Whether to include rewards information in the response. The default is `false`.
- `encoding`: (string) _[optional]_ - The encoding format to use for the block data. Can be one
of `base58`, `base64`, `jsonParsed`, or `json`
- Returns the block data as a JSON object.
- `commitment`: (string) _[optional]_ The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `maxSupportedTransactionVersion`: (integer) _[optional]_ - The maximum supported transaction version to return.
If the requested block contains a transaction with a higher version, an error will be returned. If this parameter
is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt an error.
## Returns
`result` - `null` when the block doesn't exist, or an object with the following fields:
- `blockHeight` - The number of blocks before this block.
- `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch). It's `null` if not available.
- `blockhash` - The hash of the block encoded as a `base58` string.
- `parentSlot` - The slot index of this block's parent.
- `previousBlockhash` - The block hash of this block's parent encoded as `base58` string; if the parent block
is not available due to ledger cleanup, the field returns `11111111111111111111111111111111`.
- `transactions` - If full transaction details are requested, returns an array of JSON objects with the following fields:
- `meta` - The transaction status metadata object, which contains additional information about the block and its
transactions. The meta object can be `null`, or it may contain the following fields:
- `err` - Error code if the transaction failed, or `null` if the transaction succeeds.
- `fee` - The total fees paid by all transactions in the block encoded as `u64` integer.
- `innerInstructions` - An array of objects representing the inner instructions of all transactions in the
block (omitted if inner instruction recording is disabled). Each object has the following fields:
- `logMessages` - An array of strings containing any log messages generated by the block's transactions
(omitted if inner instruction recording is disabled).
- `postBalances` - An array of lamport balances for each account in the block after the transactions were processed.
- `postTokenBalances` - An array of token balances for each token account in the block after the transactions were
processed (omitted if inner instruction recording is disabled).
- `preBalances` - An array of lamport balances for each account in the block before the transactions were processed.
- `preTokenBalances` - An array of token balances for each token account in the block before the transactions were
processed (omitted if inner instruction recording is disabled).
- `rewards` - An object containing information about the rewards earned by the block's validators
(only present if the rewards are requested). It has the following fields:
- `pubkey` - The public key of the account that received the award encoded as a `base58` string.
- `lamports` - The number of reward lamports credited or debited by the account.
- `postBalance` - The account balance in lamports after the reward was applied.
- `rewardType` - The type of reward. It could be `fee`, `rent`, `voting`, or `staking`.
- `commission` - The vote account commission when the reward was credited, only present for voting and staking rewards.
- `status` - The status of the transaction. It returns `Ok` if the transaction was successful, and `Err`
if the transaction failed.
- `transaction` - The transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameter.
- `message` - An array of transactions objects included in the block:
- `accountKeys` - An array of public keys associated with the accounts that were accessed during
the execution of transactions in the block.
- `pubkey` - The public key associated with the block producer that created the block.
- `signer` - Indicates if the account is a required transaction signer. It can also be used to identify the signers
involved in the block's transactions and to verify the authenticity of the signatures.
- `source` - Identifies the accounts that provided the funds for the block's transactions.
- `writable` - A boolean value that indicates whether the accounts associated with the given public keys
were modified by the transactions or not.
- `instructions` - An array of instructions that were executed in the block's transactions
- `parsed` - An array of parsed instructions that were executed in the block's transactions
- `info` - An array of information objects that provide additional details about the transactions in the block.
- `clockSysvar` - Provides information about the current state of the blockchain.
- `slotHashesSysvar` - Provides information about the hashes of recent slots.
- `vote` - An array of vote accounts that were involved in the block's transactions.
- `hash` - The hash of the block. It can be used to uniquely identify the block and to verify the authenticity
of the block's contents.
- `slots` - An array of slot numbers that correspond to the transactions in the block.
- `timestamp` - The Unix timestamp of the block's creation.
- `voteAccount` - A vote account to identify the validator that produced the block and to verify the validity of their vote.
- `voteAuthority` - An authority associated with the vote account used to produce the block.
- `type` - The type of the block. It can be used to differentiate between regular blocks and special
blocks such as snapshot or transaction confirmation blocks.
- `program` - The data associated with the program that was executed in the block's transactions.
- `programId` - The public key of the program that was executed in the block's transactions.
- `stackHeight` - The current depth of the execution stack.
- `recentBlockhash` - The recent block hash for the account's cluster.
- `signatures` - The list of transaction signatures contained within a particular block.
- `version` - The transaction version. Returns `undefined` if` maxSupportedTransactionVersion` is not set in the requested parameters.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getBlock", "params": [333290000, {"encoding": "json", "maxSupportedTransactionVersion": 0, "transactionDetails": "full", "rewards": false}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"blockHeight": 359639279,
"blockTime": 1743651773,
"blockhash": "6m5rEYueCyWK54JQ9tNLJ7ZLMYQsQ5HFjySZgt2FjaV2",
"parentSlot": 371661599,
"previousBlockhash": "AGX8AvrjGJouXLwAoqEVLABfHMqeyGdVHw8zacsG4Dit",
"transactions": [
{
"meta": {
"computeUnitsConsumed": 2100,
"err": null,
"fee": 5000,
"innerInstructions": [],
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logMessages": [
"Program Vote111111111111111111111111111111111111111 invoke [1]",
"Program Vote111111111111111111111111111111111111111 success"
],
"postBalances": [
7221320288943,
10172781085509212,
1
],
"postTokenBalances": [],
"preBalances": [
7221320293943,
10172781085509212,
1
],
"preTokenBalances": [],
"rewards": null,
"status": {
"Ok": null
}
},
"transaction": {
"message": {
"accountKeys": [
"dv1ZAGvdsz5hHLwWXsVnM94hWf1pjbKVau1QVkaMJ92",
"5ZWgXcyqrrNpQHCme5SdC5hCeYb2o3fEJhF7Gok3bTVN",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 1,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 0],
"data": "67MGmzAKuQPwzeYjrCpiDrjsgJk2cKGAWHeYYXr5hJVLwo11193dCcRDeWHENT2mB8qxgRnFXXpyXdm2WR7c9R2Gdn1ZTJiC4s7voQNfLo5hEiGrHbW5C15Ru6W9zSx7tLJSBgdUVeeNa6cp3FhJtfA5vChhLo54eVuQERTEfU3YSaSRAyCciNpEXUVmiWtrVY9fDEznum",
"programIdIndex": 2,
"stackHeight": null
}
],
"recentBlockhash": "AGX8AvrjGJouXLwAoqEVLABfHMqeyGdVHw8zacsG4Dit"
},
"signatures": [
"4LYx3ESTTTiD3DSJ8TmDrEHQNEJHM9WWbKw4bz6GrguJ7Eon4MAepRWZZyaaJ57agxhss9HeaUhgXVurDCp3pi8H"
]
},
"version": "legacy"
...
}
]
},
"id": 1
}
```
---
## getBlockCommitment
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBlockCommitment`
Returns the commitment for a block identified by the given slot number.
## Parameters
`slot`: (integer) _[required]_ - The slot number of the block to query.
## Returns
`result` - An object with the following fields:
- `commitment` - The commitment values for the block. Returns either:
- `null` if the block is not found.
- Array of `u64` integers logging the amount of cluster stake in lamports that has voted on the
block at each depth from `0` to `MAX_LOCKOUT_HISTORY`.
- `totalStake` - The total number of lamports being used by validators to participate in the block production
and voting process
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getBlockCommitment", "params": [5]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"commitment": [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 10, 32
],
"totalStake": 42
},
"id": 1
}
```
---
## getBlockHeight
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBlockHeight`
Returns the current block height.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result`: (integer) - The current block height in `u64` format.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getBlockHeight", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": 359660979,
"id": 1
}
```
---
## getBlockProduction
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBlockProduction`
Returns recent block production information from the current or previous epoch.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `range`: (array) _[optional]_ - Slot range to return block production for. If not provided, defaults to current epoch.
- `firstSlot`: (integer) _[optional]_ - The first slot in the range.
- `lastSlot`: (integer) _[optional]_ - The last slot in the range.
- `identity`: (string) _[optional]_ - Only return results for this `base58` encoded validator identity.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object containing block production information:
- `byIdentity` - A dictionary of validator identities, as `base58` encoded strings. This is a two
element array containing the number of leader slots and the number of blocks produced.
- `range` - The block production slot range:
- `firstSlot` - The first slot of the block production information (inclusive).
- `lastSlot` - The last slot of the block production information (inclusive).
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getBlockProduction", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 371687291
},
"value": {
"byIdentity": {
"3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs": [
584,
584
],
...
"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB": [
40400,
40400
]
},
"range": {
"firstSlot": 371520000,
"lastSlot": 371687291
}
}
},
"id": 1
}
```
---
## getBlocks
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBlocks`
Returns a list of confirmed blocks between two given slots.
## Parameters
- `startSlot`: (integer) _[required]_ - The starting slot number for the range of blocks to query.
- `endSlot`: (integer) _[optional]_ - The ending slot number for the range of blocks to query.
Must be no more than 500,000 blocks higher than `startSlot`.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
## Returns
`result`: (integer) - An array of `u64` integers representing the block numbers within the specified range. If `endSlot` is not
provided, the method will return blocks starting from `startSlot` to the most recent block.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id":1, "method":"getBlocks", "params":[371661723, 371661733]}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":[371661723,371661724,371661725,371661726,371661727,371661728,371661729,371661730,371661731,371661732,371661733],
"id":1
}
```
---
## getBlocksWithLimit
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getBlocksWithLimit`
Returns a list of confirmed blocks starting at the given slot, up to the specified limit.
## Parameters
- `startSlot`: (integer) _[required]_ - The starting slot number for the range of blocks to query.
- `limit`: (integer) _[required]_ - The maximum number of confirmed blocks to return, starting from the specified slot.
Must be no more than 500,000 blocks higher than `startSlot`.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
## Returns
`result`: (integer) - An array of `u64` integers representing the block numbers from the `startSlot` up to the specified `limit`.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id":1, "method":"getBlocksWithLimit", "params":[371661723, 10]}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":[371661723,371661724,371661725,371661726,371661727,371661728,371661729,371661730,371661731,371661732],
"id":1
}
```
---
## getClusterNodes
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getClusterNodes`
Returns information about all the nodes participating in the cluster.
## Parameters
None
## Returns
`result`: An array of objects with the following fields:
- `featureSet` - The unique identifier of the node's feature set.
- `gossip` - The gossip network address for the node.
- `pubkey` - The public key of the node encoded as `base58` string.
- `rpc` -The IP address and port number of the node's JSON-RPC service. `nul`` if the JSON-RPC service is disabled.
- `shredVersion` - The version of the data structure used by this node to store and transmit blocks.
- `tpu` - The TPU network address for the node.
- `version` - The software version of the node. `null` if the version information is unavailable.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id":1, "method":"getClusterNodes"}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"featureSet": 3294202862,
"gossip": "208.91.107.3:8001",
"pubkey": "8GFyFHMa8oobGzK6Bab1qdExMqjvQoFeHYTpkfJiR8NH",
"pubsub": null,
"rpc": null,
"serveRepair": "208.91.107.3:8013",
"shredVersion": 2405,
"tpu": "208.91.107.3:8004",
"tpuForwards": "208.91.107.3:8005",
"tpuForwardsQuic": "208.91.107.3:8011",
"tpuQuic": "208.91.107.3:8010",
"tpuVote": "208.91.107.3:8006",
"tvu": "208.91.107.3:8002",
"version": "2.2.3"
},
...
],
"id": 1
}
```
---
## getEpochInfo
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getEpochInfo`
Returns information about the current epoch.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: (integer) _[optional]_ - The minimum slot to use for the query.
## Returns
`result`: An array of objects with the following fields:
- `absoluteSlot` - The current slot.
- `blockHeight` - The current block height.
- `epoch` - The current epoch.
- `slotIndex` - The current slot relative to the start of the current epoch.
- `slotsInEpoch` - The number of slots in this epoch.
- `transactionCount` The total number of transactions processed during the current epoch.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"absoluteSlot": 371857300,
"blockHeight": 359834889,
"epoch": 860,
"slotIndex": 337300,
"slotsInEpoch": 432000,
"transactionCount": 15448034599
},
"id": 1
}
```
---
## getEpochSchedule
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getEpochSchedule`
Returns epoch schedule information from the cluster's genesis configuration.
## Parameters
None
## Returns
`result` - An object with the following fields:
- `firstNormalEpoch` - The first normal length epoch. Calculated as `log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)`.
- `firstNormalSlot` - The slot number of the first normal slot. Calculated as `MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1)`.
- `leaderScheduleSlotOffset` - The number of slots before starting an epoch to calculate a leader schedule for that epoch.
- `slotsPerEpoch` - The maximum number of slots in each epoch.
- `warmup` - Whether epochs start shorter and grow in length. During warmup (`true`) the epoch schedule starts small and
gradually increases to ease the network into normal operation, whereas without warmup (`false`), epochs have a
consistent length from the start.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getEpochSchedule"}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"firstNormalEpoch": 0,
"firstNormalSlot": 0,
"leaderScheduleSlotOffset": 432000,
"slotsPerEpoch": 432000,
"warmup": false
},
"id": 1
}
```
---
## getFeeForMessage
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getFeeForMessage`
Returns the fee the network will charge for a specified message.
## Parameters
- `message`: (string) _[required]_ - The `base64` encoded transaction message.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: (integer) _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - `null` when the block doesn't exist, or an object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - `null`, or the fee for the specified message.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getFeeForMessage", "params": ["AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA", {"commitment": "processed"}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.1.11",
"slot": 320142245
},
"value": null
},
"id": 1
}
```
---
## getFirstAvailableBlock
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getFirstAvailableBlock`
Returns the slot of the lowest confirmed block that has not been purged from the ledger.
## Parameters
None
## Returns
`result`: (integer) - The slot of the lowest confirmed block as a 64-bit unsigned integer.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getFirstAvailableBlock"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":116113408,
"id":1
}
```
---
## getGenesisHash
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getGenesisHash`
Returns the genesis hash for the network.
## Parameters
None
## Returns
`result`: (string) - The hash encoded as a `base58` string.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getGenesisHash"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":"EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG",
"id":1
}
```
---
## getHealth
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getHealth`
Returns the health of the node.
## Parameters
None
## Returns
`result`: (string) - `Ok` if the node is healthy, or a JSON-RPC error response if the node is unhealthy.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getHealth"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": "ok",
"id":1
}
```
---
## getHighestSnapshotSlot
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getHighestSnapshotSlot`
Returns information for the highest slot that the node has a snapshot for.
This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the
full snapshot slot, if there is one.
## Parameters
None
## Returns
`result` - An object with the following fields:
- `full`: - The highest full snapshot slot encoded as a `u64` integer.
- `incremental`: The highest incremental snapshot slot derived from the full snapshot.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getHighestSnapshotSlot"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": {
"full":372722782,
"incremental":372732282
},
"id":1
}
```
---
## getIdentity
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getIdentity`
Returns the public key identity of the current node.
## Parameters
None
## Returns
`result` - An object with the following fields:
- `identity` - The public key identity as a `base58` encoded string.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getIdentity"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": {
"identity":"5UHT2MnFvARGe5mGbKZth5Yh546UWmPtucQYBGTYsi4n"
},
"id":1
}
```
---
## getInflationGovernor
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getInflationGovernor`
Returns the current inflation governor, which controls the inflation rate in the network.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result` - An object with the following fields:
- `foundation` - The proportion of total inflation allocated to the foundation.
- `foundationTerm` - The period in years during which the foundation allocation will be paid out.
- `initial` - The initial inflation percentage from time (`0`).
- `taper` - The period in years during which the inflation rate will gradually decrease from the
initial rate to the final rate.
- `terminal` - The terminal inflation percentage.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getInflationGovernor"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": {
"foundation":0.0,
"foundationTerm":0.0,
"initial":0.08,
"taper":0.15,
"terminal":0.015
},
"id":1
}
```
---
## getInflationRate
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getInflationRate`
Returns the specific inflation values for the current epoch.
## Parameters
None
## Returns
`result` - An object with the following fields:
- `epoch` - The epoch during which these values remain valid.
- `foundation` - The proportion of total inflation allocated to the foundation.
- `total` - The total inflation.
- `validator` - The portion of inflation designated for validators.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getInflationRate"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": {
"epoch":862,
"foundation":0.0,
"total":0.0385971617307845,
"validator":0.0385971617307845
},
"id":1
}
```
---
## getInflationReward
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getInflationReward`
Returns the inflation (staking) rewards for a list of addresses for an epoch.
## Parameters
- `array`: (string) _[requiredl]_ - An array of `base58` encoded addresses to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `epoch`: (integer) _[optional]_ - The epoch for which to query the rewards. If not specified, the current epoch is used.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - An object with the following fields:
- `epoch` - The epoch during which the reward was received.
- `effectiveSlot` - The slot at which the rewards become active.
- `amount` - The reward value in lamports.
- `postBalance` - The account balance after the transaction in lamports.
- `commission` - The commission rate of the vote account at the time the reward was credited.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method": "getInflationReward", "params": [["6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu", "BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"], {"epoch": 2}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"epoch": 2,
"effectiveSlot": 224,
"amount": 2500,
"postBalance": 499999442500
},
null
],
"id": 1
}
```
---
## getLargestAccounts
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getLargestAccounts`
Returns the 20 largest accounts, by lamport balance. Results may be cached up to two hours.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `filter`: (string) _[optional]_ - Filters results by account type. Supported options are `circulating` and `nonCirculating`.
## Returns
`result` - `null` when the account doesn't exist, or an object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object containing the following keys:
- `address` - The `base58` encoded account address.
- `lamports` - The number of lamports in the account.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method": "getLargestAccounts", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 54 },
"value": [
{
"address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ",
"lamports": 999974
},
{
"address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL",
"lamports": 42
}
]
},
"id": 1
}
```
---
## getLatestBlockhash
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getLatestBlockhash`
Returns the latest block hash.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object containing the following keys:
- `blockhash` - The `base58` encoded block hash.
- `lastValidBlockHeight` - The last block height at which the block hash will be valid.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method": "getLatestBlockhash", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 372758352
},
"value": {
"blockhash": "4zuGA4EyEjaN25qMVnwwij4UMRWcmEpFn1txrzMMk5xw",
"lastValidBlockHeight": 360735720
}
},
"id": 1
}
```
---
## getLeaderSchedule
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getLeaderSchedule`
Returns the leader schedule for an epoch.
## Parameters
- `slot`: (integer) _[optional]_ - The slot number to query. The method returns the leader schedule
for the epoch that corresponds to the provided slot. If unspecified, returns the leader schedule for
the current epoch.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `identity`: (string) _[optional]_ - Only return results for this `base58` encoded validator identity.
## Returns
`result` - `null` if the requested epoch is not found; otherwise, an object of `base58` encoded validator
identities, and their corresponding leader slot indices as values (indices are relative to the first slot in the requested epoch).
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"getLeaderSchedule", "params":[{"identity":"3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs"}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs": [
2816,
2817,
2818,
...
430998,
430999
]
},
"id": 1
}
```
---
## getMaxRetransmitSlot
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getMaxRetransmitSlot`
Get the highest slot that the node has processed and retransmitted.
## Parameters
None
## Returns
`result` - The slot number as a 64-bit unsigned integer.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getMaxRetransmitSlot"}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": 372797611,
"id": 1
}
```
---
## getMaxShredInsertSlot
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getMaxShredInsertSlot`
Get the maximum slot visible from after the shred insert.
## Parameters
None
## Returns
`result` - The slot number as a 64-bit unsigned integer.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getMaxShredInsertSlot"}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result":372942171,
"id": 1
}
```
---
## getMinimumBalanceForRentExemption
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getMinimumBalanceForRentExemption`
Returns the minimum balance (in lamports) required to make an account exempt from rent.
## Parameters
- `usize`: (integer) _[required]_ - The account's data length.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result` - The minimum lamports required in an account to remain rent free.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"getMinimumBalanceForRentExemption", "params":[60]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result":1308480,
"id": 1
}
```
---
## getMultipleAccounts
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getMultipleAccounts`
Returns information associated with a list of accounts.
## Parameters
- `array`: (string) _[required]_ - An array of `base58` encoded account public keys to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
or `jsonParsed`
- `dataSlice`: (object) _[optional]_ - A slice of the account data to return. Only available for `base58`, `base64`,
or `base64+zstd` encoding. This is an object with two properties:
- `offset` - The starting byte offset of the slice.
- `length` - The length of the slice in bytes.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - List of account objects. Returns `null` if the account doesn't exist, or an object containing
the following keys for the requested account:
- `data` - The account data, encoded in the specified format.
- `executable` - A boolean indicating whether the account is executable.
- `lamports` - The number of lamports in the account.
- `owner` - The public key of the program that owns the account.
- `rentEpoch` - The epoch in which the account will next be due for rent.
- `space` - The size of the account data in bytes.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getMultipleAccounts", "params": [["7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy", "ANVUJaJoVaJZELtV2AvRp7V5qPV1B84o29zAwDhPj1c2"], {"encoding": "base58"}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 372957980
},
"value": [
{
"data": [
"",
"base58"
],
"executable": false,
"lamports": 6000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 18446744073709552000,
"space": 0
},
{
"data": [
"",
"base58"
],
"executable": false,
"lamports": 3248020787,
"owner": "11111111111111111111111111111111",
"rentEpoch": 18446744073709552000,
"space": 0
}
]
},
"id": 1
}
```
---
## getProgramAccounts
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getProgramAccounts`
Returns all accounts owned by the provided program public key.
## Parameters
- `address`: (string) _[required]_ - The `base-58` encoded public key of the program to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
or `jsonParsed`
- `dataSlice`: (object) _[optional]_ - A slice of the account data to return. Only available for `base58`, `base64`,
or `base64+zstd` encoding. This is an object with two properties:
- `offset` - The starting byte offset of the slice.
- `length` - The length of the slice in bytes.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
- `withContext`: (boolean). Wraps the result in a JSON object.
- `filters` - Filter results using an array of up to 4 filter objects.
## Returns
`result` - An object with the following fields:
- `pubkey` - The public key of the node encoded as `base58` string.
- `account` - An object with the following fields:
- `data` - The account data, encoded in the specified format.
- `executable` - A boolean indicating whether the account is executable.
- `lamports` - The number of lamports assigned to the account.
- `owner` - The public key of the program that owns the account.
- `rentEpoch` - The epoch in which the account will next be due for rent.
- `space` - The size of the account data in bytes.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getProgramAccounts", "params": ["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", {"filters": [{"dataSize": 17}, {"memcmp": {"offset": 4, "bytes": "3Mc6vR"}}]}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"account": {
"data": "2R9jLfiAQ9bgdcw6h8s44439",
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28,
"space": 42
},
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
}
],
"id": 1
}
```
---
## getRecentPerformanceSamples
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getRecentPerformanceSamples`
Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds
and include the number of transactions and slots that occur in a given time window.
## Parameters
- `limit`: (integer) - The number of samples to return (maximum 720).
## Returns
`result` - An object with the following fields:
- `numNonVoteTransactions` - The number of non-vote transactions during the specified sample period.
- `numSlots` - The number of slots in the sample.
- `numTransactions` - The number of transactions in the sample.
- `samplePeriodSecs` - The number of seconds in the sample window.
- `slot` - The slot in which the sample was taken at.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"getRecentPerformanceSamples", "params": [4]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"numNonVoteTransactions": 4255,
"numSlots": 156,
"numTransactions": 6751,
"samplePeriodSecs": 60,
"slot": 372969680
},
{
"numNonVoteTransactions": 5486,
"numSlots": 156,
"numTransactions": 7980,
"samplePeriodSecs": 60,
"slot": 372969524
},
{
"numNonVoteTransactions": 4069,
"numSlots": 154,
"numTransactions": 6532,
"samplePeriodSecs": 60,
"slot": 372969368
},
{
"numNonVoteTransactions": 3760,
"numSlots": 155,
"numTransactions": 6224,
"samplePeriodSecs": 60,
"slot": 372969214
}
],
"id": 1
}
```
---
## getRecentPrioritizationFees
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getRecentPrioritizationFees`
Returns a list of prioritization fees from recent blocks.
## Parameters
- `address`: (array) _[optional]_ - Array of account addresses (up to a maximum of 128 addresses), as `base58` encoded strings.
## Returns
`result` - An array of objects with the following fields:
- `prioritizationFee` - The prioritization fee value.
- `slot` - The slot number associated with the prioritization fee.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"getRecentPrioritizationFees", "params": [["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"prioritizationFee": 0,
"slot": 372976610
},
...
{
"prioritizationFee": 0,
"slot": 372976759
}
],
"id": 1
}
```
---
## getSignaturesForAddress
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getSignaturesForAddress`
Returns signatures for confirmed transactions that include the specified address in the `accountKeys` list.
Results are returned in reverse chronological order, starting from the provided signature or the most recent confirmed block.
## Parameters
- `address`: (string) _[required]_ - The `base-58` encoded public key of the account to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
- `limit`: (number) _[optional]_ - The maximum number of signatures to return (between `1` and `1000`).
The default is `1000`.
- `before`: (string) _[optional]_ - Starts searching backward from the specified transaction signature.
If not provided, the search begins from the most recent confirmed block.
- `until`: (string) _[optional]_ - The signature to end the query at (if found before reaching `limit`).
## Returns
`result` - An object with the following fields:
- `blockTime` - The estimated production time, as Unix timestamp (seconds since the Unix epoch). `null` if not available.
- `confirmationStatus` - The transaction's cluster confirmation status. The status can be `processed`, `confirmed`, or `finalized`.
- `err` - Error code if the transaction failed, or `null` if the transaction succeeds.
- `memo` - The memo associated with the transaction, or `null` if no memo is present.
- `signature` - The `base58` encoded signature of the transaction.
- `slot` - The slot number in which the transaction was confirmed.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": ["Vote111111111111111111111111111111111111111", {"limit": 1}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
{
"blockTime": 1744177112,
"confirmationStatus": "finalized",
"err": null,
"memo": null,
"signature": "2QYQGurkeT9CwdMTnMNTETbqwU4NiLoB8kqA4KxVUu4vV1BWxw79YfzWAWpPduqA2zmxgbunyrPZtCbDR7LCmTZr",
"slot": 373019515
}
],
"id": 1
}
```
---
## getSignatureStatuses
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getSignatureStatuses`
Returns the statuses of a list of signatures. Unless the `searchTransactionHistory` configuration parameter
is included, this method only searches the recent status cache of signatures, which retains statuses for
all active slots plus `MAX_RECENT_BLOCKHASHES` rooted slots.
## Parameters
- `txSignatures`: (array of strings) _[required]_ - An array of `base58` encoded transaction signatures to confirm.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `searchTransactionHistory`: boolean - If `true`, the search includes the entire transaction
history. If `false`, the search only includes recent transactions in the latest confirmed block.
The default is `false`.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An array of objects containing the following keys, or `null` if the signature is not found:
- `confirmationStatus` - The transaction's cluster confirmation status. It can either be `processed`, `confirmed`, or `finalized`.
- `confirmations` - The number of confirmations a transaction has received. If the transaction is
`finalized` (confirmed at the highest level of commitment), the value will be `null`.
- `err` - Error code if the transaction failed, or `null` if the transaction succeeds.
- `slot` - The slot number in which the transaction was confirmed.
- `status` - The processing status of the transaction. It returns `Ok` if the transaction was successful
and `Err` if the transaction failed.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getSignatureStatuses", "params": [["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"], {"searchTransactionHistory": true}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 373170033
},
"value": [null]
},
"id": 1
}
```
---
## getSlot
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getSlot`
Returns the latest slot that has reached the commitment level.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result`: (integer) - The current slot.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getSlot", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result":373175194,
"id": 1
}
```
---
## getSlotLeader
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getSlotLeader`
Returns the current slot leader.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result`: (string) - The slot leader's `base58` encoded public key address.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getSlotLeader", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result":"dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
"id": 1
}
```
---
## getSlotLeaders
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getSlotLeaders`
Returns the slot leaders for a given slot range.
## Parameters
- `startSlot`: (integer) _[required]_ - The starting slot number for the query.`
- `limit`: (integer) _[required]_ - The maximum number of slot leaders to return (`1` to `5000`).
## Returns
`result`: (array of strings) - An array of `base58` encoded public key addresses identifying the slot leaders.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getSlotLeaders", "params": [373184397, 5]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": [
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS",
"dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV",
"dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV"
],
"id": 1
}
```
---
## getStakeMinimumDelegation
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getStakeMinimumDelegation`
Returns the minimum number of lamports required to delegate a stake account.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - The minimum number of lamports required to delegate a stake account.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","id":1,"method":"getStakeMinimumDelegation","params":[]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 373193193
},
"value": 1
},
"id": 1
}
```
---
## getSupply
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getSupply`
Returns information about the current token supply.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `total` - The total supply of lamports in the network.
- `circulating` - The circulating supply of lamports in the network.
- `nonCirculating` - The non-circulating supply of lamports in the network.
- `nonCirculatingAccounts` - An array of account addresses that hold non-circulating lamports.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getSupply", "params": []}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.2.3",
"slot": 373204187
},
"value": {
"circulating": 967687939079885400,
"nonCirculating": 315864946585692700,
"nonCirculatingAccounts": [
"Bzr4raUumaTNeqhMjvWYaF2Zm2gQwgFCDbVwcCNjNcT8",
"9NFMpkv65d2G7UMMFYHeXrBAaB6rVD3BgQ95bKiwr448",
...
"3RQvfXbzQQBT4PymcwrBPtSLVuEpK79NuPAt8k4PhrXe"
],
"total": 1283552885665578200
}
},
"id": 1
}
```
---
## getTokenAccountBalance
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTokenAccountBalance`
Returns the token balance of an SPL token account.
## Parameters
- `address`: (string) _[required]_ - The `base-58` encoded public key of the token account to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result` - An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `amount` - The raw total token supply without decimals, a string representation of a 64-bit unsigned integer.
- `decimals` - An integer value representing the number of decimal places used by the token.
- `uiAmount` - Deprecated. The total token supply using mint-prescribed decimals.
- `uiAmountString` - The total token supply as a string using mint-prescribed decimals.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getTokenAccountBalance", "params": ["3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa"]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.1.16",
"slot": 332462945
},
"value": {
"amount": "344068629195906",
"decimals": 6,
"uiAmount": 344068629.195906,
"uiAmountString": "344068629.195906"
}
},
"id": 1
}
```
---
## getTokenAccountsByDelegate
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTokenAccountsByDelegate`
Retrieves all SPL token accounts for which a specified delegate has been approved.
## Parameters
- `address`: (string) _[required]_ - The `base58` encoded public key of the delegate account to query.
- `accountDetails`: (object) _[required]_ - An object containing one the following fields:
- `mint`: (string) _[optional]_ - The `base58` encoded public key of the mint account.
- `programId`: (string) _[optional]_ - The `base58` encoded public key of the token program that owns the account.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
or `jsonParsed`
- `dataSlice`: (object) _[optional]_ - A slice of the account data to return. Only available for `base58`, `base64`,
or `base64+zstd` encoding. This is an object with two properties:
- `offset` - The starting byte offset of the slice.
- `length` - The length of the slice in bytes.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - An array of objects with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `pubkey` - The `base58` encoded public key of the token account.
- `account` - An object containing the address used to store assets:
- `data` - An object containing token state data associated with the account, either as
encoded binary data or in JSON format:
- `program` The program that manages the token.
- `parsed` - An array of parsed instructions that were executed in the block's transactions:
- `info` - An array of objects that provide additional details about the transactions in the block:
- `tokenAmount` - The balance of the token in the token account.
- `amount` - The raw total token supply without decimals, a string representation of a u64 integer.
- `decimals` - An integer value representing the number of decimal places used by the token.
- `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED).
- `uiAmountString` - The total token supply as a string using mint-prescribed decimals.
- `isNative` - A boolean value indicating whether the token is a native token of the Solana blockchain.
- `mint` - Provides information about the creation of new tokens.
- `owner` - The base-58 encoded Pubkey of the program this account has been assigned to.
- `state` - The current state of the token account.
- `type` - The type of the block. It can be used to differentiate between regular blocks and special blocks such as snapshot or transaction confirmation blocks.
- `space` - The amount of storage space required to store the token account.
- `executable` - A boolean indicating whether the account is executable.
- `lamports` - The number of lamports in the account.
- `owner` - The public key of the program that owns the account.
- `rentEpoch` - The epoch in which the account will next be due for rent.
- `space` - The size of the account data in bytes.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByDelegate", "params": ["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", {"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"}, {"encoding": "jsonParsed"}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 1114 },
"value": [
{
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp",
"account": {
"data": {
"program": "spl-token",
"parsed": {
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4,
"space": 165
}
}
]
},
"id": 1
}
```
---
## getTokenAccountsByOwner
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTokenAccountsByOwner`
Retrieves all SPL token accounts for the specified token owner.
## Parameters
- `address`: (string) _[required]_ - The `base58` encoded public key of the account owner to query.
- `accountDetails`: (object) _[required]_ - An object containing one the following fields:
- `mint`: (string) _[optional]_ - The `base58` encoded public key of the mint account.
- `programId`: (string) _[optional]_ - The `base58` encoded public key of the token program that owns the account.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
or `jsonParsed`
- `dataSlice`: (object) _[optional]_ - A slice of the account data to return. Only available for `base58`, `base64`,
or `base64+zstd` encoding. This is an object with two properties:
- `offset` - The starting byte offset of the slice.
- `length` - The length of the slice in bytes.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - An array of objects with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `pubkey` - The `base58` encoded public key of the account.
- `account` - An object containing the address used to store assets:
- `data` - An object containing state data associated with the account, either as
encoded binary data or in JSON format:
- `program` The program that manages the token.
- `parsed` - An array of parsed instructions that were executed in the block's transactions:
- `info` - An array of objects that provide additional details about the transactions in the block:
- `tokenAmount` - The balance of the token in the account.
- `amount` - The raw total token supply without decimals, a string representation of a u64 integer.
- `decimals` - An integer value representing the number of decimal places used by the token.
- `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED).
- `uiAmountString` - The total token supply as a string using mint-prescribed decimals.
- `delegate` - The public address of the delegate from which the account tokens are to be retrieved encoded as base-58 string.
- `delegateAmount` The configuration object with the following fields:
- `amount` - The raw total token supply without decimals, a string representation of a u64 integer.
- `decimals` - An integer value representing the number of decimal places used by the token.
- `uiAmount` - The total token supply using mint-prescribed decimals (DEPRECATED).
- `uiAmountString` - The total token supply as a string using mint-prescribed decimals.
- `isNative` - A boolean value indicating whether the token is a native token of the Solana blockchain.
- `mint` - Provides information about the creation of new tokens.
- `owner` - The base-58 encoded Pubkey of the program this account has been assigned to.
- `state` - The current state of the token account.
- `type` - The type of the block. It can be used to differentiate between regular blocks and special blocks such as snapshot or transaction confirmation blocks.
- `space` - The amount of storage space required to store the token account.
- `executable` - A boolean indicating whether the account is executable.
- `lamports` - The number of lamports in the account.
- `owner` - The public key of the program that owns the account.
- `rentEpoch` - The epoch in which the account will next be due for rent.
- `space` - The size of the account data in bytes.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByOwner", "params": ["A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd", {"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"}, {"encoding": "jsonParsed"}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": { "apiVersion": "2.0.15", "slot": 341197933 },
"value": [
{
"pubkey": "BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA",
"account": {
"data": {
"program": "spl-token",
"parsed": {
"info": {
"isNative": false,
"mint": "2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR",
"owner": "A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
"state": "initialized",
"tokenAmount": {
"amount": "420000000000000",
"decimals": 6,
"uiAmount": 420000000.0,
"uiAmountString": "420000000"
}
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 18446744073709551615,
"space": 165
}
}
]
},
"id": 1
}
```
---
## getTokenLargestAccounts
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTokenLargestAccounts`
Returns the 20 largest accounts holding a specified SPL token type.
## Parameters
- `address`: (string) _[required]_ - The `base58` encoded public key of the token mint to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result` - An array of objects with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `address` - The address of the token account.
- `amount` - The raw total token supply without decimals, a string representation of a `u64` integer.
- `decimals` - An integer value representing the number of decimal places used by the token.
- `uiAmount` - Deprecated. The total token supply using mint-prescribed decimals.
- `uiAmountString` - The total token supply as a string using mint-prescribed decimals.
## Example
Replace `` with your API key.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"getTokenLargestAccounts", "params": ["1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.1.16",
"slot": 332646796
},
"value": [
{
"address": "GFpkRJXUBNDWXENKAJ1dkYq4kYpHyNmgbifZbHsXXz4x",
"amount": "12",
"decimals": 0,
"uiAmount": 12,
"uiAmountString": "12"
},
...
{
"address": "GrxprwFYdFV4kdHjQDTWsdDFn9KtFn1p35rSZYDFgMkD",
"amount": "3",
"decimals": 0,
"uiAmount": 3,
"uiAmountString": "3"
}
]
},
"id": 1
}
```
---
## getTokenSupply
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTokenSupply`
Returns the total supply of an SPL token.
## Parameters
- `pubKey`: (string) _[required]_ - The `base58` encoded public key of the token mint.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
## Returns
`result`- An object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `amount` - The raw total token supply without decimals, a string representation of a `u64` integer.
- `decimals` - An integer value representing the number of decimal places used by the token.
- `uiAmount` - Deprecated. The total token supply using mint-prescribed decimals.
- `uiAmountString` - The total token supply as a string using mint-prescribed decimals.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"getTokenSupply", "params": ["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "2.1.16",
"slot": 332678924
},
"value": {
"amount": "5736490108605186363",
"decimals": 9,
"uiAmount": 5736490108.605186,
"uiAmountString": "5736490108.605186363"
}
},
"id": 1
}
```
---
## getTransaction
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTransaction`
Returns transaction details for a confirmed transaction.
## Parameters
- `address`: (string) _[required]_ - The `base58` encoded program public key.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `maxSupportedTransactionVersion`: (integer) _[optional]_ - The maximum supported transaction version to return.
If the requested transaction contains a transaction with a higher version, an error will be returned. If this parameter
is omitted, only legacy transactions will be returned, and any versioned transaction will return an error.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `json`, and `jsonParsed`. The
default is `json`.
## Returns
`result`- `null` if the transaction is not found or not confirmed, otherwise returns an object containing:
- `slot` - The slot this transaction was processed in.
- `blockTime` - The block time of the transaction as Unix timestamp (seconds since the Unix epoch). `null` if not available.
- `meta` - The transaction status metadata object, which contains additional information about the block and its
transactions. The meta object can be `null`, or it may contain the following fields:
- `err` - Error code if the transaction failed, or `null` if the transaction succeeds.
- `fee` - The total fees paid by all transactions in the block encoded as `u64` integer.
- `innerInstructions` - An array of objects representing the inner instructions of all transactions in the
block (omitted if inner instruction recording is disabled). Each object has the following fields:
- `logMessages` - An array of strings containing any log messages generated by the block's transactions
(omitted if inner instruction recording is disabled).
- `postBalances` - An array of lamport balances for each account in the block after the transactions were processed.
- `postTokenBalances` - An array of token balances for each token account in the block after the transactions were
processed (omitted if inner instruction recording is disabled):
- `accountIndex` - The index of an account within a transaction.
- `mint` - The mint address of the token.
- `owner` - The `base58` encoded public key of the program this account has been assigned to.
- `uiTokenAmount` - The amount of a token transfer.
- `amount` - The amount of the token transferred.
- `decimals` - The number of decimal places used by the token.
- `uiAmount` - The amount of the token transferred in the smallest unit of the token.
- `uiAmountString` - The amount of the token transferred with the appropriate number of decimal places for the token.
- `preBalances` - An array of lamport balances for each account in the block before the transactions were processed.
- `preTokenBalances` - An array of token balances for each token account in the block before the transactions were
processed (omitted if inner instruction recording is disabled):
- `accountIndex` - The index of an account within a transaction.
- `mint` - The mint address of the token.
- `owner` - The `base58` encoded public key of the program this account has been assigned to.
- `uiTokenAmount` - The amount of a token transfer.
- `amount` - The amount of the token transferred.
- `decimals` - The number of decimal places used by the token.
- `uiAmount` - The amount of the token transferred in the smallest unit of the token.
- `uiAmountString` - The amount of the token transferred with the appropriate number of decimal places for the token.
- `rewards` - An object containing information about the rewards earned by the block's validators
(only present if the rewards are requested). It has the following fields:
- `pubkey` - The public key of the account that received the award encoded as a `base58` string.
- `lamports` - The number of reward lamports credited or debited by the account.
- `postBalance` - The account balance in lamports after the reward was applied.
- `rewardType` - The type of reward. It could be `fee`, `rent`, `voting`, or `staking`.
- `commission` - The vote account commission when the reward was credited, only present for voting and staking rewards.
- `status` - The status of the transaction. It returns `Ok` if the transaction was successful, and `Err`
if the transaction failed.
- `transaction` - The transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameter.
- `message` - An array of transaction objects included in the block:
- `accountKeys` - An array of public keys associated with the accounts that were accessed during
the execution of transactions in the block.
- `pubkey` - The public key associated with the block producer that created the block.
- `signer` - Indicates if the account is a required transaction signer. It can also be used to identify the signers
involved in the block's transactions and to verify the authenticity of the signatures.
- `source` - Identifies the accounts that provided the funds for the block's transactions.
- `writable` - A boolean value that indicates whether the accounts associated with the given public keys
were modified by the transactions or not.
- `instructions` - An array of instructions that were executed in the block's transactions
- `parsed` - An array of parsed instructions that were executed in the block's transactions
- `info` - An array of information objects that provide additional details about the transactions in the block.
- `clockSysvar` - Provides information about the current state of the blockchain.
- `slotHashesSysvar` - Provides information about the hashes of recent slots.
- `vote` - An array of vote accounts that were involved in the block's transactions.
- `hash` - The hash of the block. It can be used to uniquely identify the block and to verify the authenticity
of the block's contents.
- `slots` - An array of slot numbers that correspond to the transactions in the block.
- `timestamp` - The Unix timestamp of the block's creation.
- `voteAccount` - A vote account to identify the validator that produced the block and to verify the validity of their vote.
- `voteAuthority` - An authority associated with the vote account used to produce the block.
- `type` - The type of the block. It can be used to differentiate between regular blocks and special
blocks such as snapshot or transaction confirmation blocks.
- `program` - The data associated with the program that was executed in the block's transactions.
- `programId` - The public key of the program that was executed in the block's transactions.
- `stackHeight` - The current depth of the execution stack.
- `recentBlockhash` - The recent block hash for the account's cluster.
- `signatures` - The list of transaction signatures contained within a particular block.
- `version` - The version of the transaction. Returns `undefined` if `maxSupportedTransactionVersion` is not specified in the request.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["bVwuWqLs5wbHMHMavFfpK6zrg3mGY6AWVTNgdeDuWi1PxmFgvQYQJBMMcYp16fmJE9hwg4nNjDFok4rxmxQ6j5e",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"blockTime": 1744593547,
"meta": {
"computeUnitsConsumed": 52018,
"err": null,
"fee": 10000,
"innerInstructions": [
{
"index": 2,
"instructions": [
{
"parsed": {
"info": {
"authority": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"destination": "EXp2FCTRX9tPyyjLneE7K6YRgh9qpqKnQLecXdRFMQFL",
"mint": "So11111111111111111111111111111111111111112",
"source": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
"tokenAmount": {
"amount": "10",
"decimals": 9,
"uiAmount": 1e-8,
"uiAmountString": "0.00000001"
}
},
"type": "transferChecked"
},
"program": "spl-token",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"stackHeight": 2
},
{
"parsed": {
"info": {
"authority": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
"destination": "HTADwVNDuSxnzYyuwhfNyZAkaVCABnbNFZzEdcR35idy",
"mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"source": "CPg85jShyN1Tez437qgR1jYbF43i8aWhTMWpbPCJoJqE",
"tokenAmount": {
"amount": "2583",
"decimals": 6,
"uiAmount": 0.002583,
"uiAmountString": "0.002583"
}
},
"type": "transferChecked"
},
"program": "spl-token",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"stackHeight": 2
}
]
}
],
"logMessages": [
"Program 11111111111111111111111111111111 invoke [1]",
"Program 11111111111111111111111111111111 success",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
...
"Program 11111111111111111111111111111111 success"
],
"postBalances": [
1160000,
10799119391,
...
5888160
],
"postTokenBalances": [
{
"accountIndex": 3,
"mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"uiTokenAmount": {
"amount": "173576140",
"decimals": 6,
"uiAmount": 173.57614,
"uiAmountString": "173.57614"
}
},
{
"accountIndex": 12,
"mint": "So11111111111111111111111111111111111111112",
"owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "700864692413",
"decimals": 9,
"uiAmount": 700.864692413,
"uiAmountString": "700.864692413"
}
},
{
"accountIndex": 13,
"mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"uiTokenAmount": {
"amount": "201175021191002",
"decimals": 6,
"uiAmount": 201175021.191002,
"uiAmountString": "201175021.191002"
}
}
],
"preBalances": [
1170000,
10799139401,
...
5888160
],
"preTokenBalances": [
{
"accountIndex": 3,
"mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"uiTokenAmount": {
"amount": "173573816",
"decimals": 6,
"uiAmount": 173.573816,
"uiAmountString": "173.573816"
}
},
{
"accountIndex": 12,
"mint": "So11111111111111111111111111111111111111112",
"owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "700864692403",
"decimals": 9,
"uiAmount": 700.864692403,
"uiAmountString": "700.864692403"
}
},
{
"accountIndex": 13,
"mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"uiTokenAmount": {
"amount": "201175021193585",
"decimals": 6,
"uiAmount": 201175021.193585,
"uiAmountString": "201175021.193585"
}
}
],
"rewards": [],
"status": {
"Ok": null
}
},
"slot": 333307946,
"transaction": {
"message": {
"accountKeys": [
{
"pubkey": "AgkMbKTWCuiAaJ262TdpXhuMPvWa21GJmAmZfo6gLEPF",
"signer": true,
"source": "transaction",
"writable": true
},
...
{
"pubkey": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"signer": false,
"source": "lookupTable",
"writable": false
}
],
"addressTableLookups": [
{
"accountKey": "CadRirmkx2CeeLd9LUtvF7D53822vrSt8PQULewPLm28",
"readonlyIndexes": [
2,
0,
5,
4
],
"writableIndexes": [
1,
9,
10
]
}
],
"instructions": [
{
"parsed": {
"info": {
"base": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"lamports": 2039290,
"newAccount": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"seed": "3JgKrBB3sagy1HMXai5hKbRnsuZZDudR",
"source": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"space": 165
},
"type": "createAccountWithSeed"
},
"program": "system",
"programId": "11111111111111111111111111111111",
"stackHeight": null
},
{
"parsed": {
"info": {
"account": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
"mint": "So11111111111111111111111111111111111111112",
"owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"rentSysvar": "SysvarRent111111111111111111111111111111111"
},
"type": "initializeAccount"
},
"program": "spl-token",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"stackHeight": null
},
{
"accounts": [
"6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
"D4FPEruKEHrG5TenZ2mpDGEfu1iUvTiqBxvpU8HLBvC2",
"CLhjQNAdhn6qZiCpDmiQFVNrhfMumDGEGMBrnVmk7wTR",
"GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
"HTADwVNDuSxnzYyuwhfNyZAkaVCABnbNFZzEdcR35idy",
"EXp2FCTRX9tPyyjLneE7K6YRgh9qpqKnQLecXdRFMQFL",
"CPg85jShyN1Tez437qgR1jYbF43i8aWhTMWpbPCJoJqE",
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"So11111111111111111111111111111111111111112",
"EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
"d2jwtX1E47jw4EwxPK9VSVCmQsQpu4tzniNkzk43rF3"
],
"data": "E73fXHPWvSR1nM1Tw5ZRioYHwnqN3caKH",
"programId": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C",
"stackHeight": null
},
{
"parsed": {
"info": {
"account": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
"destination": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
"owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA"
},
"type": "closeAccount"
},
"program": "spl-token",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"stackHeight": null
},
{
"parsed": {
"info": {
"destination": "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
"lamports": 20000,
"source": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA"
},
"type": "transfer"
},
"program": "system",
"programId": "11111111111111111111111111111111",
"stackHeight": null
}
],
"recentBlockhash": "BRRXvTHndixZBzAacVfLkCfXX8X4jzrWdd9WKKsmTKG3"
},
"signatures": [
"bVwuWqLs5wbHMHMavFfpK6zrg3mGY6AWVTNgdeDuWi1PxmFgvQYQJBMMcYp16fmJE9hwg4nNjDFok4rxmxQ6j5e",
"3mSzNawWNP75KjSH3yyLyydBWaeEV7nJsWNHzJy5ThN4h2sv1vBbygwbLeRFU9zuoeBDVfqdU1tPpH2G9m8eFUFp"
]
},
"version": 0
},
"id": 1
}
```
---
## getTransactionCount
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getTransactionCount`
Returns the current transaction count from the ledger.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: (integer) _[optional]_ - The minimum slot to use for the query.
## Returns
`result` (integer): The current transaction count.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":394414196266,
"id":1
}
```
---
## getVersion
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getVersion`
Returns the Solana version running on the node.
## Parameters
None
## Returns
`result` - An object with the following fields:
- `solana-core` - The version of the Solana core software.
- `feature-set` - ID of the software's feature set.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getVersion"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": {
"feature-set":3271415109,
"solana-core":"2.1.16"
},
"id":1
}
```
---
## getVoteAccounts
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `getVoteAccounts`
Returns the account info and associated stake for all the voting accounts in the current bank.
## Parameters
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `votePubkey`: (string) _[optional]_ - The `base58` encoded public key of the validator vote account to return results for.
- `keepUnstakedDelinquents`: (boolean) _[optional]_ - If `true`, the response includes all delinquent
accounts, even if they are not staked.
- `delinquentSlotDistance`: (integer) _[optional]_ - The number of slots that a validator must be behind to be considered delinquent.
It's not recommended to specify this parameter.
## Returns
`result` - An object of current and delinquent voting accounts with the following fields:
- `current` - An array of objects with the following fields:
- `activatedStake` - The amount of stake in lamports delegated to this vote account.
- `commission` - The commission rate for the validator as a percentage (0 - 100).
- `epochCredits` - An array of arrays containing the epoch, credits earned, and previous credits earned.
- `epochVoteAccount` - A boolean indicating if the account is staked for the current epoch.
- `lastVote` - The most recent slot voted on by this vote account.
- `nodePubkey` - The public key of the validator.
- `rootSlot` - The root slot number.
- `votePubkey` - The public key of the vote account.
- `delinquent` - An array of objects with the same fields as `current`, but for delinquent accounts.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"current": [
{
"activatedStake": 21728348612276,
"commission": 0,
"epochCredits": [
[
767,
552326409,
545429728
],
[
768,
559219285,
552326409
],
[
769,
566108108,
559219285
],
[
770,
573001980,
566108108
],
[
771,
577049781,
573001980
]
],
"epochVoteAccount": true,
"lastVote": 333325355,
"nodePubkey": "W1FAbXyQJ5iPghy12TqPktwobU5kTD73ZjA6QZCvsRp",
"rootSlot": 333325324,
"votePubkey": "DXjujkbMhAvkaygmjLbi7UGdovAs2AU6y45UMEqxhEnw"
},
...
]
},
"id": 1
}
```
---
## isBlockhashValid
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `isBlockhashValid`
Returns whether a block hash is still valid.
## Parameters
- `blockhash`: (string) _[requiredl]_ - The `base58` encoded hash of the block.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `epoch`: (integer) _[optional]_ - The epoch for which to query the rewards. If not specified, the current epoch is used.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - `true` if the block hash is still valid; otherwise `false`.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"isBlockhashValid", "params":["4JsC66MuiW8EbromjB3h64NmZQAH24rAWxwK5raQFTt9", {"commitment":"processed"}]}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": {
"context": {
"apiVersion":"2.1.16",
"slot":333329792
},
"value":false
},
"id":1
}
```
---
## minimumLedgerSlot
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `minimumLedgerSlot`
Returns the lowest slot that the node has information about in its ledger.
## Parameters
None
## Returns
`result` (integer): The lowest slot that the node has information about in its ledger.
### Request
```bash
curl https://solana-mainnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id":1, "method":"minimumLedgerSlot"}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":333274647,
"id":1
}
```
---
## requestAirdrop
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `requestAirdrop`
Requests an airdrop of lamports to a specified account.
:::info
This method doesn't work on mainnet.
:::
## Parameters
- `address`: (string) _[required]_ - The `base-58` encoded public key of the receiving account.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
## Returns
`result` - The transaction signature of the airdrop.
### Request
```bash
curl https://solana-testnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id":1, "method":"requestAirdrop", "params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", 100000]}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result":"3Q51CirQ3eyysjpbe2FmPgMMpnaTdcY6MGpKUhuZ7TBcWZFHvNB5QMwy5Z5LYy78K4rtYFo78ozw9zxkZgYJMm3D",
"id":1
}
```
---
## sendTransaction
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `sendTransaction`
Submits a pre-signed transaction to the cluster for processing.
## Parameters
- `transaction`: (string) _[required]_ - The transaction as an encoded string.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58` (deprecated) or `base64`.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
- `skipPreflight`: (boolean) _[optional]_ - If `true`, skips the preflight check. The default is `false`.
- `preflightCommitment`: (string) _[optional]_ - The commitment level to use for the preflight check. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `maxRetries`: (integer) _[optional]_ - The maximum number of retries for the transaction. If this parameter
is not provided, the RPC node will retry the transaction until it is finalized or until the block hash expires.
## Returns
`result` (string) - The first transaction signature embedded in the transaction, as a `base58` encoded string (transaction ID).
### Request
```bash
curl https://solana-testnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": ["4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"]}'
```
### Response
```bash
{
"jsonrpc":"2.0",
"result": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb",
"id": 1
}
```
---
## simulateTransaction
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# `simulateTransaction`
Simulate sending a transaction.
This method is useful for testing and debugging transactions before sending them to the network.
## Parameters
- `transaction`: (string) _[required]_ - The transaction as an encoded string. The transaction must have a valid
block hash, but doesn't need to be signed.
- `config`: (object) _[optional]_ - Configuration object with the following options:
- `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
- `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
reached maximum lockout, meaning the cluster has recognized this block as finalized.
- `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
- `processed` - Queries its most recent block. The block may still be skipped by the cluster.
- `sigVerify`: (boolean) _[optional]_ - If `true`, verifies the signatures in the transaction.
Conflicts with `replaceRecentBlockhash`. The default is `false`.
- `replaceRecentBlockhash`: (boolean) _[optional]_ - If `true`, replaces the recent block hash in the transaction with the
latest block hash. Conflicts with `sigVerify`. The default is `false`.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58` (deprecated) or `base64`.
- `minContextSlot`: _[optional]_ - The minimum slot to use for the query.
- `innerInstructions`: (boolean) _[optional]_ - If `true`, returns the inner instructions of the transaction.
The inner instructions will be `jsonParsed` where possible, otherwise `json`.
- `accounts`: (object) _[optional]_ - An object containing the following fields:
- `addresses`: (array) _[optional]_ - An array of addresses to include in the response.
- `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
or `jsonParsed`.
## Returns
`result` - `null` if the account doesn't exist; otherwise an object with the following fields:
- `context` - An object containing the following keys:
- `slot` - The slot number of the block that was queried.
- `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
- `err` - An error if transaction failed, `null` if transaction succeeded.
- `logs` - An array of log messages generated by the transaction. Returns `null` if the simulation failed.
- `accounts` -
- `data` - The account data, encoded in the specified format.
- `executable` - A boolean indicating whether the account is executable.
- `lamports` - The number of lamports in the account.
- `owner` - The public key of the program that owns the account.
- `rentEpoch` - The epoch in which the account will next be due for rent.
- `space` - The size of the account data in bytes.
- `unitsConsumed` - The number of compute units consumed by the transaction.
- `returnData` - An array of objects containing the following fields:
- `programId` - The public key of the program that executed the transaction.
- `data` - The account data, encoded as `base64` binary data.
- `innerInstructions` - An array of [inner instructions](https://solana.com/docs/rpc/json-structures#inner-instructions).
### Request
```bash
curl https://solana-testnet.infura.io/v3/ \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "simulateTransaction", "params": ["AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=", {"encoding": "base64"}]}'
```
### Response
```bash
{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 218 },
"value": {
"err": null,
"accounts": null,
"logs": [
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri invoke [1]",
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri consumed 2366 of 1400000 compute units",
"Program return: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri KgAAAAAAAAA=",
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
],
"returnData": {
"data": ["Kg==", "base64"],
"programId": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
},
"unitsConsumed": 2366
}
},
"id": 1
}
```
---
## Supported networks
import SectionNetworks from "@site/src/components/Sections/SectionNetworks.jsx";
# Supported networks
DIN provides API access to multiple blockchain networks. Below are the networks currently supported
by our infrastructure.
---
## Prepare for mainnet launch
:::danger Time Sensitive - DIN AVS Mainnet Launch: November 14th, 2025
Operators must begin onboarding with their wallets immediately due to a 17-day operator allocation delay. October 27, 2025 is the latest date
to create your wallets and onboard in time for mainnet launch.
**Critical: Create and register TWO wallets (primary + backup) with EigenLayer.** If your primary wallet encounters issues during onboarding, you won't have time to activate a new wallet before the deadline.
:::
:::info Video tutorial
[Watch the mainnet preparation tutorial.](https://www.loom.com/share/db796cf0b89b40b0961595f961cb1672?sid=daf8a0db-1325-444e-95b1-aeb166f1c635)
:::
## Immediate action items
Perform the following steps before the October 27, 2025 cut-off for mainnet launch:
1. **Create TWO new wallets (primary + backup):**
- Generate **two** new externally owned account wallets. Refer to the
[wallet setup options](#wallet-setup-options).
- Each wallet must not be used with any other EigenLayer Autonomous Verifiable Service (AVS).
- Secure your private keys for both wallets.
- Document both wallet addresses.
- **Why two wallets?** Due to the 17-day EigenLayer activation delay, having a backup wallet ensures you can still meet the mainnet launch
deadline if any issues occur with your primary wallet during onboarding.
2. **Start Fireblocks setup (optional):**
- Contact [Fireblocks](https://www.fireblocks.com/) for an account.
- Begin the KYC/verification process.
- [Install and register on EigenLayer using Fireblocks](https://docs.eigencloud.xyz/products/eigenlayer/operators/howto/registeroperators/register-operator-with-fireblocks).
3. **Secure ETH for both wallets:**
- Minimum 1 ETH per wallet (EigenLayer recommendation).
- Transfer to both operator wallets.
Specific stake amounts will be calculated during [Step 2](./onboard/stake-tokens.md).
4. **Register BOTH wallets with EigenLayer:**
- Access the [DIN app](https://app.din.build).
- Complete only [Step 1](./onboard/register-operator.md) with your **primary wallet**.
- Complete only [Step 1](./onboard/register-operator.md) again with your **backup wallet**.
- This ensures both wallets will be ready by mainnet launch in case you need to switch.
:::note
Only Step 1 (EigenLayer registration) is needed now. Steps 2-5 will be completed after the DIN contract is deployed on mainnet.
:::
## Configuration steps
Before starting Step 1 registration, configure the DIN app for mainnet:
1. **Switch MetaMask to Ethereum Mainnet:**
- Open MetaMask and switch from Sepolia to Ethereum Mainnet network.
2. **Select DIN Mainnet configuration:**
- In the DIN app, go to AVS settings.
- Select **DIN Mainnet** from the AVS configuration dropdown.
3. **Verify network settings before registration:**
- When you open the TXTX page for Step 1, confirm **Mainnet** is displayed.
- Ensure your wallet shows the correct mainnet address and ETH balance.
## Wallet setup options
:::warning MetaMask Required for Onboarding
**You must use MetaMask wallet when connecting to the DIN app for AVS onboarding.** While you can store your keys in a hardware wallet or
Fireblocks, you must access them through MetaMask during the onboarding process. Onboarding may fail if you use other wallet connection methods
(WalletConnect, Coinbase Wallet, etc.).
:::
Use one of the following wallet options:
- **Option 1: Hardware wallet (recommended)**
- Use Ledger or Trezor
- Create new derivation path
- Document recovery phrase securely
- **Option 2: [Fireblocks MPC]((https://docs.eigencloud.xyz/products/eigenlayer/operators/howto/registeroperators/register-operator-with-fireblocks)) (enterprise)**
- Superior security for institutions
- Multi-party computation
- No single point of failure
- **Option 3: Software wallet (not recommended)**
- Higher risk profile
- Use only if hardware unavailable
## Prepare infrastructure
While completing onboarding, ensure your infrastructure is ready:
- Set up RPC nodes for chosen networks (operator sets).
- Configure high availability.
- Implement monitoring.
:::info Initial period guidance
During the initial period of the DIN AVS, DIN admins will recommend which operator sets you should
join based on your DIN Router traffic history. This helps ensure optimal network coverage and performance using observed traffic patterns.
:::
## Mainnet and testnet differences
Testnet and mainnet have different risk, funding, and activation profiles. Use Sepolia testnet to
validate your setup end to end with test funds, then move to mainnet when you are ready to stake real
assets and accept slashing risk.
| | Testnet | Mainnet |
|--------|---------|---------|
| **Wallet** | Any EOA wallet (MetaMask recommended) | Two new EOA wallets (primary + backup), dedicated to DIN AVS |
| **Wallet connection** | MetaMask required for onboarding | MetaMask required for onboarding |
| **Wallet age requirement** | None | Both wallets must be registered on EigenLayer for 17 days before activation |
| **Funding** | Testnet ETH | ETH |
| **Allocation delay** | Customizable (0 default) | Customizable (0 default) |
| **Slashing** | No real loss | Real economic risk |
| **Performance** | Relaxed service level agreements | Strict service level agreements |
## Common mainnet pitfalls
### Fatal mistakes
- **Using a non-MetaMask wallet connection**
_Fix_: Always connect through MetaMask when onboarding in the DIN app. You can use hardware wallets or Fireblocks for key storage, but connect
them through MetaMask. Other wallet providers (WalletConnect, Coinbase Wallet, etc.) may cause onboarding to fail.
- **Reusing a wallet from another AVS**
_Fix_: Use a fresh, DIN-dedicated EOA for mainnet. Do not reuse keys/accounts tied to any other AVS.
- **Wrong network selected during registration**
_Fix_: Before starting Step 1, switch MetaMask from Sepolia to Ethereum Mainnet AND select **DIN Mainnet** in the app's AVS configuration.
Verify **Mainnet** is displayed in the TXTX page before proceeding. Registering on the wrong network wastes the 17-day activation period.
### Costly errors
- **Not creating a backup wallet**
_Fix_: Create and register **two** wallets with EigenLayer. If your primary wallet encounters issues during onboarding (e.g., transaction
failures, wrong configuration), you won't have time to create and activate a new wallet before the November 14th deadline due to the 17-day
activation period.
- **Starting after October 27th, 2025**
_Fix_: Plan for EigenLayer's protocol activation delay (17 days). Start by October 27, 2025, to be
active by November 14, 2025.
- **Insufficient ETH for gas**
_Fix_: Pre-fund your operator wallet with buffered ETH (gas + safety margin). Monitor fees; top
up before critical steps.
- **Not using hardware wallet**
_Fix_: Prefer Ledger/Trezor or MPC, enforce approvals/policies, and restrict who can sign mainnet
transactions.
- **Delayed Fireblocks setup**
_Fix_: Start KYC and workspace setup early; test a full registration flow before deadline.
- **Poor allocation strategy**
_Fix_: Set the default allocation delay to `0` (see [Step 3](./onboard/allocation-delay.md)) unless you
need an operations buffer; size and place stake where you can meet SLAs, and avoid over-concentration
or thin coverage.
---
## Step 3: Set allocation delay
Configure the allocation delay that determines when your stake becomes active for slashing.
Allocation delay is the time between staking tokens and when they become slashable. This is customizable
on both testnet and mainnet.
:::warning Important
This is different to the 17-day wait period for your wallet to become active on EigenLayer, for mainnet.
The allocation delay is your choice for operational safety and is in addition to the 17-day wait period.
:::
:::info Video tutorial
[Watch the step 2 and 3 combined tutorial.](https://www.loom.com/share/871e1f969e664f73ae64f033d434ffce?sid=09ba1cf4-726b-4a44-8fd0-49f064edb364) (Step 3 begins at 14:00)
:::
## Prerequisites
Ensure you have:
- Completed Steps [1](register-operator.md) and [2](stake-tokens.md).
- Enough ETH for gas fees.
## Steps
### 1. Start step 3
1. Open the [DIN app](https://app.din.build).
2. Select **Start Step 3**.
3. Select **Open TXTX** to open the runbook.
### 2. Set the delay value
In TXTX:
1. Connect your wallet.
2. Review the pre-filled delay value (the default is `0`).
3. Customize if desired.
4. Select **Validate**.
:::warning Cannot be changed
Once set, the allocation delay is permanent for your operator address.
:::
### 3. Execute the transaction
1. Select **Send Transaction**.
2. Sign in your wallet.
3. Wait for the confirmation.
### 4. Completion
When successful:
- The transaction is confirmed.
- Download the output file.
- Step 3 shows **✓**.
## Output file example
Your output contains:
```json
{
"allocation_delay_out": 0,
"set_allocation_delay_tx_hash": "0x...",
"effectBlock": 9329006
}
```
## Next steps
- Step 4: Watcher setup (Not yet available)
- [Step 5: Allocate stake to operator sets](./opt-in-avs.md) (Requires DIN team coordination)
---
## Step 5: Allocate stake to operator sets
This is the final step to complete your operator registration and begin serving traffic. It takes
the stake you allocated in Step 2 and associates it with the specific operator sets you've been
allowlisted for. This registration enables you to start receiving and serving RPC requests.
:::info Video tutorial
[Watch the Step 5 tutorial for the complete walkthrough.](https://www.loom.com/share/ff00347005a445e8ba8dc125714ce869) (5 minutes)
:::
## Prerequisites
Ensure the following:
- You've completed Steps 1-4.
- If set, the [allocation delay](allocation-delay.md) period has passed.
- You've messaged DIN team (`din@consensys.net`) that you reached Step 5.
## Steps
:::info Important - coordination required
When you reach Step 5, you'll see **Step 5: Configuration Required** in the app.
The DIN team needs to configure your custom operator image on the backend. Contact the team at
`din@consensys.net` when ready to proceed with this step.
Once configured by the DIN team, the status will change to **Step 5 Ready** and you can proceed.
:::
### 1. Access Step 5
1. Open the [DIN app](https://app.din.build).
1. Select **Step 5**.
1. Enter your operator name. This name determines how you'll appear in the DIN app (for example, `Rivet`, `SimplyStaking`).
1. Select **Continue to Step 5**.
1. Select **Open TXTX** to open a secure environment. This step automates the complex EigenLayer CLI
commands for you.
### 2. Execute transactions
The workflow executes two main transactions:
- **Transaction 1: Modify allocations**
- Associates your stake with your assigned operator sets
- Uses the `modifyAllocations` contract function
- **Transaction 2: Register for operator sets**
- Registers your BLS public key
- Adds you to each operator set
- Uses the `registerForOperatorSets` contract function
Follow the prompts in TXTX to sign each transaction.
### 3. Completion
The step is complete when you see confetti and **Runbook Complete**. Next:
1. Review the output data (optional: download for your records).
2. Select **End Session**.
3. Close TXTX.
### 4. Verify your registration
Go to the **Operators** page in the DIN app to view your newly created operator.
You'll see one operator entry for each operator set you were assigned:
- Operator set ID (for example: `5`, `35`)
- Network name (for example: `blast-testnet`, `base-mainnet`)
- Your operator name
- Status: `Active`
Step 5 has performed the following:
- Taken your stake from Step 2 and associated it with your assigned operator sets
(for example: sets `5` and `35`).
- Registered your BLS key for secure validation.
- Made you discoverable in the DIN network.
## Output data example
The step 5 output includes:
- **Operator name** - How you're identified in the DIN app.
- **Operator sets** - Which sets you're registered for (for example: `[5, 35]`).
- **Service manager** - DIN AVS contract address.
- **Allocation manager** - EigenLayer allocation contract address.
- **Transaction hashes** - Both modify allocations and register for operator sets.
- **Registration logs** - Confirmation events for each operator set.
Example output:
```json
{
"operator_name": "Rivet",
"operator_sets": [5, 35],
"modify_allocations_tx_hash": "0xa851e0...",
"register_for_operator_sets_tx_hash": "0x73ac44...",
"register_for_operator_sets_logs": [
{
"event_name": "OperatorAddedToOperatorSet",
"data": {
"operator": {
"OperatorSet": {
"id": 5
}
}
}
}
]
}
```
## Contract addresses
### Testnet (Sepolia)
- **Service Manager** - `0xC3dFB1C6cd1Ef8487Fd0f777e26B80d999b941d6`
- **Allocation Manager** - `0x42583067658071247ec8ce0a516a58f682002d07`
### Mainnet
Addresses will be provided before launch.
---
## Step 1: Register as an operator
Register your operator on EigenLayer. This step **must** be performed at least 17 days before you intend
to start serving traffic because EigenLayer has 17-day operator allocation delay.
:::info Video tutorial
[Watch the Step 1 tutorial.](https://www.loom.com/share/fa59256208a942a7acf14c20ddd2b77f?sid=36b11ad4-2e9c-4563-b6b1-83da6ca5812c) (5 minutes)
:::
## Prerequisites
Ensure you've completed all the [prerequisites](../prerequisites.md) before starting this process.
:::warning MetaMask Required
**You must use MetaMask wallet for AVS onboarding.** Onboarding may fail if you use other wallet providers (TrustWallet, Coinbase Wallet, etc.).
Connect your operator wallet through MetaMask to ensure a successful registration.
:::
## Steps
### 1. Start registration
1. Open the [DIN app](https://app.din.build).
1. Select the **AVS** section.
1. Select the **Onboarding** tab.
1. Step 1 opens in the **Onboarding Steps** section.
### 2. Check the registration status
1. Connect your DIN AVS wallet **using MetaMask**.
1. Select **Check if registered**.
1. If already registered → Skip to [Step 2: Stake tokens](./stake-tokens.md).
1. If not registered → Continue the following steps.
### 3. Register as an operator
1. Select **Start Step 1 Registration**.
1. Select **Open TXTX** to open the runbook.
1. Confirm the environment and wallet address and select **Start Runbook**.
1. Sign the transaction in your wallet.
1. Wait for confirmation (~2 minutes).
### 4. Completion
When successful:
- Your transaction will be confirmed onchain.
- Download the output file for your records.
- In the DIN app, Step 1 shows **✓**.
## Output file example
Your output file contains:
```json
{
"registered_operator_address": "0x...",
"register_as_operator_tx_hash": "0x...",
"registered_metadata_uri": "https://..."
}
```
Save this file for your records.
## Next step
Continue to [Step 2: Stake Tokens](./stake-tokens.md).
---
## Step 2: Stake tokens
Deposit tokens into EigenLayer strategies to back your operator with economic security.
:::info Video tutorials
- [Allowlisting and allocations](https://www.loom.com/share/39a6e731504749eca9b5dff11db9a038?sid=b0b0942c-e3ee-4635-87cf-61f785a9933f)
- [Staking process](https://www.loom.com/share/871e1f969e664f73ae64f033d434ffce?sid=09ba1cf4-726b-4a44-8fd0-49f064edb364)
:::
## Prerequisites
Ensure the following:
- You've completed [Step 1: Register as an operator](register-operator.md).
- You have enough ETH for staking (amounts calculated in app).
- You're ready to convert to stETH/WETH.
## Steps
### Part A: Request allowlisting
1. Open the [DIN app](https://app.din.build).
2. Select **Request access to participate in DIN**.
3. Select the operator sets from available networks (see table below).
4. Configure allocation percentages (must total 100%).
5. Submit request.
6. Wait for approval (usually within 24 hours).
:::info Operator set selection
DIN admins will guide you on which operator sets to participate in based on your DIN router traffic history during the initial period.
:::
#### Available operator sets
| Set ID | Network Name |
|--------|-------------|
| 2 | Ethereum |
| 3 | Ethereum-holesky |
| 4 | blast-mainnet |
| 5 | blast-testnet |
| 6 | polygon |
| 7 | polygon-testnet |
| 8 | optimism-mainnet |
| 9 | optimism-sepolia |
| 10 | arbitrum-mainnet |
| 11 | arbitrum-mainnet-archive |
| 12 | arbitrum-sepolia-archive |
| 13 | avalanche-mainnet |
| 14 | mantle-mainnet |
| 15 | mantle-sepolia |
| 16 | zksync-mainnet |
| 17 | zksync-sepolia |
| 18 | bsc-mainnet |
| 19 | bsc-testnet |
| 20 | starknet-mainnet |
| 21 | starknet-sepolia |
| 22 | opbnb-mainnet |
| 23 | opbnb-testnet |
| 24 | base-mainnet |
| 25 | base-sepolia |
| 26 | scroll-mainnet |
| 27 | scroll-sepolia |
| 28 | solana-mainnet |
| 29 | solana-devnet |
| 30 | unichain-mainnet |
| 31 | unichain-sepolia |
| 32 | Swellchain-mainnet |
| 33 | Swellchain-testnet |
| 34 | Sei-mainnet |
| 35 | Sei-mainnet-archive |
| 36 | Hoodi |
### Part B: Prepare tokens
Based on your approved allocations, convert ETH to:
- **WETH** - Use any DEX or wrap directly.
- **stETH** - Use Lido for mainnet, test contracts for testnet.
The dashboard shows exact amounts needed.
### Part C: Stake tokens
1. Select **Start Step 2** in the DIN app.
2. Select **Open TXTX** to open the runbook.
3. For each strategy (WETH, stETH):
1. Connect your wallet.
1. Approve the token spending.
1. Sign the transaction.
1. Deposit funds into the strategy.
1. Sign the transaction.
4. Wait for confirmations.
### 4. Completion
When successful:
- All strategies show **Complete**.
- Download output file.
- Step 2 shows **✓**.
## Output file example
Your output contains deposit details for each strategy:
```json
{
"WETH Stable Token": {
"deposit_amount": 1000000000000,
"deposit_into_strategy_tx_hash": "0x...",
"approved_amount": 1000000000000
},
"stETH Stable Token": {
"deposit_amount": 1000000000000,
"deposit_into_strategy_tx_hash": "0x...",
"approved_amount": 1000000000000
}
}
```
## Next step
Continue to [Step 3: Set allocation delay](./allocation-delay.md).
---
## Step 4: Watcher setup
:::info Not Required
Step 4 is under development and not required for operators. Skip to [Step 5](./opt-in-avs.md).
:::
Watchers will monitor operator performance in the future. We'll notify operators when this becomes available.
## Next step
Continue to [Step 5: Allocate stake to operator sets](./opt-in-avs.md).
---
## Prerequisites
Before starting the [onboarding process](./onboard/) using the [DIN app](https://app.din.build), ensure you have the following ready:
## Wallet requirements
Compatible wallets include MetaMask and WalletConnect. DIN supports
[multiple wallet setup options](./mainnet-preparation.md#wallet-setup-options).
### Mainnet
- Ensure you have a **brand new externally owned account (EOA) wallet**, never used with any other EigenLayer AVS.
- Ensure your wallet is **dedicated to DIN only**.
It cannot be shared with other EigenLayer AVS operations.
:::danger Critical for Mainnet
Your wallet MUST be dedicated exclusively to DIN AVS. Using a wallet associated with another AVS will cause operational failures.
:::
:::warning Mainnet Launch - November 14th, 2025
DIN AVS is launching on mainnet soon! Operators must begin onboarding with their wallets **immediately**
due to a 17-day operator allocation delay. October 27, 2025 is the latest date to create your wallet
and onboard in time for mainnet launch.
:::
### Testnet
- Any wallet works for testing.
## Financial requirements
- Ensure you have **minimum 1 ETH** in your wallet (EigenLayer recommendation).
- Stake amounts will be calculated during [Step 2](./onboard/stake-tokens.md) based on your operator sets.
### Current strategies
- stETH (Lido Staked ETH)
- WETH (Wrapped ETH)
:::note
Additional strategies will be available after launch.
:::
## Technical requirements
Ensure you have:
- A compatible **browser** - Chrome, Firefox, or Brave (latest version).
- **Stable internet** for transaction signing.
- **Pop-ups enabled** for `app.din.build`.
## Account access
Ensure you have:
- An account on the [DIN app](https://app.din.build).
- Completed the email verification.
- Access to DIN's TXTX onboarding (automatic during onboarding).
## Operator requirements
Before proceeding, understand:
- What [operator sets](../operator-sets.md) you'll be serving.
- The [slashing conditions](../slashing-and-rewards.md) for the AVS.
- Performance requirements (≥ 99.9% uptime).
- There's a 17-day wait for your registered wallet ([step 1](./onboard/register-operator.md)) to become
eligible for rewards and slashing on EigenLayer.
## Ready to start?
If all prerequisites are met, review the [mainnet launch](./mainnet-preparation.md) instructions,
then begin with [Step 1: Register as Operator](./onboard/register-operator.md).
---
## Troubleshoot
This page provides solutions to common issues encountered during DIN AVS onboarding.
## Login issues
### Turnkey code not received
- Wait 2-3 minutes.
- Check your spam folder.
- Request code resend.
- Try a different browser.
### Dashboard won't load
- Disable ad blockers.
- Allow pop-ups for `https://app.din.build`.
- Try incognito mode.
## Wallet issues
### MetaMask won't connect
- Unlock MetaMask first.
- Check that you're on the correct network.
- Clear MetaMask activity data.
### Wrong network
- Testnet: Switch to Sepolia (chain ID: `11155111`).
- Mainnet: Switch to Ethereum Mainnet.
## Step-specific issues
### Step 1: Registration
#### Already registered error
- Select **Check if registered** first.
- If registered, skip to Step 2.
#### TXTX won't load
- Allow pop-ups.
- Disable extensions.
- Clear your cache.
### Step 2: Staking
#### Not allowlisted
- Check the request status.
- Contact `din@consensys.net` if you've waited over 24 hours.
#### Token conversion failed
- Check that the gas fees are included.
- Try smaller amounts.
- Verify contract addresses.
#### Approval stuck
- Check on Etherscan.
- Speed up with higher gas.
- Cancel and retry if needed.
### Step 3: Allocation Delay
#### Wrong delay set
:::danger Critical
You cannot change this once set. You must use a new operator address if incorrect.
:::
#### Contract not found
- Verify the correct network.
- Sepolia: `0x42583067658071247ec8ce0a516a58f682002d07`
### Step 5: Allocate stake
#### Configuration required
The message **Step 5: Configuration Required** means you must contact the DIN team at `din@consensys.net`. They need to set up your custom operator image on the backend.
#### Can't see my operator
- Refresh the **Operators** page.
- Check that you're looking at the correct network.
- Verify the transaction completed successfully (check the transaction hash on Etherscan).
#### Custom image not ready
- Contact the DIN team at `din@consensys.net`.
- Provide the operator address and readiness confirmation.
#### BLS key failed
- Restart the workflow.
- Clear your browser cache.
- Try a different browser.
#### Registration failed
- Confirm if the allocation delay has expired.
- Verify whether the gas is sufficient.
- Confirm that you've completed previous steps.
## Transaction issues
### General transaction failures
- Increase the gas limit.
- Check your ETH balance.
- Wait for lower gas prices.
- Verify the network selection.
### Session timeout
- Select **Extend +30** before expiry.
- If expired, restart the step.
- Complete in one sitting.
## Post-onboarding
### Not receiving traffic
- Verify that you've completed all steps.
- Check if the allocation delay has expired.
- Test infrastructure connectivity.
- Contact the DIN team at `din@consensys.net`.
## Get help
When contacting support always provide:
1. Your operator address.
2. The step where the issue occurred.
3. Error messages (exact text).
4. Transaction hashes.
5. Screenshots if applicable.
## FAQ
**Can I change my operator address?**
No, you must start over with new address.
**Can I modify allocation delay?**
No, it is permanent once set.
**Can I add operator sets later?**
Yes, additional sets can be added.
**What if I miss mainnet launch?**
You can still join after launch, but you will miss initial traffic.
**Can I withdraw my stake?**
Yes, but it is subject to withdrawal delays.
---
## Operator sets
EigenLayer operator sets have been discussed and designed at length to create more granular roles and permissions for EigenLayer operators and AVS design.
For DIN as an AVS, this would mean the node providers would be able to join EigenLayer restaking and specifically be identified for watchers to stake or slash.
Each operator set will need to represent a specific service—for example, the watcher service or specific blockchain networks.

## Understanding operator sets
Operator sets in DIN represent different blockchain networks that operators can serve. Each set has its own:
- Staking requirements
- Performance metrics
- Slashing conditions
- Infrastructure requirements
## Available operator sets
DIN currently supports the following blockchain networks through operator sets:
| Set ID | Network Name |
|--------|-------------|
| 2 | Ethereum |
| 3 | Ethereum-holesky |
| 4 | blast-mainnet |
| 5 | blast-testnet |
| 6 | polygon |
| 7 | polygon-testnet |
| 8 | optimism-mainnet |
| 9 | optimism-sepolia |
| 10 | arbitrum-mainnet |
| 11 | arbitrum-mainnet-archive |
| 12 | arbitrum-sepolia-archive |
| 13 | avalanche-mainnet |
| 14 | mantle-mainnet |
| 15 | mantle-sepolia |
| 16 | zksync-mainnet |
| 17 | zksync-sepolia |
| 18 | bsc-mainnet |
| 19 | bsc-testnet |
| 20 | starknet-mainnet |
| 21 | starknet-sepolia |
| 22 | opbnb-mainnet |
| 23 | opbnb-testnet |
| 24 | base-mainnet |
| 25 | base-sepolia |
| 26 | scroll-mainnet |
| 27 | scroll-sepolia |
| 28 | solana-mainnet |
| 29 | solana-devnet |
| 30 | unichain-mainnet |
| 31 | unichain-sepolia |
| 32 | Swellchain-mainnet |
| 33 | Swellchain-testnet |
| 34 | Sei-mainnet |
| 35 | Sei-mainnet-archive |
| 36 | Hoodi |
*Check [app.din.build](https://app.din.build) for the most up-to-date list and requirements.*
## Joining operator sets
Operators select which sets to join during onboarding:
1. **Assess Capabilities**: Evaluate your infrastructure for each network
2. **Review Requirements**: Check minimum stake and performance standards
3. **Select Sets**: Choose networks you can reliably support
4. **Allocate Stake**: Distribute your stake across selected sets
5. **Configure Infrastructure**: Set up nodes for each network
For detailed instructions, see our [Operator Onboarding Guide](./operator-onboarding/index.md).
## Stake allocation strategies
When joining operator sets, you'll allocate your stake across different strategies:
### Available strategies
- **stETH** (Lido Staked ETH): Earns staking rewards
- **WETH** (Wrapped ETH): Provides liquidity flexibility
- **cbETH** (Coinbase Staked ETH): Alternative staking option (mainnet)
- **rETH** (Rocket Pool ETH): Decentralized staking (mainnet)
### Allocation examples
#### Conservative approach (focus on yield)
- 75% stETH
- 25% WETH
#### Balanced approach
- 50% stETH
- 50% WETH
#### Flexible approach (focus on liquidity)
- 25% stETH
- 75% WETH
## Performance requirements
Each operator set has specific SLA requirements:
### General standards
- **Uptime**: Greater than 99.9%
- **Response Time**: Less than 100ms p50
- **Availability**: Continuous (every day)
- **Data Freshness**: Real-time
### Network-specific requirements
Different networks may have additional requirements:
- **Ethereum**: Archive node access
- **L2s**: Sequencer connectivity
- **Alt-L1s**: Native token holdings
## Rewards distribution
Rewards are calculated per operator set based on:
1. **Request Volume**: Number of RPC requests served
2. **Performance Metrics**: SLA compliance
3. **Stake Weight**: Your stake relative to total
4. **Network Demand**: Overall usage of the network
## Slashing conditions
Each operator set can have specific slashing conditions:
- **Downtime**: Extended unavailability
- **Latency**: Consistent slow responses
- **Invalid Data**: Serving incorrect information
- **Liveness**: Failure to respond
See [Slashing and Rewards](./slashing-and-rewards.md) for detailed information.
## Managing multiple sets
### Best practices
1. **Start Small**: Begin with 1-2 sets you know well
2. **Monitor Performance**: Ensure service level agreement compliance before adding more
3. **Scale Gradually**: Add sets as infrastructure allows
4. **Maintain Balance**: Don't overextend resources
### Infrastructure considerations
- **Dedicated Nodes**: Run separate nodes per network
- **Monitoring**: Track each set independently
- **Redundancy**: Backup systems per network
- **Team Expertise**: Ensure knowledge for each chain
## Future developments
### Upcoming features
- Dynamic stake reallocation
- Cross-set performance bonuses
- Set-specific governance rights
- Advanced slashing parameters
### Planned operator sets
- Additional L2 solutions
- Cosmos ecosystem chains
- Solana and other alt-L1s
- Application-specific chains
## Getting started
Ready to join operator sets? Follow these steps:
1. **Review Requirements**: Check our [Prerequisites](./operator-onboarding/prerequisites.md)
2. **Begin Onboarding**: Start with [Step 1: Register](./operator-onboarding/onboard/register-operator.md)
3. **Select Sets**: Choose during the allowlisting process
4. **Allocate Stake**: Configure in [Step 2](./operator-onboarding/onboard/stake-tokens.md)
---
## Slashing and rewards
The DIN AVS ties incentives to measured performance. Node providers and watchers earn rewards for
meeting service level agreements (SLAs), and face penalties (including slashing) when independent watcher
attestations show sustained violations. This aligns behavior with DIN’s reliability and performance goals.
:::info Operator onboarding
Ready to operate and earn? Start with the [operator onboarding guide](./operator-onboarding/index.md).
DIN AVS is launching on mainnet soon! Operators must begin onboarding immediately due to a 17-day
operator allocation delay.
:::
## Performance-based rewards
- **SLA compliance rewards** - Node providers and watchers who consistently meet or
exceed SLA standards receive additional token rewards. These rewards, distributed through the
gateway contract, encourage participants to prioritize performance and reliability.
- **Reputation-linked routing** - Higher SLA scores improve reputation, which can increase traffic
allocation and earnings.
## Deterrents for underperformance
- **Progressive penalties and slashing** - Repeated or severe SLA violations trigger escalating responses,
which encourages operators to rectify issues promptly, reducing long-term service disruptions.
- **Suspension or removal** - Chronic non-compliance can result in removal from relevant operator
sets to protect network quality.
## Slashable events and penalties
### Types of slashing events
The following table identifies the types of slashable events. The recovery time specifies the time
in which to rectify the issue to avoid a repeated offense. TODO: confirm exact meaning of "Recovery time"
| Violation type | First offense | Repeated offense | Recovery time |
|---------------|---------------|------------------|---------------|
| **Downtime** (less than 99.9% uptime) | 0.1% stake | 0.5% stake | 24 hours |
| **High latency** (over 200ms p50) | 0.05% stake | 0.25% stake | 12 hours |
| **Invalid data** | 1% stake | 5% stake | 48 hours |
| **Complete failure** | 2% stake | 10% stake | 72 hours |
### Mitigation strategies
Us the following strategies to reduce SLA violations and minimize slashing risk:
1. **Infrastructure redundancy**: Run multiple nodes per operator set
2. **Monitoring systems**: Track uptime, latency, error rate, and data freshness; alert before breaches.
3. **Gradual scaling**: Start with fewer operator sets and scale upwards
4. **Team coverage**: Maintain runbooks, on-call rotation, and incident drills.
## Reward calculations
### Reward formula
```text
operator rewards = (base rate × request volume × performance score) / total network stake
```
### Factors affecting rewards
1. **Request volume**: Higher traffic = higher rewards
2. **Performance score**: Better service level agreement compliance = bonus multipliers
3. **Stake weight**: Your stake vs. total network stake
4. **Operator set demand**: Popular networks pay more
### Expected returns
::info
Returns are estimates and depend on network growth and demand.
:::
| Scenario | Annual return | Requirements |
|----------|---------------|--------------|
| **Conservative** | 5-8% APY | Basic SLA compliance |
| **Standard** | 8-12% APY | Good performance, multiple sets |
| **Optimized** | 12-18% APY | Excellent performance, high volume |
## Reward distribution
### Payment schedule
- **Frequency**: Monthly distributions
- **Method**: Direct to operator address
- **Currency**: ETH and potentially DIN tokens
- **Timing**: First week of each month
### Tracking your rewards
1. Monitor dashboard at [app.din.build](https://app.din.build)
2. View per-operator-set breakdown
3. Export reports for accounting
4. Track performance metrics
## Veto committee protection
The [Veto Committee](./veto-committee.md) can review and potentially reverse slashing events in cases of:
- Network-wide issues
- Unfair slashing conditions
- Technical failures beyond operator control
- Coordinated attacks on operators
## Getting started
Ready to start earning rewards while avoiding slashing?
1. **Understand requirements**: Review our [Prerequisites](./operator-onboarding/prerequisites.md)
2. **Begin onboarding**: Follow our [Step-by-Step Guide](./operator-onboarding/index.md)
3. **Prepare for mainnet**: Check [Mainnet Preparation](./operator-onboarding/mainnet-preparation.md)
4. **Monitor performance**: Set up robust monitoring systems
---
## Veto Committee
The DIN Veto Committee is comprised of the seven highest performing node providers over a 14.5 day period (an epoch).
Performance is measured as total successful requests served over an epoch.
This is directly proportional to the rewards earned over the epoch.
If a provider is slashed during the prior epoch, they are still eligible to be part of the Veto Committee.
[Hats protocol](https://www.hatsprotocol.xyz/) is used to assign the role of a Veto Committee member, to timebox membership, and to revoke the role in the event of non-participation.
The DIN Veto Committee has a process to review slashing scenarios with shared opinions in the **#din-general** Slack channel.
---
## LLM markdown txt files
Plain text versions of all documentation, optimized for LLM consumption.
## Standard version
**[Download llms.txt](/llms.txt)** (21KB)
This file contains:
- Table of contents with links to all documentation pages.
- Brief descriptions of each section.
- Follows the [llmstxt.org](https://llmstxt.org/) standard.
## Full version
**[Download llms-full.txt](/llms-full.txt)** (344KB)
This file contains:
- Complete content of all documentation pages.
- All text, code examples, and structured content.
- Optimized for AI/LLM processing.
---
## Roadmap
DIN is progressing through a carefully structured roadmap that gradually enhances its decentralization, scalability, and governance capabilities.
This roadmap is divided into key phases, each designed to build on the last, ensuring a robust and resilient network.
| Phase | Milestones | Description |
| ----- | ---------- | ----------- |
| Federated Phase (2024) | Joining DIN, processing transactions | Alpha customers (Infura, MetaMask) route API traffic and seed developer calls; providers meet performance thresholds and handle transactions, with payments managed through traditional invoicing. |
| Progressive Decentralization (2024-2025) | DIN as an AVS, decentralized transaction processing, DIN Payments Layer 3, DIN Foundation and DAO, incentivized testnet | Early stage integration of economic security and staking/slashing through DIN as an AVS; providers gain routing flexibility beyond Infura; payments move to Layer 3 on-chain protocol; DIN Foundation oversees shared services and governance transitions to DAO-driven decision-making. |
| Full Decentralization (2025-2026) | Permissionless onboarding, advanced payments, and DAO-managed innovation fund | DIN becomes fully permissionless, enabling automated service level agreement enforcement, dynamic pricing, cross-protocol staking, and DAO-led growth initiatives, establishing DIN as a decentralized, community-driven infrastructure for web3. |
## Federated Phase
The Federated Phase is the foundational stage of DIN, where the network's initial components are deployed, tested, and refined in a controlled environment with trusted alpha customers.
This phase focuses on establishing DIN's basic operational capabilities, ensuring service reliability, and verifying economic viability before fully opening the network.
### Joining DIN
- **Acceptance criteria and minimum performance thresholds** - During this phase,
DIN implements strict entry requirements for node providers and watchers,
ensuring that each participant meets predefined performance standards.
Providers must demonstrate compliance with service-level agreements covering metrics
such as response freshness, data validity, and uptime.
- **Assigned identities for DIN routing** - Each participant is assigned a unique identity, enabling seamless routing of developer API requests to the appropriate node providers.
This identity management system lays the groundwork for effective transaction processing and tracking, setting clear accountability for each operator within the network.
### Processing transactions for DIN
- **Transaction routing from alpha customers** - Infura and MetaMask generate developer API traffic, which is routed through DIN provider nodes.
This federated setup enables DIN to validate its routing efficiency, latency benchmarks, and load-balancing algorithms under real-world conditions.
- **Traditional invoicing and payment validation** - In this phase,
payments from alpha customers to node providers are handled through traditional invoicing,
allowing DIN to test and refine its financial tracking and reward distribution processes.
This traditional invoicing approach provides DIN with critical insights into payment workflows,
helping to prepare the network for decentralized, onchain payment models in later phases.
## Progressive Decentralization
In 2025, DIN will transition from its federated setup to a progressively decentralized network.
This phase introduces additional layers of decentralization,
with expanded functionality for transaction routing, payments, and governance,
marking the beginning of DIN's evolution towards a permissionless infrastructure.
With inspiration, the Cosmos Hub introduced a modular approach to interoperability, allowing networks to expand and evolve through phased upgrades.
### DIN as an AVS
The practical implementation of the network watcher has explored usage of DIN launching as an Autonomous Verifiable Service (AVS) on EigenLayer.
EigenLayer's AVS model provides a robust framework for economic alignment and real-time performance enforcement.
DIN has integrated new functionalities that streamline agent onboarding,
improve oversight via a watchtower,
and establish a structured accountability model without launching a token that may have floating value.
- **Onboarding components** - Ability for providers to stake and add their wallet identities to join the DIN Router Registry contracts
- **Economic security service level agreements** - Watcher and AVS operator capabilities for staking, slashing, and challenging the onboarded node performance and reputation of entities in DIN.
The DIN AVS system aims to deploy watchers with a dedicated "watcher node kit," which operates as both a monitoring tool and a user-friendly interface to the DIN network backend.
Through the AVS interface, watchers access essential modules for onboarding DIN providers, viewing onboarding notes, tracking network status, and enforcing slashing protocols.
Acting as operators on EigenLayer, DIN watchers not only monitor service accuracy and reliability but also uphold AVS-based slashing and staking rules for performance infractions.
Watchers gather and analyze response data by running simulated requests to ensure adherence to service level agreements.
Their results are then published on a public event stream, providing transparency and informing DIN's crypto-economic incentives.
By aligning with EigenLayer's AVS structure,
DIN strengthens its validation processes,
ensuring real-time accountability and economic security for all network participants.
### Decentralized traffic processing
- **Provider-driven routing capabilities** - Providers in the DIN network will gain the ability to route service traffic through various web3 gateways, not limited to Infura.
This expanded functionality decentralizes the routing process, creating an open network where multiple web3 gateways can interact with DIN providers.
- **DIN Payments Layer 3 network** - DIN will implement an onchain payments layer on Linea as a Layer 3 to facilitate real-time, decentralized payments among DIN providers and web3 gateways.
This payments layer will allow for seamless, automated transactions, eliminating the need for traditional invoicing and streamlining economic interactions within DIN.
Operators will be compensated based on their service contributions, with payment records transparently available onchain.
### DIN Foundation and governance
- **Establishment of the DIN Foundation** - The DIN Foundation will be formed to oversee shared services,
community initiatives, and technical upgrades,
ensuring that DIN remains aligned with the community's evolving needs.
The Foundation will manage essential services like security audits, research funding,
and cross-protocol collaborations.
- **Decentralized governance and DAO** - The introduction of a DIN DAO will enable community-led governance,
where stakeholders propose and vote on protocol upgrades, SLA adjustments, and economic policies.
Token holders who stake within the DAO gain voting rights,
empowering them to shape the future of DIN and ensuring that governance decisions reflect the collective interests of the network.
### Incentivized testnet as a mechanism design laboratory
Incentivized testnets are invaluable for stress-testing decentralized infrastructure and optimizing network mechanics
before mainnet deployment.
The DIN Incentivized Testnet is a vital component of DIN's mechanism design,
allowing the network to test, validate,
and optimize its economic structures in a live, controlled environment.
The testnet enables DIN to fine-tune its staking, slashing, reward,
and governance mechanisms before mainnet deployment.
#### Economic testing and reward calibration
- **Staking and slashing simulations** - The incentivized testnet allows DIN to run simulations of staking
and slashing mechanisms,
identifying optimal thresholds for penalties and ensuring that the economic deterrents are effective
without being overly punitive.
- **Reward structure optimization** - By distributing rewards based on testnet performance,
DIN collects data on the effectiveness of its incentive structures,
including high-performance bonuses and routing efficiency rewards.
This feedback helps the DAO calibrate rewards to ensure they align with desired behaviors and network standards.
- **DAO policy feedback** - Testnet participants are encouraged to provide feedback on the economic
and governance policies in place.
This input allows the DAO to make informed adjustments,
ensuring that the network's policies are fair, practical, and aligned with community expectations.
#### Participant onboarding and reputation building
- **Early access to economic mechanisms** - Node providers, watchers,
and web3 gateways gain early access to DIN's staking, slashing, and reward systems through the testnet.
This experience allows them to adapt to DIN's operational standards and fine-tune their infrastructure,
reducing the learning curve for mainnet.
- **Reputation establishment** - Participants who perform well on the incentivized testnet build a reputation
that can carry over to the mainnet,
giving them a competitive edge in request routing and access to higher-tier rewards.
This early reputation system encourages operators to establish themselves as reliable contributors
to DIN's ecosystem.
#### Data-driven mechanism refinement
- **Performance data collection** - Real-time data on SLA compliance, request throughput,
and operator availability from the testnet informs adjustments to the mainnet mechanism design.
The DAO reviews this data to refine parameters,
ensuring DIN's economic model supports scalability and network resilience.
- **Iterative testing for robust mechanisms** - The testnet enables iterative testing of new policies
and mechanisms, allowing the DAO to make adjustments based on test outcomes.
This iterative process ensures that only well-tested mechanisms are deployed on mainnet,
reducing the likelihood of economic inefficiencies or security vulnerabilities.
## Full decentralization and governance-driven expansion
In the final phase, DIN will operate as a fully decentralized, community-governed infrastructure,
with robust economic mechanisms, autonomous routing, a sustainable business model,
and a mature governance framework.
### Open network access and permissionless onboarding
- **Permissionless onboarding of operators** - The DIN onboarding process will become permissionless,
enabling anyone who meets the staking and SLA requirements to join as a node provider or watcher.
This open access expands DIN's capacity to accommodate growing demand and diversifies the operator base,
enhancing network resilience.
- **Automated SLA compliance and enforcement** - Through further integration with EigenLayer's AVS model,
DIN will implement automated SLA compliance checks and penalty enforcement.
This ensures that performance standards are consistently maintained without manual intervention,
supporting a fully autonomous infrastructure.
### Advanced payment and reward structures
- **Dynamic pricing and custom service level agreements** - As DIN matures,
the DAO may introduce dynamic pricing for API requests and allows operators to offer customized service level agreements.
This flexibility enables providers to compete based on specialized services,
fostering a competitive and adaptable market for blockchain API services.
- **Cross-protocol staking and partnerships** - DIN will explore partnerships with other web3 projects,
such as staking collaborations, liquidity pooling, and cross-chain integrations,
enhancing DIN's economic resilience and extending its ecosystem reach.
### DAO-managed innovation fund and ecosystem growth
- **Funding for ecosystem development** - The DIN DAO will establish an innovation fund,
supporting projects that build on DIN, integrate with other blockchain networks, or advance web3 infrastructure.
This fund will fuel ecosystem growth and attract developers, researchers,
and contributors to enhance DIN's utility and reach.
- **Community-driven upgrades and enhancements** - As a fully decentralized network,
DIN's growth will be guided by community-driven proposals and DAO-backed initiatives.
The DAO will support upgrades to DIN's core protocol, expand governance mechanisms, and enable ongoing innovation,
ensuring that DIN remains adaptable and responsive to technological advancements and user needs.
---
## Manage payments
The Ingress Operators pay DIN Providers via DIN Payments for their processed requests/relays through the DIN Router.
The costs for specific relays are not currently in a granular method-based pricing.
The service level agreements for each network are agreed upon between the DIN Provider and Infura teams.
- Is there a bespoke services contract for each network or across the DIN set of services?
- Are there service level agreements for DIN?
- **Answer:** Yes.
We will be putting into place the service level agreement as part of the Watcher protocol going live, which will occur prior to your onboarding.
- Are there service level agreements for each of the networks from each of the providers?
- **Answer:** Yes.
We will share these for each network.
These service level agreements are enforced by the watcher.
- What available resources are there to help with the onboarding and implementation of access to the set of DIN Services (for example, RPC for specific networks)?
- How do I pay for these services?
- What is the DIN Payment module?
- How can I access it?
- How can I withdraw funds from this module or network?
- Do these payments get distributed directly to the node providers?
```mermaid
flowchart TD
u["**User**"] -->|Pay fees for access| dsp["**DIN service provider**"]
dsp -->|Stake or restake to list| dp["**DIN protocol**"]
dp -->|Reward from the network to augment fees and bootstrap service supply| dsp
dp -->|Reward from the network to augment fees and boostrap service supply| w["**Watcher**"]
dp -->|Reward from the network to augment fees and boostrap service supply| c@{ shape: processes, label: "**Covalent**" }
u -->|Pay fees for Covalent APIs| c
```
---
## Monitor usage
The DIN Watcher function consists of a variety of monitoring tools, including an OpenTelemetry Collector that can be used for your own SRE review.
The telemetry collector:
- Listens to the OTLP Trace forwarding component in OTLP format.
- Scrapes Prometheus metric data from DIN Router directly from the router's `/metrics` endpoint.
- Updates our internal Signoz Cloud dashboard for troubleshooting and metrics.
It is up to the Web3 gateway to determine what they want to do with the Open Telemetry Data (e.g. follow our tooling to show into Signoz dashboard).
```mermaid
flowchart LR
dr["**DIN Router
2019/metrics**"] -->|OTLP trace forwarding| ot["**OpenTelemetry
Collector**"]
ot -->|"Prometheus metrics scrape/pull"| dr
ot --> cloud["**Grafana Cloud or
Signoz Cloud**"]
```
- What dashboards can we expect to see on the performance of DIN Providers or the DIN Router? Completed relays?
- **Answer:** DIN Router data is added to the Open Telemetry collector and processed into a Signoz Cloud dashboard.
- What is the DIN Observability Dashboard? Can I get access to it?
- **Answer:** DIN is in the process of building app.din.build in order to provide a more "SaaS-based" interaction with the DIN Router and other DIN components.
- Can you create other dashboards for the desired data?
- **Answer:** Since you will be given the API of the collected metrics, you can use that to build other dashboards.
We will always take suggestions related to the DIN Observability Dashboard, but further customizations are best made by consuming the API and building those view into your own application.
---
## Onboard as a web3 gateway
## DIN authentication process
This section describes how a gateway would be added as an Ingress Operator for the router.
We have mainly done this manually (as Infura was our only ingress operator in scope), but we are expanding the authentication protocol to include the additional handshake.
The alpha testing for security purposes will likely remain manual (in collaboration with our dev team).
```mermaid
---
config:
layout: elk
---
flowchart TD
subgraph c["**Client**"]
c1[Client-side session SDK]
end
c -.->|"DIN RPC
request"| r
c -.->|"Direct
provider RPC
request"| p
c1 <-->|din-caddy-plugins| r1
c1 <-->|Auth request| p1
subgraph r["**Router**"]
r1[Session manager]
end
r -.->|"Provider RPC
request"| p
r1 <-->|"Auth request
for session
token"| p1
subgraph p["**Provider**"]
p1[Auth app]
end
```
- Is this a registered IP Address or domain that can ping the DIN Router?
- **Answer:** Yes, this is a DNS (registered IP address).
- Is there a smart contract allow list or is it a manual handshake process for now?
- **Answer:** It would be a manual handshake for now, with the allowlist being stored in a configuration file until the smart contract registry is up and running.
- How does Infura do this?
- **Answer:** Currently, Infura does not authenticate to the DIN Router, but we are adding this functionality as we expand the services to more web3 gateways.
### Configuration
In the initial implementation of the authentication protocol, the bare minimum configuration will require:
- **DIN Router**
- A web3 EOA private key to sign requests
- The existing configuration mapping services to provider endpoints
- **DIN Provider**
- A allowlist of web3 addresses to accept requests from
- A secret key to create signed session tokens (this should be shared across all Caddy instances run by the same provider)
- A configuration mapping services to backend endpoints (this will allow providers to run one set of DIN Provider Proxies for an arbitrary number of services).
### Protocol
1. For each service / provider pairing, the DIN Router will establish a session.
1. The DIN Router will send an [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) authenticated message to the DIN Provider at `https://$PROVIDER_ENDPOINT/auth`.
The Sign In With Ethereum message will have the form:
```text
Message: $MESSAGE
$DOMAIN wants you to sign in with your Ethereum account:
$SIGNER_ADDRESS
URI: $PROVIDER_URL/auth
Version: 1
Chain ID: 1
Nonce: $NONCE
Issued At: $ISSUED_AT
Expiration Time: $EXPIRE_TIME
```
- `$MESSAGE` - At this time, the contents of this field is not important.
Within the Sign In With Ethereum protocol, this is intended to be shown to the user signing with a wallet.
As these signatures will be automated, this field can be ignored, but will be included by Sign In With Ethereum libraries.
- `$DOMAIN` - Domain should reflect the address of the router.
- `$SIGNER_ADDRESS` - Should match the address used to sign this message.
- `$PROVIDER_URL` - should match the public address of the provider verifying this message.
- `$NONCE` - This is a random value specified by the signer to distinguish this request from others.
- `$ISSUED_AT` - An ISO-8601 Timestamp of when this message was created
- `$EXPIRE_TIME` - An ISO-8601 Timestamp of when this message should no longer be accepted.
Note that this is not the expiration of the token being requested, just for this request.
It should generally be within a few minutes.
This message should be included in a JSON payload of the form:
```text
{"msg": "Message: ... Expiration Time...", "sig": "0x12234...0abcd"}
```
Where `sig` should be the signature produced by signing the message with the private key associated with `$SIGNER_ADDRESS`.
2. The DIN Provider will verify the message, and confirm that the signer appears in its allowlist.
If the message does not verify or the signer is not in the allowlist, the DIN provider should respond with a 401 status code.
3. The DIN Provider will respond with:
```text
{
"headers": {"x-api-key": "$API_KEY"},
"exp": $EXPIRATION_TIME,
"uses": $USES_LIMIT,
"error": $ERROR_MESSAGE
}
```
- `$API_KEY` - The API key generated by the provider.
The provided DIN caddy plugins will have a JWT token here, but from a protocol perspective it should be treated as an opaque key.
- `$EXPIRATION_TIME` - A unix timestamp after which this key will no longer be accepted.
Either this or `uses` should be specified, not both.
- `$USES_LIMIT` - The number of times this key may be used.
Either this or `exp` should be specified, not both.
- `$ERROR_MESSAGE` - A message indicating why the other fields could not be provided.
2. For each request to the DIN Router:
1. The DIN Router will select a provider that offers the service capable of handling the incoming request.
2. If there is a current API Key available for that service / provider pairing,
the router will forward the RPC request to that provider including the API Key associated with the session
in the `x-api-key` header.
1. If there is not a current API key for that service / provider pairing,
the DIN Router should establish a session as defined above.
3. The DIN Provider will verify the API key in the `x-api-key` header,
and ensure that it is associated with the appropriate service.
1. If the API key is not present, the provider should respond with a 401 status code.
2. If the API key is present, but is expired or does not authorize access to the request service,
the provider should respond with a 403 status code.
3. If the API key verifies successfully,
the provider should proxy the request to the backend service and return the response.
## DIN Router initial registration
This section answers questions on how we manually add the Web3 Gateway / Ingress Operator
with your appropriate permissions.
A Caddy Proxy router set of configurations is used to make the connection between the user and the provider.
```mermaid
---
config:
layout: elk
---
flowchart LR
subgraph Caddy ["**Caddy Proxy Router**"]
direction TB
c1{{Determine service by path}}
subgraph c2 [Determine available providers]
direction TB
c2a{{Allow only providers from the appropriate priority level}} -.-> c2b{{Allow only healthy providers to be selected}}
end
c1 --> c2
c2 --> c3{{Select provider based on Caddy server dynamic load balancing algorithm}}
end
u["**User**"] -->|Send request| Caddy
Caddy -->|Send request to selected provider| p["**Provider**"]
```
- What are the security requirements for this?
- **Answer:** Currently, the registration would be done via Sign In with Ethereum, and the DIN team would allowlist the Ethereum address that the new gateway is using to access the DIN Router.
- Is there an example handshake and what is registered (for example, IP addresses vs domains)?
- **Answer:** Example code is available that can be shared.
An Ethereum address is required in order to authenticate.
- What rate limiting protection is created here?
All rate limiting is enforced on the Gateway side, and therefore Gateway providers must be able to pay for the requests that they use.
- **Answer:** The DIN Router will enforce some blocking of certain methods, but the assumption is that any requests that are sent to the DIN Router by a gateway are expected to be returned.
Therefore, there will be a list of methods that we will suggest do not make sense to forward to the DIN Router for certain networks.
## DIN Router network configuration
An Ingress Operator will choose between different registered networks/chains
and their set technical requirements (for example, methods, RPS, volume, advanced methods).
The full list of these available networks and requirements has not been rendered into a web application,
but we can use the Infura documentation as a starting point for which networks and methods are supported.
- How do I select which available networks (mainnet and testnet) where I can be added to requests?
- Is this the caddy file?
- **Answer:** The DIN team is able to provide a list of available networks where requests can be sent.
This list will typically only include networks that are "production-ready" - they can receive requests at an RPS in the thousands.
Sometimes, we will make available networks that are in pre-production, largely for integration purposes and for some testing.
- Is there a list of these chains?
- **Answer:** The DIN team keeps a list of supported chains that are available for your consumption.
- Do I use a fixed reference on my side? The router side?
- **Answer:** You will use a fixed reference to the relevant DIN Router endpoint for each network you are consuming within your routing logic.
- How can I change this?
- **Answer:** You will likely not need to change the DIN endpoints, but in the event you do, you will be responsible for changing to any new DIN endpoints that are provided to you.
- What are the expected methods available for each of the DIN Provider networks?
- **Answer:** The DIN team will provide a list of methods for each supported chain.
- Can I set any routing preferences for this particular chain?
- **Answer:** Potentially, if you have specific routing preferences you will work with the DIN team to see if these preferences can be implemented.
---
## x402 payments
DIN implements [x402](https://docs.cdp.coinbase.com/x402/core-concepts/how-it-works), which is an internet-native payment protocol that was developed by Coinbase for fast, cheap, and AI-friendly payments.
DIN's implementation focuses on the AI agent's access to web3 API calls across multiple blockchain networks.
This creates a "headless gateway" implementation so the AI agent can access multiple RPC networks.
The main user stories covered include:
- As an AI agent, I can call a DIN endpoint (Ethereum, Base, Blast), pay with a token (USDC), and receive relevant JSON-RPC information for my response.
- As an AI agent, I can receive additional information on my DIN usage (transaction receipts, calls with the endpoint).
This can be a redirect of the user to a DIN app for monitoring.
- As an AI agent, I can share additional information (website, code, docs). This can be a terminal-like response function.

This interaction shows how the AI agent can interact with multiple APIs in order to gather sufficient information to complete its requests.
## Web3 API marketplace with micro-payments
Web3 infrastructure still runs on traditional financial rails.
DIN node providers still need to pay for their bare metal electric bills or AWS bills with fiat invoices.
They still need to pay their DevOps teams with paychecks into their bank accounts.
A majority of SaaS still uses Stripe or some credit card service to pay for their web3 gateway monthly plans.
Utilities and resources prefer fiat.
DIN's mission is to reduce the cost of web3.
We want more companies to see the advantages of becoming web3 native end-to-end.
Building with x402 means that DIN can also convert some of the transactions between gateways and node providers to use more native web3 payments and keep track of better web3 treasuries.
## B2AI (Business to AI) market
AI agents are getting smarter and more resilient.
Just as trading bots quickly saturated the crypto market with native API calls, we will see more AI agents interact with more web3 resources across multiple networks.
Your AI agent orchestrator will be tasked with decisions that give it options for spending money to achieve results.
Instead of creating web2 accounts and storing passwords, it makes more sense for authentication to happen in a more headless way between decentralized services while paying the hosts of these services.
This is a recreation of the economic gas transaction fees for the dapps and services built on top of blockchains.